-
Notifications
You must be signed in to change notification settings - Fork 0
Class GraphicsWindow
Kristian Virtanen edited this page Oct 23, 2024
·
3 revisions
The GraphicsWindow class provides functionality for creating, customizing, and managing a graphical window. You can control its properties, such as background color, dimensions, resizability, and draw shapes and text on it. The class also includes event handling for key and mouse actions within the graphics window.
- Description: Gets or sets the background color of the graphics window. The color should be a valid color name.
- Description: Gets or sets the brush color used for filling shapes. The color should be a valid color name.
- Description: Gets or sets a value indicating whether the graphics window is resizable.
- Description: Gets or sets a value indicating whether bold text is used in the graphics window.
- Description: Gets or sets a value indicating whether italic text is used in the graphics window.
- Description: Gets or sets the name of the font used for drawing text.
- Description: Gets or sets the size of the font used for drawing text.
- Description: Gets or sets the height of the graphics window in pixels.
-
Description: Stores the last error message, if any operation fails, including a timestamp in
yyyy-MM-dd HH:mm:ssformat.
- Description: Gets or sets the pen color for drawing shapes. The color should be a valid color name.
- Description: Gets or sets the width of the pen used for drawing shapes.
- Description: Gets or sets the width of the graphics window in pixels.
- Description: Occurs when a key is pressed while the graphics window has focus.
- Description: Occurs when a key is released while the graphics window has focus.
- Description: Occurs when the mouse button is pressed down in the graphics window.
- Description: Occurs when the mouse is moved within the graphics window.
- Description: Occurs when the mouse button is released in the graphics window.
- Description: Clears the graphics window, resetting it to the background color.
-
Returns:
trueif the window was cleared successfully,falseif an error occurred.
- Description: Displays the graphics window and initializes it if it hasn't been created yet.
-
Returns:
trueif successful,falseif an error occurred.
- Description: Hides the graphics window.
-
Returns:
trueif successful,falseif an error occurred.
-
Description: Draws an ellipse at the specified coordinates (
x,y) with the given width and height. -
Parameters:
-
x: The horizontal position of the ellipse. -
y: The vertical position of the ellipse. -
width: The width of the ellipse. -
height: The height of the ellipse.
-
-
Returns:
trueif the ellipse was drawn successfully,falseif an error occurred.
-
Description: Fills an ellipse at the specified coordinates (
x,y) with the given width and height using the current brush color. -
Parameters:
-
x: The horizontal position of the ellipse. -
y: The vertical position of the ellipse. -
width: The width of the ellipse. -
height: The height of the ellipse.
-
-
Returns:
trueif the ellipse was filled successfully,falseif an error occurred.
-
Description: Draws a rectangle at the specified coordinates (
x,y) with the given width and height. -
Parameters:
-
x: The horizontal position of the rectangle. -
y: The vertical position of the rectangle. -
width: The width of the rectangle. -
height: The height of the rectangle.
-
-
Returns:
trueif the rectangle was drawn successfully,falseif an error occurred.
-
Description: Fills a rectangle at the specified coordinates (
x,y) with the given width and height using the current brush color. -
Parameters:
-
x: The horizontal position of the rectangle. -
y: The vertical position of the rectangle. -
width: The width of the rectangle. -
height: The height of the rectangle.
-
-
Returns:
trueif the rectangle was filled successfully,falseif an error occurred.
-
Description: Draws the specified text at the given coordinates (
x,y) using the current font and pen color. -
Parameters:
-
x: The horizontal position of the text. -
y: The vertical position of the text. -
text: The string of text to draw.
-
-
Returns:
trueif the text was drawn successfully,falseif an error occurred.