Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Change the tick icon
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Change the tick icon

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


Joined: 30 October 2006
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote ContactGT Quote  Post ReplyReply Direct Link To This Post Topic: Change the tick icon
    Posted: 14 December 2006 at 11:14am
I have a menu item that turns on/off a window. Is it possible to use a custom icon or bitmap for the tick next to a menu item when SetCheck(true), instead of the grey tick. Also, can I show something when the item is SetCheck(false)?
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: 14 December 2006 at 1:34pm
Hi,
yes, just set any icon for this item - this icon will be in rectangle instead check mark.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
ContactGT View Drop Down
Newbie
Newbie


Joined: 30 October 2006
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote ContactGT Quote  Post ReplyReply Direct Link To This Post Posted: 14 December 2006 at 5:47pm
Thanks, but how do I get to the item? In my MainFrame::OnCreate(), I have:
 
 // Add the menu bar
 CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(
  _T("Menu Bar"), IDR_MAINFRAME);
 if(pMenuBar == NULL)
 {
  TRACE0("Failed to create menu bar.\n");
  return -1;      // fail to create
 }
 pMenuBar->SetFlags(xtpFlagHideMinimizeBox | xtpFlagHideMaximizeBox);
 CMenu *menu = pMenuBar->GetMenu();
 CMenu *subMenu = menu->GetSubMenu(3);
 
 
But the pMenuBar->GetMenu() returns NULL, so I can't get to the items in the menus to set the check and uncheck icons.
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: 15 December 2006 at 12:48am

hi,

you have to set icons to imagemanager for Controls Ids.
 
pCommandBars->GetImageManager()->SetIcons(..);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.203 seconds.