Problems with context menu |
Post Reply |
Author | |
jamiei
Newbie Joined: 01 November 2003 Location: United Kingdom Status: Offline Points: 4 |
Post Options
Thanks(0)
Posted: 02 November 2003 at 4:13pm |
I've created a CTreeView derived class that is then attached to a docking pane using AttachView. Inside this derived class I've overridden the OnContextMenu method where I want to display a context menu. The code that does this is as follows:
CMenu menu; menu.LoadMenu( IDR_MAINFRAME ); CMenu* pMenu = menu.GetSubMenu(0); CXTPPopupBar popup;popup.LoadMenu( pMenu ); popup.Popup( point.x, point.y, 0 );
For some reason, this only seems to be called if I double click on the view. For example, if I just right click once in the tree control's area I get nothing, if I double click then a menu is displayed before being destroyed straight away. I added a call to MessageBox just to block the code and the menu does appear, but as I said, as soon as the code continues the menu is destroyed. I've not found anything about using the pop-up menus (yet) so it's possible I've used the classes in the wrong way. However, what is slightly weirder is the fact I need to double click to get it displayed. If anyone can shed any light I'd be very grateful. I've so far found using/creating the docking panes fairly problematic! |
|
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 |