home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / dreamscape / source / Dreamscape / Headers / utils / h / windowcmds < prev   
Encoding:
Text File  |  1996-09-07  |  2.7 KB  |  97 lines

  1.  
  2. // utils.h.windowcmds
  3.  
  4. // Dreamscape - C++ class library for RISC OS
  5. // Copyright (c) 1996 Mark Seaborn <mseaborn@argonet.co.uk>
  6. //
  7. // This library is free software; you can redistribute it and/or
  8. // modify it under the terms of the GNU Library General Public
  9. // License as published by the Free Software Foundation; either
  10. // version 2 of the License, or (at your option) any later version.
  11. // See the Dreamscape documentation for more information.
  12.  
  13. #ifndef dreamscape_windowcmds_H
  14. #define dreamscape_windowcmds_H
  15.  
  16. #include "basewindow.h"
  17. #include "command.h"
  18.  
  19. class ShowWindowCommand: public Command {
  20.   BaseWindow *window;
  21.   unsigned show_transient: 1;
  22.   unsigned show_position: 1;
  23.  
  24. public:
  25.   enum Position { default_position = 0, at_pointer = 1 };
  26.   enum { transient = 2 };
  27.   ShowWindowCommand(BaseWindow *window, int flags = 0);
  28.  
  29.   void execute();
  30.  
  31.   ShowWindowCommand &operator=(BaseWindow *w) { window = w; return *this; }
  32.   operator BaseWindow*() const { return window; }
  33.  
  34.   void set_window(BaseWindow *w) { window = w; }
  35.   BaseWindow *get_window() const { return window; }
  36.  
  37.   void set_transient(bool t) { show_transient = t; }
  38.   bool get_transient() const { return show_transient; }
  39.  
  40.   void set_position(Position position) { show_position = position; }
  41.   Position get_position() const { return (Position) show_position; }
  42. };
  43.  
  44. class HideWindowCommand: public Command {
  45.   BaseWindow *window;
  46.  
  47. public:
  48.   HideWindowCommand(BaseWindow *w): window(w) {}
  49.  
  50.   void execute();
  51.  
  52.   HideWindowCommand &operator=(BaseWindow *w) { window = w; return *this; }
  53.   operator BaseWindow*() const { return window; }
  54.  
  55.   void set_window(BaseWindow *w) { window = w; }
  56.   BaseWindow *get_window() const { return window; }
  57. };
  58.  
  59. class IconiseWindowCommand: public Command {
  60.   BaseWindow *window;
  61.  
  62. public:
  63.   IconiseWindowCommand(BaseWindow *w): window(w) {}
  64.  
  65.   void execute();
  66.  
  67.   IconiseWindowCommand &operator=(BaseWindow *w)
  68.     { window = w; return *this; }
  69.   operator BaseWindow*() const { return window; }
  70.  
  71.   void set_window(BaseWindow *w) { window = w; }
  72.   BaseWindow *get_window() const { return window; }
  73. };
  74.  
  75. class ShowWindowTCommand: public ShowWindowCommand {
  76. public:
  77.   ShowWindowTCommand(BaseWindow *window, int flags = 0):
  78.     ShowWindowCommand(window, flags | transient) {}
  79. };
  80.  
  81. class ShowWindowPCommand: public ShowWindowCommand {
  82. public:
  83.   ShowWindowPCommand(BaseWindow *window, int flags = 0):
  84.     ShowWindowCommand(window, flags | at_pointer) {}
  85. };
  86.  
  87. class ShowWindowTPCommand: public ShowWindowCommand {
  88. public:
  89.   ShowWindowTPCommand(BaseWindow *window, int flags = 0):
  90.     ShowWindowCommand(window, flags | transient | at_pointer) {}
  91. };
  92.  
  93. typedef ShowWindowTCommand ShowWindowTransientCommand;
  94. typedef ShowWindowPCommand ShowWindowAtPointerCommand;
  95.  
  96. #endif
  97.