![]() |
how to create menuitem with 2 icons |
Post Reply ![]() |
Author | |
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() Posted: 30 March 2006 at 3:13am |
Hello All, Can anyone tell me how to create menuitems to display with two icons . (Check icon and someother icon ) . I should display the check icon and also other icon with a particular menu item . Like the one display in latest msdn . I have attached the image in the zip file . Pleas help on this issue.2006-03-30_031203_2icon.zip
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Sorry link don't work... Show image as is (click Image Upload) |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hi Oleg, It is opening for me when i extract from zip file .I will attach the gif file of the image.I want the samething to be shown in the menu item of a menubar.how to do it for a menu popup for a button control in the toolbar.
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello, Call pPopupBar->SetDoubleGripper(TRUE); for this popup bar. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hi Oleg, My requirement is like this we are creating a toolbar in that a button has to popup a menu like that. m_wndMenuBar is a member of CXTPToolBar CMenu *pSubMenu = NULL; So please help on this issue to solve this problem because i dont know how to get the CXTPPopupBar from CXTPControlPopup to set the Gripper for the menu.
|
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hi Oleg, I need it for the mainmenu and also for its submenu.I need it like this.Please help on this issue.
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello, here code CXTPPoupBar*pPopupBar = (CXTPPoupBar*)pBtnCtrl->GetCommandBar(); pPopupBar ->SetDoubleGripper(TRUE) |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hi Oleg, It is working for main menu but its not workng for the submenu of the main menu.Also ow i can set icon for popup submenu item that is Zoom In / Zoom Out . Please help on this issue. |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello, 1. to set icon call pControl->SetStyle(xtpButtonIconAndCaption); and assign iconId pControl->SetIconId(ID_ICON);
2. to set sublemnu double gripper find its popupbar and call SetDoubleGripper for it.
CXTPPoupBar*pPopupBarChild = (CXTPPoupBar*)pPopupBar->GetControl(7)->GetCommandBar( ); pPopupBarChild->SetDoubleGripper(TRUE); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hello Oleg, When i tried to do get the pPopupBarChild pointer it is crashing since (CXTPPoupBar*)pPopupBar->GetControl(7) is returning NULL so i can't set icon also for that menu item.I will be staying here till night so please help on this issue to resolve. |
|
Raj
Software Engineer eGrabber Inc http://vcfreax.blogspot.com/ |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
??? instead 7 use index you need. I don't know how much items you have in popup and where your popup control.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hello Oleg, m_wndLayer2ToolBar.CreateToolBar(WS_VISIBLE|WS_CHILD|CBRS_TO OLTIPS, this, AFX_IDW_TOOLBAR + 3); pCtrl = m_wndLayer2ToolBar.GetControls()->FindControl(ID_BUDDYLIS T_BTN); CMenu cMenu; CMenu cSubMenu; if( pSubMenu && pBtnCtrl ) CXTPpChildPopupBar *pChildPopupBar = (CXTPPopupBar*)pPopupBar->GetControl(10)->GetCommandBa r(); When i tried to get the the ppopupBarChild it is crashing while i debugged this is where it is crashing CXTPControl* CXTPCommandBar::GetControl(int nIndex) const this function is returning NULL that is why it cant get the pointer my menubar is the same what i had sent earlier with menu iitem ( copy,New etc... ) in the previous mail So please help on this issue i dont what i have to do give me a sample also how to do it in the ame manner. |
|
Raj
Software Engineer eGrabber Inc http://vcfreax.blogspot.com/ |
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hi Oleg, I had already sent the code for the following . Please help me to solve this issue . Its a very important one in our module . |
|
Raj
Software Engineer eGrabber Inc http://vcfreax.blogspot.com/ |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
The line: pPopupBar->GetControl(10)
So Are you sure you need index 10? Double check it. if it returns NULL it mean index out of range. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hello Oleg , Thanks for the reply . Thing is its crashing because m_pControls->GetCount() is less than the nIndex i dont know how to set the m_pControls Count.Give me a solution on this why it is less than my index . I had already sent you the code. CXTPControl* CXTPCommandBar::GetControl(int nIndex) const |
|
Raj
Software Engineer eGrabber Inc http://vcfreax.blogspot.com/ |
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hello Oleg, Can you check me and tell what is the issue please!! |
|
Raj
Software Engineer eGrabber Inc http://vcfreax.blogspot.com/ |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello, Create with wizard new application, recreate this issue and attach here. I will show what you must to change. Can't understand why it is so difficult for you. All you need is specify index of your popup control. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hello Oleg, I need to set the same two icons for a right click menu . can you help me to solve the issue how to add two icons in right click menu. |
|
Raj
Software Engineer eGrabber Inc http://vcfreax.blogspot.com/ |
|
![]() |
|
JamesH ![]() Senior Member ![]() Joined: 01 December 2004 Status: Offline Points: 149 |
![]() ![]() ![]() ![]() ![]() |
I'm having a problem with the doubleGripper as well.
I have a CommandBarPopup pointer:
ICommandBarPopupPtr popup;
And I add tools to it using:
ctrl = popup->CommandBar->Controls->Add( XtremeCommandBars::xtpControlButton, (long)ts->ctrlID, A2W( (char*)(ts->caption) ), vtMissing, VARIANT_TRUE);
I set the control to be checked:
ctrl->Checked = ts->depressed;
And then I set the double gripper so those tools should have an icon and a check mark:
popup->CommandBar->DoubleGripper = VARIANT_TRUE;
The tools show up in the correct checked or unchecked state but just with the single gripper (ie. no check mark, just a highlighted icon).
Any ideas?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
In our WTL sample I added:
XtremeCommandBars::ICommandBarPopupPtr popup = m_spCommandBars->GetActiveMenuBar()->Controls->GetItem(1);
popup->CommandBar->DoubleGripper = VARIANT_TRUE; and it works as expected. Check your code.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
JamesH ![]() Senior Member ![]() Joined: 01 December 2004 Status: Offline Points: 149 |
![]() ![]() ![]() ![]() ![]() |
Hey Oleg,
Thanks for the quick response. Your right it was something dumb, the menu created is later copied before being displayed and the copy didn't copy over the DoubleGripper property.
![]() Thanks again,
- James
|
|
![]() |
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 |