![]() |
How to diaplay a popup menu? |
Post Reply ![]() |
Author | ||
freehawk ![]() Groupie ![]() Joined: 22 April 2004 Status: Offline Points: 95 |
![]() ![]() ![]() ![]() ![]() Posted: 25 November 2004 at 10:08pm |
|
Hello When right-clicked toolbar, how to display a my popup menu? Thanks. Freehawk
|
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
variant 1. create custom command bars class and override GetToolbarsPopup method in OnCreate: class CMyCommandBars : public CXTPCommandBars DECLARE_DYNCREATE() ... InitCommandBars(RUNTIME_CLASS(CMyCommandBars)) variant 2. catch OnInitCommandsPopup (ON_XTP_INITCOMMANDSPOPUP()) and modify popup if it has Customize button.
|
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
freehawk ![]() Groupie ![]() Joined: 22 April 2004 Status: Offline Points: 95 |
![]() ![]() ![]() ![]() ![]() |
|
Thank you very much. But I dont understand all. Could you give me a sample? -Freehawk
|
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
freehawk ![]() Groupie ![]() Joined: 22 April 2004 Status: Offline Points: 95 |
![]() ![]() ![]() ![]() ![]() |
|
Thank you very very much. Now I have several questions . 1.With this way, can I judge the place where right-click button is clicked and display different popupmenu? example: When right-clicked toolbar1, I display popupmenu1. and when right-clicked toolbar2, I will display popupmenu2. 2.I hope to display my popup menu only, not want to display "Customize", "Standard".. menu items in the popupmenu, How to realize it? -Freehawk
|
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
1. No, you can't 2. Call pPopupBar->GetControls()->RemoveAll(); |
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
freehawk ![]() Groupie ![]() Joined: 22 April 2004 Status: Offline Points: 95 |
![]() ![]() ![]() ![]() ![]() |
|
Thank you for the reply. About "1", is there any way to realize it? -Freehawk
|
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
1. Override CXTPCommandBars::ContextMenu as void CMyCommandBars::ContextMenu(CPoint point) CXTPPopupBar* pPopup = GetToolbarsPopup(); while ( pPopup->IsTrackingMode() )
using point parameter you can find toolbar under this point |
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
freehawk ![]() Groupie ![]() Joined: 22 April 2004 Status: Offline Points: 95 |
![]() ![]() ![]() ![]() ![]() |
|
Thank you. How to do as "using point parameter you can find toolbar under this point" ? use HitTest? -Freehawk
|
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
WindowFromPoint , ChildWindowFromPoint
|
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
freehawk ![]() Groupie ![]() Joined: 22 April 2004 Status: Offline Points: 95 |
![]() ![]() ![]() ![]() ![]() |
|
Thank you very much. I will try it. BTW, Could you give me a sample to realize it? It was big trouble to me for a long time. -Freehawk
|
||
![]() |
||
freehawk ![]() Groupie ![]() Joined: 22 April 2004 Status: Offline Points: 95 |
![]() ![]() ![]() ![]() ![]() |
|
I tryed it, but I cannot know the place right-clicked. Could you give me a sample to realize it? It was big trouble to me for a long time. Thanks. -Freehawk
|
||
![]() |
||
freehawk ![]() Groupie ![]() Joined: 22 April 2004 Status: Offline Points: 95 |
![]() ![]() ![]() ![]() ![]() |
|
Thank you very much. I finished it. -Freehawk
|
||
![]() |
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 |