⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 advmenus.hpp

📁 Delphi的Office 2007风格界面控件
💻 HPP
📖 第 1 页 / 共 3 页
字号:
	TCustomAdvMenuStyler* FCurrentMenuStyler;
	Byte FOpacity;
	bool FMenuUpdating;
	int FUpdateRef;
	unsigned FOldWndHandle;
	void *FOldWndProcPtr;
	bool FDirectUpdate;
	Controls::TImageList* FDisabledImages;
	TCustomAdvMenuStyler* __fastcall GetMenuStyler(void);
	TCustomAdvMenuStyler* __fastcall GetCurrentMenuStyler(void);
	void __fastcall SetMenuStyler(const TCustomAdvMenuStyler* Value);
	Byte __fastcall GetOpacity(void);
	void __fastcall SetOpacity(const Byte Value);
	AnsiString __fastcall GetVersion();
	void __fastcall SetVersion(const AnsiString Value);
	
protected:
	HIDESBASE int __stdcall _AddRef(void);
	HIDESBASE int __stdcall _Release(void);
	Menus::TMenu* __fastcall GetSelf(void);
	virtual void __fastcall MenuChanged(System::TObject* Sender, Menus::TMenuItem* Source, bool Rebuild);
	virtual void __fastcall Loaded(void);
	virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation);
	void __fastcall AllocMenuStyler(void);
	void __fastcall MenuFontChanged(System::TObject* Sender);
	void __fastcall ActivateMDIChild(System::TObject* Sender);
	__property Byte Opacity = {read=GetOpacity, write=SetOpacity, default=255};
	virtual int __fastcall GetVersionNr(void);
	__property unsigned OldWndHandle = {read=FOldWndHandle, write=FOldWndHandle, nodefault};
	__property void * OldWndProcPtr = {read=FOldWndProcPtr, write=FOldWndProcPtr};
	__property TCustomAdvMenuStyler* CurrentMenuStyler = {read=GetCurrentMenuStyler};
	
public:
	__fastcall virtual TAdvMainMenu(Classes::TComponent* AOwner);
	__fastcall virtual ~TAdvMainMenu(void);
	void __fastcall BeginUpdate(void);
	void __fastcall EndUpdate(void);
	void __fastcall ExpandItemWidth(System::TObject* Sender, Graphics::TCanvas* ACanvas, int &Width, int &Height);
	void __fastcall AdvancedDrawItem(System::TObject* Sender, Graphics::TCanvas* ACanvas, const Types::TRect &ARect, Windows::TOwnerDrawState State);
	__property bool MenuUpdating = {read=FMenuUpdating, nodefault};
	__property bool DirectUpdate = {read=FDirectUpdate, write=FDirectUpdate, nodefault};
	
__published:
	__property Controls::TImageList* DisabledImages = {read=FDisabledImages, write=FDisabledImages};
	__property TCustomAdvMenuStyler* MenuStyler = {read=GetMenuStyler, write=SetMenuStyler};
	__property OwnerDraw  = {default=1};
	__property AnsiString Version = {read=GetVersion, write=SetVersion};
private:
	void *__IAdvMenu;	/* Advmenus::IAdvMenu */
	
public:
	operator IInterface*(void) { return (IInterface*)&__IAdvMenu; }
	operator IAdvMenu*(void) { return (IAdvMenu*)&__IAdvMenu; }
	
};


class DELPHICLASS TAdvPopupMenu;
class PASCALIMPLEMENTATION TAdvPopupMenu : public Menus::TPopupMenu 
{
	typedef Menus::TPopupMenu inherited;
	
private:
	TCustomAdvMenuStyler* FMenuStyler;
	TCustomAdvMenuStyler* FInternalMenuStyler;
	TCustomAdvMenuStyler* FCurrentMenuStyler;
	Byte FOpacity;
	bool FMenuUpdating;
	int FUpdateRef;
	bool FDirectUpdate;
	Controls::TImageList* FDisabledImages;
	TCustomAdvMenuStyler* __fastcall GetMenuStyler(void);
	TCustomAdvMenuStyler* __fastcall GetCurrentMenuStyler(void);
	void __fastcall SetMenuStyler(const TCustomAdvMenuStyler* Value);
	Byte __fastcall GetOpacity(void);
	void __fastcall SetOpacity(const Byte Value);
	void __fastcall AllocMenuStyler(void);
	AnsiString __fastcall GetVersion();
	void __fastcall SetVersion(const AnsiString Value);
	
protected:
	HIDESBASE int __stdcall _AddRef(void);
	HIDESBASE int __stdcall _Release(void);
	virtual void __fastcall Loaded(void);
	virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation);
	Menus::TMenu* __fastcall GetSelf(void);
	virtual void __fastcall MenuChanged(System::TObject* Sender, Menus::TMenuItem* Source, bool Rebuild);
	__property Byte Opacity = {read=GetOpacity, write=SetOpacity, default=255};
	virtual int __fastcall GetVersionNr(void);
	__property TCustomAdvMenuStyler* CurrentMenuStyler = {read=GetCurrentMenuStyler};
	
