28 #include "showfullobject.h"
30 #include "visiblearea.h"
32 #include "showsubwindowspec.h"
38 class AboutToBeShownListener;
39 class HasBeenHiddenListener;
41 class OpenWindowListener;
42 class CloseWindowListener;
43 class PointerEnteringListener;
44 class PointerLeavingListener;
45 class MouseClickListener;
47 class LoseCaretListener;
48 class GainCaretListener;
49 class ScrollRequestListener;
72 enum { TOOLBOX_CLASS = 0x82880 };
237 void scroll(
int x,
int y);
240 void size(
int width,
int height);
307 DSFLAG_BOUND_POINT = 64,
308 DSFLAG_DROP_SHADOW = 128,
370 unsigned int flags()
const {
return _flags;}
375 bool open()
const {
return (_flags & (1<<16));}
410 BUTTONTYPE_IGNORE_CLICKS,
412 BUTTONTYPE_CLICK_AUTO,
413 BUTTONTYPE_CLICK_ONCE,
416 BUTTONTYPE_CLICK_DRAG,
417 BUTTONTYPE_RELEASE_DRAG,
418 BUTTONTYPE_DOUBLE_DRAG,
419 BUTTONTYPE_CLICK_ONCE9,
420 BUTTONTYPE_DOUBLE_CLICK_DRAG,
421 BUTTONTYPE_CLICK_DRAG11,
422 BUTTONTYPE_RESERVED12,
423 BUTTONTYPE_RESERVED13,
424 BUTTONTYPE_RESERVED14,
425 BUTTONTYPE_GAIN_FOCUS
435 char _title_foreground;
436 char _title_background;
437 char _work_area_foreground;
438 char _work_area_background;
441 char _title_highlight;
444 unsigned int _title_bar_flags;
445 unsigned int _work_area_flags;
446 unsigned int _sprite_area_pointer;
447 unsigned int _min_width_and_height;
448 unsigned int _title_data[3];
449 unsigned int _initial_icon_count;
460 unsigned int flags()
const {
return _flags;}
533 int min_width()
const {
return (_min_width_and_height & 0xFFFF);}
539 int min_height()
const {
return (_min_width_and_height >> 16);}
void drag_rubber_box_local(const Point &start, DragHandler *handler) const
Start dragging of rubber rotating dashes box confined to inside the window.
Definition: window.cc:1318
Size size() const
Returns the size of the window.
Definition: window.cc:742
void remove_pointer_leaving_listener(PointerLeavingListener *listener)
Remove a listener for pointer leaving events.
Definition: window.cc:988
void remove_scroll_request_listener(ScrollRequestListener *listener)
Remove listener for when a click has occurred on a window's scroll bar.
Definition: window.cc:1091
ObjectId _handle
Handle for toolbox object.
Definition: object.h:173
unsigned int flags() const
Window flags.
Definition: window.h:460
unsigned int work_area_flags() const
Work area flags.
Definition: window.h:467
BBox extent() const
Get the current work area extent for the window.
Definition: window.cc:414
void drag_box_local(const BBox &box, DragHandler *handler) const
Drag fixed rotating dots box constrained to this window.
Definition: window.cc:1238
Class to represent a two-dimensional size.
Definition: size.h:34
Base class for gadget memory resources.
Definition: resgadget.h:42
Window ibl_toolbar() const
Get internal bottom left toolbar.
Definition: window.cc:305
Window(const Object &other)
Construct a Window from an Object that refers to a Window.
Definition: window.h:99
void remove_key_listener(KeyListener *listener)
Remove a listener for key pressed events.
Definition: window.cc:1040
Menu menu() const
Get the current menu used by this object.
Definition: window.cc:154
Window etl_toolbar() const
Get external top left toolbar.
Definition: window.cc:390
void remove_close_window_listener(CloseWindowListener *listener)
Remove a listener for close window events.
Definition: window.cc:971
std::string message(const std::string &token)
Shortcut to the tbx::app()->messages().message(...)
Definition: message.cc:41
void add_mouse_click_listener(MouseClickListener *listener)
Add a listener for mouse click events.
Definition: window.cc:1016
This is the base class for all Gadgets.
Definition: gadget.h:48
bool operator!=(const Object &other) const
Check if this Window does not refers to the same underlying toolbox object as another.
Definition: window.h:152
Listener for about to be shown event.
Definition: abouttobeshownlistener.h:76
WimpColour work_area_background() const
Work area background colour.
Definition: window.h:505
void check_toolbox_class(int class_id) const
Check if this objects toolbox class is as specified.
Definition: object.cc:122
void remove_pointer_entering_listener(PointerEnteringListener *listener)
Remove a listener for pointer entering events.
Definition: window.cc:1004
void add_pointer_leaving_listener(PointerLeavingListener *listener)
Add a listener for the pointer leaving the visible work area of the window.
Definition: window.cc:980
Class to represent a two dimensional bounding box.
Definition: bbox.h:37
BBox outline() const
Get the bounding box that completely covers the window on the screen.
Definition: window.cc:838
void remove_about_to_be_shown_listener(AboutToBeShownListener *listener)
Remove a listener for when a window is about to be shown.
Definition: window.cc:884
WindowHandle _window_handle
WIMP window handle.
Definition: window.h:325
Listener for gain caret Wimp event.
Definition: caretlistener.h:144
void remove_all_shortcuts()
Remove all window shortcuts.
Definition: window.cc:212
void open_subwindow(const WindowOpenInfo &open_info, Window &parent, unsigned int align_flags=0)
Open a window as a subwindow.
Definition: window.cc:652
int ComponentId
Type for underlying toolbox component id.
Definition: handles.h:33
const BBox & work_area() const
Work area.
Definition: window.h:477
ButtonType
Enumeration of the button types for the work area.
Definition: window.h:408
WimpColour title_foreground() const
Title foreground and frame colour.
Definition: window.h:485
std::string title() const
Get the title (caption) of the window.
Definition: window.h:199
bool open() const
Window is open.
Definition: window.h:375
void open_window(const WindowOpenInfo &open_info)
Open window in a new location.
Definition: window.cc:634
bool fully_visible() const
Window is fully visible.
Definition: window.h:382
void remove_redraw_listener(RedrawListener *listener)
Remove a listener for redraw events.
Definition: window.cc:924
void add_shortcuts(const res::ResShortcut *shortcuts, int num)
Add multiple keyboard shortcuts from an array.
Definition: window.cc:189
Point scroll() const
Returns the current scroll coordinates in the window.
Definition: window.cc:699
void add_scroll_request_listener(ScrollRequestListener *listener)
Add listener for when a click has occurred on a window's scroll bar.
Definition: window.cc:1083
void drag_point(DragHandler *handler) const
Start drag operation of the mouse pointer.
Definition: window.cc:1133
Window & operator=(const Object &other)
Assign this Window from an Object that refers to a SaveAs.
Definition: window.h:136
int WindowHandle
Type for WIMP windows handle.
Definition: handles.h:35
void add_about_to_be_shown_listener(AboutToBeShownListener *listener)
Add a listener for when the window is about to be shown.
Definition: window.cc:876
void drag_sprite(const Sprite &sprite, const BBox &box, DragHandler *handler, int flags=0) const
Drag a sprite in the desktop.
Definition: window.cc:1382
void add_has_been_hidden_listener(HasBeenHiddenListener *listener)
Add A listener for when the window has been hidden.
Definition: window.cc:895
Window resource object.
Definition: reswindow.h:48
Class to represent a standard desktop WIMP colour.
Definition: colour.h:146
WindowHandle window_handle_in_front() const
WIMP handle of window on top of this window or -1 for none.
Definition: window.h:349
void title(std::string new_title)
Set the title (caption) of the window.
Definition: window.h:205
void add_pointer_entering_listener(PointerEnteringListener *listener)
Add a listener of the pointer entering the visible work area of the window.
Definition: window.cc:996
Class to report status of a drag started on a window.
Definition: draghandler.h:35
void remove_shortcuts(const res::ResShortcut *shortcuts, int num)
Remove given window shortcuts.
Definition: window.cc:226
Keyboard short cut.
Definition: resshortcut.h:43
ButtonType button_type() const
Button type.
Definition: window.h:472
void get_toolbars(Window *internal_bottom_left, Window *internal_top_left, Window *external_bottom_left, Window *external_top_left)
Get toolbars.
Definition: window.cc:271
Common base class for the UserSprite and WimpSprite classes.
Definition: sprite.h:299
void drag_point_local(DragHandler *handler) const
Drag mouse pointer constrained to this window.
Definition: window.cc:1159
Window(const Window &other)
Construct a Window from another Window.
Definition: window.h:88
Window ebl_toolbar() const
Get external bottom left toolbar.
Definition: window.cc:362
std::string help_message() const
Get the help message for the window.
Definition: window.h:187
int int_property(int property_id) const
Return the value of a property that returns an integer.
Definition: object.cc:435
bool full_size() const
window has been toggled to full size
Definition: window.h:387
void add_loader(Loader *loader, int file_type=-2)
Add a file loader.
Definition: window.cc:1103
const VisibleArea & visible_area() const
Visible area of this window.
Definition: window.h:339
std::string string_property(int property_id) const
Return the value of a property that returns text.
Definition: object.cc:477
Point top_left() const
Get the position of the top left of the visible area of the Window on the desktop.
Definition: window.cc:791
Class to represent a position in two dimensional space.
Definition: point.h:36
void get_info(WindowInfo &info) const
Get complete information about the windows state.
Definition: window.cc:617
bool toggle_size() const
the current Open_Window_Request was caused by a click on the Toggle Size icon
Definition: window.h:392
Window()
Construct creates an unassigned Window.
Definition: window.h:79
WimpColour work_area_foreground() const
Work area foreground colour.
Definition: window.h:498
VisibleArea & visible_area()
Visible area of this window.
Definition: window.h:344
bool force_to_screen() const
force window to screen once on the next Open_Window
Definition: window.h:402
void add_shorcut(const res::ResShortcut &shortcut)
Add a keyboard shortcut.
Definition: window.cc:171
Class to store information for the Visible area of a window and provide work area to screen conversio...
Definition: visiblearea.h:36
Class to handle file/data loading from the filer or an external application.
Definition: loader.h:179
Listener for the pointer entering the window.
Definition: pointerlistener.h:62
Listener for the pointer leaving the window.
Definition: pointerlistener.h:44
WimpColour scroll_outer() const
Scroll bar outer colour.
Definition: window.h:511
Window(const std::string &template_name)
Create a Window from the named template.
Definition: window.h:107
Listener for mouse clicks on a Window.
Definition: mouseclicklistener.h:129
ObjectId handle() const
Return the underlying toolbox object id this object references.
Definition: object.h:93
void remove_menu()
Removes the menu from the window.
Definition: window.cc:137
WimpColour title_highlight() const
Title background highlight colour.
Definition: window.h:523
int IconHandle
Type for WIMP icon handle.
Definition: handles.h:37
void add_open_window_listener(OpenWindowListener *listener)
Add a listener to be called when the window is opened.
Definition: window.cc:943
WindowHandle window_handle() const
Return the underlying WIMP windows handle of the window.
Definition: window.h:165
void force_redraw(const BBox &work_area)
Force the area to be redrawn.
Definition: window.cc:428
The Window object represents a toolbox window.
Definition: window.h:69
void show_as_subwindow(const ShowSubWindowSpec &spec)
Show this window as a sub window (nested child) of an existing window.
Definition: window.cc:61
Redraw event listener.
Definition: redrawlistener.h:75
unsigned int flags() const
Window flags.
Definition: window.h:370
void remove_open_window_listener(OpenWindowListener *listener)
Remove a listener for window opened events.
Definition: window.cc:951
WindowHandle _window_handle_in_front
Handle of window in front of this one.
Definition: window.h:327
WindowHandle window_handle() const
WIMP window handle of this window.
Definition: window.h:334
DragSpriteFlags
Flags for drag_sprite.
Definition: window.h:302
void remove_has_been_hidden_listener(HasBeenHiddenListener *listener)
Remove a listener for when a window has been hidden.
Definition: window.cc:903
void remove_mouse_click_listener(MouseClickListener *listener)
Remove a listener for mouse click events.
Definition: window.cc:1024
void add_lose_caret_listener(LoseCaretListener *listener)
Add a listener for when the window loses the caret.
Definition: window.cc:1048
void drag_box(const BBox &box, DragHandler *handler) const
Drag fixed rotating dots box.
Definition: window.cc:1211
int min_width() const
Minimum width of the window.
Definition: window.h:533
void block_copy(const BBox &bounds, const Point &to)
Fast copy of a part of the work area to somewhere else.
Definition: window.cc:856
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.
Definition: window.cc:1400
int min_height() const
Minimum height of the window.
Definition: window.h:539
void add_key_listener(KeyListener *listener)
Add a listener for key pressed events.
Definition: window.cc:1032
void add_gain_caret_listener(GainCaretListener *listener)
Add a listener for when the window gains the caret.
Definition: window.cc:1064
Listener for an object has been hidden event.
Definition: hasbeenhiddenlistener.h:36
Structure used to show a window as a subwindow.
Definition: showsubwindowspec.h:58
Class with details of window location on screen.
Definition: window.h:322
WimpColour scroll_inner() const
Scroll bar inner colour.
Definition: window.h:517
Window state structure for the Window get_state method.
Definition: window.h:355
void remove_gadget(ComponentId component_id)
Remove a gadget from the window.
Definition: window.cc:103
void cancel_drag() const
Cancel current drag operation.
Definition: window.cc:1368
void add_redraw_listener(RedrawListener *listener)
Add a listener to be called when the window needs redrawing.
Definition: window.cc:916
Listener for Wimp Open Window Request events.
Definition: openwindowlistener.h:97
Objects derived from this class can be shown with there full location and size specified as well as t...
Definition: showfullobject.h:40
WimpColour title_background() const
Title background colour.
Definition: window.h:491
Window & operator=(const Window &other)
Assign this Window from another.
Definition: window.h:124
void remove_lose_caret_listener(LoseCaretListener *listener)
Remove a listener for when the window loses the caret.
Definition: window.cc:1056
bool operator==(const Object &other) const
Check if this Window refers to the same underlying toolbox object as another.
Definition: window.h:144
Class to manipulate a toolbox object.
Definition: object.h:50
static Window from_handle(WindowHandle window_handle)
Get the window from the wimp window handle.
Definition: window.cc:526
void help_message(const std::string &message)
Set the help message for the Window.
Definition: window.h:181
void update(const BBox &bounds, RedrawListener *background=0)
Update the window immediately using any registered redrawers.
Definition: window.cc:443
void remove_gain_caret_listener(GainCaretListener *listener)
Remove a listener for when the window gains the caret.
Definition: window.cc:1072
Gadget add_gadget(const res::ResGadget &gadget_template)
Add a gadget to the window.
Definition: window.cc:83
VisibleArea _visible_area
Position on screen and scroll settings.
Definition: window.h:326
void set_toolbars(Window *internal_bottom_left, Window *internal_top_left, Window *external_bottom_left, Window *external_top_left)
Set toolbars for this window.
Definition: window.cc:251
BBox bounds() const
Get position and size of the visible area of window on the desktop.
Definition: window.cc:821
Window Information structure for the Window get_info method.
Definition: window.h:431
void add_close_window_listener(CloseWindowListener *listener)
Add a listener to be called when the window has received a request to close.
Definition: window.cc:963
void get_state(WindowState &state) const
Gets a summary of the current state of the window.
Definition: window.cc:573
void drag_rubber_box(const Point &start, DragHandler *handler) const
Start dragging of rubber rotating dashes box.
Definition: window.cc:1291
Window itl_toolbar() const
Get internal top left toolbar.
Definition: window.cc:334
Listener for KeyPressed WIMP event.
Definition: keylistener.h:178
Gadget gadget(ComponentId component_id)
Get the gadget with the given component id.
Definition: window.cc:514
void remove_loader(Loader *loader, int file_type=-2)
Remove a file loader.
Definition: window.cc:1117
Listener for the close window request message.
Definition: closewindowlistener.h:45
Listener for LoseCaret Wimp event.
Definition: caretlistener.h:126
bool input_focus() const
window has the input focus
Definition: window.h:397