|
upload adialog example with flat menu
the do som thing with the menu about,exit,etc..
i belive in KISS
KEEP IT SIMPLE STUPIT
|
|
|
|
|
How change the system Menu ?
|
|
|
|
|
when i work it on Win2000,and i Create one Popup menu,like this:
void CSwsWnd::OnRButtonDown(UINT nFlags, CPoint point)
{
CPoint pt = point;
ClientToScreen(&pt);
CMenu menu;
VERIFY(menu.LoadMenu(IDR_MENUHTML));
CMenu* pPopup = menu.GetSubMenu(0);
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y,
AfxGetMainWnd());
}
and now i click right button,and rclick,rclick ,i find some shader not lost,
why?
(i use SDI MFC appliction)
thank you!
|
|
|
|
|
CMenuXP::SetXPLookNFeel (this);
|
|
|
|
|
I think you should return
CallWindowProc (oldWndProc, hWnd, uMsg, wParam, lParam);
at:
LRESULT CALLBACK CWndMenuXP::SubClassMenuProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NCPAINT:
but no return 0, so it will not flash(drawn twice)
and if you return oldWndProc, still have problem: other menu will not drawn shadow.
so how to do?
|
|
|
|
|
Did anyone fix this problem (of the dual menu draw under Windows XP)
If I click on a menu item, it indeed draws the menu twice. Once as the immediate draw, and on ce as the drop down draw.
When I have a submenu open and move to other submenus (without clicking) it draws fine (immediate draw)
|
|
|
|
|
Great job but you forgot in your article to add:
<br />
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)<br />
{<br />
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)<br />
return -1;<br />
CMenuXP::SetXPLookNFeel (this);
...<br />
}<br />
Best regards,
Sebastian
Cheers for "Robocik" and helpful people from CodeProject
|
|
|
|
|
I try to test it in dialog based program, but failed.
And there is a thing could be improved: deal "alt" key.
When you pressed 'alt' key in Office XP ,the menu changed like mouse over.
tomPeakz
|
|
|
|
|
Did you declare the macros for your dialog window ?
|
|
|
|
|
Yes,like in the doc-view application. but no use.
tomPeakz
|
|
|
|
|
Good evening,
Take a look down, there you'll find a posting in which I've described the using of CMenuXP in dialog apps.
Happosai
------------------------------------
http://www.happosai.tk
|
|
|
|
|
Hi all..
I placed CMenuXP in my program which works well with the main application menu, but I tried to create a popup menu but it doesn't look well...
This is the code,
void CAtributosProductoDlg::OnRclickAttrib(NMHDR* pNMHDR, LRESULT* pResult)
{
CPoint pt;
GetCursorPos(&pt);
CMenu* pPopup = m_Menu.GetSubMenu(0);
m_Menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, this, NULL);
*pResult = 0;
}
The menu is drawn poorly... how can I solve it?
Thanks in advance
Jaime
|
|
|
|
|
In the following call :
m_Menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, this, NULL); The 4th parameter must be a reference to a window that has the MENUXP macros defined.
In your case, this is the CAtributosProductoDlg dialog window.
Did you declare these macros for the window ?
|
|
|
|
|
Hi!
Thanks a lot for your help.. I placed the macros in the dialog and all is working now
Only one more question... in that case, there isn't an associated toolbar so that the menu won't be able to get which icon to place.. so, in OnInitDialog I wrote:
m_Menu.LoadMenu(IDR_FLOATMASTER);
m_bmpIcono.LoadBitmap(IDB_NEW);
m_Menu.SetMenuItemBitmaps(ID_NEW_REG, MF_BYCOMMAND, &m_bmpIcono, &m_bmpIcono);
CMenuXP::SetXPLookNFeel (this);
Where IDR_FLOATMASTER is the menu and IDB_NEW is the bitmap to place to the left of ID_NEW_REG option. How can I do it in this case?
Thanks for your controls... they are cool!!
Jaime
|
|
|
|
|
any idea of how to make a toolbar in office 2003-stlye?
thanx a lot!!
|
|
|
|
|
When I follow the steps.The error are:
--------------------Configuration: test2 - Win32 Debug--------------------
Compiling...
test2.cpp
Linking...
test2.obj : error LNK2001: unresolved external symbol "public: static void __cdecl CMenuXP::InitializeHook(void)" (?InitializeHook@CMenuXP@@SAXXZ)
test2.obj : error LNK2001: unresolved external symbol "public: static void __cdecl CMenuXP::UninitializeHook(void)" (?UninitializeHook@CMenuXP@@SAXXZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: static void __cdecl CMenuXP::SetXPLookNFeel(class CWnd *,struct HMENU__ *,bool,bool)" (?SetXPLookNFeel@CMenuXP@@SAXPAVCWnd@@PAUHMENU__@@_N2@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: static bool __cdecl CMenuXP::GetXPLookNFeel(class CWnd const *)" (?GetXPLookNFeel@CMenuXP@@SA_NPBVCWnd@@@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: static void __cdecl CMenuXP::OnMeasureItem(struct tagMEASUREITEMSTRUCT *)" (?OnMeasureItem@CMenuXP@@SAXPAUtagMEASUREITEMSTRUCT@@@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: static void __cdecl CMenuXP::OnDrawItem(struct tagDRAWITEMSTRUCT *,struct HWND__ *)" (?OnDrawItem@CMenuXP@@SAXPAUtagDRAWITEMSTRUCT@@PAUHWND__@@@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: static long __cdecl CMenuXP::OnMenuChar(struct HMENU__ *,unsigned int,unsigned int)" (?OnMenuChar@CMenuXP@@SAJPAUHMENU__@@II@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: static bool __cdecl CMenuXP::IsOwnerDrawn(struct HMENU__ *)" (?IsOwnerDrawn@CMenuXP@@SA_NPAUHMENU__@@@Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: static void __cdecl CMenuXP::UpdateMenuBar(class CWnd *)" (?UpdateMenuBar@CMenuXP@@SAXPAVCWnd@@@Z)
Debug/test2.exe : fatal error LNK1120: 9 unresolved externals
Error executing link.exe.
test2.exe - 10 error(s), 0 warning(s)
who can tell me why? thanks.
I want fly.help me.thanks
|
|
|
|
|
Did you add the MenuXP.cpp file into your project ?
|
|
|
|
|
For some reason the CMenuXP::UpdateMenuBar(this) isn't working for
drawing the outline around the menus in my SDI application's menubar.
It doesn't even look like the LoadFrame is ever being called. It never
hit the break point I set there. The rest of the menus look like the
new style.
Nice work BTW on the class. Love it.
|
|
|
|
|
Hi,
What message do I add in order for the macro ON_MENUXP_MESSAGES() to be created in the BEGIN MESSAGE MAP
...END MESSAGE MAP section?
If I add it in manually, the code run, but I can't view the CMainFrm class using ClassWizard.
What am I missing?
|
|
|
|
|
I too faced the same problem.
There is a simple work around. Just enter the ON_MENUXP_MESSAGES()
line after the text
//}}AFX_MSG_MAP
which is generated by the class wizard.
|
|
|
|
|
First of all, excellent job, looks great.
I'm having a problem getting the menu to show Bitmaps that are NOT also found in the toolbar which are picked automatically.
I am dynamically inserting Menu items at runtime using: AppendMenu
How do I now assign Bitmaps for each entry?
Have tried SetMenuItemBitmaps but has not worked, the function returns as successful, but no bitmaps are displayed.
Any help would be greatly appreciated.
Thanks,
John
|
|
|
|
|
My class is not designed to allow that.
I do not envisage to improve it for the moment.
You can try to add code in the painting function to retrieve your bitmap and use it instead of toolbar bitmaps.
|
|
|
|
|
At first, thank you for your effort.
But when I use this program, I have a problem.
I make a owner-drawn menu with DrawItem.
However, this is hooked all message, so that menu is not drawn..
I want some menu of mine to be NOT affected CMenuXP.
How??
Plz help me~
|
|
|
|
|
BOOL CMainFrame::LoadFrame(UINT nIDResource, DWORD dwDefaultStyle, CWnd* pParentWnd, CCreateContext* pContext)
{
if (!CFrameWnd::LoadFrame (nIDResource, dwDefaultStyle, pParentWnd, pContext) )
{
return false;
}
CMenuXP::UpdateMenuBar (this);
return true;
}
My code only work when i add this code on the function, because you only say about "CMenuXP::UpdateMenuBar (this);", and does not work whit this line only.
But it's the greatest and very simple code.... i haven't works to say TY!!!
REALLY KOOL!!!!!!!
|
|
|
|
|
You did a great job! But when I tried in dialog based application, it didn't work. Would you please give some suggestions?
|
|
|
|