![]() |
how to popup menu when right click |
Post Reply ![]() |
Author | |
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() Posted: 29 March 2006 at 5:34am |
Hello All , I need a help . How to popup a menu when right click on a menu item of existing menu like IE browser Favorites menu . Attached a zip file that shows IE browser right click menu on Favorites menu . When we click IE browser Favorites menu it is poping up a menu in that we can delete a favorite item by right clicking on that item and select delete i need the same thing . In my application i will popup a menu on click of a button i need to popup a menu whenever user right clicks on the particular menu item .2006-03-29_053238_popup_menu.zip . Please help on this critical issue
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello, here code (Works only in 9.81) ON_MESSAGE(WM_XTP_CONTROLRBUTTONUP, OnControlRButtonUp)
LRESULT CMainFrame::OnControlRButtonUp(WPARAM, LPARAM lParam) CMenu menu; UINT nReturn = CXTPCommandBars::TrackPopupMenu(menu.GetSubMenu(0), TPM_NONOTIFY|TPM_RECURSE|TPM_RETURNCMD, pt.x, pt.y, this); switch (nReturn) case ID_LINK_PROPERTIES: } return FALSE;
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hello Oleg iam having delete popup menu over another menu if i click delete it should reload the another menu without that delete item but it is crashing when iam trying to delete and set the refresh menu to the control. Help me to sort out this issue code as follows: LRESULT CToolDlg::OnControlRButtonUp( WPARAM wParam , LPARAM lParam )
if ( pControl->GetID() == ID_BUDDYMENUITEM || pControl->GetID() <= ID_BUDDYMENUITEM + 19 ) AddNAppendRecordsT oBuddy(true); -> from here calling another function where i wil be setting the menu to the control
int CToolDlg::AddNAppendRecordsToBuddy( bool bStartup ) egAGProInterface()->GetListFromDB( eBuddyList , cBuddyList ); pSubMenu->AppendMenu( MF_SEPARATOR ); pos = cBuddyList.GetHeadPosition( ); int ncount = cBuddyList.GetCount(); while( pos && pSubMenu ) if (csText.IsEmpty()) { return FALSE;} // -- implemented May 5 2006 to check the cBuddyList.GetNext( pos );
|
|
Raj
Software Engineer eGrabber Inc http://vcfreax.blogspot.com/ |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Raj, you scare me. You show me 130 lines of code and asking to find error. I must debug it. Create new issue in issuetrack and attach your project or small application and I will show where you have error.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hello Oleg, Thanks for the Reply . I will explain what iam doing in those functions . Second function is the one can use for adding items dynamically so that when ever i click the it should so the items that are set to the menu . If the user doesnt want the item in the menu he can right click on that item so that it will popup another menu called delete if i click it is going to the OnControlRButtonUp function then i will be calling the second function to set all the items other than the deleted item in the database and the remaining items i am loading it in the menu and it to popupbuttoncontrol Setcommandbar function . I had checked whether if there are any probs with set and get in database but no probs in that. So when i debug after the setcommandbar it is calling some functions XT and at it is going to CXTPCommandBar::IsSelected or something and it is crashing there it seems . Can you explain me how handle this situation.
|
|
Raj
Software Engineer eGrabber Inc http://vcfreax.blogspot.com/ |
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hello Oleg, I will be sending you the sample source code attched with this reply 2006-05-19_114836_XTToolBarNDlg.zip . Can you help me out to solve this issue . If you execute the exe it will show a toolbar on the dialog if you click the first popup button it will popup a menu and then if you right click the menu items after the Separtor it will popup a delete menu . If you click on that that item has to deleted . It is deleteing for 1 or 2 items if I do it for all the items it is crashing the same thing what i hgad explained before. Can you help me to solve this issue.
|
|
Raj
Software Engineer eGrabber Inc http://vcfreax.blogspot.com/ |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Hello Oleg, We are not using CXTPCommandBars* pCommandBars = GetCommandBars(); m_pToolBar = NULL; this code to create the toolbar instead of this thing we are using CXTPToolBar m_wndBuddyBtnToolbar; m_wndBuddyBtnToolbar.CreateToolBar(WS_VISIBLE|WS_CHILD|CBRS_ TOOLTIPS, this, AFX_IDW_TOOLBAR + 5 ); Here we cant get the CXTPCommandBars how should i do if iam using this way. Can you help me out its really important.
|
|
Raj
Software Engineer eGrabber Inc http://vcfreax.blogspot.com/ |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
You just need create simple CommandBars object m_pCommandBars = (CXTPCommandBars*)CXTPCommandBars::CreateObject() assign it m_wndBuddyBtnToolbar.SetCommandBars(m_pCommandBars);
and destory in destuctor m_pCommandBars->InternalRelease(); |
|
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 |