home *** CD-ROM | disk | FTP | other *** search
-
- // utils.h.mptwindow
-
- // Dreamscape - C++ class library for RISC OS
- // Copyright (c) 1996 Mark Seaborn <mseaborn@argonet.co.uk>
- //
- // This library is free software; you can redistribute it and/or
- // modify it under the terms of the GNU Library General Public
- // License as published by the Free Software Foundation; either
- // version 2 of the License, or (at your option) any later version.
- // See the Dreamscape documentation for more information.
-
- #ifndef dreamscape_mptwindow_H
- #define dreamscape_mptwindow_H
-
- #include "window.h"
- #include "winhandlers.h"
-
- class MultiPartWindow: public BaseWindow, private WindowShower,
- private WindowHider {
- class Pane: public WindowShower, public WindowHider {
- public:
- MultiPartWindow *parent;
- Window *window;
- unsigned max_size: 1;
-
- void show_window(const Position &position);
- void hide_window();
- };
- friend Pane;
- Window *window;
- List<Pane *> panes;
- WinBBox visible, old_extent;
- WinCoords scroll;
- int gap;
- unsigned owns_window: 1;
- unsigned orientation: 1;
- unsigned threaded: 1;
- unsigned pane_threaded: 1;
- unsigned resize_panes: 1;
-
- void init();
- void final();
- void show_panes(const Position &position, int &extra, int extra_each,
- Position::StackPos &stack, int &point);
-
- void show_window(const Position &position);
- void hide_window();
-
- public:
- enum InitFlags { horizontal, vertical };
- MultiPartWindow(BaseWindow *window, InitFlags flags = horizontal,
- int gap = 12);
- MultiPartWindow(const char *name, InitFlags flags = horizontal,
- int gap = 12);
- virtual ~MultiPartWindow();
-
- enum SimplePosition { first, last };
- enum ComplexPosition { before, after };
- enum PaneFlags { max_size = 1 };
- void add_window(BaseWindow *window, SimplePosition position = last,
- PaneFlags flags = max_size);
- void add_window(BaseWindow *window, ComplexPosition position,
- const BaseWindow *other_window, PaneFlags flags = max_size);
- void remove_window(BaseWindow *window);
-
- BaseWindow &get_next_window();
- const BaseWindow &get_next_window() const;
- bool has_next_window() const;
- };
-
- #endif
-