tbx  0.7.3
Public Types | Public Member Functions | Static Public Member Functions | List of all members
tbx::Window Class Reference

The Window object represents a toolbox window. More...

#include <window.h>

Inheritance diagram for tbx::Window:
tbx::ShowFullObject tbx::ShowPointObject tbx::Object

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...
 
Windowoperator= (const Window &other)
 Assign this Window from another. More...
 
Windowoperator= (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...
 
- Public Member Functions inherited from tbx::ShowFullObject
 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.
 
- Public Member Functions inherited from tbx::ShowPointObject
 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.
 
- Public Member Functions inherited from tbx::Object
 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...
 
Objectoperator= (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

- Protected Member Functions inherited from tbx::Object
 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...
 
- Protected Attributes inherited from tbx::Object
ObjectId _handle
 Handle for toolbox object.
 

Detailed Description

The Window object represents a toolbox window.

Constructor & Destructor Documentation

tbx::Window::Window ( )
inline

Construct creates an unassigned Window.

It must be assigned to a value before the other methods can be used.

tbx::Window::Window ( const Window other)
inline

Construct a Window from another Window.

This class then refers to the same underlying toolbox object as the other Window

Parameters
otherWindow to copy.
tbx::Window::Window ( const Object other)
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

Parameters
otherObject to copy.
Exceptions
ObjectNullExceptionif the other object refers to a null object handle
ObjectClassExceptionif the other object is not a Window
tbx::Window::Window ( const std::string &  template_name)
inline

Create a Window from the named template.

Parameters
template_nameThe name of the template to create the object from
Exceptions
OsErrorif an object cannot be created from the named template
ObjectClassExceptionif the template is not for a Window
Window::Window ( const res::ResWindow object_template)

Create a Window from an in memory template resource.

Parameters
object_templateThe template to create the object from
Exceptions
OsErrorif an object cannot be created from the template

Member Function Documentation

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

Parameters
gadget_template- gadget template to add
Returns
new gadget created
Exceptions
OsErrorif 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.

Parameters
loaderthe loader to add
file_typethe 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.

Parameters
shortcutobject with information about the shortcut
void Window::add_shortcuts ( const res::ResShortcut shortcuts,
int  num 
)

Add multiple keyboard shortcuts from an array.

Parameters
shortcutsarray of objects with information about the shortcuts
numnumber of shortcuts in the shortcuts array
void Window::block_copy ( const BBox bounds,
const Point to 
)

Fast copy of a part of the work area to somewhere else.

Uses VDU primitives where possible and invalidates other areas.

Parameters
bounds- rectangle to copy in work area coordinates
tonew 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.

Exceptions
OsErrorif 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.

Exceptions
OsErrorif unable to reposition the window
void Window::drag_box ( const BBox box,
DragHandler handler 
) const

Drag fixed rotating dots box.

Parameters
boxbox to drag
handlerhandler 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.

Parameters
boxbox to drag
boundsbox is constrains in (screen coordinates)
handlerhandler 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.

Parameters
boxbox to drag
handlerhandler 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.

Parameters
handlerhandler to be called when drag finishes
void Window::drag_point ( const BBox bounds,
DragHandler handler 
) const

Drag mouse pointer constrained to given bounds.

Parameters
boundspoint is constrains in (screen coordinates)
handlerhandler to be called when drag finishes
void Window::drag_point_local ( DragHandler handler) const

Drag mouse pointer constrained to this window.

Parameters
handlerhandler to be called when drag finishes
void Window::drag_rubber_box ( const Point start,
DragHandler handler 
) const

Start dragging of rubber rotating dashes box.

Parameters
startpoint of box that is dragged in screen coordinates
handlerhandler 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.

Parameters
startpoint of box that is dragged in screen coordinates
boundsbox is constrains in (screen coordinates)
handlerhandler 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.

Parameters
startpoint of box that is dragged in screen coordinates
handlerhandler 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.

Parameters
spritethe sprite to drag. A copy is made to it does not have to exist once this routine returns.
boxthe box the sprite is contained within.
handlerthe drag handler that will be notified when the drag finishes.
flagslocation 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.

Parameters
spritethe sprite to drag. A copy is made to it does not have to exist once this routine returns.
boxthe box the sprite is contained within.
boundsthe bounding box the drag is restricted to.
handlerthe drag handler that will be notified when the drag finishes.
flagslocation 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.

Parameters
spritethe sprite to drag. A copy is made to it does not have to exist once this routine returns.
boxthe box the sprite is contained within.
handlerthe drag handler that will be notified when the drag finishes.
flagslocation of sprite in the box and other sprite dragging options.
void Window::force_redraw ( const BBox work_area)

Force the area to be redrawn.

Parameters
work_areaarea to redraw in work area coordinates
Window Window::from_handle ( WindowHandle  window_handle)
static

Get the window from the wimp window handle.

Parameters
window_handlethe wimp window handle
Returns
A window object for the handle. If the handle was not found an uninitialised (null) window will be returned.
Gadget Window::from_handle ( WindowHandle  window_handle,
IconHandle  icon_handle,
Window window = 0 
)
static

Get a gadget from a given wimp window/icon handle pair.

Parameters
window_handlethe wimp window handle
icon_handlethe wimp icon handle
windowpointer 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).
Returns
a Gadget for the given handles. If not found the an uninitialised (null) gadget is returned.
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.

Parameters
infoupdated with information about the window
Exceptions
OsErrorunable 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.

Parameters
statewindow state structure to update with the state
Exceptions
OsErrorunable 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

Parameters
statewindow state structure to update with the state
parentUpdated to parent window of a subwindow (may be null())
align_flagsalignment flags of a subwindow
Exceptions
OsErrorunable to retrieve state for window.
void tbx::Window::help_message ( const std::string &  message)
inline

Set the help message for the Window.

Parameters
messagethe new help message
std::string tbx::Window::help_message ( ) const
inline

Get the help message for the window.

Returns
current help message
void Window::menu ( Menu  menu)

Set menu used with this window.

Parameters
menunew menu to use.
Menu Window::menu ( ) const

Get the current menu used by this object.

Returns
Menu on Window. If there is no menu the return menus null() method will be true.
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

Parameters
open_infonew information to be used by the window.
parentWindow to make this a subwindow of
align_flagsuse 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

Parameters
open_infonew information to be used by the for the window
Exceptions
OsErrorif unable to open the window
bool tbx::Window::operator!= ( const Object other) const
inline

Check if this Window does not refers to the same underlying toolbox object as another.

Parameters
otherObject to compare to
Returns
true if they do not refer to the same underlying toolbox object
Window& tbx::Window::operator= ( const Window other)
inline

Assign this Window from another.

Both objects will then refer to the same underlying toolbox object

Parameters
otherWindow to copy
Returns
reference to this SaveAs
Window& tbx::Window::operator= ( const Object other)
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

Parameters
otherObject to copy.
Returns
reference to this Window
Exceptions
ObjectNullExceptionif the other object refers to a null object handle
ObjectClassExceptionif the other object is not a Window
bool tbx::Window::operator== ( const Object other) const
inline

Check if this Window refers to the same underlying toolbox object as another.

Parameters
otherObject to compare to
Returns
true if they refer to the same underlying toolbox object
BBox Window::outline ( ) const

Get the bounding box that completely covers the window on the screen.

Note: The window must be visible for this call if the Nested Window Manager is not installed.

Returns
Bounding box for window (min inclusive, max exclusive).
Exceptions
OsErrorif call fails
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.

Parameters
loaderthe loader to remove
file_typethe 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.

Exceptions
OsErrorif 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.

Exceptions
OsErrorif 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.

Exceptions
OsErrorif 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.

Parameters
specShowSubWindowSpec 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.

Exceptions
OsErrorif 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.

Exceptions
OsErrorif 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.

Exceptions
OsErrorif unable to get the size
std::string tbx::Window::title ( ) const
inline

Get the title (caption) of the window.

Returns
the window title
void tbx::Window::title ( std::string  new_title)
inline

Set the title (caption) of the window.

Parameters
new_titlenew title for the window
void Window::top_left ( int  x,
int  y 
)

Set the position of the top left of the visible area of the Window on the desktop.

This should only be called once a window has been shown.

Exceptions
OsErrorif unable to reposition the window
void Window::top_left ( const Point pos)

Set the position of the top left of the visible area of the Window on the desktop.

This should only be called once a window has been shown.

Exceptions
OsErrorif unable to reposition the window
Point Window::top_left ( ) const

Get the position of the top left of the visible area of the Window on the desktop.

This should only be called once a window has been shown.

Exceptions
OsErrorif unable to reposition the window
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.

Parameters
boundsarea to update in work area co-ordinates
backgroundredrawer 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.

Parameters
boundsarea to update in work area co-ordinates
redrawersarray of redrawers to use to update the window
redrawer_countnumber of redrawers in the array.

The documentation for this class was generated from the following files: