[wx-dev] wxAUI Hint Window Issues and wxMac Status

Alex Bligh alex at alex.org.uk
Mon Aug 14 11:50:38 PDT 2006


Bryan,

> http://sourceforge.net/tracker/index.php?func=detail&aid=1538989&group_id=9863&atid=309863 

Thanks. I think we should probably take this, but subject to the
comments below re the API for selecting the hint changing.

> With these two builds, I'd like to clear up the intended behavior of 
> some of the manager flags, specifically these:
> 
> 1) wxAUI_MGR_TRANSPARENT_HINT (default)
> 2) wxAUI_MGR_TRANSPARENT_HINT_FADE (default)
> 3) wxAUI_MGR_DISABLE_VENETIAN_BLINDS
> 4) wxAUI_MGR_DISABLE_VENETIAN_BLINDS_FADE (default)
> 
> Currently, with both builds as you can see from running the demo, either 
> you have the transparent hint on and none of the venetian flags matter 
> (as both MSW and Mac have transparency support in 2.7 now),  or you have
> it off and they still don't matter because it will fallback on some 
> early initial method of drawing outlines around the dock area.

That's not what is meant to happen. If you have
wxAUI_MGR_TRANSPARENT_HINT set, then what is meant to happen is
it
a) uses the transparent hint window OR
b) uses the simulated transparency (venetian blinds) unless its
    disabled (in which case it should fall back).

If you do not have wxAUI_MGR_TRANSPARENT_HINT (or the platform
does not support transparency and the venetian blinds are
disabled), then it does not use either of the above two methods,
it resorts to drawing outlines.

 > The
> venetian blinds settings don't matter in either case because those only 
> are currently designed to take effect when the platform wxWidgets was 
> built for does not support transparency.

If the platform does not support transparency, but
wxAUI_MGR_TRANSPARENT_HINT is set, you should (by default) get
venetian blinds.

This is the default behaviour on wxGTK on 2.7.0 and the default
behaviour on the 2.6 port on wxGTK. So if you aren't seeing this
it should be Mac specific.

> I'd like to see the behavior changed so that when 
> wxAUI_MGR_TRANSPARENT_HINT is not used, the venetian blinds will always 
> be used unless wxAUI_MGR_DISABLE_VENETIAN_BLINDS is specified actually 
> making that flag more useful, and making it possible for applications to 
> use venetian even if the platform supports transparency if they prefer. 
> I think that was the intended behavior in the first place, but is not 
> the case with the logic in the code currently.

No that was not the intended behaviour. The venetian blind effect was
originally designed as a "substitute transparency" only for where
platforms do not currently support it. Initially they weren't
universally popular, but much of their unpopularity seems to be
down to the fact people didn't like them breaking.

I'd be happy to see this change, but...

> On _all_ platforms, the fallback method used when transparent hint is 
> turned off leaves lots of artifacts. On Mac, it is generally an issue 
> with the floating pane, but you can also see some with scrollbars in the 
> managed window for some odd reason.

... it seems to me a rather easier solution is simply do disable
the ultimate fallback method entirely. It's got a lot of things wrong
with it, which I think have been listed many times, so I won't bother
listing them again.

This would then make wxAUI_MGR_TRANSPARENT_HINT simply mean
"use transparency if it's available else fall back to venetian
blinds".

Ben had an alternative proposal for fixing up all this logic which
(once it was explained to me this fallback would work) was
also rather more comprehensible than the current system. Ben,
what were your plans here?

> Exhibit B: Venetian Blinds on wxMac 2.6 (also in 2.7):
> http://www.phoenixcpm.com/wxwidgets/wxaui-mac-venetian.png
> 
> At first I thought it was calculating twice the size of the dock 
> location with the calculations of drawing the venetian blinds, but that 
> window stays the same size no matter where you dock the window, so it 
> seems that's generated from the size of the floating pane somehow. The 
> correct hint window sizes are calculated when either the transparent or 
> fallback dock hints though on all platforms as well as venetian blinds 
> on MSW and GTK, so this issue is specifically restricted to venetian 
> blinds on Mac.

I don't understand that at all. The venetian blinds window is
a window, just like the transparent hint window. Its size is
set by the docking code. The only logical explanation for it
getting larger with venetian blinds set is that the wxRegion
it creates for the window needs to be clipped to the window
size itself on wxMac but not on any other platform, which would
be pretty extraordinary but I suppose possible. It should be
easy enough for you to try that (look for wxPseudoTransparentFrame
and just clip the region).

> On another note, you may have noticed the venetian blinds on Mac use a 
> white color making it really hard to see the dock location. I thought 
> that color was set in wxPseudoTransparentFrame in OnPaint, but I'm not 
> having much luck changing that color. Someone needs to point out for me 
> where that color is as it seems I'm blind.

dc.SetBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION));
within wxPseudoTransparentFrame::OnPaint(wxPaintEvent& WXUNUSED(event))

IE it uses the active title bar colour. This is white on the Mac,
so possibly not a great choice.

> Another issue with venetian blinds on Mac is that on the first couple 
> times the hint window shows, it has the typical Mac OS X window drop 
> shadow behind it. After being shown a couple of times though, it stops 
> using the drop shadow every time it shows from there on out.
> 
> Exhibit C: Venetian Drop Shadow on wxMac 2.6 (also in 2.7):
> http://www.phoenixcpm.com/wxwidgets/aui/mac-hint-shadow.png

No idea.

> One more issue (last one for now, I promise) has only just popped up 
> recently on Mac in CVS. I'm not sure if this is related to code changed 
> in wxAUI, but the transparent hint window has now picked up what looks 
> like a title bar.

Go to wxFrameManager::SetManagedWindow() and delete the use of
wxCAPTION. I don't know why it's trying to use a caption here
on the Mac. Stefan, I think this is yours?

 > On another note since the screenshot shows it, it's
> also bugged me a little that the transparent hint window shows above the 
> floating pane.

I'm not sure how ordering of wxFLOAT_ON_TOP windows is controlled.
However, I'd note "fixing" this would mean the hint window would be
invisible if it was behind the floating windows, so I think this
may be right.

Alex




More information about the wx-dev mailing list