Marco DeFreitas
2014-03-13 02:02:36 UTC
INTRODUCTION
Currently, wxAUI floating panes are always "floating" over the parent
frame. The assumption is that these panes are transient, such as a tool
palette. However, in a complicated application, there might be panes that
contain non-transient information that the user might want shown for long
periods of time, such as a realtime plot (continuously plotting data) or a
variable display page. The fact that these panes are always on top of the
parent makes it cumbersome to manage windows, especially on small screens
such as on a laptop. It would be nice if the wxAUI system allowed for
non-transient panes, that is, panes that can be below the main frame if the
main frame is "clicked". The default, of course, should be that panes are
"transient", thus not breaking any old code.
I made some minor changes to wxWidgets-3.0.0 code to allow this to happen
and was hoping it could be reviewed and integrated into the official code
base.
IMPLEMENTATION OVERVIEW
The wxAUI system uses a wxMiniFrame, which hard-codes in the
wxFRAME_FLOAT_ON_PARENT style. I modified it so it does not hard-code it,
but allows the user to specify whether to "float" on the parent or not,
based on the passed in style. I set the default style so that it would
float by default, insuring backward compatability.
The next step was to add in a new "transient" attribute to wxAuiPaneInfo.
The user can call a wxAuiPaneInfo::Transient(bool) member function to
specify whether the pane is transient or not. The attribute default is
true, to ensure backward comaptability.
In wxAuiManager, the transparent hint window is specified with a
wxFRAME_FLOAT_ON_PARENT style. I removed this style on the hint window
since it is not needed (the hint exists only while dragging a floating
pane, and can not be obscured by anything else) and the hint window can
obscure a non-transient dragged pane if the style remained. Also, after
creating the hint window, I "raised" the dragged window if it is
non-transient, just to be sure it is above the hint window.
The constructor for wxAuiFloatingFrame hard-codes in the style
wxFRAME_FLOAT_ON_FRAME. I removed this so it can float or not based on the
attributes of the passed in wxAuiPaneInfo parameter. Again, the
wxAuiPaneInfo has the transient attribute set to true by default, so it
should still have backward compatibility.
Finally, I modified the auidemo.cpp sample program to test a non-transient
window. Under the "View" pulldown menu is an item named "Create
Non-Transient Pane".
I tested this on GTK and Windows. The following files were modified:
include/wx/aui/floatpane.h
include/wx/aui/framemanager.h
include/wx/gtk/minifram.h
include/wx/msw/minifram.h
samples/aui/auidemo.cpp
src/aui/floatpane.cpp
src/aui/framemanager.cpp
src/gtk/minifram.cpp
I uploaded the diff patches to these 8 files.
Please take a look (should this be posted to the trac website?).
Thanks!
Marco
Currently, wxAUI floating panes are always "floating" over the parent
frame. The assumption is that these panes are transient, such as a tool
palette. However, in a complicated application, there might be panes that
contain non-transient information that the user might want shown for long
periods of time, such as a realtime plot (continuously plotting data) or a
variable display page. The fact that these panes are always on top of the
parent makes it cumbersome to manage windows, especially on small screens
such as on a laptop. It would be nice if the wxAUI system allowed for
non-transient panes, that is, panes that can be below the main frame if the
main frame is "clicked". The default, of course, should be that panes are
"transient", thus not breaking any old code.
I made some minor changes to wxWidgets-3.0.0 code to allow this to happen
and was hoping it could be reviewed and integrated into the official code
base.
IMPLEMENTATION OVERVIEW
The wxAUI system uses a wxMiniFrame, which hard-codes in the
wxFRAME_FLOAT_ON_PARENT style. I modified it so it does not hard-code it,
but allows the user to specify whether to "float" on the parent or not,
based on the passed in style. I set the default style so that it would
float by default, insuring backward compatability.
The next step was to add in a new "transient" attribute to wxAuiPaneInfo.
The user can call a wxAuiPaneInfo::Transient(bool) member function to
specify whether the pane is transient or not. The attribute default is
true, to ensure backward comaptability.
In wxAuiManager, the transparent hint window is specified with a
wxFRAME_FLOAT_ON_PARENT style. I removed this style on the hint window
since it is not needed (the hint exists only while dragging a floating
pane, and can not be obscured by anything else) and the hint window can
obscure a non-transient dragged pane if the style remained. Also, after
creating the hint window, I "raised" the dragged window if it is
non-transient, just to be sure it is above the hint window.
The constructor for wxAuiFloatingFrame hard-codes in the style
wxFRAME_FLOAT_ON_FRAME. I removed this so it can float or not based on the
attributes of the passed in wxAuiPaneInfo parameter. Again, the
wxAuiPaneInfo has the transient attribute set to true by default, so it
should still have backward compatibility.
Finally, I modified the auidemo.cpp sample program to test a non-transient
window. Under the "View" pulldown menu is an item named "Create
Non-Transient Pane".
I tested this on GTK and Windows. The following files were modified:
include/wx/aui/floatpane.h
include/wx/aui/framemanager.h
include/wx/gtk/minifram.h
include/wx/msw/minifram.h
samples/aui/auidemo.cpp
src/aui/floatpane.cpp
src/aui/framemanager.cpp
src/gtk/minifram.cpp
I uploaded the diff patches to these 8 files.
Please take a look (should this be posted to the trac website?).
Thanks!
Marco
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users