public:
	__fastcall virtual TAdvPopupMenu(Classes::TComponent* AOwner);
	__fastcall virtual ~TAdvPopupMenu(void);
	void __fastcall ExpandItemWidth(System::TObject* Sender, Graphics::TCanvas* ACanvas, int &Width, int &Height);
	void __fastcall AdvancedDrawItem(System::TObject* Sender, Graphics::TCanvas* ACanvas, const Types::TRect &ARect, Windows::TOwnerDrawState State);
	virtual void __fastcall Popup(int X, int Y)/* overload */;
	HIDESBASE virtual void __fastcall Popup(const Types::TPoint &P)/* overload */;
	void __fastcall PopupAtCursor(void);
	void __fastcall BeginUpdate(void);
	void __fastcall EndUpdate(void);
	__property bool MenuUpdating = {read=FMenuUpdating, nodefault};
	__property bool DirectUpdate = {read=FDirectUpdate, write=FDirectUpdate, nodefault};
	
__published:
	__property Controls::TImageList* DisabledImages = {read=FDisabledImages, write=FDisabledImages};
	__property TCustomAdvMenuStyler* MenuStyler = {read=GetMenuStyler, write=SetMenuStyler};
	__property OwnerDraw  = {default=1};
	__property AnsiString Version = {read=GetVersion, write=SetVersion};
private:
	void *__IAdvMenu;	/* Advmenus::IAdvMenu */
	
public:
	operator IInterface*(void) { return (IInterface*)&__IAdvMenu; }
	operator IAdvMenu*(void) { return (IAdvMenu*)&__IAdvMenu; }
	
};


