![]() |
How to diaplay a popup menu? |
Post Reply
|
| Author | ||
freehawk
Groupie
Joined: 22 April 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
Quote Reply
Topic: How to diaplay a popup menu?Posted: 25 November 2004 at 10:08pm |
|
|
Hello When right-clicked toolbar, how to display a my popup menu? Thanks. Freehawk
|
||
![]() |
||
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 01 December 2004 at 4:42am |
|
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 December 2004 at 1:43am |
|
|
Thank you very much. But I dont understand all. Could you give me a sample? -Freehawk
|
||
![]() |
||
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 December 2004 at 2:57am |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
freehawk
Groupie
Joined: 22 April 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 December 2004 at 7:59pm |
|
|
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
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 December 2004 at 7:16am |
|
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 December 2004 at 7:34pm |
|
|
Thank you for the reply. About "1", is there any way to realize it? -Freehawk
|
||
![]() |
||
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 December 2004 at 1:11am |
|
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 December 2004 at 2:26am |
|
|
Thank you. How to do as "using point parameter you can find toolbar under this point" ? use HitTest? -Freehawk
|
||
![]() |
||
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 December 2004 at 5:30am |
|
|
WindowFromPoint , ChildWindowFromPoint
|
||
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
freehawk
Groupie
Joined: 22 April 2004 Status: Offline Points: 95 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 December 2004 at 7:37pm |
|
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 December 2004 at 1:52am |
|
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 December 2004 at 10:12pm |
|
|
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 |