Top-level, non-pop-up Menuitems
-
I'm trying to make a menubar so that I have an item on it that's not a pop-up item. The best way to explain what I need is the following code from my .rc file:
IDR_MAINFRAME MENU DISCARDABLE BEGIN POPUP "&File" BEGIN MENUITEM "&Load File...", ID_FILE_LOAD MENUITEM SEPARATOR MENUITEM "&Info...", ID_FILE_INFO END POPUP "&Options" BEGIN MENUITEM "&Colors...", ID_OPTIONS_COLORS MENUITEM "&About...", ID_FILE_ABOUT END MENUITEM "&Top-Level", ID_TOP_LEVEL END
So, I want to have the ID_TOP_LEVEL command on the menubar without any "parent menu" item. This code complies fine, but when I run it on my Toshiba, the menuitem doesn't even show up (ie: not displayed). I just see the "File" and "Options" menuitems. The only command I can see that solves my problem is this funky "shared new" menuitem. however I can't find the documentation on how to handle it (messages, etc). I've looked through almost every .rc file for all the samples here on CP, and it seems like I'm the only person out there who wants a top-level, non-pop-up menuitem. I'm use eVC++, MFC, and a dialog-based app. If anyone has any ideas, please help me out. TIA Violence is the last refuge of the incompetent [Salvor Hardin] -
I'm trying to make a menubar so that I have an item on it that's not a pop-up item. The best way to explain what I need is the following code from my .rc file:
IDR_MAINFRAME MENU DISCARDABLE BEGIN POPUP "&File" BEGIN MENUITEM "&Load File...", ID_FILE_LOAD MENUITEM SEPARATOR MENUITEM "&Info...", ID_FILE_INFO END POPUP "&Options" BEGIN MENUITEM "&Colors...", ID_OPTIONS_COLORS MENUITEM "&About...", ID_FILE_ABOUT END MENUITEM "&Top-Level", ID_TOP_LEVEL END
So, I want to have the ID_TOP_LEVEL command on the menubar without any "parent menu" item. This code complies fine, but when I run it on my Toshiba, the menuitem doesn't even show up (ie: not displayed). I just see the "File" and "Options" menuitems. The only command I can see that solves my problem is this funky "shared new" menuitem. however I can't find the documentation on how to handle it (messages, etc). I've looked through almost every .rc file for all the samples here on CP, and it seems like I'm the only person out there who wants a top-level, non-pop-up menuitem. I'm use eVC++, MFC, and a dialog-based app. If anyone has any ideas, please help me out. TIA Violence is the last refuge of the incompetent [Salvor Hardin]Due to the very nature of how menu items are inserted in the command bar, you cannot do that using straight MFC. First, read this: Disabling top-level popup menus in the PocketPC 2002[^] Now, read this: QA: How do I get the command bar menu handle?[^] By now, you should be sick of my articles and wondering how did they helped you getting near to your goal. It's simple: you have to fake the menu yourself. For some guidance, look in wcebar.cpp (MFC sources) on line 631. It's all there!
-
Due to the very nature of how menu items are inserted in the command bar, you cannot do that using straight MFC. First, read this: Disabling top-level popup menus in the PocketPC 2002[^] Now, read this: QA: How do I get the command bar menu handle?[^] By now, you should be sick of my articles and wondering how did they helped you getting near to your goal. It's simple: you have to fake the menu yourself. For some guidance, look in wcebar.cpp (MFC sources) on line 631. It's all there!
João Paulo Figueira wrote: you should be sick of my articles Never! You're "The One" when it comes to working on PocketPC code, especially the article on multi-toolbars. :rose: João Paulo Figueira wrote: It's all there! Well, a few sleepless nights later (been working on this for a while), I've accomplished nothing. Oh well, maybe it's time to redesign my dialog-app to just use a toolbar (bitmap) button instead of a menu (string) item. :(( Or maybe I should get back to doing my schoolwork instead. :-D Do you know if it's possible to have a text-only toolbar? ie: load a bitmap toolbar with a single button, then somehow change it from a bitmap to a string? Thanks! You rule! :-D I prefer to wear gloves when using it, but that's merely a matter of personal hygiene [Roger Wright on VB] Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. [Rich Cook]
-
João Paulo Figueira wrote: you should be sick of my articles Never! You're "The One" when it comes to working on PocketPC code, especially the article on multi-toolbars. :rose: João Paulo Figueira wrote: It's all there! Well, a few sleepless nights later (been working on this for a while), I've accomplished nothing. Oh well, maybe it's time to redesign my dialog-app to just use a toolbar (bitmap) button instead of a menu (string) item. :(( Or maybe I should get back to doing my schoolwork instead. :-D Do you know if it's possible to have a text-only toolbar? ie: load a bitmap toolbar with a single button, then somehow change it from a bitmap to a string? Thanks! You rule! :-D I prefer to wear gloves when using it, but that's merely a matter of personal hygiene [Roger Wright on VB] Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. [Rich Cook]
:-O Well, I was not fishing for compliments but, anyway, thanks! Atlantys wrote: Do you know if it's possible to have a text-only toolbar? Yes, you can do that. If you look into eVC's help file, go to 'Microsoft Windows CE / User Interface Services / Creating Controls / Working with Common Controls'. Read the entries on 'Creating a Command Bar' and 'Creating a ToolBar'. You will see that these controls may accept bitmaps, text, or both. Atlantys wrote: load a bitmap toolbar with a single button, then somehow change it from a bitmap to a string? I think that you may be able to this using the
TBSTYLE_LIST
.