Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a generic operating system GUI window. More...
#include <omGUIWindow.h>
Classes | |
class | Delegate |
A class that contains function objects that recieve window events. More... | |
Public Member Functions | |
Window (const UTF8String &title, const Size2D &size) | |
Create a centered window with the specified width and height. More... | |
Window (const UTF8String &title, const Size2D &size, const Vector2i &position) | |
Create a window with the specified width, height, position. More... | |
~Window () | |
Destroy a window, closing it if is visible and releasing all resources used. More... | |
Size | getObjectCount () const |
Return the number of window object children that this window has. More... | |
WindowObject * | getObject (Index childIndex) const |
Return a shared pointer to the child window object at the specified index in this window. More... | |
Bool | addObject (WindowObject *object) |
Add a child window object to this window. More... | |
Bool | removeObject (const WindowObject *object) |
Remove the child window object from this window that matches the specified element. More... | |
void | clearObjects () |
Remove all child window objects from this window. More... | |
MenuBar * | getMenu () const |
Return a pointer to the window's menu. More... | |
Bool | setMenu (MenuBar *newMenu) |
Set a pointer to the window's menu. More... | |
Vector2i | getPosition () const |
Get the position of the window relative to the top left corner of the screen (in pixels). More... | |
Bool | setPosition (const Vector2i &newPosition) |
Set the position of the window relative to the top left corner of the screen (in pixels). More... | |
Bool | setPosition (Int xPosition, Int yPosition) |
Set the position of the window relative to the top left corner of the screen (in pixels). More... | |
Bool | center () |
Center the window within the screen where it currently resides. More... | |
Size2D | getFrameSize () const |
Return the size of the entire window frame, including any title or menu bars or borders. More... | |
Size2D | getContentSize () const |
Return a 2D vector indicating the horizontal and vertical size of the window's content area in pixels. More... | |
Bool | setContentSize (const Size2D &newSize) |
Set the size of the window's content view, changing the window's size and resizing the content view. More... | |
Bool | setContentSize (Size newWidth, Size newHeight) |
Set the size of the window's content view, changing the window's size and resizing the content view. More... | |
UTF8String | getTitle () const |
Return the title string for this window. More... | |
Bool | setTitle (const UTF8String &newTitle) |
Set the title string for this window. More... | |
Bool | moveToFront () |
Move the window to the front of the window order (in it's level) within an application. More... | |
Bool | moveToBack () |
Move the window to the back of the window order, beneath all windows but the desktop. More... | |
Bool | hasFocus () const |
Return whether or not the window currently has focus. More... | |
Bool | getIsVisible () const |
Return whether or not the window is currently visible. More... | |
Bool | setIsVisible (Bool newIsVisible) |
Set whether or not the window should be visible. More... | |
Bool | getIsMinimized () const |
Return a boolean value indicating whether or not a window is currently minimized. More... | |
Bool | setIsMinimized (Bool newIsMinimized) |
Set a boolean value determining whether or not a window should be minimized. More... | |
Bool | getIsMaximized () const |
Return a boolean value indicating whether or not a window is currently maximized. More... | |
Bool | setIsMaximized (Bool newIsMaximized) |
Set a boolean value determining whether or not a window should be maximized. More... | |
Bool | getIsFloating () const |
Return whether or not the window is floating (always in front of normal windows). More... | |
Bool | setIsFloating (Bool newIsFloating) |
Set whether or not the window is floating (always in front of normal windows). More... | |
Bool | getIsResizable () const |
Return whether or not the window is able to be resized by the GUI user. More... | |
void | setIsResizable (Bool newIsResizable) |
Set whether or not the window is able to be resized by the GUI user. More... | |
Bool | getIsMovable () const |
Return whether or not the window is able to be moved by the GUI user. More... | |
void | setIsMovable (Bool newIsMovable) |
Set whether or not the window is able to be resized by the GUI user. More... | |
Bool | getIsClosable () const |
Return whether or not the window is able to be closed by the GUI user. More... | |
void | setIsClosable (Bool newIsClosable) |
Set whether or not the window is able to be closed by the GUI user. More... | |
DisplayID | getDisplay () const |
Return the ID of the display that this window overlaps the most. More... | |
const Window::Delegate & | getDelegate () const |
Get a reference to the delegate object associated with this window. More... | |
void | setDelegate (const Window::Delegate &delegate) |
Set the delegate object to which this window sends events. More... | |
virtual void * | getInternalPointer () const |
Return a pointer to this window's platform-specific internal representation. More... | |
Public Member Functions inherited from om::gui::objects::GUIObject | |
virtual | ~GUIObject () |
Destroy a GUI element and release all resources associated with it. More... | |
A class that represents a generic operating system GUI window.
A window is a rectangular region of the screen that floats over the GUI desktop. It is generally the top-level object that contains the interface for an application.
om::gui::objects::Window::Window | ( | const UTF8String & | title, |
const Size2D & | size | ||
) |
Create a centered window with the specified width and height.
om::gui::objects::Window::Window | ( | const UTF8String & | title, |
const Size2D & | size, | ||
const Vector2i & | position | ||
) |
Create a window with the specified width, height, position.
om::gui::objects::Window::~Window | ( | ) |
Destroy a window, closing it if is visible and releasing all resources used.
Size om::gui::objects::Window::getObjectCount | ( | ) | const |
Return the number of window object children that this window has.
WindowObject* om::gui::objects::Window::getObject | ( | Index | childIndex | ) | const |
Return a shared pointer to the child window object at the specified index in this window.
If the specified index is out of bounds or an error occurs, a NULL pointer is returned.
Bool om::gui::objects::Window::addObject | ( | WindowObject * | object | ) |
Add a child window object to this window.
The method returns whether or not the add operation was successful. The method can fail if the specified window object pointer is NULL or if the window object already has a parent window.
Bool om::gui::objects::Window::removeObject | ( | const WindowObject * | object | ) |
Remove the child window object from this window that matches the specified element.
The method returns whether or not the specified window object was found to be a part of this window and then successfully removed.
void om::gui::objects::Window::clearObjects | ( | ) |
Remove all child window objects from this window.
MenuBar* om::gui::objects::Window::getMenu | ( | ) | const |
Return a pointer to the window's menu.
Vector2i om::gui::objects::Window::getPosition | ( | ) | const |
Get the position of the window relative to the top left corner of the screen (in pixels).
Bool om::gui::objects::Window::setPosition | ( | const Vector2i & | newPosition | ) |
Set the position of the window relative to the top left corner of the screen (in pixels).
Set the position of the window relative to the top left corner of the screen (in pixels).
Bool om::gui::objects::Window::center | ( | ) |
Center the window within the screen where it currently resides.
Size2D om::gui::objects::Window::getFrameSize | ( | ) | const |
Return the size of the entire window frame, including any title or menu bars or borders.
Size2D om::gui::objects::Window::getContentSize | ( | ) | const |
Return a 2D vector indicating the horizontal and vertical size of the window's content area in pixels.
Bool om::gui::objects::Window::setContentSize | ( | const Size2D & | newSize | ) |
Set the size of the window's content view, changing the window's size and resizing the content view.
Set the size of the window's content view, changing the window's size and resizing the content view.
UTF8String om::gui::objects::Window::getTitle | ( | ) | const |
Return the title string for this window.
On most platforms, this string will be placed at the top of the window in a title bar.
Bool om::gui::objects::Window::setTitle | ( | const UTF8String & | newTitle | ) |
Set the title string for this window.
The method returns whether or not the title change operation was successful.
Bool om::gui::objects::Window::moveToFront | ( | ) |
Move the window to the front of the window order (in it's level) within an application.
Bool om::gui::objects::Window::moveToBack | ( | ) |
Move the window to the back of the window order, beneath all windows but the desktop.
Bool om::gui::objects::Window::hasFocus | ( | ) | const |
Return whether or not the window currently has focus.
Bool om::gui::objects::Window::getIsVisible | ( | ) | const |
Return whether or not the window is currently visible.
Set whether or not the window should be visible.
Bool om::gui::objects::Window::getIsMinimized | ( | ) | const |
Return a boolean value indicating whether or not a window is currently minimized.
Set a boolean value determining whether or not a window should be minimized.
Bool om::gui::objects::Window::getIsMaximized | ( | ) | const |
Return a boolean value indicating whether or not a window is currently maximized.
Set a boolean value determining whether or not a window should be maximized.
Bool om::gui::objects::Window::getIsFloating | ( | ) | const |
Return whether or not the window is floating (always in front of normal windows).
Set whether or not the window is floating (always in front of normal windows).
Bool om::gui::objects::Window::getIsResizable | ( | ) | const |
Return whether or not the window is able to be resized by the GUI user.
void om::gui::objects::Window::setIsResizable | ( | Bool | newIsResizable | ) |
Set whether or not the window is able to be resized by the GUI user.
Bool om::gui::objects::Window::getIsMovable | ( | ) | const |
Return whether or not the window is able to be moved by the GUI user.
void om::gui::objects::Window::setIsMovable | ( | Bool | newIsMovable | ) |
Set whether or not the window is able to be resized by the GUI user.
Bool om::gui::objects::Window::getIsClosable | ( | ) | const |
Return whether or not the window is able to be closed by the GUI user.
void om::gui::objects::Window::setIsClosable | ( | Bool | newIsClosable | ) |
Set whether or not the window is able to be closed by the GUI user.
DisplayID om::gui::objects::Window::getDisplay | ( | ) | const |
Return the ID of the display that this window overlaps the most.
const Window::Delegate& om::gui::objects::Window::getDelegate | ( | ) | const |
Get a reference to the delegate object associated with this window.
void om::gui::objects::Window::setDelegate | ( | const Window::Delegate & | delegate | ) |
Set the delegate object to which this window sends events.
|
virtual |
Return a pointer to this window's platform-specific internal representation.
On Mac OS X, this method returns a pointer to a subclass of NSWindow which represents the window.
On Windows, this method returns an HWND indicating a handle to the window which represents the window.
Implements om::gui::objects::GUIObject.