|
i tried to make manu bar transparent
failed!
|
|
|
|
|
Hi,
to fix the strange/broken look of the system menu, just add the following lines in CMenuXP::SetXPLookNFeel :
...
<br />
if ( pWnd->IsKindOf (RUNTIME_CLASS(CMDIFrameWnd)) )<br />
{<br />
CMDIChildWnd* pActiveChild = ((CMDIFrameWnd*)pWnd)->MDIGetActive();<br />
<br />
if ( pActiveChild != NULL && pActiveChild->GetSystemMenu (false)->GetSafeHmenu() == hMenu )<br />
{<br />
CMenuItemXP::ms_rcMRUMenuBarItem.SetRectEmpty();<br />
return;<br />
}<br />
if ( AfxGetMainWnd() != NULL && AfxGetMainWnd()->GetSystemMenu(false)->GetSafeHmenu() == hMenu )<br />
{<br />
CMenuItemXP::ms_rcMRUMenuBarItem.SetRectEmpty();<br />
return;<br />
}<br />
}<br />
...
greets
Ingo
|
|
|
|
|
...
}<br />
<br />
if( pWnd->IsKindOf (RUNTIME_CLASS(CMDIChildWnd)) )<br />
{<br />
if( pWnd->GetSystemMenu(false)->GetSafeHmenu() == hMenu )<br />
{<br />
CMenuItem::ms_rcMRUMenuBarItem.SetRectEmpty();<br />
return;<br />
}<br />
} ...
It is perfect in this.;)
|
|
|
|
|
|
To Fix the system Menu, I used this techinique - hope it will be simple in the function CMenuXP::SetXPLookNFeel
added this code
HMENU sysmenu=GetSystemMenu(pWnd->m_hWnd,FALSE);
if(sysmenu == hMenu)
return ;
rajadiga@hotmail.com
|
|
|
|
|
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
|
|
|
|