advpreviewmenu.hpp
来自「TMSPack基本上涵盖了Delphi所有的基础控件」· HPP 代码 · 共 1,079 行 · 第 1/4 页
HPP
1,079 行
#pragma option push -w-inl
/* TPersistent.Destroy */ inline __fastcall virtual ~TVistaBackground(void) { }
#pragma option pop
};
class PASCALIMPLEMENTATION TAdvCustomPreviewMenuStyler : public Classes::TComponent
{
typedef Classes::TComponent inherited;
private:
Advglowbutton::TGlowButtonAppearance* FButtonAppearance;
TSelectionAppearance* FMenuItemAppearance;
TVistaBackground* FFrameAppearance;
Graphics::TColor FRightFrameColor;
Graphics::TColor FLeftFrameColor;
Graphics::TColor FRightFrameBorderColor;
void __fastcall SetButtonAppearance(const Advglowbutton::TGlowButtonAppearance* Value);
void __fastcall SetFrameAppearance(const TVistaBackground* Value);
void __fastcall SetMenuItemAppearance(const TSelectionAppearance* Value);
protected:
virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation);
void __fastcall Change(int PropID = 0x0);
__property TVistaBackground* FrameAppearance = {read=FFrameAppearance, write=SetFrameAppearance};
__property Graphics::TColor LeftFrameColor = {read=FLeftFrameColor, write=FLeftFrameColor, nodefault};
__property Graphics::TColor RightFrameColor = {read=FRightFrameColor, write=FRightFrameColor, nodefault};
__property Graphics::TColor RightFrameBorderColor = {read=FRightFrameBorderColor, write=FRightFrameBorderColor, nodefault};
__property TSelectionAppearance* MenuItemAppearance = {read=FMenuItemAppearance, write=SetMenuItemAppearance};
__property Advglowbutton::TGlowButtonAppearance* ButtonAppearance = {read=FButtonAppearance, write=SetButtonAppearance};
public:
__fastcall virtual TAdvCustomPreviewMenuStyler(Classes::TComponent* AOwner);
__fastcall virtual ~TAdvCustomPreviewMenuStyler(void);
virtual void __fastcall Assign(Classes::TPersistent* Source);
};
class DELPHICLASS TPreviewMenuWindow;
class DELPHICLASS TAdvCustomPreviewMenuPanel;
class PASCALIMPLEMENTATION TAdvCustomPreviewMenuPanel : public Controls::TCustomControl
{
typedef Controls::TCustomControl inherited;
private:
Classes::TComponent* FOwner;
Classes::TNotifyEvent FOnShouldHide;
bool FShowBorder;
HIDESBASE MESSAGE void __fastcall CMMouseLeave(Messages::TMessage &Message);
protected:
virtual void __fastcall Paint(void);
DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
__property Classes::TNotifyEvent OnShouldHide = {read=FOnShouldHide, write=FOnShouldHide};
__property bool ShowBorder = {read=FShowBorder, write=FShowBorder, nodefault};
virtual void __fastcall InitializeAndUpdate(void);
public:
__fastcall virtual TAdvCustomPreviewMenuPanel(Classes::TComponent* AOwner);
__fastcall virtual ~TAdvCustomPreviewMenuPanel(void);
public:
#pragma option push -w-inl
/* TWinControl.CreateParented */ inline __fastcall TAdvCustomPreviewMenuPanel(HWND ParentWindow) : Controls::TCustomControl(ParentWindow) { }
#pragma option pop
};
class PASCALIMPLEMENTATION TPreviewMenuWindow : public Forms::TCustomForm
{
typedef Forms::TCustomForm inherited;
private:
bool FHideOnDeActivate;
Classes::TComponent* FOwner;
bool FShowBorder;
Extctrls::TTimer* FHideTimer;
Graphics::TColor FBorderColor;
TAdvCustomPreviewMenuPanel* FPreviewMenuPanel;
HIDESBASE MESSAGE void __fastcall WMActivate(Messages::TWMActivate &Message);
HIDESBASE MESSAGE void __fastcall WMNCHitTest(Messages::TWMNCHitTest &Message);
HIDESBASE MESSAGE void __fastcall WMKeyDown(Messages::TWMKey &Message);
MESSAGE void __fastcall WMGetDlgCode(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall CMDialogChar(Messages::TWMKey &Message);
void __fastcall HideTimerOnTime(System::TObject* Sender);
protected:
virtual void __fastcall Loaded(void);
DYNAMIC void __fastcall Paint(void);
HWND __fastcall GetParentWnd(void);
virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
void __fastcall UpdateSize(void);
__property bool HideOnDeActivate = {read=FHideOnDeActivate, write=FHideOnDeActivate, nodefault};
__property bool ShowBorder = {read=FShowBorder, write=FShowBorder, nodefault};
__property Graphics::TColor BorderColor = {read=FBorderColor, write=FBorderColor, nodefault};
__property TAdvCustomPreviewMenuPanel* PreviewMenuPanel = {read=FPreviewMenuPanel, write=FPreviewMenuPanel};
public:
__fastcall virtual TPreviewMenuWindow(Classes::TComponent* AOwner);
__fastcall virtual TPreviewMenuWindow(Classes::TComponent* AOwner, int Dummy);
__fastcall virtual ~TPreviewMenuWindow(void);
virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);
public:
#pragma option push -w-inl
/* TWinControl.CreateParented */ inline __fastcall TPreviewMenuWindow(HWND ParentWindow) : Forms::TCustomForm(ParentWindow) { }
#pragma option pop
};
class DELPHICLASS TAdvPreviewMenuPanel;
class DELPHICLASS TMenuItemScroller;
class PASCALIMPLEMENTATION TMenuItemScroller : public System::TObject
{
typedef System::TObject inherited;
private:
int FMin;
int FMax;
int FPosition;
void __fastcall SetMax(const int Value);
void __fastcall SetMin(const int Value);
void __fastcall SetPosition(const int Value);
bool __fastcall GetVisible(void);
public:
__fastcall TMenuItemScroller(void);
bool __fastcall CanGoForward(void);
bool __fastcall CanGoBack(void);
__property int Min = {read=FMin, write=SetMin, nodefault};
__property int Max = {read=FMax, write=SetMax, nodefault};
__property int Position = {read=FPosition, write=SetPosition, nodefault};
__property bool Visible = {read=GetVisible, nodefault};
public:
#pragma option push -w-inl
/* TObject.Destroy */ inline __fastcall virtual ~TMenuItemScroller(void) { }
#pragma option pop
};
class DELPHICLASS TAdvPreviewSubMenuItems;
class DELPHICLASS TAdvPreviewSubMenuItem;
class PASCALIMPLEMENTATION TAdvPreviewMenuPanel : public TAdvCustomPreviewMenuPanel
{
typedef TAdvCustomPreviewMenuPanel inherited;
private:
Classes::TComponent* FOwner;
TAdvPreviewMenu* FAdvPreviewMenu;
#pragma pack(push,1)
Types::TRect FLeftFrameRect;
#pragma pack(pop)
#pragma pack(push,1)
Types::TRect FRightFrameRect;
#pragma pack(pop)
int FItemIndex;
int FItemHot;
int FItemDown;
int FItemHeight;
int FImageSpace;
int FLineSpace;
Classes::TList* FButtonList;
int FSubMenuItem;
int FSubMenuItemHeight;
int FSubMenuItemHot;
int FSubMenuItemDown;
int FSubMenuCaptionHeight;
Menus::TPopupMenu* FSubMenuPopup;
bool FInternalHideSubMenuPopup;
int FHintItemIndex;
int FHintSubMenuItemIndex;
Advhintinfo::TAdvHintInfo* FOfficeHint;
bool FIgnoreMouseMove;
bool FShortCutItemHintShowing;
bool FShortCutSubMenuItemHintShowing;
AnsiString FShortCutChars;
bool FButtonPartHot;
bool FDropDownPartHot;
bool FInternalClick;
Extctrls::TTimer* FMouseTimer;
bool FMouseSetHot;
int FMouseItemHot;
TMenuItemScroller* FSubMenuScroller;
int FSubMenuVisibleItemCount;
int FTopSubMenuItem;
bool FSubMenuScollUpHot;
bool FSubMenuScollUpDown;
bool FSubMenuScollDownHot;
bool FSubMenuScollDownDown;
bool FSubMenuScrolling;
int FSelectedItem;
int FSelectedSubItem;
int FHintItem;
int FHintSubItem;
int FButtonHot;
HIDESBASE MESSAGE void __fastcall CMMouseLeave(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall CMDialogChar(Messages::TWMKey &Message);
MESSAGE void __fastcall WMGetDlgCode(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall CMFocusChanged(Controls::TCMFocusChanged &Message);
void __fastcall OnButtonKeyPress(System::TObject* Sender, char &Key);
void __fastcall OnButtonKeyDown(System::TObject* Sender, Word &Key, Classes::TShiftState Shift);
void __fastcall OnButtonClick(System::TObject* Sender);
void __fastcall OnMouseTimer(System::TObject* Sender);
void __fastcall SetItemHot(const int Value);
void __fastcall SetSubMenuItemHot(const int Value);
void __fastcall SetSubMenuItem(const int Value);
void __fastcall SetOfficeHint(const Advhintinfo::TAdvHintInfo* Value);
void __fastcall SetButtonHot(const int Value);
protected:
bool FEditorCreated;
virtual void __fastcall Paint(void);
DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
void __fastcall DrawShortCutHint(Graphics::TCanvas* Canvas, AnsiString ShortCutHint, const Types::TPoint &Pt, bool Shaded);
void __fastcall DrawItems(void);
void __fastcall DrawItem(int Index, bool RefreshItem = false);
void __fastcall DrawSubMenuItems(Graphics::TCanvas* ACanvas = (Graphics::TCanvas*)(0x0));
void __fastcall DrawSubMenuItem(int AIndex, bool RefreshItem = false, Graphics::TCanvas* ACanvas = (Graphics::TCanvas*)(0x0));
void __fastcall DrawRightFrame(Graphics::TCanvas* ACanvas, bool WithItems = true);
void __fastcall DrawUpScrollBtn(void);
void __fastcall DrawDownScrollBtn(void);
int __fastcall ItemAtPos(int X, int Y);
void __fastcall SelectItem(int Index);
TAdvPreviewSubMenuItems* __fastcall GetSubMenuItems(void);
int __fastcall SubMenuItemAtPos(int X, int Y)/* overload */;
int __fastcall SubMenuItemAtPos(int X, int Y, TAdvPreviewSubMenuItem* &SubItem)/* overload */;
void __fastcall SelectSubMenuItem(int Index);
void __fastcall HideMenuWindow(void);
void __fastcall InternalClickSubItem(int SubIndex);
void __fastcall CheckKeyPress(Word Key);
void __fastcall CheckMouseMove(int X, int Y);
void __fastcall ShowSubMenuPopup(int AIndex);
void __fastcall HideSubMenuPopup(void);
bool __fastcall IsFirstItem(int Index, bool CheckEnable, bool CheckVisible);
bool __fastcall IsLastItem(int Index, bool CheckEnable, bool CheckVisible);
void __fastcall ItemHotNext(void);
void __fastcall ItemHotPrevious(void);
void __fastcall ItemHotLast(void);
bool __fastcall IsFirstSubMenuItem(int Index, bool CheckEnable, bool CheckVisible);
bool __fastcall IsLastSubMenuItem(int Index, bool CheckEnable, bool CheckVisible);
void __fastcall SubMenuItemHotNext(void);
void __fastcall SubMenuItemHotPrevious(void);
void __fastcall SubMenuItemHotLast(void);
bool __fastcall IsFirstButton(int Index, bool CheckEnable, bool CheckVisible);
bool __fastcall IsLastButton(int Index, bool CheckEnable, bool CheckVisible);
void __fastcall ButtonHotNext(void);
void __fastcall ButtonHotPrevious(void);
void __fastcall ButtonHotLast(void);
void __fastcall ShowAllItemsShortCutHint(void);
void __fastcall HideAllItemsShortCutHint(void);
void __fastcall ShowItemShortCutHint(int Index);
void __fastcall HideItemShortCutHint(int Index);
void __fastcall DrawItemShortCutHint(int Index);
void __fastcall DrawItemSubItemShortCutHint(int Index);
void __fastcall ShowItemSubItemShortCutHint(int Index);
void __fastcall HideItemSubItemShortCutHint(int Index);
void __fastcall ShowAllSubMenuItemsShortCutHint(void);
void __fastcall HideAllSubMenuItemsShortCutHint(void);
void __fastcall DrawSubMenuItemShortCutHint(int Index);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?