tbx  0.7.6
window.h
1 /*
2  * tbx RISC OS toolbox library
3  *
4  * Copyright (C) 2010-2013 Alan Buckley All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 
25 #ifndef TBX_WINDOW_H
26 #define TBX_WINDOW_H
27 
28 #include "showfullobject.h"
29 #include "pollinfo.h"
30 #include "visiblearea.h"
31 #include "colour.h"
32 #include "showsubwindowspec.h"
33 
34 namespace tbx
35 {
36  class Gadget;
37  class Listener;
38  class AboutToBeShownListener;
39  class HasBeenHiddenListener;
40  class RedrawListener;
41  class OpenWindowListener;
42  class CloseWindowListener;
43  class PointerEnteringListener;
44  class PointerLeavingListener;
45  class MouseClickListener;
46  class KeyListener;
47  class LoseCaretListener;
48  class GainCaretListener;
49  class ScrollRequestListener;
50 
51  class WindowOpenInfo;
52  class WindowState;
53  class WindowInfo;
54  class Loader;
55  class DragHandler;
56  class Sprite;
57 
58  namespace res
59  {
60  class ResWindow;
61  class ResGadget;
62  class ResShortcut;
63  }
64 
69  class Window : public ShowFullObject
70  {
71  public:
72  enum { TOOLBOX_CLASS = 0x82880 };
73 
79  Window() {};
88  Window(const Window &other) : ShowFullObject(other._handle) {}
99  Window(const Object &other) : ShowFullObject(other) {check_toolbox_class(Window::TOOLBOX_CLASS);}
107  Window(const std::string &template_name) : ShowFullObject(template_name) {check_toolbox_class(Window::TOOLBOX_CLASS);}
114  Window(const res::ResWindow &object_template);
115 
124  Window &operator=(const Window &other) {_handle = other.handle(); return *this;}
136  Window &operator=(const Object &other) {_handle = other.handle(); check_toolbox_class(TOOLBOX_CLASS); return *this;}
144  bool operator==(const Object &other) const {return (_handle == other.handle());}
152  bool operator!=(const Object &other) const {return (_handle != other.handle());}
153 
154  void show_as_subwindow(const ShowSubWindowSpec &spec);
155 
156  Gadget gadget(ComponentId component_id);
157 
159  static Gadget from_handle(WindowHandle window_handle, IconHandle icon_handle, Window *window = 0);
160 
161  // Properties
166 
167  Gadget add_gadget(const res::ResGadget &gadget_template);
168  void remove_gadget(ComponentId component_id);
169 
170  void menu(Menu menu);
171  Menu menu() const;
172  void remove_menu();
173  //TODO: set_pointer
174  //TODO: get_pointer
175 
181  void help_message(const std::string &message) {string_property(7, message);}
187  std::string help_message() const {return string_property(8);}
188 
189  void add_shorcut(const res::ResShortcut &shortcut);
190  void add_shortcuts(const res::ResShortcut *shortcuts, int num);
191  void remove_all_shortcuts();
192  void remove_shortcuts(const res::ResShortcut *shortcuts, int num);
193 
199  std::string title() const {return string_property(12);}
205  void title(std::string new_title) {string_property(11, new_title);}
206 
207  //TODO: Gadget default_focus()
208  //TODO: default_focus(Gadget gadget)
209 
210  void set_toolbars(Window *internal_bottom_left, Window *internal_top_left, Window *external_bottom_left, Window *external_top_left);
211  void get_toolbars(Window *internal_bottom_left, Window *internal_top_left, Window *external_bottom_left, Window *external_top_left);
212 
213  void ibl_toolbar(Window window);
214  Window ibl_toolbar() const;
215  void itl_toolbar(Window window);
216  Window itl_toolbar() const;
217  void ebl_toolbar(Window window);
218  Window ebl_toolbar() const;
219  void etl_toolbar(Window window);
220  Window etl_toolbar() const;
221 
222 
223 
224  void extent(const BBox &new_extent);
225  BBox extent() const;
226 
227  // Methods
228  void force_redraw(const BBox &work_area);
229  void update(const BBox &bounds, RedrawListener *background = 0);
230  void update(const BBox &bounds, RedrawListener **redrawers, int redrawer_count);
231  void get_state(WindowState &state) const;
232  void get_state(WindowState &state, Window &parent, int &align_flags) const;
233  void get_info(WindowInfo &info) const;
234  void open_window(const WindowOpenInfo &open_info);
235  void open_subwindow(const WindowOpenInfo &open_info , Window &parent, unsigned int align_flags = 0);
236  void scroll(int x, int y);
237  void scroll(const Point &pos);
238  Point scroll() const;
239  void size(int width, int height);
240  void size(const Size &size);
241  Size size() const;
242  void top_left(int x, int y);
243  void top_left(const Point &pos);
244  Point top_left() const;
245  void bounds(const BBox &bounds);
246  BBox bounds() const;
247  BBox outline() const;
248 
249  void block_copy(const BBox &bounds, const Point &to);
250 
251  void focus();
252 
253  // Listeners - toolbox events
256 
259 
260  // Listeners - WIMP events
261  void add_redraw_listener(RedrawListener *listener);
262  void remove_redraw_listener(RedrawListener *listener);
275  void add_key_listener(KeyListener *listener);
276  void remove_key_listener(KeyListener *listener);
277  void add_all_key_listener(KeyListener *listener);
278  void remove_all_key_listener(KeyListener *listener);
285 
286  // Listeners - drag and drop between applications
287  void add_loader(Loader *loader, int file_type = -2);
288  void remove_loader(Loader *loader, int file_type = -2);
289 
290  // Drags from the application
291  void drag_point(DragHandler *handler) const;
292  void drag_point_local(DragHandler *handler) const;
293  void drag_point(const BBox &bounds, DragHandler *handler) const;
294 
295  void drag_box(const BBox &box, DragHandler *handler) const;
296  void drag_box_local(const BBox &box, DragHandler *handler) const;
297  void drag_box(const BBox &box, const BBox &bounds, DragHandler *handler) const;
298 
299  void drag_rubber_box(const Point &start, DragHandler *handler) const;
300  void drag_rubber_box_local(const Point &start, DragHandler *handler) const;
301  void drag_rubber_box(const Point &start, const BBox &bounds, DragHandler *handler) const;
302  void cancel_drag() const;
303 
307  enum DragSpriteFlags {DSFLAG_NONE = 0, //- No flags set sprite is in bottom left of box
308  DSFLAG_HCENTRE, //- Sprite is horizontally centred in box
309  DSFLAG_RIGHT, //- Sprite is on the right of the box
310  DSFLAG_VCENTRE = 4, //- Sprite is vertically centred in box
311  DSFLAG_TOP = 8, //- Sprite it at top of box
312  DSFLAG_BOUND_POINT = 64, //- Point is set to bounds, otherwise box
313  DSFLAG_DROP_SHADOW = 128, //- Sprite has drop shadow
314  DSFLAG_SOLID = 256 //- Do no dither the sprite
315  };
316 
317  void drag_sprite(const Sprite &sprite, const BBox &box, DragHandler *handler, int flags = 0) const;
318  void drag_sprite_local(const Sprite &sprite, const BBox &box, DragHandler *handler, int flags = 0) const;
319  void drag_sprite(const Sprite &sprite, const BBox &box, const BBox &bounds, DragHandler *handler, int flags = 0) const;
320  };
321 
328  {
329  protected:
333  friend class Window;
334 
335  public:
340 
344  const VisibleArea &visible_area() const {return _visible_area;}
345 
350 
355  };
356 
361  {
362  private:
363  unsigned int _flags;
364 
365  friend class Window;
366 
367  public:
368 
375  unsigned int flags() const {return _flags;}
376 
380  bool open() const {return (_flags & (1<<16));}
381 
387  bool fully_visible() const {return (_flags & (1<<17));}
388 
392  bool full_size() const {return (_flags & (1<<17));}
393 
397  bool toggle_size() const {return (_flags & (1<<19));}
398 
402  bool input_focus() const {return (_flags & (1<<20));}
403 
407  bool force_to_screen() const {return (_flags & (1<<21));}
408  };
409 
414  {
415  BUTTONTYPE_IGNORE_CLICKS,
416  BUTTONTYPE_ALWAYS,
417  BUTTONTYPE_CLICK_AUTO,
418  BUTTONTYPE_CLICK_ONCE,
419  BUTTONTYPE_RELEASE,
420  BUTTONTYPE_DOUBLE,
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
431  };
432 
436  class WindowInfo : public WindowOpenInfo
437  {
438  private:
439  unsigned int _flags;
440  char _title_foreground;
441  char _title_background;
442  char _work_area_foreground;
443  char _work_area_background;
444  char _scroll_outer;
445  char _scroll_inner;
446  char _title_highlight;
447  char _reserved; /* Unused - must be 0 */
448  BBox _work_area;
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;
455 
456  friend class Window;
457 
458  public:
465  unsigned int flags() const {return _flags;}
466 
472  unsigned int work_area_flags() const {return _work_area_flags;}
473 
477  ButtonType button_type() const {return ButtonType((_work_area_flags>>12) & 15);}
478 
482  const BBox &work_area() const {return _work_area;}
483 
490  WimpColour title_foreground() const {return WimpColour(_title_foreground);}
496  WimpColour title_background() const {return WimpColour(_title_background);}
497 
503  WimpColour work_area_foreground() const {return WimpColour(_work_area_foreground);}
510  WimpColour work_area_background() const {return WimpColour(_work_area_background);}
516  WimpColour scroll_outer() const {return WimpColour(_scroll_outer);}
522  WimpColour scroll_inner() const {return WimpColour(_scroll_inner);}
528  WimpColour title_highlight() const {return WimpColour(_title_highlight);}
529 
538  int min_width() const {return (_min_width_and_height & 0xFFFF);}
544  int min_height() const {return (_min_width_and_height >> 16);}
545 
546  };
547 }
548 
549 #endif
tbx::Object::int_property
int int_property(int property_id) const
Return the value of a property that returns an integer.
Definition: object.cc:477
tbx::Window::operator=
Window & operator=(const Object &other)
Assign this Window from an Object that refers to a SaveAs.
Definition: window.h:136
tbx::Window::title
std::string title() const
Get the title (caption) of the window.
Definition: window.h:199
tbx::Window::drag_sprite
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
tbx::Window::remove_loader
void remove_loader(Loader *loader, int file_type=-2)
Remove a file loader.
Definition: window.cc:1174
tbx::Window::etl_toolbar
Window etl_toolbar() const
Get external top left toolbar.
Definition: window.cc:391
tbx::MouseClickListener
Listener for mouse clicks on a Window.
Definition: mouseclicklistener.h:130
tbx::WindowState::flags
unsigned int flags() const
Window flags.
Definition: window.h:375
tbx
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
tbx::Window::cancel_drag
void cancel_drag() const
Cancel current drag operation.
Definition: window.cc:1425
tbx::GainCaretListener
Listener for gain caret Wimp event.
Definition: caretlistener.h:145
tbx::ComponentId
int ComponentId
Type for underlying toolbox component id.
Definition: handles.h:33
tbx::Window::remove_redraw_listener
void remove_redraw_listener(RedrawListener *listener)
Remove a listener for redraw events.
Definition: window.cc:936
tbx::Window::add_redraw_listener
void add_redraw_listener(RedrawListener *listener)
Add a listener to be called when the window needs redrawing.
Definition: window.cc:928
tbx::ScrollRequestListener
Scroll request listener.
Definition: scrollrequestlistener.h:104
tbx::Window::operator=
Window & operator=(const Window &other)
Assign this Window from another.
Definition: window.h:124
tbx::WimpColour
Class to represent a standard desktop WIMP colour.
Definition: colour.h:147
tbx::Object::handle
ObjectId handle() const
Return the underlying toolbox object id this object references.
Definition: object.h:93
tbx::Window::drag_point
void drag_point(DragHandler *handler) const
Start drag operation of the mouse pointer.
Definition: window.cc:1190
tbx::Window::scroll
Point scroll() const
Returns the current scroll coordinates in the window.
Definition: window.cc:700
tbx::Window::add_shortcuts
void add_shortcuts(const res::ResShortcut *shortcuts, int num)
Add multiple keyboard shortcuts from an array.
Definition: window.cc:190
tbx::Window::add_about_to_be_shown_listener
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
tbx::Window::window_handle
WindowHandle window_handle() const
Return the underlying WIMP windows handle of the window.
Definition: window.h:165
tbx::Window::add_scroll_request_listener
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
tbx::Window::ibl_toolbar
Window ibl_toolbar() const
Get internal bottom left toolbar.
Definition: window.cc:306
tbx::Object::_handle
ObjectId _handle
Handle for toolbox object.
Definition: object.h:175
tbx::WindowInfo::title_highlight
WimpColour title_highlight() const
Title background highlight colour.
Definition: window.h:528
tbx::Window::remove_all_shortcuts
void remove_all_shortcuts()
Remove all window shortcuts.
Definition: window.cc:213
tbx::Object::string_property
std::string string_property(int property_id) const
Return the value of a property that returns text.
Definition: object.cc:519
tbx::Window
The Window object represents a toolbox window.
Definition: window.h:70
tbx::Window::add_lose_caret_listener
void add_lose_caret_listener(LoseCaretListener *listener)
Add a listener for when the window loses the caret.
Definition: window.cc:1105
tbx::WindowInfo::work_area
const BBox & work_area() const
Work area.
Definition: window.h:482
tbx::Window::show_as_subwindow
void show_as_subwindow(const ShowSubWindowSpec &spec)
Show this window as a sub window (nested child) of an existing window.
Definition: window.cc:62
tbx::res::ResGadget
Base class for gadget memory resources.
Definition: resgadget.h:43
tbx::WindowOpenInfo::_visible_area
VisibleArea _visible_area
Position on screen and scroll settings.
Definition: window.h:331
tbx::Window::add_pointer_entering_listener
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
tbx::Window::remove_pointer_entering_listener
void remove_pointer_entering_listener(PointerEnteringListener *listener)
Remove a listener for pointer entering events.
Definition: window.cc:1016
tbx::Window::outline
BBox outline() const
Get the bounding box that completely covers the window on the screen.
Definition: window.cc:839
tbx::CloseWindowListener
Listener for the close window request message.
Definition: closewindowlistener.h:46
tbx::WindowOpenInfo::visible_area
VisibleArea & visible_area()
Visible area of this window.
Definition: window.h:349
tbx::Window::DragSpriteFlags
DragSpriteFlags
Flags for drag_sprite.
Definition: window.h:307
tbx::WindowInfo::title_foreground
WimpColour title_foreground() const
Title foreground and frame colour.
Definition: window.h:490
tbx::Loader
Class to handle file/data loading from the filer or an external application.
Definition: loader.h:179
tbx::Window::remove_close_window_listener
void remove_close_window_listener(CloseWindowListener *listener)
Remove a listener for close window events.
Definition: window.cc:983
tbx::Window::Window
Window(const Window &other)
Construct a Window from another Window.
Definition: window.h:88
tbx::WindowInfo::title_background
WimpColour title_background() const
Title background colour.
Definition: window.h:496
tbx::VisibleArea
Class to store information for the Visible area of a window and provide work area to screen conversio...
Definition: visiblearea.h:37
tbx::HasBeenHiddenListener
Listener for an object has been hidden event.
Definition: hasbeenhiddenlistener.h:36
tbx::Window::menu
Menu menu() const
Get the current menu used by this object.
Definition: window.cc:155
tbx::Window::remove_lose_caret_listener
void remove_lose_caret_listener(LoseCaretListener *listener)
Remove a listener for when the window loses the caret.
Definition: window.cc:1113
tbx::Window::operator==
bool operator==(const Object &other) const
Check if this Window refers to the same underlying toolbox object as another.
Definition: window.h:144
tbx::Sprite
Common base class for the UserSprite and WimpSprite classes.
Definition: sprite.h:301
tbx::Menu
Class representing a toolbox menu.
Definition: menu.h:49
tbx::Window::remove_menu
void remove_menu()
Removes the menu from the window.
Definition: window.cc:138
tbx::WindowInfo::min_width
int min_width() const
Minimum width of the window.
Definition: window.h:538
tbx::WindowInfo::scroll_outer
WimpColour scroll_outer() const
Scroll bar outer colour.
Definition: window.h:516
tbx::Window::help_message
std::string help_message() const
Get the help message for the window.
Definition: window.h:187
tbx::Window::drag_rubber_box
void drag_rubber_box(const Point &start, DragHandler *handler) const
Start dragging of rubber rotating dashes box.
Definition: window.cc:1348
tbx::WindowOpenInfo::window_handle_in_front
WindowHandle window_handle_in_front() const
WIMP handle of window on top of this window or -1 for none.
Definition: window.h:354
tbx::WindowState::input_focus
bool input_focus() const
window has the input focus
Definition: window.h:402
tbx::WindowInfo
Window Information structure for the Window get_info method.
Definition: window.h:437
tbx::WindowOpenInfo::_window_handle_in_front
WindowHandle _window_handle_in_front
Handle of window in front of this one.
Definition: window.h:332
tbx::Window::open_window
void open_window(const WindowOpenInfo &open_info)
Open window in a new location.
Definition: window.cc:635
tbx::WindowInfo::work_area_flags
unsigned int work_area_flags() const
Work area flags.
Definition: window.h:472
tbx::Window::remove_open_window_listener
void remove_open_window_listener(OpenWindowListener *listener)
Remove a listener for window opened events.
Definition: window.cc:963
tbx::res::ResWindow
Window resource object.
Definition: reswindow.h:49
tbx::WindowState::full_size
bool full_size() const
window has been toggled to full size
Definition: window.h:392
tbx::WindowState::fully_visible
bool fully_visible() const
Window is fully visible.
Definition: window.h:387
tbx::BBox
Class to represent a two dimensional bounding box.
Definition: bbox.h:38
tbx::Window::gadget
Gadget gadget(ComponentId component_id)
Get the gadget with the given component id.
Definition: window.cc:515
tbx::WindowHandle
int WindowHandle
Type for WIMP windows handle.
Definition: handles.h:35
tbx::Window::size
Size size() const
Returns the size of the window.
Definition: window.cc:743
tbx::Window::extent
BBox extent() const
Get the current work area extent for the window.
Definition: window.cc:415
tbx::Object::check_toolbox_class
void check_toolbox_class(int class_id) const
Check if this objects toolbox class is as specified.
Definition: object.cc:122
tbx::Window::bounds
BBox bounds() const
Get position and size of the visible area of window on the desktop.
Definition: window.cc:822
tbx::message
std::string message(const std::string &token)
Shortcut to the tbx::app()->messages().message(...)
Definition: message.cc:41
tbx::Window::help_message
void help_message(const std::string &message)
Set the help message for the Window.
Definition: window.h:181
tbx::Window::remove_gain_caret_listener
void remove_gain_caret_listener(GainCaretListener *listener)
Remove a listener for when the window gains the caret.
Definition: window.cc:1129
tbx::OpenWindowListener
Listener for Wimp Open Window Request events.
Definition: openwindowlistener.h:98
tbx::Window::remove_about_to_be_shown_listener
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
tbx::WindowInfo::flags
unsigned int flags() const
Window flags.
Definition: window.h:465
tbx::Window::remove_scroll_request_listener
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
tbx::Window::remove_has_been_hidden_listener
void remove_has_been_hidden_listener(HasBeenHiddenListener *listener)
Remove a listener for when a window has been hidden.
Definition: window.cc:915
tbx::Size
Class to represent a two-dimensional size.
Definition: size.h:35
tbx::AboutToBeShownListener
Listener for about to be shown event.
Definition: abouttobeshownlistener.h:77
tbx::Window::add_gadget
Gadget add_gadget(const res::ResGadget &gadget_template)
Add a gadget to the window.
Definition: window.cc:84
tbx::Window::add_key_listener
void add_key_listener(KeyListener *listener)
Add a listener for key pressed events on this window.
Definition: window.cc:1068
tbx::Window::get_info
void get_info(WindowInfo &info) const
Get complete information about the windows state.
Definition: window.cc:618
tbx::Window::remove_gadget
void remove_gadget(ComponentId component_id)
Remove a gadget from the window.
Definition: window.cc:104
tbx::Window::get_state
void get_state(WindowState &state) const
Gets a summary of the current state of the window.
Definition: window.cc:574
tbx::Window::itl_toolbar
Window itl_toolbar() const
Get internal top left toolbar.
Definition: window.cc:335
tbx::Window::title
void title(std::string new_title)
Set the title (caption) of the window.
Definition: window.h:205
tbx::Window::force_redraw
void force_redraw(const BBox &work_area)
Force the area to be redrawn.
Definition: window.cc:429
tbx::Window::add_mouse_click_listener
void add_mouse_click_listener(MouseClickListener *listener)
Add a listener for mouse click events.
Definition: window.cc:1028
tbx::Window::from_handle
static Window from_handle(WindowHandle window_handle)
Get the window from the wimp window handle.
Definition: window.cc:527
tbx::Window::add_open_window_listener
void add_open_window_listener(OpenWindowListener *listener)
Add a listener to be called when the window is opened.
Definition: window.cc:955
tbx::DragHandler
Class to report status of a drag started on a window.
Definition: draghandler.h:36
tbx::Window::Window
Window()
Construct creates an unassigned Window.
Definition: window.h:79
tbx::Window::add_pointer_leaving_listener
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
tbx::ButtonType
ButtonType
Enumeration of the button types for the work area.
Definition: window.h:414
tbx::Window::drag_sprite_local
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
tbx::Window::remove_all_key_listener
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
tbx::PointerLeavingListener
Listener for the pointer leaving the window.
Definition: pointerlistener.h:45
tbx::Window::remove_mouse_click_listener
void remove_mouse_click_listener(MouseClickListener *listener)
Remove a listener for mouse click events.
Definition: window.cc:1036
tbx::Window::add_close_window_listener
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
tbx::Object
Class to manipulate a toolbox object.
Definition: object.h:51
tbx::RedrawListener
Redraw event listener.
Definition: redrawlistener.h:76
tbx::WindowState::force_to_screen
bool force_to_screen() const
force window to screen once on the next Open_Window
Definition: window.h:407
tbx::Point
Class to represent a position in two dimensional space.
Definition: point.h:37
tbx::Window::open_subwindow
void open_subwindow(const WindowOpenInfo &open_info, Window &parent, unsigned int align_flags=0)
Open a window as a subwindow.
Definition: window.cc:653
tbx::WindowOpenInfo
Class with details of window location on screen.
Definition: window.h:328
tbx::Window::add_shorcut
void add_shorcut(const res::ResShortcut &shortcut)
Add a keyboard shortcut.
Definition: window.cc:172
tbx::Window::drag_point_local
void drag_point_local(DragHandler *handler) const
Drag mouse pointer constrained to this window.
Definition: window.cc:1216
tbx::Window::get_toolbars
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
tbx::WindowState
Window state structure for the Window get_state method.
Definition: window.h:361
tbx::Window::set_toolbars
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
tbx::WindowState::toggle_size
bool toggle_size() const
the current Open_Window_Request was caused by a click on the Toggle Size icon
Definition: window.h:397
tbx::WindowOpenInfo::_window_handle
WindowHandle _window_handle
WIMP window handle.
Definition: window.h:330
tbx::ShowFullObject
Objects derived from this class can be shown with there full location and size specified as well as t...
Definition: showfullobject.h:41
tbx::PointerEnteringListener
Listener for the pointer entering the window.
Definition: pointerlistener.h:63
tbx::Window::remove_shortcuts
void remove_shortcuts(const res::ResShortcut *shortcuts, int num)
Remove given window shortcuts.
Definition: window.cc:227
tbx::Window::block_copy
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
tbx::Window::add_gain_caret_listener
void add_gain_caret_listener(GainCaretListener *listener)
Add a listener for when the window gains the caret.
Definition: window.cc:1121
tbx::Window::operator!=
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
tbx::WindowInfo::work_area_foreground
WimpColour work_area_foreground() const
Work area foreground colour.
Definition: window.h:503
tbx::Window::drag_box_local
void drag_box_local(const BBox &box, DragHandler *handler) const
Drag fixed rotating dots box constrained to this window.
Definition: window.cc:1295
tbx::KeyListener
Listener for KeyPressed WIMP event.
Definition: keylistener.h:179
tbx::Gadget
This is the base class for all Gadgets.
Definition: gadget.h:49
tbx::WindowState::open
bool open() const
Window is open.
Definition: window.h:380
tbx::LoseCaretListener
Listener for LoseCaret Wimp event.
Definition: caretlistener.h:127
tbx::Window::add_all_mouse_click_listener
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
tbx::Window::focus
void focus()
Sets the focus to an invisible caret a postion 0,0 in the window.
Definition: window.cc:877
tbx::WindowOpenInfo::visible_area
const VisibleArea & visible_area() const
Visible area of this window.
Definition: window.h:344
tbx::Window::drag_rubber_box_local
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
tbx::Window::remove_pointer_leaving_listener
void remove_pointer_leaving_listener(PointerLeavingListener *listener)
Remove a listener for pointer leaving events.
Definition: window.cc:1000
tbx::Window::Window
Window(const Object &other)
Construct a Window from an Object that refers to a Window.
Definition: window.h:99
tbx::IconHandle
int IconHandle
Type for WIMP icon handle.
Definition: handles.h:37
tbx::Window::ebl_toolbar
Window ebl_toolbar() const
Get external bottom left toolbar.
Definition: window.cc:363
tbx::Window::remove_key_listener
void remove_key_listener(KeyListener *listener)
Remove a listener for key pressed events on this window .
Definition: window.cc:1076
tbx::Window::add_has_been_hidden_listener
void add_has_been_hidden_listener(HasBeenHiddenListener *listener)
Add A listener for when the window has been hidden.
Definition: window.cc:907
tbx::ShowSubWindowSpec
Structure used to show a window as a subwindow.
Definition: showsubwindowspec.h:59
tbx::Window::add_loader
void add_loader(Loader *loader, int file_type=-2)
Add a file loader.
Definition: window.cc:1160
tbx::res::ResShortcut
Keyboard short cut.
Definition: resshortcut.h:44
tbx::WindowOpenInfo::window_handle
WindowHandle window_handle() const
WIMP window handle of this window.
Definition: window.h:339
tbx::Window::add_all_key_listener
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
tbx::WindowInfo::min_height
int min_height() const
Minimum height of the window.
Definition: window.h:544
tbx::Window::Window
Window(const std::string &template_name)
Create a Window from the named template.
Definition: window.h:107
tbx::Window::top_left
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
tbx::WindowInfo::scroll_inner
WimpColour scroll_inner() const
Scroll bar inner colour.
Definition: window.h:522
tbx::Window::drag_box
void drag_box(const BBox &box, DragHandler *handler) const
Drag fixed rotating dots box.
Definition: window.cc:1268
tbx::Window::remove_all_mouse_click_listener
void remove_all_mouse_click_listener(MouseClickListener *listener)
Remove listener for key press on window or any of its components.
Definition: window.cc:1059
tbx::Window::update
void update(const BBox &bounds, RedrawListener *background=0)
Update the window immediately using any registered redrawers.
Definition: window.cc:444
tbx::WindowInfo::work_area_background
WimpColour work_area_background() const
Work area background colour.
Definition: window.h:510
tbx::WindowInfo::button_type
ButtonType button_type() const
Button type.
Definition: window.h:477