wxPopupWindow Problem Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Tech-Muc
Earned a small fee
Earned a small fee
Posts: 13
Joined: Sun Feb 08, 2009 1:57 pm

wxPopupWindow Problem

Post by Tech-Muc » Tue Mar 16, 2010 12:05 pm

Hello,

A small problem: If I change the CS_DROPSHADOW flag of a wxPopupWindow with the following instruction:

::SetClassLongPtr((HWND)GetHWND(), GCL_STYLE, ::GetClassLongPtr((HWND)GetHWND(), GCL_STYLE ) | CS_DROPSHADOW );


ALL wxPopupWindows on the screen get a Shadow effect. How can I prevent this - as i only want one wxPopupWindow to get the Shadow effect.

(or: how can i instruct wxWidgets to give the given wxPopupWindow class a independent / unique window class).

Thanks for any help,
Timo

frank_frl
Earned some good credits
Earned some good credits
Posts: 139
Joined: Sat Feb 18, 2006 1:41 pm
Location: Germany

Re: wxPopupWindow Problem

Post by frank_frl » Tue Mar 16, 2010 6:35 pm

You are changing a class style here, not a window style, so all derived windows will be affected.
Tech-Muc wrote: ::SetClassLongPtr((HWND)GetHWND(), GCL_STYLE, ::GetClassLongPtr((HWND)GetHWND(), GCL_STYLE ) | CS_DROPSHADOW );
You are calling native MSW code, so wxWidgets can't help you.
Tech-Muc wrote: (or: how can i instruct wxWidgets to give the given wxPopupWindow class a independent / unique window class).
IMO there is no way to archive this with wxWidgets.
(You could draw the shadow yourself :wink: )

Frank
WinXp SP3, OS X10.5.5; CodeLite, Dialog::Blocks, wxWidgets 2.8.10

eranif
Moderator
Moderator
Posts: 607
Joined: Tue Nov 29, 2005 7:10 pm
Location: Israel

Post by eranif » Tue Mar 16, 2010 7:09 pm

I actually did this exact same thing couple of years ago :)
The problem is that this style affects all classes with the same name (when passed to RegisterClass)

So you need to Register a new class with new name and then pass it the style
Its not easy since you need override some of wxWidgets internal like MSWCreate and other code

Eran
IDE: CodeLite + wxCrafter
OS: All
https://wxcrafter.codelite.org
https://codelite.org

Post Reply