Print Page | Close Window

Struggling Newbie

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=12288
Printed Date: 01 October 2024 at 8:20pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Struggling Newbie
Posted By: ludwig
Subject: Struggling Newbie
Date Posted: 29 September 2008 at 12:57pm

Hello

I'm a complete newbie with CodeJock software.  I have commandbars and controls 2007.  I have a large existing project written in MS Visual C++ 6.0 with MFC, using MDI windows.  I have managed to convert my default menu and toolbars to use Xtreme CommandBars and MenuBar, but I have some questions.

(1) In my existing code, if the user switches between MDI windows, I currently override CView::OnActivateView and dynamically add and delete menus as appropriate for the current window.  I used to call GetMenu to retrieve the main application menu, but that no longer works.  I presume I now call GetCommandBars()->GetMenuBar() to retrieve a pointer to the application menu bar - is that right?  How do I then add or delete menus to this?

(2) The main application menu used to automatically list each open MDI Child Window at the bottom of the Windows menu.  That no longer happens.  How do I get that working again?  I notice that there is a method CXTPMenuBar::AddMDIMenu.  Can I use this?  It appears to take a resource ID, but I have no idea what the resource is for.

(3) How can I create context menus that have the same look and style as the application menus now have?

(4)I seem to be spending a long time trying to work out how to do things.  I have looked at samples, documentation, online help, and the Internet sites, but I still have loads of questions and cannot even work out how to use either the "Designer Studio" application or the "Resource Editor".  I'm not even sure what I'm supposed to be able to do with them, or whether I even need them (e.g. for toolbar and dialog design).  I want to improve the look of my toolbars and toolbar icons.  Do I need to use the Resource Editor for this?  Is there any good introduction info that I'm missing?  All help much appreciated.




Replies:
Posted By: mgampi
Date Posted: 01 October 2008 at 4:05am
Hi;

(2):

Add a menu item with ID 35000 to your main menu. The rest is done by the toolkit.

(3):

just call CXTPCommandBars::TrackPopupMenu().

(4):

I'm using Axialis IconWorkshop (www.axialis.com) and/or Photoshop to create my bitmaps and icons.
I've never tried to use the tools provided by CJ to do this. Also the internal VS resource editor is unusable when alpha channels are required...



-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: Oleg
Date Posted: 01 October 2008 at 4:21am

(1)

Yes, you need use CXTPControls mehods to add/remove menus.
for example pMenuBar->GetControls()->Add(...);
pMenuBar->GetControls()->Delete(...); etc.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: ludwig
Date Posted: 04 October 2008 at 1:19pm
Thank you for your replies.  I tried adding a menu item with id 35000 to my top-level menu and it appeared to have no effect (it was as if it wasn't there at all).  I also tried adding it to the Windows menu - again, with no effect.  What should happen when I do this?
 
I'm still really struggling trying to work out how menus work.  One big problem I have is that I add menus dynamically in response to CMainFrame::OnInitMenu and CMainFrame::OnInitMenuPopup, and I handle clicks on them dynamically too in CMainFrame::OnCmdMsg.  Can I do anything like this with CodeJock menus?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net