![]() |
Menu Bar Issue. |
Post Reply ![]() |
Author | |
Makarand ![]() Senior Member ![]() ![]() Joined: 27 February 2007 Location: India Status: Offline Points: 140 |
![]() ![]() ![]() ![]() ![]() Posted: 26 March 2007 at 11:06am |
Hi, I am facing the problem with the menu. I am trying to replace the codejock lib 4.2 to 10.4.2. I have created menu by using following code. // Initialize the command bars // Get a pointer to the command bars object. // Add the menu bar Now the problem with the command routing of menu bar, When I select the "File" menu from the menu bar, all the menus from the "File" like "New", "Open"... get fired. I am confused for this misbehavior, If I remove the code and replace the old code as follow if (!m_wndMenuBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP It is working fine. Please help for the Issue Thank You,
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi May be you have some update handler that can delete these commands...
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
saket ![]() Newbie ![]() Joined: 15 March 2007 Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
Hi , What we need to do for this, So that command do not get deleted.
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
I don't know what you do to delete it, so I don't know how to prevent.
Send whole project to support@codejock.com and I will suggest you what to change.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
saket ![]() Newbie ![]() Joined: 15 March 2007 Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
Hi, We are having MDI application. Previously we were using codejock 4.2. And the code for creation of menu and getting the HANDLE of Menu is as follows: MAINFRAME.CPP Header Section: #include ".\Common\XTPImageManager.h" //#include <XTImageManager.h> // This path is relative to 'Xtreme Toolkit\Include' folder //#include <Common.Include/XTAnimationMemDC.h> In “int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)” //Create Menu and load it if (!m_wndMenuBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndMenuBar.LoadMenuBar(IDR_MAINFRAME)) { TRACE0("Failed to create menubar\n"); return -1; // fail to create } //Get the Handle for Menu In the other class say XYZCLS.CPP, we need the CMenu* Void XYZCLS ::xyzFun() { CMenu* ptrMenu; CMainFrame * pFrame = (CMainFrame *)AfxGetMainWnd(); ptrMenu = pFrame->GetMenu(); [Able to get ptrMenu] pSubMenu = pMenu->GetSubMenu(nPos); //assume nPos = 0 } This was the code for CodeJock 4.2 and that is working fine. Here is the sample code for what I want to do using codejock 10.4.2. MAINFRAME.CPP Header Section: #include ".\Common\XTPImageManager.h" //#include <XTImageManager.h> // This path is relative to 'Xtreme Toolkit\Include' folder //#include <Common.Include/XTAnimationMemDC.h> In “int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)” //Create Menu and load it /*if (!m_wndMenuBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndMenuBar.LoadMenuBar(IDR_MAINFRAME)) { TRACE0("Failed to create menubar\n"); return -1; // fail to create } */ -------------------Replaced the above code with // Initialize the command bars if (!InitCommandBars()) return -1; pCommandBars = GetCommandBars(); // Add the menu bar : CALL "SetMenu()" member to create menu bar RETURN CXTPMenuBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME); //pMenuBar->LoadMenuBar(IDR_MAINFRAME); //Get the Handle for Menu [In the hMenu, we are not getting handle to menu],
Void XYZCLS ::xyzFun() { CMenu* ptrMenu; CMainFrame * pFrame = (CMainFrame *)AfxGetMainWnd(); ptrMenu = pFrame->GetMenu(); [In the ptrMenu, we are not getting pointer to menu], Since we are not able to get pMenu, the below line break the execution, pSubMenu = pMenu->GetSubMenu(nPos); //assume nPos = 0 The above line is breaking because “pMenu”. } If are ignoring it and trying to open any menu, the application is firing command for the entire menu item. I had changed the “MainFrame.h”, Given Below //class CMainFrame : public CMDIFrameWnd class CMainFrame : public CXTPMDIFrameWnd For the Child Frame Window: //No Change class CChildFrame : public CMDIChildWnd Since “CXTPMDIChildWnd” is not there for codejock 10.4.2. CChildFrame derivation is as it. This is the issue. Please help me out. Thanks in advance.
Saket Kumar. |
|
![]() |
|
saket ![]() Newbie ![]() Joined: 15 March 2007 Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
What is the class for below in codejock 10.4.2
CXTMDIChildWnd / CXTControlBar /
|
|
![]() |
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 |