tbx
0.7.5
|
The Window object represents a toolbox window. More...
#include <window.h>
Public Types | |
enum | { TOOLBOX_CLASS = 0x82880 } |
enum | DragSpriteFlags { DSFLAG_NONE = 0, DSFLAG_HCENTRE, DSFLAG_RIGHT, DSFLAG_VCENTRE = 4, DSFLAG_TOP = 8, DSFLAG_BOUND_POINT = 64, DSFLAG_DROP_SHADOW = 128, DSFLAG_SOLID = 256 } |
Flags for drag_sprite. | |
Public Member Functions | |
Window () | |
Construct creates an unassigned Window. More... | |
Window (const Window &other) | |
Construct a Window from another Window. More... | |
Window (const Object &other) | |
Construct a Window from an Object that refers to a Window. More... | |
Window (const std::string &template_name) | |
Create a Window from the named template. More... | |
Window (const res::ResWindow &object_template) | |
Create a Window from an in memory template resource. More... | |
Window & | operator= (const Window &other) |
Assign this Window from another. More... | |
Window & | operator= (const Object &other) |
Assign this Window from an Object that refers to a SaveAs. More... | |
bool | operator== (const Object &other) const |
Check if this Window refers to the same underlying toolbox object as another. More... | |
bool | operator!= (const Object &other) const |
Check if this Window does not refers to the same underlying toolbox object as another. More... | |
void | show_as_subwindow (const ShowSubWindowSpec &spec) |
Show this window as a sub window (nested child) of an existing window. More... | |
Gadget | gadget (ComponentId component_id) |
Get the gadget with the given component id. More... | |
WindowHandle | window_handle () const |
Return the underlying WIMP windows handle of the window. | |
Gadget | add_gadget (const res::ResGadget &gadget_template) |
Add a gadget to the window. More... | |
void | remove_gadget (ComponentId component_id) |
Remove a gadget from the window. More... | |
void | menu (Menu menu) |
Set menu used with this window. More... | |
Menu | menu () const |
Get the current menu used by this object. More... | |
void | remove_menu () |
Removes the menu from the window. | |
void | help_message (const std::string &message) |
Set the help message for the Window. More... | |
std::string | help_message () const |
Get the help message for the window. More... | |
void | add_shorcut (const res::ResShortcut &shortcut) |
Add a keyboard shortcut. More... | |
void | add_shortcuts (const res::ResShortcut *shortcuts, int num) |
Add multiple keyboard shortcuts from an array. More... | |
void | remove_all_shortcuts () |
Remove all window shortcuts. | |
void | remove_shortcuts (const res::ResShortcut *shortcuts, int num) |
Remove given window shortcuts. | |
std::string | title () const |
Get the title (caption) of the window. More... | |
void | title (std::string new_title) |
Set the title (caption) of the window. More... | |
void | set_toolbars (Window *internal_bottom_left, Window *internal_top_left, Window *external_bottom_left, Window *external_top_left) |
Set toolbars for this window. More... | |
void | get_toolbars (Window *internal_bottom_left, Window *internal_top_left, Window *external_bottom_left, Window *external_top_left) |
Get toolbars. | |
void | ibl_toolbar (Window window) |
Set internal bottom left toolbar. | |
Window | ibl_toolbar () const |
Get internal bottom left toolbar. | |
void | itl_toolbar (Window window) |
Set internal top left toolbar. | |
Window | itl_toolbar () const |
Get internal top left toolbar. | |
void | ebl_toolbar (Window window) |
Set external bottom left toolbar. | |
Window | ebl_toolbar () const |
Get external bottom left toolbar. | |
void | etl_toolbar (Window window) |
Set external top left toolbar. | |
Window | etl_toolbar () const |
Get external top left toolbar. | |
void | extent (const BBox &new_extent) |
Set the work area extent for the window. | |
BBox | extent () const |
Get the current work area extent for the window. | |
void | force_redraw (const BBox &work_area) |
Force the area to be redrawn. More... | |
void | update (const BBox &bounds, RedrawListener *background=0) |
Update the window immediately using any registered redrawers. More... | |
void | update (const BBox &bounds, RedrawListener **redrawers, int redrawer_count) |
Update the window immediately using the given redrawers. More... | |
void | get_state (WindowState &state) const |
Gets a summary of the current state of the window. More... | |
void | get_state (WindowState &state, Window &parent, int &align_flags) const |
Gets a summary of the current state of the window. More... | |
void | get_info (WindowInfo &info) const |
Get complete information about the windows state. More... | |
void | open_window (const WindowOpenInfo &open_info) |
Open window in a new location. More... | |
void | open_subwindow (const WindowOpenInfo &open_info, Window &parent, unsigned int align_flags=0) |
Open a window as a subwindow. More... | |
void | scroll (int x, int y) |
Scroll window to given coordinates. More... | |
void | scroll (const Point &pos) |
Scroll window to given coordinates. More... | |
Point | scroll () const |
Returns the current scroll coordinates in the window. More... | |
void | size (int width, int height) |
Set the size of the window. More... | |
void | size (const Size &size) |
Set the size of the window. More... | |
Size | size () const |
Returns the size of the window. More... | |
void | top_left (int x, int y) |
Set the position of the top left of the visible area of the Window on the desktop. More... | |
void | top_left (const Point &pos) |
Set the position of the top left of the visible area of the Window on the desktop. More... | |
Point | top_left () const |
Get the position of the top left of the visible area of the Window on the desktop. More... | |
void | bounds (const BBox &bounds) |
Set position and size of the visible area of window on the desktop. More... | |
BBox | bounds () const |
Get position and size of the visible area of window on the desktop. More... | |
BBox | outline () const |
Get the bounding box that completely covers the window on the screen. More... | |
void | block_copy (const BBox &bounds, const Point &to) |
Fast copy of a part of the work area to somewhere else. More... | |
void | add_about_to_be_shown_listener (AboutToBeShownListener *listener) |
Add a listener for when the window is about to be shown. More... | |
void | remove_about_to_be_shown_listener (AboutToBeShownListener *listener) |
Remove a listener for when a window is about to be shown. | |
void | add_has_been_hidden_listener (HasBeenHiddenListener *listener) |
Add A listener for when the window has been hidden. More... | |
void | remove_has_been_hidden_listener (HasBeenHiddenListener *listener) |
Remove a listener for when a window has been hidden. | |
void | add_redraw_listener (RedrawListener *listener) |
Add a listener to be called when the window needs redrawing. More... | |
void | remove_redraw_listener (RedrawListener *listener) |
Remove a listener for redraw events. | |
void | add_open_window_listener (OpenWindowListener *listener) |
Add a listener to be called when the window is opened. More... | |
void | remove_open_window_listener (OpenWindowListener *listener) |
Remove a listener for window opened events. | |
void | add_close_window_listener (CloseWindowListener *listener) |
Add a listener to be called when the window has received a request to close. More... | |
void | remove_close_window_listener (CloseWindowListener *listener) |
Remove a listener for close window events. | |
void | add_pointer_leaving_listener (PointerLeavingListener *listener) |
Add a listener for the pointer leaving the visible work area of the window. | |
void | remove_pointer_leaving_listener (PointerLeavingListener *listener) |
Remove a listener for pointer leaving events. | |
void | add_pointer_entering_listener (PointerEnteringListener *listener) |
Add a listener of the pointer entering the visible work area of the window. | |
void | remove_pointer_entering_listener (PointerEnteringListener *listener) |
Remove a listener for pointer entering events. | |
void | add_mouse_click_listener (MouseClickListener *listener) |
Add a listener for mouse click events. More... | |
void | remove_mouse_click_listener (MouseClickListener *listener) |
Remove a listener for mouse click events. | |
void | add_key_listener (KeyListener *listener) |
Add a listener for key pressed events. | |
void | remove_key_listener (KeyListener *listener) |
Remove a listener for key pressed events. | |
void | add_lose_caret_listener (LoseCaretListener *listener) |
Add a listener for when the window loses the caret. | |
void | remove_lose_caret_listener (LoseCaretListener *listener) |
Remove a listener for when the window loses the caret. | |
void | add_gain_caret_listener (GainCaretListener *listener) |
Add a listener for when the window gains the caret. | |
void | remove_gain_caret_listener (GainCaretListener *listener) |
Remove a listener for when the window gains the caret. | |
void | add_scroll_request_listener (ScrollRequestListener *listener) |
Add listener for when a click has occurred on a window's scroll bar. More... | |
void | remove_scroll_request_listener (ScrollRequestListener *listener) |
Remove listener for when a click has occurred on a window's scroll bar. | |
void | add_loader (Loader *loader, int file_type=-2) |
Add a file loader. More... | |
void | remove_loader (Loader *loader, int file_type=-2) |
Remove a file loader. More... | |
void | drag_point (DragHandler *handler) const |
Start drag operation of the mouse pointer. More... | |
void | drag_point_local (DragHandler *handler) const |
Drag mouse pointer constrained to this window. More... | |
void | drag_point (const BBox &bounds, DragHandler *handler) const |
Drag mouse pointer constrained to given bounds. More... | |
void | drag_box (const BBox &box, DragHandler *handler) const |
Drag fixed rotating dots box. More... | |
void | drag_box_local (const BBox &box, DragHandler *handler) const |
Drag fixed rotating dots box constrained to this window. More... | |
void | drag_box (const BBox &box, const BBox &bounds, DragHandler *handler) const |
Drag fixed rotating dots box constrained to given bounds. More... | |
void | drag_rubber_box (const Point &start, DragHandler *handler) const |
Start dragging of rubber rotating dashes box. More... | |
void | drag_rubber_box_local (const Point &start, DragHandler *handler) const |
Start dragging of rubber rotating dashes box confined to inside the window. More... | |
void | drag_rubber_box (const Point &start, const BBox &bounds, DragHandler *handler) const |
Start dragging of rubber rotating dashes box confined to inside the window. More... | |
void | cancel_drag () const |
Cancel current drag operation. | |
void | drag_sprite (const Sprite &sprite, const BBox &box, DragHandler *handler, int flags=0) const |
Drag a sprite in the desktop. More... | |
void | drag_sprite_local (const Sprite &sprite, const BBox &box, DragHandler *handler, int flags=0) const |
Drag a sprite within the window the pointer is in the desktop. More... | |
void | drag_sprite (const Sprite &sprite, const BBox &box, const BBox &bounds, DragHandler *handler, int flags=0) const |
Drag a sprite within the specified bounds. More... | |
![]() | |
ShowFullObject () | |
Constructor with no reference to a Toolbox object. More... | |
ShowFullObject (ObjectId handle) | |
Construct from a Toolbox object id. More... | |
ShowFullObject (const Object &other) | |
Construct as reference to another Toolbox object. More... | |
ShowFullObject (const std::string &template_name) | |
Create a Toolbox object and make this object a reference to it. More... | |
ShowFullObject (const res::ResObject &object_template) | |
Create Toolbox object from a memory template and make this object a reference to it. More... | |
void | show (const ShowFullSpec &full_spec) |
Show object with full position specified. | |
void | show (const ShowFullSpec &full_spec, const Object &parent) |
Show object with full position specified. | |
void | show (const ShowFullSpec &full_spec, const Component &parent) |
Show object with full position specified. | |
![]() | |
ShowPointObject () | |
Constructor with no reference to a Toolbox object. More... | |
ShowPointObject (ObjectId handle) | |
Construct from a Toolbox object id. More... | |
ShowPointObject (const Object &other) | |
Construct as reference to another Toolbox object. More... | |
ShowPointObject (const std::string &template_name) | |
Create a Toolbox object and make this object a reference to it. More... | |
ShowPointObject (const res::ResObject &object_template) | |
Create Toolbox object from a memory template and make this object a reference to it. More... | |
void | show (const Object &parent) |
Show object with given parent object. | |
void | show (const Component &parent) |
Show object with given parent component. | |
void | show (const Point &pos) |
Show object with top left at the given position. | |
void | show (const Point &pos, const Object &parent) |
Show object with top left at the given position. | |
void | show (const Point &pos, const Component &parent) |
Show object with top left at the given position. | |
void | show_as_menu () |
Show object as a menu at default position. | |
void | show_as_menu (const Object &parent) |
Show object as a menu with the given parent. | |
void | show_as_menu (const Component &parent) |
Show object as a menu with the given parent. | |
void | show_as_menu (const Point &pos) |
Show object as a menu at the given point with the given parent. | |
void | show_as_menu (const Point &pos, const Object &parent) |
Show object as a menu at the given point with the given parent. | |
void | show_as_menu (const Point &pos, const Component &parent) |
Show object as a menu at the given point with the given parent. | |
void | show_as_submenu (const MenuItem &parent) |
Show object as a sub menu from the given menu item. | |
void | show_as_submenu (const Point &pos, const MenuItem &parent) |
Show object as a sub menu at the given point from the given menu item. | |
![]() | |
Object () | |
Constructs an object unattached to a toolbox object. More... | |
Object (ObjectId handle) | |
Construct an object referencing the given toolbox object. More... | |
Object (const Object &other) | |
Construct an object referencing the same toolbox object as another. | |
Object (const std::string &template_name) | |
Create a toolbox object with the given name in the application resources and assign a reference to it in this object. More... | |
void | delete_object () |
Delete the underlying toolbox object. More... | |
bool | null () const |
Check if object has been initialised. More... | |
ObjectId | handle () const |
Return the underlying toolbox object id this object references. More... | |
Object & | operator= (const Object &other) |
Assign this object to reference the same toolbox object as another. More... | |
bool | operator== (const Object &other) const |
Check if this object references the same toolbox object as another. More... | |
bool | operator!= (const Object &other) const |
Check if this object does not reference the same toolbox object as another. More... | |
operator bool () const | |
Operator to check if an object has been initialised. More... | |
int | toolbox_class () const |
Get the toolbox class of this object. More... | |
void | check_toolbox_class (int class_id) const |
Check if this objects toolbox class is as specified. More... | |
void * | client_handle () const |
Return user defined handle stored against this object. More... | |
void | client_handle (void *client_handle) |
Set a user defined handle for this object. More... | |
Object | parent_object () const |
Get parent object. More... | |
Component | parent_component () const |
Get parent component. More... | |
Object | ancestor_object () const |
Get ancestor object. More... | |
Component | ancestor_component () const |
Get ancestor component. More... | |
void | show () |
Show the object at the default place. More... | |
void | hide () |
Hide the object. More... | |
bool | showing () const |
Check if an object is currently showing. | |
void | add_command (int command_id, Command *command) |
Add a command to this Object. More... | |
void | remove_command (int command_id, Command *command) |
Remove a command from this object. More... | |
void | add_user_event_listener (int event_id, UserEventListener *listener) |
Add a user event listener. More... | |
void | remove_user_event_listener (int event_id, UserEventListener *listener) |
Remove a user event listener from this object. More... | |
void | add_object_deleted_listener (ObjectDeletedListener *listener) |
Add listener for when the toolbox object referenced by this object has been deleted. More... | |
void | remove_object_deleted_listener (ObjectDeletedListener *listener) |
Remove listener for when the toolbox object referenced by this object has been deleted. More... | |
void | remove_all_listeners () |
Remove all listeners and commands from this object. More... | |
Static Public Member Functions | |
static Window | from_handle (WindowHandle window_handle) |
Get the window from the wimp window handle. More... | |
static Gadget | from_handle (WindowHandle window_handle, IconHandle icon_handle, Window *window=0) |
Get a gadget from a given wimp window/icon handle pair. More... | |
Additional Inherited Members | |
![]() | |
Object (const res::ResObject &object_template) | |
Protected constructor to create an object. | |
void | add_listener (int action, Listener *listener, RawToolboxEventHandler handler) |
Add a listener for the given toolbox event. More... | |
void | remove_listener (int action, Listener *listener) |
Remove listener for toolbox event. More... | |
void | set_handler (int action, Listener *listener, RawToolboxEventHandler handler) |
Set handler for an event that should not have more than one listener. More... | |
int | int_property (int property_id) const |
Return the value of a property that returns an integer. More... | |
void | int_property (int property_id, int value) |
Set the value of a property that requires an integer. More... | |
std::string | string_property (int property_id) const |
Return the value of a property that returns text. More... | |
void | string_property (int property_id, const std::string &value) |
Set the value of a property that requires a string. More... | |
int | string_property_length (int property_id) const |
Gets the size of a string properties buffer. More... | |
bool | bool_property (int property_id) const |
Get a boolean property from the toolbox Cobject. More... | |
void | bool_property (int property_id, bool value) |
Set a boolean property from the toolbox object. More... | |
![]() | |
ObjectId | _handle |
Handle for toolbox object. | |
The Window object represents a toolbox window.
|
inline |
Construct creates an unassigned Window.
It must be assigned to a value before the other methods can be used.
|
inline |
|
inline |
Construct a Window from an Object that refers to a Window.
This class then refers to the same underlying toolbox object as the other object
other | Object to copy. |
ObjectNullException | if the other object refers to a null object handle |
ObjectClassException | if the other object is not a Window |
|
inline |
Window::Window | ( | const res::ResWindow & | object_template | ) |
void Window::add_about_to_be_shown_listener | ( | AboutToBeShownListener * | listener | ) |
Add a listener for when the window is about to be shown.
The default about to be shown event must be enabled in the toolbox resources for the listeners to be called.
void Window::add_close_window_listener | ( | CloseWindowListener * | listener | ) |
Add a listener to be called when the window has received a request to close.
This event is only generated when the auto close flag in the resource is unset.
Gadget Window::add_gadget | ( | const res::ResGadget & | gadget_template | ) |
Add a gadget to the window.
If the window is visible it will be shown immediately If the gadgets component id is -1 it will be allocated an unused component id
gadget_template | - gadget template to add |
OsError | if add fails |
void Window::add_has_been_hidden_listener | ( | HasBeenHiddenListener * | listener | ) |
Add A listener for when the window has been hidden.
The default has been hidden event must be enabled in the toolbox resources for the listeners to be called.
void Window::add_loader | ( | Loader * | loader, |
int | file_type = -2 |
||
) |
Add a file loader.
loader | the loader to add |
file_type | the file type for the loader or -2 (the default) for any type. |
void Window::add_mouse_click_listener | ( | MouseClickListener * | listener | ) |
Add a listener for mouse click events.
This listener will only be called if an approriate button type has been set in the Windows resources.
void Window::add_open_window_listener | ( | OpenWindowListener * | listener | ) |
Add a listener to be called when the window is opened.
This listener is only called it the auto open flag in the window resource is unset.
An open window event is generated whenever this visible area, scroll position or stacking order of a window is changed. This includes when the Window is first show.
The tbx library automatically calls the Wimp_OpenWindow swi to realise the change on the screen, so it should not be called from the listener.
void Window::add_redraw_listener | ( | RedrawListener * | listener | ) |
Add a listener to be called when the window needs redrawing.
This listener will only be called if the auto redraw flag on the window has been unset.
The listeners are called in the order they have been added
void Window::add_scroll_request_listener | ( | ScrollRequestListener * | listener | ) |
Add listener for when a click has occurred on a window's scroll bar.
The appropriate flag must of been set in the window when it was created for this event to be generated.
void Window::add_shorcut | ( | const res::ResShortcut & | shortcut | ) |
Add a keyboard shortcut.
shortcut | object with information about the shortcut |
void Window::add_shortcuts | ( | const res::ResShortcut * | shortcuts, |
int | num | ||
) |
Add multiple keyboard shortcuts from an array.
shortcuts | array of objects with information about the shortcuts |
num | number of shortcuts in the shortcuts array |
Fast copy of a part of the work area to somewhere else.
Uses VDU primitives where possible and invalidates other areas.
bounds | - rectangle to copy in work area coordinates |
to | new location in work area coordinates |
void Window::bounds | ( | const BBox & | bounds | ) |
Set position and size of the visible area of window on the desktop.
This should only be called once a window has been shown.
OsError | if unable to reposition the window |
BBox Window::bounds | ( | ) | const |
Get position and size of the visible area of window on the desktop.
This should only be called once a window has been shown.
OsError | if unable to reposition the window |
void Window::drag_box | ( | const BBox & | box, |
DragHandler * | handler | ||
) | const |
Drag fixed rotating dots box.
box | box to drag |
handler | handler to be called when drag finishes |
void Window::drag_box | ( | const BBox & | box, |
const BBox & | bounds, | ||
DragHandler * | handler | ||
) | const |
Drag fixed rotating dots box constrained to given bounds.
box | box to drag |
bounds | box is constrains in (screen coordinates) |
handler | handler to be called when drag finishes |
void Window::drag_box_local | ( | const BBox & | box, |
DragHandler * | handler | ||
) | const |
Drag fixed rotating dots box constrained to this window.
box | box to drag |
handler | handler to be called when drag finishes |
void Window::drag_point | ( | DragHandler * | handler | ) | const |
Start drag operation of the mouse pointer.
Usually called in response to a mouse drag
handler is called when the drag finishes.
handler | handler to be called when drag finishes |
void Window::drag_point | ( | const BBox & | bounds, |
DragHandler * | handler | ||
) | const |
Drag mouse pointer constrained to given bounds.
bounds | point is constrains in (screen coordinates) |
handler | handler to be called when drag finishes |
void Window::drag_point_local | ( | DragHandler * | handler | ) | const |
Drag mouse pointer constrained to this window.
handler | handler to be called when drag finishes |
void Window::drag_rubber_box | ( | const Point & | start, |
DragHandler * | handler | ||
) | const |
Start dragging of rubber rotating dashes box.
start | point of box that is dragged in screen coordinates |
handler | handler called when drag is finished |
void Window::drag_rubber_box | ( | const Point & | start, |
const BBox & | bounds, | ||
DragHandler * | handler | ||
) | const |
Start dragging of rubber rotating dashes box confined to inside the window.
start | point of box that is dragged in screen coordinates |
bounds | box is constrains in (screen coordinates) |
handler | handler called when drag is finished |
void Window::drag_rubber_box_local | ( | const Point & | start, |
DragHandler * | handler | ||
) | const |
Start dragging of rubber rotating dashes box confined to inside the window.
start | point of box that is dragged in screen coordinates |
handler | handler called when drag is finished |
void Window::drag_sprite | ( | const Sprite & | sprite, |
const BBox & | box, | ||
DragHandler * | handler, | ||
int | flags = 0 |
||
) | const |
Drag a sprite in the desktop.
sprite | the sprite to drag. A copy is made to it does not have to exist once this routine returns. |
box | the box the sprite is contained within. |
handler | the drag handler that will be notified when the drag finishes. |
flags | location of sprite in the box and other sprite dragging options |
void Window::drag_sprite | ( | const Sprite & | sprite, |
const BBox & | box, | ||
const BBox & | bounds, | ||
DragHandler * | handler, | ||
int | flags = 0 |
||
) | const |
Drag a sprite within the specified bounds.
sprite | the sprite to drag. A copy is made to it does not have to exist once this routine returns. |
box | the box the sprite is contained within. |
bounds | the bounding box the drag is restricted to. |
handler | the drag handler that will be notified when the drag finishes. |
flags | location of sprite in the box and other sprite dragging options. |
void Window::drag_sprite_local | ( | const Sprite & | sprite, |
const BBox & | box, | ||
DragHandler * | handler, | ||
int | flags = 0 |
||
) | const |
Drag a sprite within the window the pointer is in the desktop.
sprite | the sprite to drag. A copy is made to it does not have to exist once this routine returns. |
box | the box the sprite is contained within. |
handler | the drag handler that will be notified when the drag finishes. |
flags | location of sprite in the box and other sprite dragging options. |
void Window::force_redraw | ( | const BBox & | work_area | ) |
Force the area to be redrawn.
work_area | area to redraw in work area coordinates |
|
static |
Get the window from the wimp window handle.
window_handle | the wimp window handle |
|
static |
Get a gadget from a given wimp window/icon handle pair.
window_handle | the wimp window handle |
icon_handle | the wimp icon handle |
window | pointer to Window to update with the details of the window or 0 if window details are not required. If the window was not found the Window will be set to be uninitialised (null). |
Gadget Window::gadget | ( | ComponentId | component_id | ) |
Get the gadget with the given component id.
Note: The id is not validated.
void Window::get_info | ( | WindowInfo & | info | ) | const |
Get complete information about the windows state.
info | updated with information about the window |
OsError | unable to retrieve state for window. |
void Window::get_state | ( | WindowState & | state | ) | const |
Gets a summary of the current state of the window.
Usually this call isn't needed as the main information it returns is given during redraw events anyway.
It can be useful if the state is required outside of a redraw event or if the window flags are required.
state | window state structure to update with the state |
OsError | unable to retrieve state for window. |
void Window::get_state | ( | WindowState & | state, |
Window & | parent, | ||
int & | align_flags | ||
) | const |
Gets a summary of the current state of the window.
Usually this call isn't needed as the main information it returns is given during redraw events anyway.
It can be useful if the state is required outside of a redraw event or if the window flags are required.
This version alsoe returns the parent window and alignment flags for sub windows
state | window state structure to update with the state |
parent | Updated to parent window of a subwindow (may be null()) |
align_flags | alignment flags of a subwindow |
OsError | unable to retrieve state for window. |
|
inline |
Set the help message for the Window.
message | the new help message |
|
inline |
Get the help message for the window.
void Window::menu | ( | Menu | menu | ) |
Set menu used with this window.
menu | new menu to use. |
Menu Window::menu | ( | ) | const |
void Window::open_subwindow | ( | const WindowOpenInfo & | open_info, |
Window & | parent, | ||
unsigned int | align_flags = 0 |
||
) |
Open a window as a subwindow.
A subwindow is a child window nested inside another window
open_info | new information to be used by the window. |
parent | Window to make this a subwindow of |
align_flags | use one the AlignFlags to specify how the edges of the subwindow are aligned to its parent window. |
void Window::open_window | ( | const WindowOpenInfo & | open_info | ) |
Open window in a new location.
This should only be called once a window has been shown. Resize, scroll and/or change the window stack position.
Note that all coordinates are rounded down to whole numbers of pixels
open_info | new information to be used by the for the window |
OsError | if unable to open the window |
|
inline |
Assign this Window from an Object that refers to a SaveAs.
This class then refers to the same underlying toolbox object as the other object
other | Object to copy. |
ObjectNullException | if the other object refers to a null object handle |
ObjectClassException | if the other object is not a Window |
|
inline |
BBox Window::outline | ( | ) | const |
void Window::remove_gadget | ( | ComponentId | component_id | ) |
Remove a gadget from the window.
If the window is visible this will cause a redraw of the Window
Automatically removes any listeners that were added to the gadget
void Window::remove_loader | ( | Loader * | loader, |
int | file_type = -2 |
||
) |
Remove a file loader.
loader | the loader to remove |
file_type | the file type for the loader or -2 (the default) for any type. |
void Window::scroll | ( | int | x, |
int | y | ||
) |
Scroll window to given coordinates.
This should only be called once a window has been shown.
OsError | if unable to scroll window |
void Window::scroll | ( | const Point & | pos | ) |
Scroll window to given coordinates.
This should only be called once a window has been shown.
OsError | if unable to scroll window |
Point Window::scroll | ( | ) | const |
Returns the current scroll coordinates in the window.
This should only be called once a window has been shown.
OsError | if unable to retrieve them |
void Window::set_toolbars | ( | Window * | internal_bottom_left, |
Window * | internal_top_left, | ||
Window * | external_bottom_left, | ||
Window * | external_top_left | ||
) |
Set toolbars for this window.
pointers set to 0 means don't change
void Window::show_as_subwindow | ( | const ShowSubWindowSpec & | spec | ) |
Show this window as a sub window (nested child) of an existing window.
spec | ShowSubWindowSpec specifying the location, parent and alignment flags for positioning this window in it's parent. |
void Window::size | ( | int | width, |
int | height | ||
) |
Set the size of the window.
This should only be called once a window has been shown.
OsError | if unable to set the new size |
void Window::size | ( | const Size & | size | ) |
Set the size of the window.
This should only be called once a window has been shown.
OsError | if unable to set the new size |
Size Window::size | ( | ) | const |
Returns the size of the window.
This should only be called once a window has been shown.
OsError | if unable to get the size |
|
inline |
Get the title (caption) of the window.
|
inline |
Set the title (caption) of the window.
new_title | new title for the window |
void Window::top_left | ( | int | x, |
int | y | ||
) |
void Window::top_left | ( | const Point & | pos | ) |
Point Window::top_left | ( | ) | const |
void Window::update | ( | const BBox & | bounds, |
RedrawListener * | background = 0 |
||
) |
Update the window immediately using any registered redrawers.
The redrawing routines should not remove themselves from the window during this call.
bounds | area to update in work area co-ordinates |
background | redrawer to paint the background or 0 for none. |
void Window::update | ( | const BBox & | bounds, |
RedrawListener ** | redrawers, | ||
int | redrawer_count | ||
) |
Update the window immediately using the given redrawers.
bounds | area to update in work area co-ordinates |
redrawers | array of redrawers to use to update the window |
redrawer_count | number of redrawers in the array. |