//-- var, const, procedure ---------------------------------------------------
static const Shortint MAJ_VER = 0x2;
static const Shortint MIN_VER = 0x5;
static const Shortint REL_VER = 0x0;
static const Shortint BLD_VER = 0x0;
extern PACKAGE System::ResourceString _AdvResourceRadioItem;
#define Advmenus_AdvResourceRadioItem System::LoadResourceString(&Advmenus::_AdvResourceRadioItem)
extern PACKAGE System::ResourceString _AdvResourceCheckItem;
#define Advmenus_AdvResourceCheckItem System::LoadResourceString(&Advmenus::_AdvResourceCheckItem)
extern PACKAGE System::ResourceString _AdvResourceSubMenuItem;
#define Advmenus_AdvResourceSubMenuItem System::LoadResourceString(&Advmenus::_AdvResourceSubMenuItem)
extern PACKAGE System::ResourceString _AdvWinKeyString;
#define Advmenus_AdvWinKeyString System::LoadResourceString(&Advmenus::_AdvWinKeyString)
static const Shortint ItemTextOffset = 0x8;
static const Shortint GlyphOffset = 0x6;
static const Shortint MinItemHeight = 0x10;
static const Shortint ItemHeightIncrement = 0x0;
static const Shortint TriangleSize = 0x11;
static const Shortint SystemImageWidth = 0x8;
static const int TriangleColor = 0x0;
static const Byte DefaultOpacity = 0xff;
static const bool DefaultFlat = true;
static const bool DefaultUseSystemFont = true;
static const int DefaultMenuBorderColor = 0x7c7c94;
static const int DefaultColor = 0xd8bdaf;
static const int DefaultColorTo = 0x1fffffff;
#define DefaultGradientDirection (TGradientDirection)(0)
static const bool DefaultBarVisible = false;
#define DefaultBarVisibleIn (TSideBarVisibleIn)(0)
#define DefaultBarSide (TSideBarPosition)(0)
static const Shortint DefaultBarSize = 0x18;
static const int DefaultBarBorder = 0xa19d9d;
static const int DefaultBarSplitterColor = 0x808080;
static const int DefaultBarSplitterColorTo = 0x1fffffff;
static const Shortint DefaultBarSplitterWidth = 0x1;
static const Shortint DefaultBarSplitterMargin = 0x0;
static const Shortint DefaultBarSplitterGradientWidth = 0x0;
#define DefaultBarSplitterGradientType (TGradientType)(2)
static const int DefaultItemColor = 0xfffafd;
static const int DefaultItemColorTo = 0x1fffffff;
#define DefaultItemGradientDirection (TGradientDirection)(0)
static const int DefaultTextColor = 0x80000008;
static const int DefaultRootItemColor = 0xe5d7d7;
static const int DefaultRootItemColorTo = 0xf7f2f2;
#define DefaultRootItemGradientDirection (TGradientDirection)(1)
static const int DefaultRootTextColor = 0x80000008;
static const int DefaultRootSelectedColor = 0xf2e8e8;
static const int DefaultRootSelectedColorTo = 0xcdb8b9;
#define DefaultRootSelectedGradientDirection (TGradientDirection)(0)
static const int DefaultRootSelectedBorder = 0x947c7c;
static const int DefaultRootSelectedTextColor = 0x80000008;
static const int DefaultHoverColor = 0xcff6ff;
static const int DefaultHoverColorTo = 0x9dd8ff;
#define DefaultHoverGradientDirection (TGradientDirection)(0)
static const int DefaultHoverBorder = 0x6f4b4b;
static const int DefaultHoverTextColor = 0x80000008;
static const int DefaultSelectedColor = 0xc2eeff;
static const int DefaultSelectedColorTo = 0x1fffffff;
#define DefaultSelectedGradientDirection (TGradientDirection)(0)
static const int DefaultSelectedBorder = 0x6f4b4b;
static const int DefaultSelectedTextColor = 0x80000008;
static const int DefaultSelectedCheckColor = 0x3e80fe;
static const int DefaultSelectedCheckColorTo = 0x1fffffff;
static const int DefaultSelectedCheckBorder = 0x6f4b4b;
#define DefaultSelectedCheckGradientDirection (TGradientDirection)(0)
static const int DefaultSelectedRadioColor = 0x3e80fe;
static const int DefaultSelectedRadioColorTo = 0x1fffffff;
static const int DefaultSelectedRadioBorder = 0x6f4b4b;
#define DefaultSelectedRadioGradientDirection (TGradientDirection)(0)
static const Shortint DefaultIconBarSize = 0x18;
static const Shortint MinIconBarSize = 0x10;
static const int DefaultIconBarColor = 0xfff9f9;
static const int DefaultIconBarColorTo = 0xbba0a1;
#define DefaultIconBarGradientDirection (TGradientDirection)(1)
static const int DefaultCheckColor = 0x6fc0ff;
static const int DefaultCheckColorTo = 0x1fffffff;
static const int DefaultCheckBorder = 0x6f4b4b;
#define DefaultCheckGradientDirection (TGradientDirection)(0)
static const int DefaultRadioColor = 0x6fc0ff;
static const int DefaultRadioColorTo = 0x1fffffff;
static const int DefaultRadioBorder = 0x6f4b4b;
#define DefaultRadioGradientDirection (TGradientDirection)(0)
static const Shortint DefaultBarCaptionOffsetY = 0x6;
#define DefaultBarCaptionAlignment (Classes::TAlignment)(0)
#define DefaultBarCaptionDirection (TDirection)(0)
static const int DefaultBarCaptionShadowColor = 0x1fffffff;
static const int DefaultBarCaptionHighlightColor = 0x1fffffff;
static const Shortint DefaultBarCaptionDepth = 0x1;
#define DefaultBarBitmapPosition (TBackgroundPosition)(8)
static const bool DefaultBarBitmapTransparent = true;
#define DefaultBarBackBitmapDrawStyle (TDrawStyle)(0)
#define DefaultBarBackBitmapPosition (TBackgroundPosition)(0)
static const bool DefaultBarBackBitmapTransparent = false;
static const Shortint DefaultSeparatorMargin = 0x2;
static const Shortint DefaultSeparatorWidth = 0x1;
static const int DefaultSeparatorColor = 0x8f6d6e;
static const int DefaultSeparatorColorTo = 0x1fffffff;
#define DefaultSeparatorGradientDirection (TGradientDirection)(1)
#define DefaultSeparatorGradientType (TGradientType)(2)
static const Shortint DefaultSeparatorGradientWidth = 0x0;
extern PACKAGE void __fastcall MeasureItem(Menus::TMenuItem* MenuItem, Graphics::TCanvas* ACanvas, int &Width, int &Height, bool SideBarVisible = false);
extern PACKAGE void __fastcall DrawMenuItemBackground(Menus::TMenuItem* MenuItem, Graphics::TCanvas* ACanvas, const Types::TRect &ARect, Windows::TOwnerDrawState State, bool SideBarVisible = false);
extern PACKAGE void __fastcall DrawMenuItemText(Menus::TMenuItem* MenuItem, Graphics::TCanvas* ACanvas, const AnsiString ACaption, Types::TRect &Rect, Windows::TOwnerDrawState State, int Flags);
extern PACKAGE void __fastcall DrawMenuItem(_di_IAdvMenu AdvMenu, Menus::TMenuItem* MenuItem, Graphics::TCanvas* ACanvas, const Types::TRect &ARect, Windows::TOwnerDrawState State);
extern PACKAGE void __fastcall DrawMenuItemEx(_di_IAdvMenu AdvMenu, Menus::TMenuItem* MenuItem, Graphics::TCanvas* ACanvas, const Types::TRect &ARect, Windows::TOwnerDrawState State);
extern PACKAGE void __fastcall DrawLineItem(_di_IAdvMenu AdvMenu, Menus::TMenuItem* MenuItem, Graphics::TCanvas* ACanvas, const Types::TRect &ARect, Windows::TOwnerDrawState State);
extern PACKAGE void __fastcall DrawFadeLine(Graphics::TCanvas* ACanvas, const Types::TRect &AClipRect, const Types::TRect &ALineRect, Graphics::TColor AColor, int AGradientWidth, bool AClip);
extern PACKAGE void __fastcall DrawBarCaption(_di_IAdvMenu AdvMenu, Graphics::TCanvas* ACanvas, const Types::TRect &AClipRect);
extern PACKAGE void __fastcall DrawGradient(Graphics::TBitmap* ABitmap, Graphics::TCanvas* ACanvas, const Types::TRect &ARect, Graphics::TColor ColorFrom, Graphics::TColor ColorTo, TGradientDirection Direction);
extern PACKAGE void __fastcall DrawGradientClipped(Graphics::TBitmap* ABitmap, Graphics::TCanvas* ACanvas, const Types::TRect &ARect, const Types::TRect &AClipRect, Graphics::TColor ColorFrom, Graphics::TColor ColorTo, TGradientDirection Direction);
extern PACKAGE void __fastcall DrawFramedGradient(Graphics::TBitmap* ABitmap, Graphics::TCanvas* ACanvas, const Types::TRect &ARect, Graphics::TColor ColorFrom, Graphics::TColor ColorTo, TGradientDirection Direction, Graphics::TColor BorderColor, bool Fill = true);
extern PACKAGE void __fastcall DrawFramedVistaGradient(Graphics::TBitmap* ABitmap, Graphics::TCanvas* ACanvas, const Types::TRect &ARect, Graphics::TColor ColorFrom, Graphics::TColor ColorTo, Graphics::TColor ColorMirrorFrom, Graphics::TColor ColorMirrorTo, TGradientDirection Direction, Graphics::TColor BorderColor, bool Fill = true);
extern PACKAGE void __fastcall DrawGradientEx(Graphics::TBitmap* ABitmap, Graphics::TCanvas* ACanvas, const Types::TRect &ARect, Graphics::TColor ColorFrom, Graphics::TColor ColorTo, TGradientDirection Direction, TGradientType GradientType, int GradientWidth, int Margin);
extern PACKAGE void __fastcall DrawBarBorder(_di_IAdvMenu AdvMenu, Graphics::TCanvas* ACanvas, const Types::TRect &ARect);
extern PACKAGE void __fastcall DrawBarSplitter(_di_IAdvMenu AdvMenu, Graphics::TCanvas* ACanvas, const Types::TRect &ARect);
extern PACKAGE void __fastcall DrawImage(Graphics::TCanvas* ACanvas, const Types::TRect &ARect, TBackground* AImage, bool BackGradient = true);
extern PACKAGE Menus::TMenu* __fastcall GetParentMenuEx(Menus::TMenuItem* MenuItem);
extern PACKAGE void __fastcall SetMenuItemEvents(Menus::TMenu* Menu, Menus::TMenuItem* MenuItem, Menus::TMenuMeasureItemEvent ExpandItemWidth, Menus::TAdvancedMenuDrawItemEvent AdvancedDrawItem, bool Recursive, bool AllowOwnerDrawn = true);
extern PACKAGE void __fastcall SetMenuOpacity(Menus::TMenuItem* MenuItem, Graphics::TCanvas* Canvas)/* overload */;
extern PACKAGE void __fastcall SetMenuOpacity(_di_IAdvMenu AdvMenu, const unsigned WindowHandle, const Byte Opacity)/* overload */;
extern PACKAGE void __fastcall DrawMenuWindowBorder(Menus::TMenuItem* MenuItem, Graphics::TCanvas* Canvas)/* overload */;
extern PACKAGE void __fastcall RefreshMenu(_di_IAdvMenu AdvMenu, const bool BarChanged, const bool WidthChanged);
extern PACKAGE Menus::TMenuItem* __fastcall FirstVisibleItem(Menus::TMenuItem* MenuItem);
extern PACKAGE Menus::TMenuItem* __fastcall LastVisibleItem(Menus::TMenuItem* MenuItem);
extern PACKAGE int __fastcall VisibleMenuIndex(Menus::TMenuItem* MenuItem);
extern PACKAGE bool __fastcall IsInFirstVisibleMenu(Menus::TMenuItem* MenuItem);
extern PACKAGE bool __fastcall IsInTopMenu(Menus::TMenuItem* MenuItem);
extern PACKAGE bool __fastcall IsInFirstLevelMenu(Menus::TMenuItem* MenuItem);
extern PACKAGE int __fastcall GetMenuItemLevel(Menus::TMenuItem* MenuItem);
extern PACKAGE bool __fastcall IsSideBarVisible(Menus::TMenuItem* MenuItem);
extern PACKAGE bool __fastcall IsInTopPopupMenu(Menus::TMenuItem* MenuItem);
extern PACKAGE bool __fastcall IsFirstSubMenuItem(Menus::TMenuItem* MenuItem);
extern PACKAGE bool __fastcall IsInTopMainMenu(Menus::TMenuItem* MenuItem);
extern PACKAGE bool __fastcall IsAfterMenuBreak(Menus::TMenuItem* MenuItem);
extern PACKAGE bool __fastcall IsRightAligned(Menus::TMenuItem* MenuItem, unsigned MenuWnd);
extern PACKAGE bool __fastcall IsRightmost(Menus::TMenuItem* MenuItem);
extern PACKAGE _di_IAdvMenu __fastcall GetAdvMenuIntf(Menus::TMenu* AMenu);
extern PACKAGE _di_IAdvMenu __fastcall GetMenuItemIntf(Menus::TMenuItem* AMenuItem);
extern PACKAGE AnsiString __fastcall AdvShortCutToText(Classes::TShortCut ShortCut);
extern PACKAGE Types::TRect __fastcall GetMenuRect(Menus::TMenuItem* MenuItem, unsigned MenuWnd);
extern PACKAGE unsigned __fastcall GetMenuWnd(Menus::TMenu* Menu);
extern PACKAGE unsigned __fastcall GetMDIClientWnd(_di_IAdvMenu AdvMenu);
extern PACKAGE Forms::TForm* __fastcall FindForm(unsigned Window);
extern PACKAGE void __fastcall DisableMenuAnimation(void);
extern PACKAGE void __fastcall RestoreMenuAnimation(void);

}	/* namespace Advmenus */
using namespace Advmenus;
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// AdvMenus

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -