📄 bsskinboxctrls.pas
字号:
property HorizontalExtent: Boolean
read GetHorizontalExtent write SetHorizontalExtent;
property Font;
property Sorted: Boolean read GetSorted write SetSorted;
property Style: TbsSkinCustomComboBoxStyle read FStyle write SetStyle;
property SelStart: Integer read GetSelStart write SetSelStart;
property SelLength: Integer read GetSelLength write SetSelLength;
property OnListBoxDrawItem: TbsDrawSkinItemEvent
read FOnListBoxDrawItem write SetListBoxDrawItem;
property OnComboBoxDrawItem: TbsDrawSkinItemEvent
read FOnComboBoxDrawItem write FOnComboBoxDrawItem;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
property OnClick: TNotifyEvent read FOnClick write FOnClick;
property OnCloseUp: TNotifyEvent read FOnCloseUp write FOnCloseUp;
property OnDropDown: TNotifyEvent read FOnDropDown write FOnDropDown;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnEnter;
property OnExit;
published
property UseSkinSize: Boolean read FUseSkinSize write FUseSkinSize;
end;
TbsSkinComboBox = class(TbsSkinCustomComboBox)
published
property AlphaBlend;
property AlphaBlendValue;
property AlphaBlendAnimation;
property HideSelection;
property AutoComplete;
property ListBoxUseSkinFont;
property ListBoxUseSkinItemHeight;
property ListBoxWidth;
property Images;
property ImageIndex;
property ListBoxCaption;
property ListBoxCaptionMode;
property ListBoxDefaultFont;
property ListBoxDefaultCaptionFont;
property ListBoxDefaultItemHeight;
property ListBoxCaptionAlignment;
property Enabled;
property PopupMenu;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
//
property Text;
property Align;
property Items;
property ItemIndex;
property DropDownCount;
property HorizontalExtent;
property Font;
property Sorted;
property Style;
property OnListBoxDrawItem;
property OnComboBoxDrawItem;
property OnChange;
property OnClick;
property OnCloseUp;
property OnDropDown;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnEnter;
property OnExit;
end;
TbsSkinMRUComboBox = class(TbsSkinComboBox)
public
procedure AddMRUItem(Value: String);
end;
TbsColorBoxStyles = (bscbStandardColors, bscbExtendedColors, bscbSystemColors,
bscbIncludeNone, bscbIncludeDefault, bscbCustomColor,
bscbPrettyNames);
TbsColorBoxStyle = set of TbsColorBoxStyles;
TbsSkinColorComboBox = class(TbsSkinCustomComboBox)
private
FShowNames: Boolean;
FNeedToPopulate: Boolean;
FExStyle: TbsColorBoxStyle;
FDefaultColorColor: TColor;
FNoneColorColor: TColor;
FSelectedColor: TColor;
procedure SetShowNames(Value: Boolean);
function GetColor(Index: Integer): TColor;
function GetColorName(Index: Integer): string;
function GetSelected: TColor;
procedure SetSelected(const AColor: TColor);
procedure ColorCallBack(const AName: string);
procedure SetDefaultColorColor(const Value: TColor);
procedure SetNoneColorColor(const Value: TColor);
procedure SetExStyle(AStyle: TbsColorBoxStyle);
protected
procedure DrawColorItem(Cnvs: TCanvas; Index: Integer;
ItemWidth, ItemHeight: Integer; TextRect: TRect; State: TOwnerDrawState);
procedure CreateWnd; override;
function PickCustomColor: Boolean; virtual;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure OnLBCloseUp(Sender: TObject);
public
constructor Create(AOwner: TComponent); override;
property Colors[Index: Integer]: TColor read GetColor;
property ColorNames[Index: Integer]: string read GetColorName;
procedure PopulateList;
published
property HideSelection;
property AutoComplete;
property AlphaBlend;
property AlphaBlendValue;
property ListBoxCaption;
property ListBoxCaptionMode;
property ListBoxWidth;
property Enabled;
property PopupMenu;
property ShowHint;
property TabOrder;
property Visible;
//
property Align;
property ItemIndex;
property DropDownCount;
property Font;
property Sorted;
property ExStyle: TbsColorBoxStyle read FExStyle write SetExStyle
default [bscbStandardColors, bscbExtendedColors, bscbSystemColors];
property Selected: TColor read GetSelected write SetSelected default clBlack;
property DefaultColorColor: TColor read FDefaultColorColor write SetDefaultColorColor default clBlack;
property NoneColorColor: TColor read FNoneColorColor write SetNoneColorColor default clBlack;
property ShowNames: Boolean read FShowNames write SetShowNames;
property OnClick;
property OnChange;
end;
TbsSkinColorListBox = class(TbsSkinListBox)
private
FShowNames: Boolean;
FExStyle: TbsColorBoxStyle;
FDefaultColorColor: TColor;
FNoneColorColor: TColor;
FSelectedColor: TColor;
procedure SetShowNames(Value: Boolean);
function GetColor(Index: Integer): TColor;
function GetColorName(Index: Integer): string;
function GetSelected: TColor;
procedure SetSelected(const AColor: TColor);
procedure ColorCallBack(const AName: string);
procedure SetDefaultColorColor(const Value: TColor);
procedure SetNoneColorColor(const Value: TColor);
procedure SetExStyle(AStyle: TbsColorBoxStyle);
protected
procedure DrawColorItem(Cnvs: TCanvas; Index: Integer;
ItemWidth, ItemHeight: Integer; TextRect: TRect; State: TOwnerDrawState);
procedure CreateWnd; override;
function PickCustomColor: Boolean; virtual;
procedure Loaded; override;
procedure ListBoxKeyDown(var Key: Word; Shift: TShiftState); override;
procedure ListBoxDblClick; override;
public
constructor Create(AOwner: TComponent); override;
property Colors[Index: Integer]: TColor read GetColor;
property ColorNames[Index: Integer]: string read GetColorName;
procedure PopulateList;
published
property Sorted;
property ExStyle: TbsColorBoxStyle read FExStyle write SetExStyle
default [bscbStandardColors, bscbExtendedColors, bscbSystemColors];
property Selected: TColor read GetSelected write SetSelected default clBlack;
property DefaultColorColor: TColor read FDefaultColorColor write SetDefaultColorColor default clBlack;
property NoneColorColor: TColor read FNoneColorColor write SetNoneColorColor default clBlack;
property ShowNames: Boolean read FShowNames write SetShowNames;
end;
TbsFontDevice = (fdScreen, fdPrinter, fdBoth);
TbsFontListOption = (foAnsiOnly, foTrueTypeOnly, foFixedPitchOnly,
foNoOEMFonts, foOEMFontsOnly, foScalableOnly, foNoSymbolFonts);
TbsFontListOptions = set of TbsFontListOption;
TbsSkinFontSizeComboBox = class(TbsSkinCustomComboBox)
private
PixelsPerInch: Integer;
FFontName: TFontName;
procedure SetFontName(const Value: TFontName);
procedure Build;
function GetSizeValue: Integer;
public
property FontName: TFontName read FFontName write SetFontName;
property SizeValue: Integer read GetSizeValue;
published
property HideSelection;
property AutoComplete;
property AlphaBlend;
property AlphaBlendValue;
property ListBoxCaption;
property ListBoxCaptionMode;
property ListBoxWidth;
property Enabled;
property PopupMenu;
property ShowHint;
property TabOrder;
property Visible;
//
property Align;
property ItemIndex;
property DropDownCount;
property Font;
property Sorted;
property Style;
property OnChange;
property OnClick;
//
end;
TbsSkinFontListBox = class(TbsSkinListBox)
protected
FDevice: TbsFontDevice;
FUpdate: Boolean;
FUseFonts: Boolean;
FOptions: TbsFontListOptions;
procedure ListBoxCreateWnd; override;
procedure SetFontName(const NewFontName: TFontName);
function GetFontName: TFontName;
function GetTrueTypeOnly: Boolean;
procedure SetDevice(Value: TbsFontDevice);
procedure SetOptions(Value: TbsFontListOptions);
procedure SetTrueTypeOnly(Value: Boolean);
procedure SetUseFonts(Value: Boolean);
procedure Reset;
procedure DrawLBFontItem(Cnvs: TCanvas; Index: Integer;
ItemWidth, ItemHeight: Integer; TextRect: TRect; State: TOwnerDrawState);
procedure DrawTT(Cnvs: TCanvas; X, Y: Integer; C: TColor);
procedure Loaded; override;
public
constructor Create(AOwner: TComponent); override;
procedure PopulateList;
published
property Enabled;
property PopupMenu;
property ShowHint;
property TabOrder;
property Visible;
//
property Align;
property ItemIndex;
property Font;
property Sorted;
//
property Device: TbsFontDevice read FDevice write SetDevice default fdScreen;
property FontName: TFontName read GetFontName write SetFontName;
property Options: TbsFontListOptions read FOptions write SetOptions default [];
property TrueTypeOnly: Boolean read GetTrueTypeOnly write SetTrueTypeOnly
stored False;
property UseFonts: Boolean read FUseFonts write SetUseFonts default False;
end;
TbsSkinFontComboBox = class(TbsSkinCustomComboBox)
protected
FDevice: TbsFontDevice;
FUpdate: Boolean;
FUseFonts: Boolean;
FOptions: TbsFontListOptions;
procedure SetFontName(const NewFontName: TFontName);
function GetFontName: TFontName;
function GetTrueTypeOnly: Boolean;
procedure SetDevice(Value: TbsFontDevice);
procedure SetOptions(Value: TbsFontListOptions);
procedure SetTrueTypeOnly(Value: Boolean);
procedure SetUseFonts(Value: Boolean);
procedure Reset;
procedure WMFontChange(var Message: TMessage); message WM_FONTCHANGE;
procedure DrawLBFontItem(Cnvs: TCanvas; Index: Integer;
ItemWidth, ItemHeight: Integer; TextRect: TRect; State: TOwnerDrawState);
procedure DrawCBFontItem(Cnvs: TCanvas; Index: Integer;
ItemWidth, ItemHeight: Integer; TextRect: TRect; State: TOwnerDrawState);
procedure CreateWnd; override;
procedure DrawTT(Cnvs: TCanvas; X, Y: Integer; C: TColor);
public
constructor Create(AOwner: TComponent); override;
procedure PopulateList;
published
property HideSelection;
property AutoComplete;
property AlphaBlend;
property AlphaBlendValue;
property ListBoxCaption;
property ListBoxCaptionMode;
property ListBoxWidth;
property Enabled;
property PopupMenu;
property ShowHint;
property TabOrder;
property Visible;
//
property Align;
property ItemIndex;
property DropDownCount;
property Font;
property Sorted;
property Style;
property OnChange;
property OnClick;
//
property Device: TbsFontDevice read FDevice write SetDevice default fdScreen;
property FontName: TFontName read GetFontName write SetFontName;
property Options: TbsFontListOptions read FOptions write SetOptions default [];
property TrueTypeOnly: Boolean read GetTrueTypeOnly write SetTrueTypeOnly
stored False;
property UseFonts: Boolean read FUseFonts write SetUseFonts default False;
end;
TbsValueType = (vtInteger, vtFloat);
TbsSkinSpinEdit = class(TbsSkinCustomControl)
private
FUseSkinSize: Boolean;
FMouseIn: Boolean;
FEditFocused: Boolean;
StopCheck: Boolean;
FDecimal: Byte;
FMinValue, FMaxValue, FIncrement: Double;
FromEdit: Boolean;
FValueType: TbsValueType;
FOnChange: TNotifyEvent;
FValue: Double;
OldActiveButton, ActiveButton, CaptureButton: Integer;
TimerMode: Integer;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -