GraphicsWindow Class Reference« | ReferenceGuide | GraphicsCanvas » This class defines a basic top level window that can be opened on the desktop and used to produce simple graphical drawings. It contains a canvas on which geometric shapes can be drawn and manipulated. Public Methods
Detailed DescriptionGraphicsWindow()
Creates a new graphics window with a canvas that has a default size. The canvas contained in the window is initially empty with a white background. It is created with a default size of 400 x 400.
GraphicsWindow(width, height)
Creates a new graphics window with a canvas of the given size. The canvas contained in the window is initially empty with a white background. The size of the canvas will be set to the size specified by
width and height .
canvas()
Returns a reference to the canvas contained within the window. The canvas can be used to draw and manipulate geometric shapes and text.
wait()
Starts the event loop that processes various window events. This causes the sequential execution of the program to stop and wait for the user to click the close button on the main window or to call the quit() method on any window. This method should only be called on the main window.
setTitle(title)
Sets the title of the window. The title is displayed in the title bar of the top-level window. By default, the window has no title.
getMouse()
v2.0 Gets and returns the position at which the next mouse button is clicked. The program pauses and waits until the user clicks a mouse button within the canvas area. Other events continue to be processed using the regular event handlers.
getKey()
v2.0 Gets and returns the next key pressed by the user. The program pauses and waits for the user to press any key within the window. Other events continue to be processed using the regular event handlers.
pause(msTime)
v2.0 Pauses the program for a given amount of time. This method only pauses the sequential flow of execution for a specified amount of time. The events (window, mouse, key, etc) continue to be processed in the background.
isValid()
Returns a Boolean indicating whether the window associated with the object exist and is valid. The object of an invalid window, which normally results from being closed, can not be used.
quit()
Terminates the GUI application. The program continues execution immediately after the call to the wait() method, but none of the Ez Graphics tools can be used.
close()
Closes and destroys the window. The window object still exist, but the window is not valid and can not be used. If the main window is closed, the event loop will be terminated.
hide()
show()
Shows or deiconifies a previously hidden top level window.
menu()
v2.0 Returns a reference to the menu bar associated with the window. A menu bar will be displayed after this method is called the first time and the menu has been configured.
showMenu()
v2.0 Displays the menu bar at the top of the window. The menu() method is used to access the menu for configuration.
hideMenu()
v2.0 Hides the menu bar and removes it from the window. The menu still exists and can be displayed again and/or configured further.
showStatus()
v2.0 Displays a status bar at the bottom of the window that can be used to display text messages.
hideStatus()
v2.0 Hides the status bar by removing it from the bottom of the window. Hiding the bar does not destroy it or the text contained within the bar.
setStatus(text)
v2.0 Sets the text message displayed in the message bar. By default, the message is aligned to the left side of the bar.
setStatus()
v2.0 Clears the text message and sets it to the empty string.
configStatus(options)
v2.0 Modifies one or more configuration options of the status bar. The options and settings are specified as named parameters.
enableEvents(event1, event2, ...)
v2.0 Enables one or more action events on the window.
clearEvents(event1, event2, ...)
v2.0 Clears or deactivates one or more window events that were set using the enableEvents() method.
setEventHander(handler)
v2.0 Sets the event handler to a user-defined function or object. By default, the callback methods of the GraphicsWindow class are called and thus must be overridden in a derived class.
setTimer(msTime)
v2.0 Sets a timer that triggers an alarm after it expires. When the alarm is triggered, an
Alarm event occurs and the appropriate event handler is called.
clearTimer()
v2.0 Clears the timer before it expires.
alertDialog(message)
Displays a note or information type message in a basic dialog box.
alertDialog(message, msgType)
Displays one of several types of messages within a basic dialog box. There are three types of alert messages: Informational, Warning, and Error.
alertDialog(message, msgType, title)
Displays one of several types of messages within a basic dialog box. The dialog box has a user-specified title. There are three types of alert messages: Informational, Warning, and Error.
confirmDialog(title, message)
confirmDialog(title, message, cancel)
inputDialog(title, prompt)
inputDialog(title, prompt, initValue)
colorDialog()
colorDialog(initColor)
openfileDialog()
openfileDialog(fileTypes)
openfileDialog(fileTypes, initDir)
savefileDialog()
savefileDialog(fileTypes)
savefileDialog(fileTypes, initDir)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Last modified: March 18, 2018, at 04:06 PM.
|