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 };
236 void scroll(
int x,
int y);
239 void size(
int width,
int height);
312 DSFLAG_BOUND_POINT = 64,
313 DSFLAG_DROP_SHADOW = 128,
375 unsigned int flags()
const {
return _flags;}
380 bool open()
const {
return (_flags & (1<<16));}
415 BUTTONTYPE_IGNORE_CLICKS,
417 BUTTONTYPE_CLICK_AUTO,
418 BUTTONTYPE_CLICK_ONCE,
421 BUTTONTYPE_CLICK_DRAG,
422 BUTTONTYPE_RELEASE_DRAG,
423 BUTTONTYPE_DOUBLE_DRAG,
424 BUTTONTYPE_CLICK_ONCE9,
425 BUTTONTYPE_DOUBLE_CLICK_DRAG,
426 BUTTONTYPE_CLICK_DRAG11,
427 BUTTONTYPE_RESERVED12,
428 BUTTONTYPE_RESERVED13,
429 BUTTONTYPE_RESERVED14,
430 BUTTONTYPE_GAIN_FOCUS
440 char _title_foreground;
441 char _title_background;
442 char _work_area_foreground;
443 char _work_area_background;
446 char _title_highlight;
449 unsigned int _title_bar_flags;
450 unsigned int _work_area_flags;
451 unsigned int _sprite_area_pointer;
452 unsigned int _min_width_and_height;
453 unsigned int _title_data[3];
454 unsigned int _initial_icon_count;
465 unsigned int flags()
const {
return _flags;}
538 int min_width()
const {
return (_min_width_and_height & 0xFFFF);}
544 int min_height()
const {
return (_min_width_and_height >> 16);}
int int_property(int property_id) const
Return the value of a property that returns an integer.
Definition: object.cc:477
Window & operator=(const Object &other)
Assign this Window from an Object that refers to a SaveAs.
Definition: window.h:136
std::string title() const
Get the title (caption) of the window.
Definition: window.h:199
void drag_sprite(const Sprite &sprite, const BBox &box, DragHandler *handler, int flags=0) const
Drag a sprite in the desktop.
Definition: window.cc:1439
void remove_loader(Loader *loader, int file_type=-2)
Remove a file loader.
Definition: window.cc:1174
Window etl_toolbar() const
Get external top left toolbar.
Definition: window.cc:391
Listener for mouse clicks on a Window.
Definition: mouseclicklistener.h:130
unsigned int flags() const
Window flags.
Definition: window.h:375
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
void cancel_drag() const
Cancel current drag operation.
Definition: window.cc:1425
Listener for gain caret Wimp event.
Definition: caretlistener.h:145
int ComponentId
Type for underlying toolbox component id.
Definition: handles.h:33
void remove_redraw_listener(RedrawListener *listener)
Remove a listener for redraw events.
Definition: window.cc:936
void add_redraw_listener(RedrawListener *listener)
Add a listener to be called when the window needs redrawing.
Definition: window.cc:928
Window & operator=(const Window &other)
Assign this Window from another.
Definition: window.h:124
Class to represent a standard desktop WIMP colour.
Definition: colour.h:147
ObjectId handle() const
Return the underlying toolbox object id this object references.
Definition: object.h:93
void drag_point(DragHandler *handler) const
Start drag operation of the mouse pointer.
Definition: window.cc:1190
Point scroll() const
Returns the current scroll coordinates in the window.
Definition: window.cc:700
void add_shortcuts(const res::ResShortcut *shortcuts, int num)
Add multiple keyboard shortcuts from an array.
Definition: window.cc:190
void add_about_to_be_shown_listener(AboutToBeShownListener *listener)
Add a listener for when the window is about to be shown.
Definition: window.cc:888
WindowHandle window_handle() const
Return the underlying WIMP windows handle of the window.
Definition: window.h:165
void add_scroll_request_listener(ScrollRequestListener *listener)
Add listener for when a click has occurred on a window's scroll bar.
Definition: window.cc:1140
Window ibl_toolbar() const
Get internal bottom left toolbar.
Definition: window.cc:306
ObjectId _handle
Handle for toolbox object.
Definition: object.h:175
WimpColour title_highlight() const
Title background highlight colour.
Definition: window.h:528
void remove_all_shortcuts()
Remove all window shortcuts.
Definition: window.cc:213
std::string string_property(int property_id) const
Return the value of a property that returns text.
Definition: object.cc:519
The Window object represents a toolbox window.
Definition: window.h:70
void add_lose_caret_listener(LoseCaretListener *listener)
Add a listener for when the window loses the caret.
Definition: window.cc:1105
const BBox & work_area() const
Work area.
Definition: window.h:482
void show_as_subwindow(const ShowSubWindowSpec &spec)
Show this window as a sub window (nested child) of an existing window.
Definition: window.cc:62
Base class for gadget memory resources.
Definition: resgadget.h:43
VisibleArea _visible_area
Position on screen and scroll settings.
Definition: window.h:331
void add_pointer_entering_listener(PointerEnteringListener *listener)
Add a listener of the pointer entering the visible work area of the window.
Definition: window.cc:1008
void remove_pointer_entering_listener(PointerEnteringListener *listener)
Remove a listener for pointer entering events.
Definition: window.cc:1016
BBox outline() const
Get the bounding box that completely covers the window on the screen.
Definition: window.cc:839
Listener for the close window request message.
Definition: closewindowlistener.h:46
VisibleArea & visible_area()
Visible area of this window.
Definition: window.h:349
DragSpriteFlags
Flags for drag_sprite.
Definition: window.h:307
WimpColour title_foreground() const
Title foreground and frame colour.
Definition: window.h:490
Class to handle file/data loading from the filer or an external application.
Definition: loader.h:179
void remove_close_window_listener(CloseWindowListener *listener)
Remove a listener for close window events.
Definition: window.cc:983
Window(const Window &other)
Construct a Window from another Window.
Definition: window.h:88
WimpColour title_background() const
Title background colour.
Definition: window.h:496
Class to store information for the Visible area of a window and provide work area to screen conversio...
Definition: visiblearea.h:37
Listener for an object has been hidden event.
Definition: hasbeenhiddenlistener.h:36
Menu menu() const
Get the current menu used by this object.
Definition: window.cc:155
void remove_lose_caret_listener(LoseCaretListener *listener)
Remove a listener for when the window loses the caret.
Definition: window.cc:1113
bool operator==(const Object &other) const
Check if this Window refers to the same underlying toolbox object as another.
Definition: window.h:144
Common base class for the UserSprite and WimpSprite classes.
Definition: sprite.h:301
void remove_menu()
Removes the menu from the window.
Definition: window.cc:138
int min_width() const
Minimum width of the window.
Definition: window.h:538
WimpColour scroll_outer() const
Scroll bar outer colour.
Definition: window.h:516
std::string help_message() const
Get the help message for the window.
Definition: window.h:187
void drag_rubber_box(const Point &start, DragHandler *handler) const
Start dragging of rubber rotating dashes box.
Definition: window.cc:1348
WindowHandle window_handle_in_front() const
WIMP handle of window on top of this window or -1 for none.
Definition: window.h:354
bool input_focus() const
window has the input focus
Definition: window.h:402
Window Information structure for the Window get_info method.
Definition: window.h:437
WindowHandle _window_handle_in_front
Handle of window in front of this one.
Definition: window.h:332
void open_window(const WindowOpenInfo &open_info)
Open window in a new location.
Definition: window.cc:635
unsigned int work_area_flags() const
Work area flags.
Definition: window.h:472
void remove_open_window_listener(OpenWindowListener *listener)
Remove a listener for window opened events.
Definition: window.cc:963
Window resource object.
Definition: reswindow.h:49
bool full_size() const
window has been toggled to full size
Definition: window.h:392
bool fully_visible() const
Window is fully visible.
Definition: window.h:387
Class to represent a two dimensional bounding box.
Definition: bbox.h:38
Gadget gadget(ComponentId component_id)
Get the gadget with the given component id.
Definition: window.cc:515
int WindowHandle
Type for WIMP windows handle.
Definition: handles.h:35
Size size() const
Returns the size of the window.
Definition: window.cc:743
BBox extent() const
Get the current work area extent for the window.
Definition: window.cc:415
void check_toolbox_class(int class_id) const
Check if this objects toolbox class is as specified.
Definition: object.cc:122
BBox bounds() const
Get position and size of the visible area of window on the desktop.
Definition: window.cc:822
std::string message(const std::string &token)
Shortcut to the tbx::app()->messages().message(...)
Definition: message.cc:41
void help_message(const std::string &message)
Set the help message for the Window.
Definition: window.h:181
void remove_gain_caret_listener(GainCaretListener *listener)
Remove a listener for when the window gains the caret.
Definition: window.cc:1129
Listener for Wimp Open Window Request events.
Definition: openwindowlistener.h:98
void remove_about_to_be_shown_listener(AboutToBeShownListener *listener)
Remove a listener for when a window is about to be shown.
Definition: window.cc:896
unsigned int flags() const
Window flags.
Definition: window.h:465
void remove_scroll_request_listener(ScrollRequestListener *listener)
Remove listener for when a click has occurred on a window's scroll bar.
Definition: window.cc:1148
void remove_has_been_hidden_listener(HasBeenHiddenListener *listener)
Remove a listener for when a window has been hidden.
Definition: window.cc:915
Class to represent a two-dimensional size.
Definition: size.h:35
Listener for about to be shown event.
Definition: abouttobeshownlistener.h:77
Gadget add_gadget(const res::ResGadget &gadget_template)
Add a gadget to the window.
Definition: window.cc:84
void add_key_listener(KeyListener *listener)
Add a listener for key pressed events on this window.
Definition: window.cc:1068
void get_info(WindowInfo &info) const
Get complete information about the windows state.
Definition: window.cc:618
void remove_gadget(ComponentId component_id)
Remove a gadget from the window.
Definition: window.cc:104
void get_state(WindowState &state) const
Gets a summary of the current state of the window.
Definition: window.cc:574
Window itl_toolbar() const
Get internal top left toolbar.
Definition: window.cc:335
void title(std::string new_title)
Set the title (caption) of the window.
Definition: window.h:205
void force_redraw(const BBox &work_area)
Force the area to be redrawn.
Definition: window.cc:429
void add_mouse_click_listener(MouseClickListener *listener)
Add a listener for mouse click events.
Definition: window.cc:1028
static Window from_handle(WindowHandle window_handle)
Get the window from the wimp window handle.
Definition: window.cc:527
void add_open_window_listener(OpenWindowListener *listener)
Add a listener to be called when the window is opened.
Definition: window.cc:955
Class to report status of a drag started on a window.
Definition: draghandler.h:36
Window()
Construct creates an unassigned Window.
Definition: window.h:79
void add_pointer_leaving_listener(PointerLeavingListener *listener)
Add a listener for the pointer leaving the visible work area of the window.
Definition: window.cc:992
ButtonType
Enumeration of the button types for the work area.
Definition: window.h:414
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:1457
void remove_all_key_listener(KeyListener *listener)
Remove a listener for key pressed events on this window or the components it contains.
Definition: window.cc:1097
Listener for the pointer leaving the window.
Definition: pointerlistener.h:45
void remove_mouse_click_listener(MouseClickListener *listener)
Remove a listener for mouse click events.
Definition: window.cc:1036
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:975
Class to manipulate a toolbox object.
Definition: object.h:51
Redraw event listener.
Definition: redrawlistener.h:76
bool force_to_screen() const
force window to screen once on the next Open_Window
Definition: window.h:407
Class to represent a position in two dimensional space.
Definition: point.h:37
void open_subwindow(const WindowOpenInfo &open_info, Window &parent, unsigned int align_flags=0)
Open a window as a subwindow.
Definition: window.cc:653
Class with details of window location on screen.
Definition: window.h:328
void add_shorcut(const res::ResShortcut &shortcut)
Add a keyboard shortcut.
Definition: window.cc:172
void drag_point_local(DragHandler *handler) const
Drag mouse pointer constrained to this window.
Definition: window.cc:1216
void get_toolbars(Window *internal_bottom_left, Window *internal_top_left, Window *external_bottom_left, Window *external_top_left)
Get toolbars.
Definition: window.cc:272
Window state structure for the Window get_state method.
Definition: window.h:361
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:252
bool toggle_size() const
the current Open_Window_Request was caused by a click on the Toggle Size icon
Definition: window.h:397
WindowHandle _window_handle
WIMP window handle.
Definition: window.h:330
Objects derived from this class can be shown with there full location and size specified as well as t...
Definition: showfullobject.h:41
Listener for the pointer entering the window.
Definition: pointerlistener.h:63
void remove_shortcuts(const res::ResShortcut *shortcuts, int num)
Remove given window shortcuts.
Definition: window.cc:227
void block_copy(const BBox &bounds, const Point &to)
Fast copy of a part of the work area to somewhere else.
Definition: window.cc:857
void add_gain_caret_listener(GainCaretListener *listener)
Add a listener for when the window gains the caret.
Definition: window.cc:1121
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
WimpColour work_area_foreground() const
Work area foreground colour.
Definition: window.h:503
void drag_box_local(const BBox &box, DragHandler *handler) const
Drag fixed rotating dots box constrained to this window.
Definition: window.cc:1295
Listener for KeyPressed WIMP event.
Definition: keylistener.h:179
This is the base class for all Gadgets.
Definition: gadget.h:49
bool open() const
Window is open.
Definition: window.h:380
Listener for LoseCaret Wimp event.
Definition: caretlistener.h:127
void add_all_mouse_click_listener(MouseClickListener *listener)
Add listener for a mouse click on a window or any of its components.
Definition: window.cc:1051
void focus()
Sets the focus to an invisible caret a postion 0,0 in the window.
Definition: window.cc:877
const VisibleArea & visible_area() const
Visible area of this window.
Definition: window.h:344
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:1375
void remove_pointer_leaving_listener(PointerLeavingListener *listener)
Remove a listener for pointer leaving events.
Definition: window.cc:1000
Window(const Object &other)
Construct a Window from an Object that refers to a Window.
Definition: window.h:99
int IconHandle
Type for WIMP icon handle.
Definition: handles.h:37
Window ebl_toolbar() const
Get external bottom left toolbar.
Definition: window.cc:363
void remove_key_listener(KeyListener *listener)
Remove a listener for key pressed events on this window .
Definition: window.cc:1076
void add_has_been_hidden_listener(HasBeenHiddenListener *listener)
Add A listener for when the window has been hidden.
Definition: window.cc:907
Structure used to show a window as a subwindow.
Definition: showsubwindowspec.h:59
void add_loader(Loader *loader, int file_type=-2)
Add a file loader.
Definition: window.cc:1160
Keyboard short cut.
Definition: resshortcut.h:44
WindowHandle window_handle() const
WIMP window handle of this window.
Definition: window.h:339
void add_all_key_listener(KeyListener *listener)
Add a listener for key pressed events on this window or the components it contains.
Definition: window.cc:1089
int min_height() const
Minimum height of the window.
Definition: window.h:544
Window(const std::string &template_name)
Create a Window from the named template.
Definition: window.h:107
Point top_left() const
Get the position of the top left of the visible area of the Window on the desktop.
Definition: window.cc:792
WimpColour scroll_inner() const
Scroll bar inner colour.
Definition: window.h:522
void drag_box(const BBox &box, DragHandler *handler) const
Drag fixed rotating dots box.
Definition: window.cc:1268
void remove_all_mouse_click_listener(MouseClickListener *listener)
Remove listener for key press on window or any of its components.
Definition: window.cc:1059
void update(const BBox &bounds, RedrawListener *background=0)
Update the window immediately using any registered redrawers.
Definition: window.cc:444
WimpColour work_area_background() const
Work area background colour.
Definition: window.h:510
ButtonType button_type() const
Button type.
Definition: window.h:477