Print Page | Close Window

Adding bitmap pane to CXTPStatusBar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=9261
Printed Date: 30 September 2024 at 3:23am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Adding bitmap pane to CXTPStatusBar
Posted By: smitchell
Subject: Adding bitmap pane to CXTPStatusBar
Date Posted: 09 January 2008 at 2:21am
How do I add a bitmap to a pane in the CXTPStatusBar?
It seems that CXTPStatusBarIconPane plays a role in this.
Thanks for any pointers .... Stan



Replies:
Posted By: smitchell
Date Posted: 10 January 2008 at 1:32pm
I came up with a solution for this.
 
Briefly:
Derive a BmpWnd class from CXTPStatusBarPaneWnd.
Call its Create() passing the m_wndStatusBar.
Add a pane for it: wndStatusBar.AddIndicator(ID)
Associate the window: wndStatusBar.AddControl(&m_bmpWnd,ID)
 
Most of the work is done in BmpWnd::DoPaint() - BitBlts that make a selected color in the bmp transparent.
-------
BTW Ultimate Toolbox has SetPaneBitmap member in its COXStatusBar which makes this easy to do. I'm migrating our application to CJ so needed to implement the equivalent. SetPaneBitmap would be a welcome addition to CXTPStatusBar or CXTPStatusBarPane
 
Cheers .... Stan (using XTP v11.2.2)


Posted By: Oleg
Date Posted: 11 January 2008 at 1:31am
Hi,
 
Better derive from CXTPStatusBarPane and override its CXTPStatusBarPane::OnDraw
 
CXTPStatusBarPaneWnd class add additional window handle to draw, and it can reason of flickers.
 


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: smitchell
Date Posted: 11 January 2008 at 12:49pm
Hi Oleg,
I tried your suggestion to move the implementation into CXTPStatusBarPane rather than using CXTPStatusBarPaneWnd. It worked as well but I had problems resolving heap corruption on application close during processing WM_NCDESTROY (using CXTPStatusBarPaneWnd, I don't see this).
Thanks .... Stan


Posted By: Oleg
Date Posted: 12 January 2008 at 2:52am
Hi,
don't delete pane manually. It will be deleted by CXTPStatusbar. and create it dynamically.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: smitchell
Date Posted: 15 January 2008 at 7:41pm

Thanks, Oleg

That fixed the problem.

Regards .... Stan




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net