![]() |
How to add a drop down arrow ? |
Post Reply
|
| Author | |
Louis
Newbie
Joined: 17 August 2005 Status: Offline Points: 19 |
Post Options
Thanks(0)
Quote Reply
Topic: How to add a drop down arrow ?Posted: 17 August 2005 at 1:35pm |
|
What are the steps to add a drop down arrow to a toolbar button ? I have been looking at the samples and did'nt see any using this, maybe I missed it. Can someone tell me what sample has it or describe the stpes here. Also how to get notification to react. thanks, |
|
![]() |
|
Louis
Newbie
Joined: 17 August 2005 Status: Offline Points: 19 |
Post Options
Thanks(0)
Quote Reply
Posted: 17 August 2005 at 4:05pm |
|
ok, I managed to get a drop down arrow. Find it by looking at the GUI_VisualStudio7 sample. Taking a lot of time to figure out things juts by looking at samples. Wish the doc had more info on key features like this one. Now, I need to know how to display a popup menu when the arrow is clicked. The popop menu must be DYNAMICALLY built. thanks, |
|
![]() |
|
Louis
Newbie
Joined: 17 August 2005 Status: Offline Points: 19 |
Post Options
Thanks(0)
Quote Reply
Posted: 17 August 2005 at 9:30pm |
|
Ok, now I got the toolbar button menu to be filled up. Oleg, I just need to know if what I did is a good way of doing this ? //Populate dynamically a toolbar button's drop down menu: void CMainFrame::OnInitCommandsPopup(CXTPPopupBar* pCommandBar){ CXTPControlPopup *pPopup = pCommandBar->GetControlPopup(); int nPopupID = pPopup->GetID(); if( nPopupID == ID_VIEW_GRAPH ) { CXTPControls* pControls = pCommandBar->GetControls(); pControls->RemoveAll(); //Fill items pControl = pControls->Add(xtpControlButton, ID_GRAPH1, _T(""), i, TRUE); pControl->SetCaption(csCaption); ... } } |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 18 August 2005 at 4:08am |
|
Yes, code is ok, but better use code from DynamicPopups see CControlFavorites::OnCalcDynamicSize(..) { ... } because it will allow to customize this popup by user - to add/remove some buttons.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Louis
Newbie
Joined: 17 August 2005 Status: Offline Points: 19 |
Post Options
Thanks(0)
Quote Reply
Posted: 18 August 2005 at 9:13am |
|
Thanks oleg. I don't need this item to be customized. It is dynamically filled from a list of docking windows (title) that are used to display graphs. When the item is selected the focus is set to the proper commandbar. One last question on this topic. To avoid creating control IDs and process them with standard message handling mechanism, I used the technique in the sample DynamicPopups for the favorite control. By using the message map: ON_XTP_EXECUTE(ID_VIEW_GRAPH_ITEM, OnViewGraphItem) i can process the event for the item. To me it all works fine, I just hope it is a good way and no possible conflict. I am working on an existing MFC application that was using the toolbar notification message TBN_DROPDOWN and then using TrackPopupMenu to do this. This way I don't need to create a control and use OnCalcDynamicSize. I just do it all in the MainFrame. If using OnCalcDynamicSize is still a better way let me know. many thanks, |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 18 August 2005 at 1:21pm |
|
Yes it can be used without problems.
ps. Glad you catch how all this work :) |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
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 |