home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / dreamscape / source / Dreamscape / Headers / utils / h / mptwindow < prev    next >
Encoding:
Text File  |  1996-08-25  |  2.0 KB  |  73 lines

  1.  
  2. // utils.h.mptwindow
  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_mptwindow_H
  14. #define dreamscape_mptwindow_H
  15.  
  16. #include "window.h"
  17. #include "winhandlers.h"
  18.  
  19. class MultiPartWindow: public BaseWindow, private WindowShower,
  20. private WindowHider {
  21.   class Pane: public WindowShower, public WindowHider {
  22.   public:
  23.     MultiPartWindow *parent;
  24.     Window *window;
  25.     unsigned max_size: 1;
  26.  
  27.     void show_window(const Position &position);
  28.     void hide_window();
  29.   };
  30.   friend Pane;
  31.   Window *window;
  32.   List<Pane *> panes;
  33.   WinBBox visible, old_extent;
  34.   WinCoords scroll;
  35.   int gap;
  36.   unsigned owns_window: 1;
  37.   unsigned orientation: 1;
  38.   unsigned threaded: 1;
  39.   unsigned pane_threaded: 1;
  40.   unsigned resize_panes: 1;
  41.  
  42.   void init();
  43.   void final();
  44.   void show_panes(const Position &position, int &extra, int extra_each,
  45.     Position::StackPos &stack, int &point);
  46.  
  47.   void show_window(const Position &position);
  48.   void hide_window();
  49.  
  50. public:
  51.   enum InitFlags { horizontal, vertical };
  52.   MultiPartWindow(BaseWindow *window, InitFlags flags = horizontal,
  53.     int gap = 12);
  54.   MultiPartWindow(const char *name, InitFlags flags = horizontal,
  55.     int gap = 12);
  56.   virtual ~MultiPartWindow();
  57.  
  58.   enum SimplePosition { first, last };
  59.   enum ComplexPosition { before, after };
  60.   enum PaneFlags { max_size = 1 };
  61.   void add_window(BaseWindow *window, SimplePosition position = last,
  62.         PaneFlags flags = max_size);
  63.   void add_window(BaseWindow *window, ComplexPosition position,
  64.         const BaseWindow *other_window, PaneFlags flags = max_size);
  65.   void remove_window(BaseWindow *window);
  66.  
  67.   BaseWindow &get_next_window();
  68.   const BaseWindow &get_next_window() const;
  69.   bool has_next_window() const;
  70. };
  71.  
  72. #endif
  73.