Discussion:
Question on wxMiniFrame
Marco DeFreitas
2014-02-13 22:19:49 UTC
Permalink
Is there a way to create a wxMiniFrame that is not always on top of its
parent? The wxWindow::Raise and wxWindow::Lower functions do not seem to
work.

There is a wxFRAME_FLOAT_ON_PARENT style for wxFrame, but even if it is not
specified, it always stays on top.

This can be seen in the dialogs sample program when creating a miniframe...
it always stays on top, even though the source code did not specify the
wxFRAME_FLOAT_ON_PARENT style.

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
Vadim Zeitlin
2014-02-13 22:31:04 UTC
Permalink
On Thu, 13 Feb 2014 14:19:49 -0800 (PST) Marco DeFreitas wrote:

MD> Is there a way to create a wxMiniFrame that is not always on top of its
MD> parent?

No, this frame is supposed to be for floating palettes and such and so is
indeed always on top of its parent in Z-order.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Marco DeFreitas
2014-02-13 22:39:38 UTC
Permalink
Thanks.

The reason I ask is that wxAUI uses miniframes for its floating panels. In
a typical wxAUI app, I would think that panels could be all sorts of
things, not just palettes (like in the auidemo program). With floating
panels and limited screen space (like a laptop), it would be nice to
"Raise" the parent.

I guess my question is, can I do this in wxAUI? Can I perhaps force wxAUI
to not use miniframes, but just regular frames?

--Marco
Post by Marco DeFreitas
Is there a way to create a wxMiniFrame that is not always on top of its
parent? The wxWindow::Raise and wxWindow::Lower functions do not seem to
work.
There is a wxFRAME_FLOAT_ON_PARENT style for wxFrame, but even if it is
not specified, it always stays on top.
This can be seen in the dialogs sample program when creating a
miniframe... it always stays on top, even though the source code did not
specify the wxFRAME_FLOAT_ON_PARENT style.
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
Vadim Zeitlin
2014-02-13 23:17:18 UTC
Permalink
On Thu, 13 Feb 2014 14:39:38 -0800 (PST) Marco DeFreitas wrote:

MD> I guess my question is, can I do this in wxAUI? Can I perhaps force wxAUI
MD> to not use miniframes, but just regular frames?

I don't think so but I don't know wxAUI that well.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Marco DeFreitas
2014-02-15 21:09:42 UTC
Permalink
Looking at the source code for aui/floatpane.h, it looks like using regular
frames instead of miniframes are supported in AUI. The following
conditional statement provides this:

#if wxUSE_MINIFRAME
#include "wx/minifram.h"
#define wxAuiFloatingFrameBaseClass wxMiniFrame
#else
#include "wx/frame.h"
#define wxAuiFloatingFrameBaseClass wxFrame
#endif

This is quite nice since it removes some of the issues with miniframes
(cannot partially move a miniframe off the screen).

So, I went into setup.h and changed the #define for wxUSE_MINIFRAME to "0".
I rebuilt and it seemed to work. The only problem is that once a panel is
undocked, it cannot be redocked. If I undock and try to redock in a single
motion (keeping the mouse button pressed as I undock and redock) it works.

This looks identical to a similar problem we previously saw with miniframes
that was fixed under ticket trac ticket #15904.

Is there a similar fix that needs to be made to wxFrame?

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
Vadim Zeitlin
2014-02-16 00:04:34 UTC
Permalink
On Sat, 15 Feb 2014 13:09:42 -0800 (PST) Marco DeFreitas wrote:

MD> Looking at the source code for aui/floatpane.h, it looks like using regular
MD> frames instead of miniframes are supported in AUI. The following
MD> conditional statement provides this:
MD>
MD> #if wxUSE_MINIFRAME
MD> #include "wx/minifram.h"
MD> #define wxAuiFloatingFrameBaseClass wxMiniFrame
MD> #else
MD> #include "wx/frame.h"
MD> #define wxAuiFloatingFrameBaseClass wxFrame
MD> #endif
MD>
MD> This is quite nice since it removes some of the issues with miniframes
MD> (cannot partially move a miniframe off the screen).
MD>
MD> So, I went into setup.h and changed the #define for wxUSE_MINIFRAME to "0".

If we really want to support using normal frames for the floating windows,
we should make it a run-time option, it's not always feasible to recompile
the library.

MD> This looks identical to a similar problem we previously saw with miniframes
MD> that was fixed under ticket trac ticket #15904.
MD>
MD> Is there a similar fix that needs to be made to wxFrame?

I don't know, you could try checking if wxEVT_MOVE are generated for
wxFrames, as this was the problem there. Personally I'm not very interested
in fixing this bug as long as we officially only support using wxMiniFrame
for the floating windows anyhow...

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Marco DeFreitas
2014-02-17 19:30:45 UTC
Permalink
VZ> I don't know, you could try checking if wxEVT_MOVE are
VZ> generated for wxFrames, as this was the problem there.
VZ> Personally I'm not very interested in fixing this bug as long
VZ> as we officially only support using wxMiniFrame for the
VZ> floating windows anyhow...

Understood. As using regular wxFrames has a lot of advantages to our users,
I'll take a stab at debugging this. I'll let you know what I find out.

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
Marco DeFreitas
2014-02-18 15:35:12 UTC
Permalink
Well, it looks like I was not getting a steady stream of move events, but
just a single one when the moving stopped.

I noticed that src/aui/floatpane.h had the following in
wxAuiFloatingFrame::OnMoveEvent:

if (!m_solidDrag)
{
// systems without solid window dragging need to be
// handled slightly differently, due to the lack of
// the constant stream of EVT_MOVING events
if (!isMouseDown())
return;
OnMoveStart();
OnMoving(event.GetRect(), wxNORTH);
m_moving = true;
return;
}

So, it seemed that if I was not getting a steady stream of move events, it
is perhaps similar to systems without solid window dragging. I commented
out the "if" line so the code would unconditionally execute.

This solved my problem... on my machine. But when I went to other machines
it didn't work. Then it worked differently on other machines. And it didn't
work when I was remotely logged in via Cygwin (on Cygwin, the isMouseDown
returns false, so I just exit).

It appears that a lot of inconsistent behavior happens based on which
Window Manager is used and perhaps the settings therein. Pretty frustrating.

Perhaps it is better to stick with wxMiniFrame (which gives consistent move
events) and try to get the behavior I want from it (being able to partially
move the window off the screen).
--
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
Marco DeFreitas
2014-02-21 15:53:28 UTC
Permalink
FYI...
Looks like moving a miniframe "partially" off the screen is a function of
the window manager and/or its settings. Using SUSE Linux, when I log in
with the Gnome desktop I cannot do it, but logging in under MWM, I can. I
guess I have to find out how to do this with the default Gnome desktop.

Anyway, not really a wxWidgets issue per se , as far as i can see...
--
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
Loading...