00001 #if !defined(AFX_TITLEMENU_H__E69DD9C2_0FDA_11D6_9385_0060086FAC36__INCLUDED_)
00002 #define AFX_TITLEMENU_H__E69DD9C2_0FDA_11D6_9385_0060086FAC36__INCLUDED_
00003
00004 #include "myString.h"
00005
00006 #if _MSC_VER > 1000
00007 #pragma once
00008 #endif // _MSC_VER > 1000
00009
00014 #include "windows.h"
00015
00046 class CMyMenu
00047 {
00048 typedef UINT (CALLBACK* LPFNDLLFUNC1)(HDC,CONST PTRIVERTEX,DWORD,CONST PVOID,DWORD,DWORD);
00049
00050
00051 protected:
00052 HFONT m_hFont;
00053 HMENU m_hMenu;
00054 MyString m_title;
00055
00056 LPFNDLLFUNC1 dllfunc_GradientFill;
00057 HINSTANCE hinst_msimg32;
00058 long clRight;
00059 long clLeft;
00060 long clText;
00061 bool bDrawEdge;
00062 UINT flag_edge;
00063
00064 protected:
00065 bool m_bCanDoGradientFill;
00066 HFONT CreatePopupMenuTitleFont();
00067 BOOL GradientFill( HDC hdc,
00068 CONST PTRIVERTEX pVertex,
00069 DWORD dwNumVertex,
00070 CONST PVOID pMesh,
00071 DWORD dwNumMesh,
00072 DWORD dwMode);
00073
00074
00075
00076
00077 public:
00078 CMyMenu();
00079
00080 void AddTitle(char *title);
00081 void operator= (HMENU hMenu) { m_hMenu = hMenu; };
00082
00083 void SetColor(long cl) {clLeft=cl;};
00084 void SetGradientColor(long cl) {clRight=cl;};
00085 void SetTextColor(long cl) {clText=cl;};
00086
00087 void SetEdge(bool shown,UINT remove=0,UINT add=0) {bDrawEdge=shown; (flag_edge^=remove)|=add;};
00088
00089 long GetColor() {return clLeft;};
00090 long GetGradientColor() {return clRight;};
00091 long GetTextColor() {return clText;};
00092 long GetEdge() {return flag_edge;};
00093
00094 virtual ~CMyMenu();
00095 virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMIS);
00096 virtual void DrawItem(LPDRAWITEMSTRUCT lpDIS);
00097
00098 private:
00099 };
00100
00102
00103
00104
00105
00106 #endif // !defined(AFX_TITLEMENU_H__E69DD9C2_0FDA_11D6_9385_0060086FAC36__INCLUDED_)
00107