advsmoothmenu.hpp
来自「TMSPack基本上涵盖了Delphi所有的基础控件」· HPP 代码 · 共 455 行 · 第 1/2 页
HPP
455 行
class PASCALIMPLEMENTATION TAdvSmoothMenuAppearance : public Classes::TPersistent
{
typedef Classes::TPersistent inherited;
private:
TAdvSmoothMenu* FOwner;
Classes::TNotifyEvent FOnChange;
Gdipfill::TGDIPFill* FFill;
Graphics::TColor FLineColor;
Byte FLineOpacity;
bool FLineVisible;
Graphics::TColor FIndicatorColor;
bool FIndicatorVisible;
Byte FIndicatorOpacity;
int FIndicatorSize;
void __fastcall SetFill(const Gdipfill::TGDIPFill* Value);
void __fastcall SetLineColor(const Graphics::TColor Value);
void __fastcall SetLineOpacity(const Byte Value);
void __fastcall SetLineVisible(const bool Value);
void __fastcall SetIndicatorColor(const Graphics::TColor Value);
void __fastcall SetIndicatorOpacity(const Byte Value);
void __fastcall SetIndicatorVisible(const bool Value);
void __fastcall SetIndicatorSize(const int Value);
protected:
void __fastcall Changed(void);
void __fastcall BackGroundChanged(System::TObject* Sender);
__property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
public:
__fastcall TAdvSmoothMenuAppearance(TAdvSmoothMenu* AOwner);
__fastcall virtual ~TAdvSmoothMenuAppearance(void);
virtual void __fastcall Assign(Classes::TPersistent* Source);
__published:
__property Gdipfill::TGDIPFill* Fill = {read=FFill, write=SetFill};
__property Graphics::TColor LineColor = {read=FLineColor, write=SetLineColor, default=16777215};
__property Byte LineOpacity = {read=FLineOpacity, write=SetLineOpacity, default=255};
__property bool LineVisible = {read=FLineVisible, write=SetLineVisible, default=1};
__property Graphics::TColor IndicatorColor = {read=FIndicatorColor, write=SetIndicatorColor, default=16777215};
__property Byte IndicatorOpacity = {read=FIndicatorOpacity, write=SetIndicatorOpacity, default=255};
__property bool IndicatorVisible = {read=FIndicatorVisible, write=SetIndicatorVisible, default=1};
__property int IndicatorSize = {read=FIndicatorSize, write=SetIndicatorSize, default=6};
};
typedef void __fastcall (__closure *TAdvSmoothMenuItemLeaveEvent)(System::TObject* Sender, int ItemIndex);
typedef void __fastcall (__closure *TAdvSmoothMenuItemEnterEvent)(System::TObject* Sender, int ItemIndex);
typedef void __fastcall (__closure *TAdvSmoothMenuItemClickEvent)(System::TObject* Sender, int ItemIndex);
#pragma option push -b-
enum TAdvSmoothMenuAnimationType { atNone, atNoOpacity, atFull };
#pragma option pop
class PASCALIMPLEMENTATION TAdvSmoothMenu : public Controls::TCustomControl
{
typedef Controls::TCustomControl inherited;
private:
bool FDesignTime;
bool FMouseInControl;
bool MouseLeave;
bool MouseEnter;
int FHoveredItem;
int FSelectedItem;
bool FAnimating;
float FCurrentPos;
float FPosTo;
float FCurrentTextPos;
Byte FCurrentTextOpc;
Extctrls::TTimer* FSmoothTimer;
Extctrls::TTimer* FRotationTimer;
TAdvSmoothMenuItems* FItems;
TAdvSmoothMenuItemAppearance* FItemAppearance;
bool FTransparent;
TAdvSmoothMenuAppearance* FAppearance;
Gdippicturecontainer::TGDIPPictureContainer* FContainer;
TAdvSmoothMenuItemLeaveEvent FOnItemLeave;
TAdvSmoothMenuItemEnterEvent FOnItemEnter;
TAdvSmoothMenuItemClickEvent FOnItemClick;
bool FRotation;
int FRotationInterval;
TAdvSmoothMenuAnimationType FAnimationType;
void __fastcall SetItems(const TAdvSmoothMenuItems* Value);
void __fastcall SetItemAppearance(const TAdvSmoothMenuItemAppearance* Value);
void __fastcall SetTransparent(const bool Value);
void __fastcall SetAppearance(const TAdvSmoothMenuAppearance* Value);
void __fastcall SetRotation(const bool Value);
void __fastcall SetRotationInterval(const int Value);
void __fastcall SetAnimationType(const TAdvSmoothMenuAnimationType Value);
AnsiString __fastcall GetVersion();
void __fastcall SetVersion(const AnsiString Value);
protected:
void __fastcall ItemAppearanceChanged(System::TObject* Sender);
void __fastcall AppearanceChanged(System::TObject* Sender);
void __fastcall ItemsChanged(System::TObject* Sender);
HIDESBASE void __fastcall FontChanged(System::TObject* Sender);
HIDESBASE void __fastcall Changed(void);
void __fastcall DrawLine(void);
void __fastcall DrawBackGround(void);
void __fastcall DrawItems(void);
void __fastcall DrawIndicator(void);
void __fastcall InitItemRects(void);
void __fastcall AnimateMenu(System::TObject* Sender);
void __fastcall RotateMenu(System::TObject* Sender);
void __fastcall DoItemClick(System::TObject* Sender, int ItemIndex);
void __fastcall DoItemEnter(System::TObject* Sender, int ItemIndex);
void __fastcall DoItemLeave(System::TObject* Sender, int ItemIndex);
HIDESBASE MESSAGE void __fastcall CMMouseEnter(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall CMMouseLeave(Messages::TMessage &Message);
virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
HIDESBASE MESSAGE void __fastcall WMEraseBkgnd(Messages::TWMEraseBkgnd &Message);
HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
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);
DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation AOperation);
DYNAMIC void __fastcall Resize(void);
void __fastcall DrawPicture(Advsmoothgdip::TGPGraphics* g, Byte opacity, Advsmoothgdip::TAdvGDIPPicture* picture, Gdipfill::TFillPicturePosition location, int w, int h, const Types::TRect &r, int x, int y);
void __fastcall InitPreview(void);
virtual void __fastcall CreateWnd(void);
int __fastcall GetVersionNr(void);
int __fastcall GetShadowOffset(void);
public:
__fastcall virtual TAdvSmoothMenu(Classes::TComponent* AOwner);
__fastcall virtual ~TAdvSmoothMenu(void);
virtual void __fastcall Assign(Classes::TPersistent* Source);
virtual void __fastcall Paint(void);
void __fastcall GetTextPosition(int &x, int &y, const Advsmoothgdip::TGPRectF &rectangle, int objectwidth, int objectheight, TAdvSmoothMenuLocation location);
int __fastcall XYToItem(int X, int Y);
void __fastcall SetComponentStyle(Advstyleif::TTMSStyle AStyle);
__published:
__property TAdvSmoothMenuAnimationType AnimationType = {read=FAnimationType, write=SetAnimationType, default=2};
__property Anchors = {default=3};
__property Constraints ;
__property bool Rotation = {read=FRotation, write=SetRotation, default=1};
__property int RotationInterval = {read=FRotationInterval, write=SetRotationInterval, default=5000};
__property TAdvSmoothMenuAppearance* Appearance = {read=FAppearance, write=SetAppearance};
__property TAdvSmoothMenuItems* Items = {read=FItems, write=SetItems};
__property TAdvSmoothMenuItemAppearance* ItemAppearance = {read=FItemAppearance, write=SetItemAppearance};
__property bool Transparent = {read=FTransparent, write=SetTransparent, default=0};
__property Gdippicturecontainer::TGDIPPictureContainer* Container = {read=FContainer, write=FContainer};
__property AnsiString Version = {read=GetVersion, write=SetVersion};
__property TAdvSmoothMenuItemClickEvent OnItemClick = {read=FOnItemClick, write=FOnItemClick};
__property TAdvSmoothMenuItemEnterEvent OnItemEnter = {read=FOnItemEnter, write=FOnItemEnter};
__property TAdvSmoothMenuItemLeaveEvent OnItemLeave = {read=FOnItemLeave, write=FOnItemLeave};
__property OnClick ;
__property OnContextPopup ;
__property OnDblClick ;
__property OnDragDrop ;
__property OnDragOver ;
__property Align = {default=0};
__property ShowHint ;
__property OnEndDock ;
__property OnEndDrag ;
__property OnMouseActivate ;
__property OnMouseEnter ;
__property OnMouseLeave ;
__property OnMouseMove ;
__property OnMouseUp ;
__property OnStartDock ;
__property OnStartDrag ;
__property PopupMenu ;
public:
#pragma option push -w-inl
/* TWinControl.CreateParented */ inline __fastcall TAdvSmoothMenu(HWND ParentWindow) : Controls::TCustomControl(ParentWindow) { }
#pragma option pop
private:
void *__ITMSStyle; /* Advstyleif::ITMSStyle */
public:
operator ITMSStyle*(void) { return (ITMSStyle*)&__ITMSStyle; }
};
class PASCALIMPLEMENTATION TAdvSmoothMenuItems : public Classes::TCollection
{
typedef Classes::TCollection inherited;
public:
TAdvSmoothMenuItem* operator[](int Index) { return Items[Index]; }
private:
TAdvSmoothMenu* FOwner;
Classes::TNotifyEvent FOnChange;
HIDESBASE TAdvSmoothMenuItem* __fastcall GetItem(int Index);
HIDESBASE void __fastcall SetItem(int Index, const TAdvSmoothMenuItem* Value);
protected:
__property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
public:
__fastcall TAdvSmoothMenuItems(TAdvSmoothMenu* AOwner);
__property TAdvSmoothMenuItem* Items[int Index] = {read=GetItem, write=SetItem/*, default*/};
HIDESBASE TAdvSmoothMenuItem* __fastcall Add(void);
HIDESBASE TAdvSmoothMenuItem* __fastcall Insert(int Index);
HIDESBASE void __fastcall Delete(int Index);
public:
#pragma option push -w-inl
/* TCollection.Destroy */ inline __fastcall virtual ~TAdvSmoothMenuItems(void) { }
#pragma option pop
};
//-- var, const, procedure ---------------------------------------------------
static const Shortint MAJ_VER = 0x1;
static const Shortint MIN_VER = 0x0;
static const Shortint REL_VER = 0x0;
static const Shortint BLD_VER = 0x0;
} /* namespace Advsmoothmenu */
using namespace Advsmoothmenu;
#pragma pack(pop)
#pragma option pop
#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif // Advsmoothmenu
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?