Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Adding bitmap pane to CXTPStatusBar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Adding bitmap pane to CXTPStatusBar

 Post Reply Post Reply
Author
Message
smitchell View Drop Down
Newbie
Newbie


Joined: 09 January 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote smitchell Quote  Post ReplyReply Direct Link To This Post Topic: Adding bitmap pane to CXTPStatusBar
    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
Back to Top
smitchell View Drop Down
Newbie
Newbie


Joined: 09 January 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote smitchell Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
smitchell View Drop Down
Newbie
Newbie


Joined: 09 January 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote smitchell Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
smitchell View Drop Down
Newbie
Newbie


Joined: 09 January 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote smitchell Quote  Post ReplyReply Direct Link To This Post Posted: 15 January 2008 at 7:41pm

Thanks, Oleg

That fixed the problem.

Regards .... Stan

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.