 |
|
 |
have created an owner drawn menu item and done required drawing in the
DrawItem function. The drawing code works as I expected bu the problems is a
box appearing outside the menu. how can I remove it? please see the following
pictured to see the output.
http://static.flickr.com/98/248788817_5aca6ca4f1_o.jpg[^]
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
 |
|
 |
Hi,
I set xp_draw_3D_bitmaps=FALSE and xp_drawmode=BCMENU_DRAWMODE_ORIGINAL in BCMenu.cpp . then the backcolor of menu is gray.
ButI set xp_draw_3D_bitmaps=FALSE and xp_drawmode=BCMENU_DRAWMODE_ORIGINAL in BCMenu.cpp of your MDI example ,the backcolor of menu is white.
why the backcolor of menu is different while same set?
how to set backcolor of menu to white. could you help me?
my application is under vc++6.0 + windows xp
Any help will definitely be apprecicated.
|
|
|
|
 |
|
 |
I've resolve this question.
you may change backcolor of menu in BCMenu::DrawItem_Win9xNT2000() or BCMenu::DrawItem_WinXP() function.change the value of m_clrBack variable to change the backcolor of menu.
I'm thankful to the author for supporting us a such good class.
|
|
|
|
 |
|
 |
Hi.
I have some problem in VC++ 2005.
When i use this command, the return value is true:
UNIT rt = menu->GetMenuItemCount();
But when i use these functions(here is some examples):
GetMenuText(pos, tmp, MF_BYPOSITION); //error: Unhandled exception at 0x004788f3 in App.exe: 0xC0000005: Access violation reading location 0xcdcdcdcd. At "string=m_MenuList[id]->GetString();" in your code
GetMenuItemID(pos); // value of this function always is "-1"
GetMenuString(pos, tmp, MF_BYPOSITION);//this function always L""
Why? I am wrong in use params or the library can not work in VC++ 2005?
Please help me.
|
|
|
|
 |
|
 |
Hi,
i think there are 2 possible problems:
- you wrote:
UNIT rt = menu->GetMenuItemCount();
GetMenuText(pos, tmp, MF_BYPOSITION);
GetMenuItemID(pos);
GetMenuString(pos, tmp, MF_BYPOSITION);
but the correct code probably is
UNIT rt = menu->GetMenuItemCount();
menu->GetMenuText(pos, tmp, MF_BYPOSITION);
menu->GetMenuItemID(pos);
menu->GetMenuString(pos, tmp, MF_BYPOSITION);
- probably the 'pos' variable is more bigger than total menu count.
Sorry for my english, but i'm italian.
bye
GianGian (Marco)
-- modified at 4:13 Thursday 29th June, 2006
|
|
|
|
 |
|
 |
I tried using truecolor bitmap. but it is not show image on menu.
Please anwser to me....
Go for it!!
|
|
|
|
 |
|
 |
Hi dalgoo,
for use a truecolor bitmap in the menu is needed to replace all 'ILC_COLORDDB' with 'ILC_COLOR32' in the image list creation.
Sorry if my english is not perfect, but i'm Italian.
bye, ciao
|
|
|
|
 |
|
 |
The trick to true color images is how you create the image list you load. At first it seemed obvious that you would do the following:
m_TrayImages.Create (IDB_TRAY_IMAGES, 16, ILC_COLOR24|ILC_MASK, RGB(255,0,255));
However, this method loads the bitmap using the half-tone palette which reeks havoc on the colors! The solution is to create the imagelist first then add the bitmap:
m_TrayImages.Create (16, 16, ILC_COLOR24|ILC_MASK, 0,0);
CBitmap bmp;
bmp.LoadBitmap(IDB_TRAY_IMAGES);
COLORREF rgbTransparentColor = RGB(255,0,255);
m_TrayImages.Add(&bmp, rgbTransparentColor);
That is it!
|
|
|
|
 |
|
 |
Is there a way to modify the code so that the tops of the menus such as the File, Edit, and Tools menus (for example) to display like the XP sytle?
|
|
|
|
 |
|
 |
Is it possible to set my own disabled image for menu item, like SetDisabledImageList in CToolBarCtrl
|
|
|
|
 |
|
 |
Just checked version 3.03
Looks like its already has what i need (color disable images)
|
|
|
|
 |
|
 |
I currently use the BCMenu system and it shows my 16 x 16 toolbar images against the relevant menu items.
A user has provided me with some 32 x 32 images (256 colours) that he would like me to consider using for my toolbar. I am happy to try but have concerns about what will happen to my menu items.
Has anyone done this kind of thing before?
Please clarify.
Andrew
|
|
|
|
 |
|
 |
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 !!!!
|
|
|
|
 |