📄 skinctrls.pas
字号:
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure Notification(AComponent: TComponent;
Operation: TOperation); override;
procedure WMCLOSESKINMENU(var Message: TMessage); message WM_CLOSESKINMENU;
function GetNewTrackButtonRect: TRect;
procedure WndProc(var Message: TMessage); override;
procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR;
procedure CreateControlDefaultImage(B: TBitMap); override;
public
TrackButtonRect: TRect;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property SkinPopupMenu: TspSkinPopupMenu read FSkinPopupMenu
write FSkinPopupMenu;
property TrackButtonMode: Boolean read FTrackButtonMode
write SetTrackButtonMode;
property OnShowTrackMenu: TNotifyEvent read FOnShowTrackMenu
write FOnShowTrackMenu;
property OnHideTrackMenu: TNotifyEvent read FOnHideTrackMenu
write FOnHideTrackMenu;
end;
TspSkinCheckRadioBox = class(TspSkinCustomControl)
protected
FImages: TCustomImageList;
FImageIndex: Integer;
FFlat: Boolean;
FClicksDisabled: Boolean;
FCanFocused: Boolean;
FMouseIn: Boolean;
FGroupIndex: Integer;
FOnClick: TNotifyEvent;
FChecked: Boolean;
CIRect, NewTextArea: TRect;
FRadio: Boolean;
MorphTimer: TTimer;
FMorphKf: Double;
procedure SetImageIndex(Value: Integer);
procedure SetImages(Value: TCustomImageList);
procedure StartMorph;
procedure StopMorph;
function IsFocused: Boolean;
procedure SetCheckState;
procedure SetFlat(Value: Boolean);
procedure SetCanFocused(Value: Boolean);
procedure SetRadio(Value: Boolean);
procedure SetChecked(Value: Boolean);
procedure DoMorph(Sender: TObject);
procedure CreateImage(B: TBitMap; R: TRect; AMouseIn: Boolean);
procedure UnCheckAll;
procedure GetSkinData; override;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
procedure ReDrawControl;
procedure CalcSize(var W, H: Integer); override;
procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
procedure WMSETFOCUS(var Message: TWMSETFOCUS); message WM_SETFOCUS;
procedure WMMOVE(var Message: TWMSETFOCUS); message WM_MOVE;
procedure WMKILLFOCUS(var Message: TWMKILLFOCUS); message WM_KILLFOCUS;
procedure WndProc(var Message: TMessage); override;
procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR;
procedure CreateControlDefaultImage(B: TBitMap); override;
procedure SkinDrawCheckImage(X, Y: Integer; Cnvs: TCanvas; IR: TRect; DestCnvs: TCanvas);
procedure Notification(AComponent: TComponent;
Operation: TOperation); override;
public
FontName: String;
FontStyle: TFontStyles;
FontHeight: Integer;
FontColor, ActiveFontColor, FrameFontColor, UnEnabledFontColor: TColor;
ActiveSkinRect, CheckImageArea, TextArea,
CheckImageRect, UnCheckImageRect: TRect;
ActiveCheckImageRect, ActiveUnCheckImageRect: TRect;
UnEnabledCheckImageRect, UnEnabledUnCheckImageRect: TRect;
Morphing: Boolean;
MorphKind: TMorphKind;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure ChangeSkinData; override;
procedure Paint; override;
published
property Images: TCustomImageList read FImages write SetImages;
property ImageIndex: Integer read FImageIndex write SetImageIndex;
property PopupMenu;
property ShowHint;
property TabStop;
property TabOrder;
property CanFocused: Boolean read FCanFocused write SetCanFocused;
property Action;
property Radio: Boolean read FRadio write SetRadio;
property Checked: Boolean read FChecked write SetChecked;
property GroupIndex: Integer read FGroupIndex write FGroupIndex;
property Flat: Boolean read FFlat write SetFlat;
property Caption;
property OnClick: TNotifyEvent read FOnClick write FOnClick;
property Align;
property Enabled;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
end;
TspSkinGauge = class(TspSkinCustomControl)
protected
FUseSkinSize: Boolean;
FMinValue, FMaxValue, FValue: Integer;
FVertical: Boolean;
FProgressText: String;
FShowPercent: Boolean;
FShowProgressText: Boolean;
FTextAlphaBlend: Boolean;
FTextAlphaBlendValue: Byte;
procedure SetTextAlphaBlendValue(Value: Byte);
procedure SetTextAlphaBlend(Value: Boolean);
procedure SetShowProgressText(Value: Boolean);
procedure SetShowPercent(Value: Boolean);
procedure SetProgressText(Value: String);
procedure SetVertical(AValue: Boolean);
procedure SetMinValue(AValue: Integer);
procedure SetMaxValue(AValue: Integer);
procedure SetValue(AValue: Integer);
procedure GetSkinData; override;
procedure CreateImage(B: TBitMap);
procedure CalcSize(var W, H: Integer); override;
procedure DrawProgressText(C: TCanvas);
procedure CreateControlDefaultImage(B: TBitMap); override;
procedure CreateControlSkinImage(B: TBitMap); override;
public
ProgressRect, ProgressArea: TRect;
NewProgressArea: TRect;
BeginOffset, EndOffset: Integer;
FontName: String;
FontStyle: TFontStyles;
FontHeight: Integer;
FontColor: TColor;
constructor Create(AOwner: TComponent); override;
function CalcProgressRect(R: TRect; AV: Boolean): TRect;
procedure Paint; override;
published
property UseSkinSize: Boolean read FUseSkinSize write FUseSkinSize;
property TextAlphaBlend: Boolean read FTextAlphaBlend
write SetTextAlphaBlend;
property TextAlphaBlendValue: Byte read FTextAlphaBlendValue
write SetTextAlphaBlendValue;
property ProgressText: String read FProgressText write SetProgressText;
property ShowProgressText: Boolean read FShowProgressText write SetShowProgressText;
property ShowPercent: Boolean read FShowPercent write SetShowPercent;
property MinValue: Integer read FMinValue write SetMinValue;
property MaxValue: Integer read FMaxValue write SetMaxValue;
property Value: Integer read FValue write SetValue;
property Vertical: Boolean
read FVertical write SetVertical;
property Align;
property Enabled;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property PopupMenu;
property ShowHint;
end;
TspSkinButtonLabel = class(TGraphicControl)
protected
FMouseIn, FDown: Boolean;
FIndex: Integer;
FSD: TspSkinData;
FSkinDataName: String;
FDefaultFont: TFont;
FUseSkinFont: Boolean;
FDefaultActiveFontColor: TColor;
FGlyph: TBitMap;
FNumGlyphs: TspNumGlyphs;
FMargin: Integer;
FSpacing: Integer;
FLayout: TspButtonLayout;
procedure Notification(AComponent: TComponent;
Operation: TOperation); override;
procedure SetSkinData(Value: TspSkinData);
procedure SetDefaultFont(Value: TFont);
procedure SetLayout(Value : TspButtonLayout);
procedure SetMargin(Value: Integer);
procedure SetSpacing(Value: Integer);
procedure SetNumGlyphs(Value: TspNumGlyphs);
procedure SetGlyph(Value: TBitMap);
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
public
FontColor: TColor;
ActiveFontColor: TColor;
FontName: String;
FontHeight: Integer;
FontStyle: TFontStyles;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure ChangeSkinData;
procedure Paint; override;
published
property Glyph: TBitMap read FGlyph write SetGlyph;
property NumGlyphs: TspNumGlyphs read FNumGlyphs write SetNumGlyphs;
property Margin: Integer read FMargin write SetMargin default -1;
property Spacing: Integer read FSpacing write SetSpacing default 4;
property Layout: TspButtonLayout read FLayout write SetLayout default blGlyphLeft;
property UseSkinFont: Boolean read FUseSkinFont write FUseSkinFont;
property DefaultActiveFontColor: TColor
read FDefaultActiveFontColor write FDefaultActiveFontColor;
property DefaultFont: TFont read FDefaultFont write SetDefaultFont;
property SkinData: TspSkinData read FSD write SetSkinData;
property SkinDataName: String read FSkinDataName write FSkinDataName;
property Align;
property Anchors;
property AutoSize;
property BiDiMode;
property Caption;
property Constraints;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property ParentBiDiMode;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property Visible;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDock;
property OnStartDrag;
end;
TspSkinLinkImage = class(TImage)
private
FURL: String;
protected
procedure Click; override;
public
constructor Create(AOwner : TComponent); override;
published
property URL: string read FURL write FURL;
end;
TspSkinLinkLabel = class(TCustomLabel)
protected
FMouseIn: Boolean;
FIndex: Integer;
FSD: TspSkinData;
FSkinDataName: String;
FDefaultFont: TFont;
FUseSkinFont: Boolean;
FDefaultActiveFontColor: TColor;
FURL: String;
procedure Notification(AComponent: TComponent;
Operation: TOperation); override;
procedure SetSkinData(Value: TspSkinData);
procedure SetDefaultFont(Value: TFont);
property Transparent;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure GetSkinData;
procedure DoDrawText(var Rect: TRect; Flags: Longint); override;
public
FontName: String;
FontStyle: TFontStyles;
FontHeight: Integer;
FontColor, ActiveFontColor: TColor;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure ChangeSkinData;
procedure Click; override;
published
property UseSkinFont: Boolean read FUseSkinFont write FUseSkinFont;
property DefaultActiveFontColor: TColor
read FDefaultActiveFontColor write FDefaultActiveFontColor;
property URL: String read FURL write FURL;
property DefaultFont: TFont read FDefaultFont write SetDefaultFont;
property SkinData: TspSkinData read FSD write SetSkinData;
property SkinDataName: String read FSkinDataName write FSkinDataName;
property Font;
property Align;
property Alignment;
property Anchors;
property AutoSize;
property BiDiMode;
property Caption;
property Color;
property Constraints;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property FocusControl;
property ParentBiDiMode;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowAccelChar;
property ShowHint;
property Layout;
property Visible;
property WordWrap;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDock;
property OnStartDrag;
end;
TspSkinTextLabel = class(TGraphicControl)
private
FIndex: Integer;
FSD: TspSkinData;
FSkinDataName: String;
FDefaultFont: TFont;
FUseSkinFont: Boolean;
//
FLines: TStrings;
FAlignment: TAlignment;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -