24 #ifndef TBX_RES_Window_H
25 #define TBX_RES_Window_H
27 #include "resobject.h"
28 #include "resgadget.h"
29 #include "resshortcut.h"
30 #include "resiteratorbase.h"
31 #include "../handles.h"
32 #include "../colour.h"
51 enum { CLASS_ID = 0x82880 };
1110 friend class const_shortcut_iterator;
1166 friend class shortcut_iterator;
1221 friend class const_gadget_iterator;
1247 const_gadget_iterator
find_gadget(
int component_id)
const;
1276 friend class gadget_iterator;
1329 #endif // TBX_RES_Window_H
const char * pointer_shape() const
Get the name of the sprite to use for the mouse pointer when it is over this window.
Definition: reswindow.h:283
ResShortcut shortcut_at_offset(int item_offset) const
Get a copy of the shortcut at the given offset.
Definition: reswindow.cc:343
void title_inputfocus(WimpColour value)
Set the background colour for the title bar when it has the input focus.
Definition: reswindow.h:917
void add_gadget(const ResGadget &gadget)
Adds the gadget to the end of the window.
Definition: reswindow.cc:222
int * OsSpriteAreaPtr
Type for pointer to underlying RISC OS Sprite area.
Definition: sprite.h:214
void title_back(WimpColour value)
Set the background colour for the title bar.
Definition: reswindow.h:855
int max_help_message() const
Get the maximum help message length.
Definition: reswindow.h:275
void string_with_length(int offset, const char *value, int length=-1)
Assign a string where the length is at offset+4.
Definition: resbase.cc:1591
void message_with_length(int offset, const char *value, int length=-1)
Assign a message where the length is at offset+4.
Definition: resbase.cc:1639
const char * title_text() const
Get the text for the title of the window.
Definition: reswindow.h:1037
bool moveable() const
Check if the window will be moveable.
Definition: reswindow.h:596
void button_type(unsigned int value)
Set the button type.
Definition: reswindow.h:991
shortcut_iterator shortcut_begin()
Get iterator to first shortcut.
Definition: reswindow.h:1173
const_shortcut_iterator shortcut_cend() const
Get constant iterator to end of shortcuts.
Definition: reswindow.h:1135
Constant iterator for gadgets in the window resource.
Definition: reswindow.h:1198
void back_icon(bool has_icon)
Set if window has a back icon.
Definition: reswindow.h:758
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
ResGadget gadget(ComponentId component_id) const
Get a copy of gadget with given component id.
Definition: reswindow.cc:198
const_gadget_iterator & operator++()
Increment to the next gadget.
Definition: reswindow.h:1207
int title_buflen() const
Get the length of the buffer to hold the title.
Definition: reswindow.h:1073
void title_validation(const std::string &value)
Set the title validation.
Definition: reswindow.h:1067
void user_scroll(bool scroll)
Set if a Scroll_Request event if returned with auto-repeat on the arrow icons and no auto-repeat on t...
Definition: reswindow.h:658
void title_text(const std::string &value)
Set the text for the title of the window.
Definition: reswindow.h:1049
int ComponentId
Type for underlying toolbox component id.
Definition: handles.h:33
const char * title_validation() const
Get the title validation.
Definition: reswindow.h:1055
bool top_window() const
Check if window can be opened below this.
Definition: reswindow.h:692
void scroll_inner(WimpColour value)
Set the scroll bar inner colour.
Definition: reswindow.h:903
const_shortcut_iterator shortcut_end() const
Get constant iterator to end of shortcuts.
Definition: reswindow.h:1123
bool adjust_size_icon() const
Check if window has an adjust size icon.
Definition: reswindow.h:812
Base class for a resource object that can be edited.
Definition: resobject.h:53
bool close_icon() const
Check if window has a close icon.
Definition: reswindow.h:764
Class to represent a standard desktop WIMP colour.
Definition: colour.h:147
int scroll_y() const
Get the Y scroll offset into the work area.
Definition: reswindow.h:553
const_gadget_iterator gadget_cend() const
Get constant iterator to the end of the gadgets.
Definition: reswindow.h:1246
WimpColour scroll_outer() const
Get the work area scroll bar outer colour.
Definition: reswindow.h:885
void adjust_size_icon(bool has_icon)
Set if window has an adjust size icon.
Definition: reswindow.h:818
bool allow_off_screen() const
Check if window is allowed off screen.
Definition: reswindow.h:636
WimpColour title_fore() const
Get the foreground/text colour for the title bar.
Definition: reswindow.h:837
const_shortcut_iterator shortcut_cbegin() const
Get constant iterator to first shortcut.
Definition: reswindow.h:1129
unsigned short min_width() const
Get the minimum width for the window.
Definition: reswindow.h:1012
int behind() const
Get the WIMP window handle this window will be opened behind.
Definition: reswindow.h:565
shortcut_iterator & operator++()
Increment to the next shortcut.
Definition: reswindow.h:1152
Base class for gadget memory resources.
Definition: resgadget.h:43
unsigned short ushort_value(int offset) const
Get a unsigned short value.
Definition: resbase.h:342
unsigned char byte_value(int offset) const
Get a byte value.
Definition: resbase.h:333
char * shortcut_start() const
Get pointer to first short cut in memory.
Definition: reswindow.h:1319
int int_value(int offset) const
Get an integer value.
Definition: resbase.h:316
WimpColour work_fore() const
Get the work area foreground colour.
Definition: reswindow.h:861
void hscrollbar(bool has_hsb)
Set if window has a horizontal scroll bar.
Definition: reswindow.h:830
void scroll_x(int value)
Set the X scroll offset into the work area.
Definition: reswindow.h:547
unsigned int flags() const
Get all flags as a word raw access.
Definition: reswindow.h:161
bool real_colours() const
Check if window colours are given as gcol numbers.
Definition: reswindow.h:680
void toolbar(bool value)
Set if this template is for a toolbar.
Definition: reswindow.h:246
void scroll_outer(WimpColour value)
Set the scroll bar outer colour.
Definition: reswindow.h:891
int _offset
Offset of current item being iterated.
Definition: resiteratorbase.h:17
void default_focus(ComponentId id)
Set the component ID of the gadget to get the default focus.
Definition: reswindow.h:376
void ignore_right_extent(bool ignore)
Set if right extent is ignored.
Definition: reswindow.h:734
bool toolbar() const
Check if this template is for a toolbar.
Definition: reswindow.h:240
void sprite_area(OsSpriteAreaPtr value)
Set a pointer to the sprite area used for client icons on this window.
Definition: reswindow.h:1006
const char * help_message() const
Get the help message.
Definition: reswindow.h:253
gadget_iterator & operator++()
Increment to the next gadget.
Definition: reswindow.h:1262
bool toggle_size_icon() const
Check if window has a toggle size icon.
Definition: reswindow.h:788
bool hot_keys() const
Check if generates events for hot keys.
Definition: reswindow.h:704
ResShortcut operator*() const
Get the shortcut pointed to by this iterator.
Definition: reswindow.h:1164
void ignore_lower_extent(bool ignore)
Set if lower extent is ignored.
Definition: reswindow.h:746
ResWindow & operator=(const ResWindow &other)
Assignment.
Definition: reswindow.h:136
gadget_iterator gadget_end()
Get iterator to the end of the gadgets.
Definition: reswindow.h:1289
unsigned int title_flags() const
Get the title flags.
Definition: reswindow.h:972
int show_event() const
Get the event ID of the event generated when the window is shown.
Definition: reswindow.h:385
void allow_off_screen(bool allow)
Set if window is allowed off screen.
Definition: reswindow.h:642
void hot_keys(bool generate)
Set if generates events for hot keys.
Definition: reswindow.h:710
int num_gadgets() const
Get the number of gadgets in this window.
Definition: reswindow.h:361
void scroll_y(int value)
Set the Y scroll offset into the work area.
Definition: reswindow.h:559
ResShortcut shortcut(int key_code) const
Get a copy of shortcut with key_code.
Definition: reswindow.cc:429
ResWindow(std::string name, bool toolbar=false)
Constructor and empty ResWindow.
Definition: reswindow.h:58
int visible_xmin() const
Get the minimum X coordinate of the visible part of the window.
Definition: reswindow.h:493
void hide_event(int value)
Set the event ID of the event generated when the window has been hidden.
Definition: reswindow.h:410
void work_xmin(int value)
Set the minimum X coordinate of the work area extent.
Definition: reswindow.h:930
ResWindow(const ResWindow &other)
Copy constructor.
Definition: reswindow.h:122
bool ignore_right_extent() const
Check if right extent is ignored.
Definition: reswindow.h:728
void menu(const char *value)
Set the menu to be shown for this menu.
Definition: reswindow.h:343
void pointer_y_hot(int value)
Set the Y position of the hotspot in the pointer.
Definition: reswindow.h:330
bool back_icon() const
Check if window has a back icon.
Definition: reswindow.h:752
int work_ymax() const
Get the maximum Y coordinate of the work area extent.
Definition: reswindow.h:960
void internal_bl_toolbar(const char *value)
Set the name of the object to use for the internal bottom left toolbar.
Definition: reswindow.h:423
const ComponentId FOCUS_TO_WINDOW
Constant to put default focus to the window.
Definition: reswindow.h:43
bool generate_has_been_hidden() const
Check if an event will be generated when the window has been hidden.
Definition: reswindow.h:227
void pointer_shape(const char *value, int max_length=-1)
Set the name of the sprite to use for the mouse pointer when it is over this window.
Definition: reswindow.h:292
int end_gadget_offset() const
Get offset to end of gadgets.
Definition: reswindow.cc:146
void window_flags(unsigned int value)
Set the window flags.
Definition: reswindow.h:589
void show_event(int event_id)
Set the event ID of the event generated when the window is shown.
Definition: reswindow.h:393
void external_bl_toolbar(const std::string &value)
Set the name of the object to use for the external bottom left toolbar.
Definition: reswindow.h:466
void init_message(int offset, const char *value)
Initialise a message in a constructor helper.
Definition: resbase.cc:1736
const_shortcut_iterator find_shortcut(int key_code) const
Find shortcut with given key.
Definition: reswindow.cc:413
bool contains_gadget(ComponentId component_id) const
Check if the window contains a gadget with the given id.
Definition: reswindow.cc:211
void check_class_id(int class_id) const
Check if this objects class id is as specified.
Definition: resobject.cc:383
const_gadget_iterator find_gadget(int component_id) const
Find gadget with given id.
Definition: reswindow.cc:182
ResGadget operator*() const
Get the gadget pointed to by this iterator.
Definition: reswindow.h:1274
bool flag(int offset, int mask) const
Check if any of the bits in a mask are set.
Definition: resbase.h:352
bool user_scroll() const
Check if a Scroll_Request event if returned with auto-repeat on the arrow icons and no auto-repeat on...
Definition: reswindow.h:650
ResWindow & operator=(const ResObject &other)
Assignment from ResObject.
Definition: reswindow.h:147
unsigned int window_flags() const
Get the window flags.
Definition: reswindow.h:580
const char * external_bl_toolbar() const
Get the name of the object to use for the external bottom left toolbar.
Definition: reswindow.h:454
Window resource object.
Definition: reswindow.h:49
ResWindow(const ResObject &other)
Construct from a ResObject.
Definition: reswindow.h:129
void help_message(const std::string &value, int max_length=-1)
Set the help message.
Definition: reswindow.h:270
void pointer_x_hot(int value)
Set the X position of the hotspot in the pointer.
Definition: reswindow.h:318
const_shortcut_iterator shortcut_begin() const
Get constant iterator to first shortcut.
Definition: reswindow.h:1117
unsigned int uint_value(int offset) const
Get an unsigned integer value.
Definition: resbase.h:324
void auto_close(bool value)
Set if window is automatically closed.
Definition: reswindow.h:220
bool titlebar() const
Check if window has a title bar.
Definition: reswindow.h:776
WimpColour work_back() const
Get the work area background colour.
Definition: reswindow.h:873
gadget_iterator operator++(int)
Increment to the next gadget.
Definition: reswindow.h:1268
const_shortcut_iterator & operator++()
Increment to the next shortcut.
Definition: reswindow.h:1096
void help_message(const char *value, int max_length=-1)
Set the help message.
Definition: reswindow.h:262
WimpColour title_inputfocus() const
Get the background colour for the title bar when it has the input focus.
Definition: reswindow.h:910
const char * name() const
Return pointer to name of object.
Definition: resobject.h:79
const char * internal_tl_toolbar() const
Get the name of the object to use for the internal top left toolbar.
Definition: reswindow.h:435
void work_xmax(int value)
Set the maximum X coordinate of the work area extent.
Definition: reswindow.h:954
int first_gadget_offset() const
Get offset to first gadget.
Definition: reswindow.cc:136
void toggle_size_icon(bool has_icon)
Set if window has a toggle size icon.
Definition: reswindow.h:794
Iterator for shortcuts.
Definition: reswindow.h:1143
int work_ymin() const
Get the minimum Y coordinate of the work area extent.
Definition: reswindow.h:936
void real_colours(bool real)
Set if window colours are given as gcol numbers.
Definition: reswindow.h:686
void external_tl_toolbar(const char *value)
Set the name of the object to use for the external top left toolbar.
Definition: reswindow.h:479
void title_text(const char *value)
Set the text for the title of the window.
Definition: reswindow.h:1043
void user_scroll_debounced(bool scroll)
Set if a Scroll_Request event if returned with no auto-repeat on the arrow icons and no auto-repeat o...
Definition: reswindow.h:674
void title_validation(const char *value)
Set the title validation.
Definition: reswindow.h:1061
bool auto_redraw() const
Check if window can be redrawn entirely by the WIMP.
Definition: reswindow.h:610
int max_pointer_shape() const
Get the maximum pointer shape length.
Definition: reswindow.h:306
void add_shortcut(const ResShortcut &shortcut)
Adds the shortcut to the end of the window.
Definition: reswindow.cc:451
WimpColour scroll_inner() const
Get the scroll bar inner colour.
Definition: reswindow.h:897
int work_xmax() const
Get the maximum X coordinate of the work area extent.
Definition: reswindow.h:948
bool generate_about_to_be_shown() const
Check if the about to be shown event will be generated.
Definition: reswindow.h:176
bool vscrollbar() const
Check if window has a vertical scroll bar.
Definition: reswindow.h:800
void external_tl_toolbar(const std::string &value)
Set the name of the object to use for the external top left toolbar.
Definition: reswindow.h:485
void visible_xmax(int value)
Set the maximum X coordinate of the visible part of the window.
Definition: reswindow.h:523
int visible_xmax() const
Get the maximum X coordinate of the visible part of the window.
Definition: reswindow.h:517
gadget_iterator gadget_begin()
Get iterator to first gadget.
Definition: reswindow.h:1283
void generate_has_been_hidden(bool value)
Set if an event will be generated when the window has been hidden.
Definition: reswindow.h:233
Base class for Resource component iterators.
Definition: resiteratorbase.h:14
const_gadget_iterator operator++(int)
Increment to the next gadget.
Definition: reswindow.h:1213
void erase_shortcut(int key_code)
Erase shortcut with specific key_code.
Definition: reswindow.cc:479
unsigned int button_type() const
Get the button type.
Definition: reswindow.h:985
void work_ymax(int value)
Set the maximum Y coordinate of the work area extent.
Definition: reswindow.h:966
gadget_iterator insert_gadget(gadget_iterator pos, const ResGadget &gadget)
Insert gadget at given position.
Definition: reswindow.cc:266
void work_back(WimpColour value)
Set the work area background colour.
Definition: reswindow.h:879
OsSpriteAreaPtr sprite_area() const
Get a pointer to the sprite area used for client icons on this window.
Definition: reswindow.h:999
const char * external_tl_toolbar() const
Get the name of the object to use for the external top left toolbar.
Definition: reswindow.h:473
int pointer_x_hot() const
Get the X position of the hotspot in the pointer.
Definition: reswindow.h:312
const_gadget_iterator gadget_begin() const
Get constant iterator to first gadget.
Definition: reswindow.h:1228
Constant iterator for shortcuts.
Definition: reswindow.h:1087
void work_ymin(int value)
Set the minimum Y coordinate of the work area extent.
Definition: reswindow.h:942
shortcut_iterator insert_shortcut(shortcut_iterator pos, const ResShortcut &shortcut)
Insert shortcut at given position.
Definition: reswindow.cc:494
void visible_xmin(int value)
Set the minimum X coordinate of the visible part of the window.
Definition: reswindow.h:499
const char * menu() const
Get the menu to be shown for this menu.
Definition: reswindow.h:337
void force_on_screen(bool on)
Set if window is forced on screen.
Definition: reswindow.h:722
bool ignore_lower_extent() const
Check if lower extent is ignored.
Definition: reswindow.h:740
void init_sprite_area_ref(int offset)
Initialise a sprite area reference.
Definition: resbase.cc:1746
const char * string(int offset) const
Return a string at the given offset.
Definition: resbase.cc:1555
void pointer_shape(const std::string &value, int max_length=-1)
Set the name of the sprite to use for the mouse pointer when it is over this window.
Definition: reswindow.h:301
void top_window(bool tw)
Set if window can be opened below this.
Definition: reswindow.h:698
shortcut_iterator shortcut_end()
Get iterator to end of shortcuts.
Definition: reswindow.h:1179
void init_string(int offset, const char *value)
Initialise a string in a constructor helper.
Definition: resbase.cc:1725
void init_object_ref(int offset)
Initialise an object reference.
Definition: resbase.cc:1756
void moveable(bool move)
Set if the window is moveable.
Definition: reswindow.h:602
char * gadget_start() const
Get pointer to position of first gadget in memory.
Definition: reswindow.h:1308
void work_fore(WimpColour value)
Set the work area foreground colour.
Definition: reswindow.h:867
const_shortcut_iterator operator++(int)
Increment to the next shortcut.
Definition: reswindow.h:1102
int pointer_y_hot() const
Get the Y position of the hotspot in the pointer.
Definition: reswindow.h:324
ComponentId default_focus() const
Get the component ID of the gadget to get the default focus.
Definition: reswindow.h:369
void internal_tl_toolbar(const std::string &value)
Set the name of the object to use for the internal top left toolbar.
Definition: reswindow.h:447
int work_xmin() const
Get the minimum X coordinate of the work area extent.
Definition: reswindow.h:924
bool pane() const
Check if a window is a pane.
Definition: reswindow.h:624
ResGadget gadget_at_offset(int item_offset) const
Get a copy of the gadget at the given offset.
Definition: reswindow.cc:109
void pane(bool p)
Set if a window is a pane.
Definition: reswindow.h:630
void auto_redraw(bool on)
Set if window can be redrawn entirely by the WIMP.
Definition: reswindow.h:618
ResObject & operator=(const ResObject &other)
Assignment.
Definition: resobject.cc:109
void close_icon(bool has_icon)
Set if window has a close icon.
Definition: reswindow.h:770
void internal_tl_toolbar(const char *value)
Set the name of the object to use for the internal top left toolbar.
Definition: reswindow.h:441
int first_shortcut_offset() const
Get offset of first shortcut in window.
Definition: reswindow.cc:369
WimpColour title_back() const
Get the background colour for the title bar.
Definition: reswindow.h:849
void vscrollbar(bool has_vsb)
Set if window has a vertical scroll bar.
Definition: reswindow.h:806
void next_gadget(int &item_offset) const
Get offset to next gadget in window.
Definition: reswindow.cc:156
bool user_scroll_debounced() const
Check if a Scroll_Request event if returned with no auto-repeat on the arrow icons and no auto-repeat...
Definition: reswindow.h:666
const_gadget_iterator gadget_cbegin() const
Get constant iterator to first gadget.
Definition: reswindow.h:1240
int num_shortcuts() const
Get the number of shortcut keys in this window.
Definition: reswindow.h:355
const_gadget_iterator gadget_end() const
Get constant iterator to the end of the gadgets.
Definition: reswindow.h:1234
void visible_ymin(int value)
Set the minimum Y coordinate of the visible part of the window.
Definition: reswindow.h:511
const ResWindow * _object
Reference to object being iterated.
Definition: resiteratorbase.h:16
Keyboard short cut.
Definition: resshortcut.h:44
void titlebar(bool has_tb)
Set if window has a title bar.
Definition: reswindow.h:782
Iterator for gadgets in the window resource.
Definition: reswindow.h:1253
const char * internal_bl_toolbar() const
Get the name of the object to use for the internal bottom left toolbar.
Definition: reswindow.h:417
bool force_on_screen() const
Check if window is forced on screen.
Definition: reswindow.h:716
void internal_bl_toolbar(const std::string &value)
Set the name of the object to use for the internal bottom left toolbar.
Definition: reswindow.h:429
void flags(unsigned int value)
Set all flags as a word.
Definition: reswindow.h:169
void auto_show(bool value)
Set if window is automatically shown.
Definition: reswindow.h:201
int end_shortcut_offset() const
Get offset to end of shortcuts in window.
Definition: reswindow.cc:379
void menu(const std::string &value)
Set the menu to be shown for this menu.
Definition: reswindow.h:349
void replace_shortcut(const ResShortcut &shortcut)
Replace menu shortcut with same key_code as given shortcut.
Definition: reswindow.cc:462
bool contains_shortcut(int key_code) const
Returns true if Window contains a shortcut with the given id.
Definition: reswindow.cc:440
void behind(int value)
Set the WIMP window handle this window will be opened behind.
Definition: reswindow.h:571
bool hscrollbar() const
Check if window has a horizontal scroll bar.
Definition: reswindow.h:824
int visible_ymin() const
Get the minimum Y coordinate of the visible part of the window.
Definition: reswindow.h:505
bool auto_show() const
Check if window is automatically shown.
Definition: reswindow.h:192
void generate_about_to_be_shown(bool value)
Set if the about to be shown event will be generated.
Definition: reswindow.h:182
bool auto_close() const
Check if window is automatically closed.
Definition: reswindow.h:211
void title_fore(WimpColour value)
Set the foreground/text colour for the title bar.
Definition: reswindow.h:843
void external_bl_toolbar(const char *value)
Set the name of the object to use for the external bottom left toolbar.
Definition: reswindow.h:460
ResShortcut operator*() const
Get the shortcut pointed to by this iterator.
Definition: reswindow.h:1108
shortcut_iterator operator++(int)
Increment to the next shortcut.
Definition: reswindow.h:1158
void replace_gadget(const ResGadget &gadget)
Replace menu gadget with same component id as given gadget.
Definition: reswindow.cc:233
void min_height(unsigned short value)
Set the minimum height for the window.
Definition: reswindow.h:1030
int scroll_x() const
Get the X scroll offset into the work area.
Definition: reswindow.h:541
void title_buflen(int value)
Set the length of the buffer to hold the title.
Definition: reswindow.h:1079
ResGadget operator*() const
Get the gadget pointed to by this iterator.
Definition: reswindow.h:1219
const char * message(int offset) const
Get the message string at the given offset.
Definition: resbase.cc:1602
void title_flags(unsigned int value)
Set the title flags.
Definition: reswindow.h:978
int hide_event() const
Get the event ID of the event generated when the window has been hidden.
Definition: reswindow.h:402
int visible_ymax() const
Get the maximum Y coordinate of the visible part of the window.
Definition: reswindow.h:529
void min_width(unsigned short value)
Set the minimum width for the window.
Definition: reswindow.h:1018
void erase_gadget(ComponentId component_id)
Erase gadget with specific id.
Definition: reswindow.cc:251
unsigned short min_height() const
Get the minimum height for the window.
Definition: reswindow.h:1024
void visible_ymax(int value)
Set the maximum Y coordinate of the visible part of the window.
Definition: reswindow.h:535