📄 stdctrls.pas
字号:
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDock;
property OnStartDrag;
end;
TRadioButton = class(TButtonControl)
private
FAlignment: TLeftRight;
FChecked: Boolean;
procedure SetAlignment(Value: TLeftRight);
procedure CMCtl3DChanged(var Message: TMessage); message CM_CTL3DCHANGED;
procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR;
procedure CNCommand(var Message: TWMCommand); message CN_COMMAND;
protected
function GetChecked: Boolean; override;
procedure SetChecked(Value: Boolean); override;
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWnd; override;
public
constructor Create(AOwner: TComponent); override;
function GetControlsAlignment: TAlignment; override;
published
property Action;
property Alignment: TLeftRight read FAlignment write SetAlignment default taRightJustify;
property Anchors;
property BiDiMode;
property Caption;
property Checked;
property Color;
property Constraints;
property Ctl3D;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Font;
property ParentBiDiMode;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
property WordWrap;
property OnClick;
property OnContextPopup;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDock;
property OnStartDrag;
end;
TListBoxStyle = (lbStandard, lbOwnerDrawFixed, lbOwnerDrawVariable,
lbVirtual, lbVirtualOwnerDraw);
TLBGetDataEvent = procedure(Control: TWinControl; Index: Integer;
var Data: string) of object;
TLBGetDataObjectEvent = procedure(Control: TWinControl; Index: Integer;
var DataObject: TObject) of object;
TLBFindDataEvent = function(Control: TWinControl;
FindString: string): Integer of object;
TCustomListBox = class(TCustomMultiSelectListControl)
private
FAutoComplete: Boolean;
FCount: Integer;
FItems: TStrings;
FFilter: String;
FLastTime: Cardinal;
FBorderStyle: TBorderStyle;
FCanvas: TCanvas;
FColumns: Integer;
FItemHeight: Integer;
FOldCount: Integer;
FStyle: TListBoxStyle;
FIntegralHeight: Boolean;
FSorted: Boolean;
FExtendedSelect: Boolean;
FTabWidth: Integer;
FSaveItems: TStringList;
FSaveTopIndex: Integer;
FSaveItemIndex: Integer;
FOnDrawItem: TDrawItemEvent;
FOnMeasureItem: TMeasureItemEvent;
FOnData: TLBGetDataEvent;
FOnDataFind: TLBFindDataEvent;
FOnDataObject: TLBGetDataObjectEvent;
function GetItemHeight: Integer;
function GetTopIndex: Integer;
procedure LBGetText(var Message: TMessage); message LB_GETTEXT;
procedure LBGetTextLen(var Message: TMessage); message LB_GETTEXTLEN;
procedure SetBorderStyle(Value: TBorderStyle);
procedure SetColumnWidth;
procedure SetColumns(Value: Integer);
procedure SetCount(const Value: Integer);
procedure SetExtendedSelect(Value: Boolean);
procedure SetIntegralHeight(Value: Boolean);
procedure SetItemHeight(Value: Integer);
procedure SetItems(Value: TStrings);
procedure SetSelected(Index: Integer; Value: Boolean);
procedure SetSorted(Value: Boolean);
procedure SetStyle(Value: TListBoxStyle);
procedure SetTabWidth(Value: Integer);
procedure SetTopIndex(Value: Integer);
procedure WMPaint(var Message: TWMPaint); message WM_PAINT;
procedure WMSize(var Message: TWMSize); message WM_SIZE;
procedure CNCommand(var Message: TWMCommand); message CN_COMMAND;
procedure CNDrawItem(var Message: TWMDrawItem); message CN_DRAWITEM;
procedure CNMeasureItem(var Message: TWMMeasureItem); message CN_MEASUREITEM;
procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN;
procedure CMCtl3DChanged(var Message: TMessage); message CM_CTL3DCHANGED;
function GetScrollWidth: Integer;
procedure SetScrollWidth(const Value: Integer);
protected
FMoving: Boolean;
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWnd; override;
procedure DestroyWnd; override;
function DoGetData(const Index: Integer): String;
function DoGetDataObject(const Index: Integer): TObject;
function DoFindData(const Data: String): Integer;
procedure WndProc(var Message: TMessage); override;
procedure DragCanceled; override;
procedure DrawItem(Index: Integer; Rect: TRect;
State: TOwnerDrawState); virtual;
function GetCount: Integer; override;
function GetSelCount: Integer; override;
procedure MeasureItem(Index: Integer; var Height: Integer); virtual;
function InternalGetItemData(Index: Integer): Longint; dynamic;
procedure InternalSetItemData(Index: Integer; AData: Longint); dynamic;
function GetItemData(Index: Integer): LongInt; dynamic;
function GetItemIndex: Integer; override;
function GetSelected(Index: Integer): Boolean;
procedure KeyPress(var Key: Char); override;
procedure SetItemData(Index: Integer; AData: LongInt); dynamic;
procedure ResetContent; dynamic;
procedure DeleteString(Index: Integer); dynamic;
procedure SetMultiSelect(Value: Boolean); override;
procedure SetItemIndex(const Value: Integer); override;
property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle default bsSingle;
property Columns: Integer read FColumns write SetColumns default 0;
property ExtendedSelect: Boolean read FExtendedSelect write SetExtendedSelect default True;
property IntegralHeight: Boolean read FIntegralHeight write SetIntegralHeight default False;
property ItemHeight: Integer read GetItemHeight write SetItemHeight;
property ParentColor default False;
property Sorted: Boolean read FSorted write SetSorted default False;
property Style: TListBoxStyle read FStyle write SetStyle default lbStandard;
property TabWidth: Integer read FTabWidth write SetTabWidth default 0;
property OnDrawItem: TDrawItemEvent read FOnDrawItem write FOnDrawItem;
property OnMeasureItem: TMeasureItemEvent read FOnMeasureItem write FOnMeasureItem;
property OnData: TLBGetDataEvent read FOnData write FOnData;
property OnDataObject: TLBGetDataObjectEvent read FOnDataObject write FOnDataObject;
property OnDataFind: TLBFindDataEvent read FOnDataFind write FOnDataFind;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure AddItem(Item: String; AObject: TObject); override;
procedure Clear; override;
procedure ClearSelection; override;
procedure CopySelection(Destination: TCustomListControl); override;
procedure DeleteSelected; override;
function ItemAtPos(Pos: TPoint; Existing: Boolean): Integer;
function ItemRect(Index: Integer): TRect;
procedure SelectAll; override;
property AutoComplete: Boolean read FAutoComplete write FAutoComplete default True;
property Canvas: TCanvas read FCanvas;
property Count: Integer read GetCount write SetCount;
property Items: TStrings read FItems write SetItems;
property Selected[Index: Integer]: Boolean read GetSelected write SetSelected;
property ScrollWidth: Integer read GetScrollWidth write SetScrollWidth default 0;
property TopIndex: Integer read GetTopIndex write SetTopIndex;
published
property TabStop default True;
end;
TListBox = class(TCustomListBox)
published
property Style;
property AutoComplete;
property Align;
property Anchors;
property BevelEdges;
property BevelInner;
property BevelKind default bkNone;
property BevelOuter;
property BiDiMode;
property BorderStyle;
property Color;
property Columns;
property Constraints;
property Ctl3D;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property ExtendedSelect;
property Font;
property ImeMode;
property ImeName;
property IntegralHeight;
property ItemHeight;
property Items;
property MultiSelect;
property ParentBiDiMode;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ScrollWidth;
property ShowHint;
property Sorted;
property TabOrder;
property TabStop;
property TabWidth;
property Visible;
property OnClick;
property OnContextPopup;
property OnData;
property OnDataFind;
property OnDataObject;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnDrawItem;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMeasureItem;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDock;
property OnStartDrag;
end;
TScrollCode = (scLineUp, scLineDown, scPageUp, scPageDown, scPosition,
scTrack, scTop, scBottom, scEndScroll);
TScrollEvent = procedure(Sender: TObject; ScrollCode: TScrollCode;
var ScrollPos: Integer) of object;
TScrollBar = class(TWinControl)
private
FKind: TScrollBarKind;
FPosition: Integer;
FMin: Integer;
FMax: Integer;
FPageSize: Integer;
FRTLFactor: Integer;
FSmallChange: TScrollBarInc;
FLargeChange: TScrollBarInc;
FOnChange: TNotifyEvent;
FOnScroll: TScrollEvent;
procedure DoScroll(var Message: TWMScroll);
function NotRightToLeft: Boolean;
procedure SetKind(Value: TScrollBarKind);
procedure SetMax(Value: Integer);
procedure SetMin(Value: Integer);
procedure SetPosition(Value: Integer);
procedure SetPageSize(Value: Integer);
procedure CNHScroll(var Message: TWMHScroll); message CN_HSCROLL;
procedure CNVScroll(var Message: TWMVScroll); message CN_VSCROLL;
procedure CNCtlColorScrollBar(var Message: TMessage); message CN_CTLCOLORSCROLLBAR;
procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND;
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWnd; override;
procedure Change; dynamic;
procedure Scroll(ScrollCode: TScrollCode; var ScrollPos: Integer); dynamic;
public
constructor Create(AOwner: TComponent); override;
procedure SetParams(APosition, AMin, AMax: Integer);
published
property Align;
property Anchors;
property BiDiMode;
property Constraints;
property Ctl3D;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Kind: TScrollBarKind read FKind write SetKind default sbHorizontal;
property LargeChange: TScrollBarInc read FLargeChange write FLargeChange default 1;
property Max: Integer read FMax write SetMax default 100;
property Min: Integer read FMin write SetMin default 0;
property PageSize: Integer read FPageSize write SetPageSize;
property ParentBiDiMode;
property ParentCtl3D;
property ParentShowHint;
property PopupMenu;
property Position: Integer read FPosition write SetPosition default 0;
property ShowHint;
property SmallChange: TScrollBarInc read FSmallChange write FSmallChange default 1;
property TabOrder;
property TabStop default True;
property Visible;
property OnContextPopup;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnScroll: TScrollEvent read FOnScroll write FOnScroll;
property OnStartDock;
property OnStartDrag;
end;
TStaticBorderStyle = (sbsNone, sbsSingle, sbsSunken);
TCustomStaticText = class(TWinControl)
private
FAlignment: TAlignment;
FAutoSize: Boolean;
FBorderStyle: TStaticBorderStyle;
FFocusControl: TWinControl;
FShowAccelChar: Boolean;
procedure CNCtlColorStatic(var Message: TWMCtlColorStatic); message CN_CTLCOLORSTATIC;
procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR;
procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED;
procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
procedure AdjustBounds;
procedure SetAlignment(Value: TAlignment);
procedure SetBorderStyle(Value: TStaticBorderStyle);
procedure SetFocusControl(Value: TWinControl);
procedure SetShowAccelChar(Value: Boolean);
procedure SetTransparent(const Value: Boolean);
function GetTransparent: Boolean;
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure Loaded; override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure SetAutoSize(Value: Boolean); override;
property Alignment: TAlignment read FAlignment write SetAlignment
default taLeftJustify;
property AutoSize: Boolean read FAutoSize write SetAutoSize default True;
property BorderStyle: TStaticBorderStyle read FBorderStyle
write SetBorderStyle default sbsNone;
property FocusControl: TWinControl read FFocusControl write SetFocusControl;
property ShowAccelChar: Boolean read FShowAccelChar write SetShowAccelChar
default True;
property Transparent: Boolean read GetTransparent write SetTransparent
default True;
public
constructor Create(AOwner: TComponent); override;
end;
TStaticText = class(TCustomStaticText)
published
property Align;
property Alignment;
property Anchors;
property AutoSize;
property BevelEdges;
property BevelInner;
property BevelKind default bkNone;
property BevelOuter;
property BiDiMode;
property BorderStyle;
property Caption;
property Color nodefault;
property Constraints;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property FocusControl;
property Font;
property ParentBiDiMode;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowAccelChar;
property ShowHint;
property TabOrder;
property TabStop;
property Transparent;
property Visible;
property OnClick;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -