|
i don't like the default icons, how to use 16bit (or higher) bitmap to replace them ?
in addition , the menu icons and toolbar icons are relative, how can i separate them ?
|
|
|
|
|
in CMenuItem::Draw funtion inside this condition
if(m_ImgDesc.m_hImgList != NULL && m_ImgDesc.m_nIndex != -1)
...
instead of these functions ImageList_ExtractIcon or ImageList_Draw , write your own function for that id so that you can return Image to load.
regards
Rajesha M Adiga
rajadiga@hotmail.com
|
|
|
|
|
See the Demo(DLG),it useful for MDI too!
m_imgList.Create (IDB_BITMAP1, 16, 0, RGB(192,192,192));
CMenuXP::SetMenuItemImage (ID_APP_ABOUT, m_imgList, 0);
CMenuXP::SetMenuItemImage (ID_FILE_ITEM1, m_imgList, 1);
CMenuXP::SetMenuItemImage (ID_FILE_ITEM2, m_imgList, 2);
CMenuXP::SetMenuItemImage (ID_FILE_ITEM3, m_imgList, 3);
|
|
|
|
|
Hi,
I downloaded the demo and tried to replace the toolbar bitmaps in the demo (\MDI\res\Toolbar.bmp) by bitmaps with 24-bit color. However, these bitmaps do not show correctly after rebuild.
Are 24-bit images supported in CMenuXP? If so, what do I need to do to make them show appropriately?
Thanks,
Connie
|
|
|
|
|
How about one for CDateTimeCtrl?
|
|
|
|
|
How to add by position ? SetMenuItemImage requires nID..
|
|
|
|
|
System menu is wrong drawd and if click at Taskbar (rightklick) I get a ASSERT error when debuging
is there a fix or it's about the cahnages made from the other guy (forgot the name) ??
THX for help.
|
|
|
|
|
Hi All
I have 32 bit, icons on the toolbar.... when I use the CMenuXP in my project... it uses the icons form the toolbar, that r shown next to the menu items...that looks odd...
I dont want the icons in the menu... how do i remove the icons from the menu, retaining.. everything else.... except the icons....
Thanks...
|
|
|
|
|
I have the same problem, anyone can help?
thanks~~
|
|
|
|
|
Hi, I had the same problem and now solved it as follows:
Before drawing the icon, add a call to ImageList_GetIconSize and get the icon size in CMenuXP::Draw . Then do not draw the icon if width is more than 16 Pixels:
Old source code part:
...
if ( m_ImgDesc.m_hImgList != NULL && m_ImgDesc.m_nIndex != -1 )
{
bool bOver = !GetDisabled() && bSelected;
if ( GetDisabled() || (bSelected && !GetChecked()) )
{
...
}
if ( !GetDisabled() )
{
::ImageList_Draw (m_ImgDesc.m_hImgList, m_ImgDesc.m_nIndex, pDC->m_hDC,
...
}
}
Solution:
if ( m_ImgDesc.m_hImgList != NULL && m_ImgDesc.m_nIndex != -1 )
{
bool bOver = !GetDisabled() && bSelected;
int cx, cy;
if (ImageList_GetIconSize( m_ImgDesc.m_hImgList, &cx, &cy))
{
if (cx <= 16)
{
if ( GetDisabled() || (bSelected && !GetChecked()) )
{
...
}
if ( !GetDisabled() )
{
::ImageList_Draw (m_ImgDesc.m_hImgList, m_ImgDesc.m_nIndex, pDC->m_hDC,
...
}
}
}
}
Gabriele
|
|
|
|
|
Hi, I had the same problem and now solved the problem:
Before drawing the icon, add a call to get the icon size in CMenuXP::Draw and do not draw the icon if size is more than 16:
Old:
...
if ( m_ImgDesc.m_hImgList != NULL && m_ImgDesc.m_nIndex != -1 )
{
bool bOver = !GetDisabled() && bSelected;
if ( GetDisabled() || (bSelected && !GetChecked()) )
{
...
}
if ( !GetDisabled() )
{
::ImageList_Draw (m_ImgDesc.m_hImgList, m_ImgDesc.m_nIndex, pDC->m_hDC,
...
}
}
Solution:
if ( m_ImgDesc.m_hImgList != NULL && m_ImgDesc.m_nIndex != -1 )
{
bool bOver = !GetDisabled() && bSelected;
int cx, cy;
if (ImageList_GetIconSize( m_ImgDesc.m_hImgList, &cx, &cy))
{
if (cx <= 16)
{
if ( GetDisabled() || (bSelected && !GetChecked()) )
{
...
}
if ( !GetDisabled() )
{
::ImageList_Draw (m_ImgDesc.m_hImgList, m_ImgDesc.m_nIndex, pDC->m_hDC,
...
}
}
}
}
Gabriele
|
|
|
|
|
Thank you very much ! The work is great.
But when i used the CMenuXP class in my dialog-based application which also used a custom CListBoxST, it did not run correctly. The menu is perfect but the listbox can not catch the WM_MEASUREITEM message, so it can not re-measure items' height.
Anyone can help me !
|
|
|
|
|
I just ran into this recently myself (that's why my owner draw controls were not working right! ) In MenuXP.h, change the implementation of theClass::OnMeasureItem() to
<br />
void theClass::OnMeasureItem (int nCtlId, LPMEASUREITEMSTRUCT lpMeasureItemStruct) \<br />
{ \<br />
if (lpMeasureItemStruct->CtlType == ODT_MENU) \<br />
CMenuXP::OnMeasureItem (lpMeasureItemStruct); \<br />
else \<br />
baseClass::OnMeasureItem(nCtlId, lpMeasureItemStruct); \<br />
}<br /> \
That should fix things for WM_MEASUREITEM. WM_DRAWITEM should do something similar, but CMenuXP::OnDrawItem() returns a BOOL and I have other fixes to CMenuXP::OnDrawItem() using the return value to make sure default processing for WM_DRAWITEM is called when necessary (see one of my previous posts).
-Frank
|
|
|
|
|
How do you stop the menubar from flickering when the windows frame is resized?
|
|
|
|
|
just like win2000 start-menu
and then it will be perfect *_*
hi,every one
|
|
|
|
|
Have you had some preview with Longhorn up to now?
I've checked my soft (including your CMenuXP) and I have some problems with the menu bar height and width. The menu bar height is only about 7 pixels and menu items are not readable, because the width of each menu bar items is shrinked, too.
Some good news: The menu itself works under LH.
|
|
|
|
|
Hye,
If the menu is popup, it does not clear background effect.. means any items hovering where it is a popup menu, we get a new menu opened, but after hiding that menu, background effect does not get cleared, if you want to test, do following,
Make a menu item menu1 and make it popup menu, and add a new menu Menu11, Menu12, Menu13 to that... After hovering on Menu1, you will get a new menu on the right side, after some time, you take your mouse over some other menu item, that right side menu will hide itself but it would not clear background effect (on shadow part) which seems to be bad.. How to solve this...
Jigar Mehta
(jigarmehta@gatescorp.com)
Software Developer
Gates Information Systems
India
|
|
|
|
|
Hi,
First of all, I'd like to thank Jean-Michel for the code. Great, clean work.
I'm developing on Windows 2000 sp4, using Visual C++ 7.1.
I'm using the menu as a popup context menu inside an activex control.
The problem is that menu items I've disabled or grayed either in the resource editor or at runtime appear enabled and can be clicked upon (sending the command message).
Is this a bug, something I'm doing wrong, or a missing feature?
Thanks
|
|
|
|
|
Change CMenuItem::GetDisabled () from
<--------------
bool CMenuItem::GetDisabled () const
{
ASSERT(m_miInfo.fMask & MIIM_STATE);
return (m_miInfo.fState & MFS_GRAYED) == MFS_GRAYED;
}
---------->
to this one
<--------------
bool CMenuItem::GetDisabled () const
{
ASSERT(m_miInfo.fMask & MIIM_STATE);
return (m_miInfo.fState & MFS_GRAYED) != 0;
}
|
|
|
|
|
Thank you very much!!!
@Jean-Michel LE FOL:
THIS IS PROBABLY A BUG! CAN FIX IT FOR THE FUTURE!
Alex
|
|
|
|
|
I thought I had asked this question before but I never saw an answer and I don't see the question listed, so I'll ask again...
Can someone explain how CMenuXP::OnMeasureItem works? Where does the height come from? What exactly is this:
LOBYTE(LOWORD(pMeasureItemStruct->itemData))
Any help is greatly appreciated.
-Frank
|
|
|
|
|
Nice code! One thing I wasn't happy with was the fact that, when you right click on the mdi's tab on the bottom shelf, (I mean the horizontal bar right at the bottom of the screen in windows) the context menu that pops up looks wrong. It uses the same drawing style as the programs menu items.
Thanks, this is great!
Mick
|
|
|
|
|
There is a problem on the demo's system menu .
How can I modify?
|
|
|
|
|
Hye,
I have downloaded the updated files that draws gradient on the menu and want to apply some images 16*16.. But it can not be applied what may be the problem???
Jigar Mehta
(jigarmehta@gatescorp.com)
Software Developer
Gates Information Systems
|
|
|
|
|
Yes,
The problem solved, Actually the problem I made was I took Imagelist member a local member of the class and not the class's member variable.. When I took it as class's member variable, it worked fine...
Jigar Mehta
(jigarmehta@gatescorp.com)
Software Developer
Gates Information Systems
India
|
|
|
|