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