-
Notifications
You must be signed in to change notification settings - Fork 0
Class GraphicsWindow
Kristian Virtanen edited this page Oct 28, 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.
- Difference from orig. SB: none.
- Description: Gets or sets the brush color used for filling shapes. The color should be a valid color name.
- Difference from orig. SB: none.
- Description: Gets or sets a value indicating whether the graphics window is resizable.
-
Difference from orig. SB: Original expects a string
"True"
or"False"
while SBOE expects booleantrue
orfalse
.
- Description: Gets or sets a value indicating whether bold text is used in the graphics window.
-
Difference from orig. SB: Original expects a string
"True"
or"False"
while SBOE expects booleantrue
orfalse
.
- Description: Gets or sets a value indicating whether italic text is used in the graphics window.
-
Difference from orig. SB: Original expects a string
"True"
or"False"
while SBOE expects booleantrue
orfalse
.
- Description: Gets or sets the name of the font used for drawing text.
- Difference from orig. SB: none.
- Description: Gets or sets the size of the font used for drawing text.
- Difference from orig. SB: none.
- Description: Gets or sets the height of the graphics window in pixels.
- Difference from orig. SB: none.
-
Description: Stores the last error message, if any operation fails, including a timestamp in
yyyy-MM-dd HH:mm:ss
format. - Difference from orig. SB: Not available at orig. SB.
- Description: Stores the last key pressed while GraphicsWindow has been open.
- Difference from orig. SB: none.
- Description: Stores the last text typed (seperator is ENTER) while GraphicsWindow has been open.
- Difference from orig. SB: none.
- Description: Gets or sets the pen color for drawing shapes. The color should be a valid color name.
- Difference from orig. SB: none.
- Description: Gets or sets the width of the pen used for drawing shapes.
- Difference from orig. SB: none.
- Description: Gets or sets the width of the graphics window in pixels.
- Difference from orig. SB: none.
- Description: Occurs when a key is pressed while the graphics window has focus.
- Difference from orig. SB: none.
- Description: Occurs when a key is released while the graphics window has focus.
- Difference from orig. SB: none.
- Description: Occurs when the mouse button is pressed down in the graphics window.
- Difference from orig. SB: none.
- Description: Occurs when the mouse is moved within the graphics window.
- Difference from orig. SB: none.
- Description: Occurs when the mouse button is released in the graphics window.
- Difference from orig. SB: none.
- Description: Clears the graphics window, resetting it to the background color.
-
Returns:
true
if the window was cleared successfully,false
if an error occurred. -
Difference from orig. SB: Original is void and returns nothing while SBOE uses Clear as boolean function and returns
true
orfalse
.
- Description: Displays the graphics window and initializes it if it hasn't been created yet.
-
Returns:
true
if successful,false
if an error occurred. -
Difference from orig. SB: Original is void and returns nothing while SBOE uses Show as boolean function and returns
true
orfalse
.
- Description: Hides the graphics window.
-
Returns:
true
if successful,false
if an error occurred. -
Difference from orig. SB: Original is void and returns nothing while SBOE uses Hide as boolean function and returns
true
orfalse
.
-
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:
true
if the ellipse was drawn successfully,false
if an error occurred. -
Difference from orig. SB: Original is void and returns nothing while at SBOE it is a boolean function and returns
true
orfalse
.
-
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:
true
if the ellipse was filled successfully,false
if an error occurred. -
Difference from orig. SB: Original is void and returns nothing while at SBOE it is a boolean function and returns
true
orfalse
.
-
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:
true
if the rectangle was drawn successfully,false
if an error occurred. -
Difference from orig. SB: Original is void and returns nothing while at SBOE it is a boolean function and returns
true
orfalse
.
-
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:
true
if the rectangle was filled successfully,false
if an error occurred. -
Difference from orig. SB: Original is void and returns nothing while at SBOE it is a boolean function and returns
true
orfalse
.
- Description: Draws a triangle which corners are passed as parameters.
-
Parameters:
-
x1, x2, x3
: The horizontal positions of the triangle -
y1, y2, y3
: The vertical positions of the triangle.
-
-
Returns:
true
if the triangle was drawn successfully,false
if an error occurred. -
Difference from orig. SB: Original is void and returns nothing while at SBOE it is a boolean function and returns
true
orfalse
.
- Description: Fills a triangle which corners are passed as parameters.
-
Parameters:
-
x1, x2, x3
: The horizontal positions of the triangle -
y1, y2, y3
: The vertical positions of the triangle.
-
-
Returns:
true
if the triangle was filled successfully,false
if an error occurred. -
Difference from orig. SB: Original is void and returns nothing while at SBOE it is a boolean function and returns
true
orfalse
.
- Description: Draws a line.
-
Parameters:
-
x1, y1
: Starting point of line. -
x2, y2
: End point of line.
-
-
Returns:
true
if the line was drawn successfully,false
if an error occurred. -
Difference from orig. SB: Original is void and returns nothing while at SBOE it is a boolean function and returns
true
orfalse
.
-
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:
true
if the text was drawn successfully,false
if an error occurred. -
Difference from orig. SB: Original is void and returns nothing while at SBOE it is a boolean function and returns
true
orfalse
.
-
Description: Draws the specified text at the given coordinates (
x
,y
) using the current font and pen color. -
Parameters:
-
x
: The horizontal start position of the text. -
y
: The vertical start position of the text. -
width
: The max width on single line. -
text
: The string of text to draw.
-
-
Returns:
true
if the text was drawn successfully,false
if an error occurred. -
Difference from orig. SB: Original is void and returns nothing while at SBOE it is a boolean function and returns
true
orfalse
.