Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPControlBitmap on MenuBar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPControlBitmap on MenuBar

 Post Reply Post Reply
Author
Message
crystyce View Drop Down
Groupie
Groupie


Joined: 19 August 2008
Location: Romania
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote crystyce Quote  Post ReplyReply Direct Link To This Post Topic: CXTPControlBitmap on MenuBar
    Posted: 08 February 2010 at 11:46am
How can I make a CXTPControlBitmap show up on a CXTPMenuBar?

I tried this, but I have no ideea how to load the bitmap on the control. Any other method to show a bitmap on the menu bar would be fine too, except for the one using a ReBar.

int CMainFrame::OnAfterCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)
{
     CXTPMenuBar* pMenuBar = DYNAMIC_DOWNCAST(CXTPMenuBar, lpCreateControl->pCommandBar);
     if (pMenuBar)
     {
          pMenuBar->SetOwner(this);

          if (lpCreateControl->strCaption == _T("&Help"))
          {
               CXTPControlBitmap* pLabel = new CXTPControlBitmap();
               
               pMenuBar->GetControls()->Add(pLabel,IDB_LOGO);
               pLabel->SetFlags(pLabel->GetFlags() | xtpFlagRightAlign);
          }
     }

     return FALSE;
     Product: Xtreme SuitePro (MFC) version 13.1.0
     Platform: Windows XP (32bit) - SP 2
     Language: Visual C++ 2008
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: 09 February 2010 at 2:41am

Hi,

to load it - add bitmap with IDB_LOGO to resources and line
 
 UINT nCommands2[] = {IDB_LOGO};
 pCommandBars->GetImageManager()->SetIcons(IDB_LOGO, nCommands2, _countof(nCommands2), xtpImageNormal);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
crystyce View Drop Down
Groupie
Groupie


Joined: 19 August 2008
Location: Romania
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote crystyce Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2010 at 6:17am
thanks a lot, that works great !
     Product: Xtreme SuitePro (MFC) version 13.1.0
     Platform: Windows XP (32bit) - SP 2
     Language: Visual C++ 2008
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.438 seconds.