 |
|
 |
I could not make a menu item MF_GRAYED
In dialog mode ,
I use BCMENU as main and single menu ,
It run OK,
but ,
I could not make a menu item grayed while CMenu will do.
I add code as below in InitDialog function
m_menu.LoadMenu(IDR_MYMENU);
m_menu.EnableMenuItem(ID_VLINK_CLOSE,MF_GRAYED);
......
it won't work, why?
or I should change it in other function?
Hello,
pleasure to meet you.
|
|
|
|
 |
|
 |
And I test these code in your example,
edit menu ID as your menu ID,
and tried a submenu mode ,
it still can not work! just as nothing happened?
Hello,
pleasure to meet you.
|
|
|
|
 |
|
 |
I've discover that if I remove the 'ON_COMMAND( ..., ... )' for an menu item, this one will appear disabled, and then do not send any message when clicked etc..
Is there a way to not getting in charge of adding such command in message map ? I explain myself, I buid dynamicly my menu and so i can't add the ON_COMMAND. I resolve this by using ON_COMMAND_EX_RANGE but I dislike that...
I'm pretty new to MFC...
Sorry if this question appear dumb... but ...
Tx,
|
|
|
|
 |
|
 |
I created BCMenu instance with several popup items in main menu and noticed that items with submenu has not the same size as other menu items.
See example screenshoot
How to fix this problem?
Sincerely Yours,
RadioShark
|
|
|
|
 |
|
|
 |
|
 |
HI friends,
Its a nice class to make our menus XP Style.I am facing an issue that hotkeys are not working when i use BCMenu as POP Up menu although they are working normally when when i dont use them as context menu..here is sample code
BCMenu aMenu;
CPoint pt(X,Y);
ClientToScreen(&pt);
switch(itemType)
{
case -1:
{
if(m_tree.CountChildren(root) == 0 && m_nAutoPopulate_Type == 2)
{
aMenu.LoadMenu(IDR_MENU_SITE_ROOT2);
aMenu.GetSubMenu(0)->TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON,pt.x+25,pt.y,this);
}
}
|
|
|
|
 |
|
 |
In the call to TrackPopupMenu replace the this pointer by a pointer to your CMainFrame ( you can get it with AfxGetMainWnd()).
|
|
|
|
 |
|
 |
hi friend.
I got the solution after one month when i posted this thread. Actually in the instruction it was clearly mention to override 3 functions in mainframe.
CMainFrame::OnMeasureItem()
CMainFrame::OnMenuChar()
CMainFrame::OnInitMenuPopup()
My problem was that i was using menu in other classes despite mainframe(altough they were part of my project) and i was not overriding these function in my classes. So the solution was to override these function in that particulare class where u want to work with BCMenu.
That mean if i used these function in one of my class CSiteTree then need to override these functions again in that particular class.
CSiteTree::OnMeasureItem()
CSiteTree::OnMenuChar()
CSiteTree::OnInitMenuPopup()
thanks for replying
ravinder
|
|
|
|
 |
|
 |
Is it possible to insert a control, like an edit box, in a popup menu item?
|
|
|
|
 |
|
 |
Now, i am programing my program with BCMenu class.
this program should be made in each language type. and then i have used SetMenuText function for changing menu string.
but i couldn't change upper menu string.
> some code
m_menu.SetMenuText(0,"FILE(&F)"); <-- it didn't change
m_menu.SetMenuText(ID_PHONE_CONNECT,"CONNECT", MF_BYCOMMAND); <-- it changed.
How can change upper menu string ?
please help me.. ..
|
|
|
|
 |
|
 |
I'm having some problems using BCMenu.
m_bcMainMenu.CreatePopupMenu();
m_bcMainMenu.SetMenuDrawMode( BCMENU_DRAWMODE_XP );
m_bcContextMenu = m_bcMainMenu.AppendODPopupMenu( "Popup menu item" );
m_bcContextMenu->SetMenuDrawMode( BCMENU_DRAWMODE_XP );
doing this the string "Popup menu item" doen's appear, it looks like the measure item function doesn't get called.
thanks for all your help
Jose Valente
|
|
|
|
 |
|
 |
nevermind, it looks like an limitation of the CMenu class.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q143209
|
|
|
|
 |
|
 |
wchar_t * can't change to cstring !!!!
|
|
|
|
 |
|
 |
Hi,
I had the same problem, but it was quite simple.
See please: http://www.codeproject.com/buttonctrl/cbuttonst.asp?df=100&forumid=111&select=1114945#xx1114945xx
@Brent Corkum:
This may be a "bug" (in VS 2003 .NET)?!?!
|
|
|
|
 |
|
|
 |
|
 |
How can I change the font of these menu items ?
Help me, please.
Nguyen
|
|
|
|
 |
|
 |
I also want to know, if there is any solution to change font of menu.
Ana
|
|
|
|
 |
|
 |
Hi guys,
i have the following problem - i am using BCMenu in an MDI aplication but when there is a document open menu icons are not visualised. I tracked the problem to the fact that CMainFrame::OnInitMenuPopup is recieving a CTempMenu instead of BCMenu object.
Does anyone had the same problem and what can be done to correct this?
Thanks in advance.
|
|
|
|
 |
|
 |
Hi,
exactly same problem. Have you found a workaround?
Please tell me
|
|
|
|
 |
|
 |
Only can use AppendMenu or InsertMenu to add information to items, but you can never retrieve the information from items.
I need use BCMenu to display a context menu, I tried to get items from main menu and combine them, but failed to do this.
|
|
|
|
 |
|
 |
This class uses CMenu as base class, so all functions remain
|
|
|
|
 |
|
 |
How to set menu to CWnd but not CFrameWnd or CDialog ?
|
|
|
|
 |
|
 |
I am confused about how to get a SubBCMenu. To get a CMenu, you can use the functions:
CMenu* GetSubMenu (int nPos);
However, you cannot do the same for BCMenu:
BCMenu* GetSubBCMenu(char* lpszSubMenuName);
So, why is there no way to get a sub menu by index as well? Having a dependency on the text of the menu seems not like a good design idea.
I need to dynamically change the text of submenus, and if I get a CMenu and change the text, it looks ugly. So I have to use the BCMenu function, but I'm unable to get the BCMenu because of lack of an easy functions to use.
How do you guys do it?
|
|
|
|
 |
|
 |
You can get BCMenu* by:
BCMenu* pSub = (BCMenu*)popMenu.GetSubMenu(0);
and set pSub again.
|
|
|
|
 |
|
 |
Hello,
when I use the XP style menu mode, the main menu item like "File" and "View" will be displayed
without marking the connected shortcut.
When I press the ALT key, the F of FILE will be underlined.
Is there a way to display the connected shorted (with an underline) directly (like
it will be done in the standard menu) ?
Just a little question.
The menu tool is perfect for out application and I´d like to thank the authors
Best regards
Manfred
|
|
|
|
 |