diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2009-08-03 06:26:32 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2009-08-03 06:26:32 +0000 |
| commit | 5e21c7ce233da01593263b03ff237bccc1b3eda1 (patch) | |
| tree | c7507931fc44a83f8b9ae6a0bbc9fdd9a4e47624 /FL | |
| parent | 7e8ba419c6283797fd19f15de90fb0064b2c5cf5 (diff) | |
Added new Fl_Window:: flags() and methods:
- set_menu_window() to mark a window as a menu window
- set_tooltip_window() to mark a window as a tooltip window
and the corresponding get methods:
- menu_window()
- tooltip_window().
This is a first step for providing more information for correct parenting
and properties to support modern (X) window managers (STR #2230).
Please see also the information in fltk.development:
http://www.fltk.org/newsgroups.php?gfltk.development+v:8003
ToDo: Another point is to be able to handle menu windows and popup windows
that are opened while a menu is active properly (will follow later).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6841 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_Window.H | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/FL/Fl_Window.H b/FL/Fl_Window.H index bb4858c66..0f7fd9610 100644 --- a/FL/Fl_Window.H +++ b/FL/Fl_Window.H @@ -75,7 +75,9 @@ class FL_EXPORT Fl_Window : public Fl_Group { FL_NOBORDER = 8, FL_FORCE_POSITION = 16, FL_NON_MODAL = 32, - FL_OVERRIDE = 256 + FL_OVERRIDE = 256, + FL_MENU_WINDOW = 4096, + FL_TOOLTIP_WINDOW = 8192 }; void _Fl_Window(); // constructor innards @@ -177,7 +179,7 @@ public: being delivered to other windows in the same program, and will also remain on top of the other windows (if the X window manager supports the "transient for" property). Several modal windows may be shown at - once, in which case only the last one shown gets events. You can See + once, in which case only the last one shown gets events. You can see which window (if any) is modal by calling Fl::modal(). */ @@ -195,6 +197,45 @@ public: int non_modal() const {return flags() & (FL_NON_MODAL|FL_MODAL);} /** + Marks the window as a menu window. + + This is intended for internal use, but it can also be used if you + write your own menu handling. However, this is not recommended. + + This flag is used for correct "parenting" of windows in communication + with the windowing system. Modern X window managers can use different + flags to distinguish menu and tooltip windows from normal windows. + + This must be called before the window is shown and cannot be changed + later. + */ + void set_menu_window() {set_flag(FL_MENU_WINDOW);} + + /** Returns true if this window is a menu window. */ + int menu_window() const {return flags() & FL_MENU_WINDOW;} + + /** + Marks the window as a tooltip window. + + This is intended for internal use, but it can also be used if you + write your own tooltip handling. However, this is not recommended. + + This flag is used for correct "parenting" of windows in communication + with the windowing system. Modern X window managers can use different + flags to distinguish menu and tooltip windows from normal windows. + + This must be called before the window is shown and cannot be changed + later. + + \note Since Fl_Tooltip_Window is derived from Fl_Menu_Window, this + also \b clears the menu_window() state. + */ + void set_tooltip_window() { set_flag(FL_TOOLTIP_WINDOW); + clear_flag(FL_MENU_WINDOW); } + /** Returns true if this window is a tooltip window. */ + int tooltip_window() const {return flags() & FL_TOOLTIP_WINDOW;} + + /** Position the window so that the mouse is pointing at the given position, or at the center of the given widget, which may be the window itself. If the optional offscreen parameter is |
