Pane Opacity |
Post Reply |
Author | |
mrmathis
Senior Member Joined: 17 May 2007 Location: United States Status: Offline Points: 105 |
Post Options
Thanks(0)
Posted: 01 September 2009 at 1:34pm |
I've been playing with the opacity setting of floating panes using CXTPDockingPaneManager::SetFloatingFramesOpacity and see some potential uses. Is there an equivalent for unpinned panes, so that they would slide out in an opaque state? If not, might that be on the horizon?
|
|
--Mike
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Windows doesn't support Opacity for Child windows - only for TopLevel. :(
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
mrmathis
Senior Member Joined: 17 May 2007 Location: United States Status: Offline Points: 105 |
Post Options
Thanks(0)
|
That's too bad.
With the floating panes, is there any way I could further manipulate things so that, say, the background would appear completely transparent? For example, say a pane contains a tree control. I'd like for the tree elements to be 50% opaque, but the background of the control to be invisible.
|
|
--Mike
|
|
mfproudman
Newbie Joined: 08 May 2008 Location: Canada Status: Offline Points: 8 |
Post Options
Thanks(0)
|
This may be related: I've been trying to get a layered/transparent view working in a docking pane. The following code works in a CDialog: HWND hWnd = GetSafeHwnd(); long style = GetWindowLong(hWnd, GWL_EXSTYLE); style |= WS_EX_LAYERED; SetWindowLong(hWnd, GWL_EXSTYLE, style); ::SetLayeredWindowAttributes(hWnd, 0, 128, LWA_ALPHA); return 0; It seems to have no effect in a CView attached to a CXTPDockingPane. I have also tried with the hWnd from the docking pane, and also no effect. What we're trying to do is have a docking pane containing a VISTA-like status gadget, with a transparent background. Any ideas? Mark Proudman |
|
Mark Proudman
|
|
mrmathis
Senior Member Joined: 17 May 2007 Location: United States Status: Offline Points: 105 |
Post Options
Thanks(0)
|
Are you saying that works in a CDialog all by itself, or with a CDialog inside a docking pane? I tried the latter and didn't have any success.
|
|
--Mike
|
|
mfproudman
Newbie Joined: 08 May 2008 Location: Canada Status: Offline Points: 8 |
Post Options
Thanks(0)
|
It works in a CDialog popped-up with DoModal() completely outside a docking pane. In other words, as was pointed out by Oleg, a top-level window can have WS_EX_LAYERED, but apparently not a DockingPane. Or am I missing something here? What we really want is a Docking Pane that becomes WS_EX_LAYERED as or if it is dragged into an undocked state. In other words, when it is floating independently outside the app's mainframe, we want to be able to see through it to the windows it overlaps. We're looking for something like a Vista gadget type of appearance for some dashboard style application state displays. Any ideas? Mark |
|
Mark Proudman
|
|
mrmathis
Senior Member Joined: 17 May 2007 Location: United States Status: Offline Points: 105 |
Post Options
Thanks(0)
|
I've gotten back to this topic and had some luck with some experiments. I went into CXTPDockingPaneMiniWnd::UpdateWindowOpacity and made these mods:
Since the dialog in my docking pane is a tree control that fills the entire dialog, and its background color is white, the whole thing goes transparent very nicely, and I can click through it at will. Now I'm playing with hiding the floating frame as well, while still providing some UI for moving/resizing/redocking/etc.
So, Codejock dev team, do you see any problem with this approach? If not, how about exposing it, since subclassing is fragile (and I really haven't tried yet to make sure I can do it properly) and modifying the delivered source is not something I enjoy maintaining from release to release?
|
|
--Mike
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Yes, better create custom class for your Floating frames and override its UpdateWindowOpacity() method.
Here some code for start
class CDockingPaneMiniWnd : public CXTPDockingPaneMiniWnd
{ public: CDockingPaneMiniWnd(CXTPDockingPaneLayout* pLayout); }; class CDockingPaneManager : public CXTPDockingPaneManager { public: CDockingPaneManager(); virtual ~CDockingPaneManager(); protected:
virtual CXTPDockingPaneBase* OnCreatePane(XTPDockingPaneType type, CXTPDockingPaneLayout* pLayout); };
CDockingPaneManager::CDockingPaneManager()
{ } CDockingPaneManager::~CDockingPaneManager()
{ }
CXTPDockingPaneBase* CDockingPaneManager::OnCreatePane(XTPDockingPaneType type, CXTPDockingPaneLayout* pLayout) { if (type == xtpPaneTypeMiniWnd) return new CDockingPaneMiniWnd(pLayout); return CXTPDockingPaneManager::OnCreatePane(type, pLayout);
}
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |