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
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include "windows.h"
00038
00039 class CMyMenu
00040 {
00041 typedef UINT (CALLBACK* LPFNDLLFUNC1)(HDC,CONST PTRIVERTEX,DWORD,CONST PVOID,DWORD,DWORD);
00042
00043
00044 protected:
00045 HFONT m_hFont;
00046 HMENU m_hMenu;
00047 MyString m_title;
00048
00049 LPFNDLLFUNC1 dllfunc_GradientFill;
00050 HINSTANCE hinst_msimg32;
00051 long clRight;
00052 long clLeft;
00053 long clText;
00054 bool bDrawEdge;
00055 UINT flag_edge;
00056
00057 protected:
00058 bool m_bCanDoGradientFill;
00059 HFONT CreatePopupMenuTitleFont();
00060 BOOL GradientFill( HDC hdc,
00061 CONST PTRIVERTEX pVertex,
00062 DWORD dwNumVertex,
00063 CONST PVOID pMesh,
00064 DWORD dwNumMesh,
00065 DWORD dwMode);
00066
00067
00068
00069
00070 public:
00071 CMyMenu();
00072
00073 void AddTitle(char *title);
00074 void operator= (HMENU hMenu) { m_hMenu = hMenu; };
00075
00076 void SetColor(long cl) {clLeft=cl;};
00077 void SetGradientColor(long cl) {clRight=cl;};
00078 void SetTextColor(long cl) {clText=cl;};
00079
00080 void SetEdge(bool shown,UINT remove=0,UINT add=0) {bDrawEdge=shown; (flag_edge^=remove)|=add;};
00081
00082 long GetColor() {return clLeft;};
00083 long GetGradientColor() {return clRight;};
00084 long GetTextColor() {return clText;};
00085 long GetEdge() {return flag_edge;};
00086
00087 virtual ~CMyMenu();
00088 virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMIS);
00089 virtual void DrawItem(LPDRAWITEMSTRUCT lpDIS);
00090
00091 private:
00092 };
00093
00095
00096
00097
00098
00099 #endif // !defined(AFX_TITLEMENU_H__E69DD9C2_0FDA_11D6_9385_0060086FAC36__INCLUDED_)
00100