home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 May
/
VPR9705A.ISO
/
VPR_DATA
/
PROGRAM
/
CBTRIAL
/
SETUP
/
DATA.Z
/
STDCTRLS.INT
< prev
next >
Wrap
Text File
|
1997-02-14
|
19KB
|
637 lines
{*******************************************************}
{ }
{ Delphi Visual Component Library }
{ }
{ Copyright (c) 1995,96 Borland International }
{ }
{*******************************************************}
unit StdCtrls;
{$R-}
interface
uses Messages, Windows, SysUtils, Classes, Controls, Forms, Menus, Graphics;
type
TCustomGroupBox = class(TCustomControl)
protected
procedure AlignControls(AControl: TControl; var Rect: TRect); override;
procedure Paint; override;
public
constructor Create(AOwner: TComponent); override;
end;
TGroupBox = class(TCustomGroupBox)
published
property Align;
property Caption;
property Color;
property Ctl3D;
property DragCursor;
property DragMode;
property Enabled;
property Font;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
TCustomLabel = class(TGraphicControl)
protected
function GetLabelText: string; virtual;
procedure Notification(AComponent: TComponent;
Operation: TOperation); override;
procedure Paint; override;
procedure SetAutoSize(Value: Boolean); virtual;
property Alignment: TAlignment default taLeftJustify;
property AutoSize: Boolean default True;
property FocusControl: TWinControl;
property ShowAccelChar: Boolean default True;
property Transparent: Boolean default False;
property WordWrap: Boolean default False;
public
constructor Create(AOwner: TComponent); override;
property Canvas;
end;
TLabel = class(TCustomLabel)
published
property Align;
property Alignment;
property AutoSize;
property Caption;
property Color;
property DragCursor;
property DragMode;
property Enabled;
property FocusControl;
property Font;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowAccelChar;
property ShowHint;
property Transparent;
property Visible;
property WordWrap;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
TEditCharCase = (ecNormal, ecUpperCase, ecLowerCase);
TCustomEdit = class(TWinControl)
protected
procedure Change; dynamic;
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWnd; override;
procedure DestroyWnd; override;
property AutoSelect: Boolean default True;
property AutoSize: Boolean default True;
property BorderStyle: TBorderStyle default bsSingle;
property CharCase: TEditCharCase default ecNormal;
property HideSelection: Boolean default True;
property MaxLength: Integer default 0;
property OEMConvert: Boolean default False;
property PasswordChar: Char default #0;
property ParentColor default False;
property ReadOnly: Boolean default False;
property OnChange: TNotifyEvent;
public
constructor Create(AOwner: TComponent); override;
procedure Clear;
procedure ClearSelection;
procedure CopyToClipboard;
procedure CutToClipboard;
procedure PasteFromClipboard;
function GetSelTextBuf(Buffer: PChar; BufSize: Integer): Integer;
procedure SelectAll;
procedure SetSelTextBuf(Buffer: PChar);
property Modified: Boolean;
property SelLength: Integer;
property SelStart: Integer;
property SelText: string;
property Text;
published
property TabStop default True;
end;
TEdit = class(TCustomEdit)
published
property AutoSelect;
property AutoSize;
property BorderStyle;
property CharCase;
property Color;
property Ctl3D;
property DragCursor;
property DragMode;
property Enabled;
property Font;
property HideSelection;
property ImeMode;
property ImeName;
property MaxLength;
property OEMConvert;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PasswordChar;
property PopupMenu;
property ReadOnly;
property ShowHint;
property TabOrder;
property TabStop;
property Text;
property Visible;
property OnChange;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
TScrollStyle = (ssNone, ssHorizontal, ssVertical, ssBoth);
TCustomMemo = class(TCustomEdit)
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWindowHandle(const Params: TCreateParams); override;
procedure KeyPress(var Key: Char); override;
procedure Loaded; override;
procedure SetAlignment(Value: TAlignment);
procedure SetLines(Value: TStrings);
procedure SetScrollBars(Value: TScrollStyle);
procedure SetWordWrap(Value: Boolean);
property Alignment: TAlignment default taLeftJustify;
property ScrollBars: TScrollStyle default ssNone;
property WantReturns: Boolean default True;
property WantTabs: Boolean default False;
property WordWrap: Boolean default True;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property Lines: TStrings;
end;
TMemo = class(TCustomMemo)
published
property Align;
property Alignment;
property BorderStyle;
property Color;
property Ctl3D;
property DragCursor;
property DragMode;
property Enabled;
property Font;
property HideSelection;
property ImeMode;
property ImeName;
property Lines;
property MaxLength;
property OEMConvert;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ReadOnly;
property ScrollBars;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
property WantReturns;
property WantTabs;
property WordWrap;
property OnChange;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
TComboBoxStyle = (csDropDown, csSimple, csDropDownList, csOwnerDrawFixed,
csOwnerDrawVariable);
TOwnerDrawState = set of (odSelected, odGrayed, odDisabled, odChecked,
odFocused);
TDrawItemEvent = procedure(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState) of object;
TMeasureItemEvent = procedure(Control: TWinControl; Index: Integer;
var Height: Integer) of object;
TCustomComboBox = class(TWinControl)
protected
procedure ComboWndProc(var Message: TMessage; ComboWnd: HWnd;
ComboProc: Pointer); virtual;
procedure WndProc(var Message: TMessage); override;
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWnd; override;
procedure DestroyWnd; override;
procedure DrawItem(Index: Integer; Rect: TRect;
State: TOwnerDrawState); virtual;
procedure MeasureItem(Index: Integer; var Height: Integer); virtual;
procedure Change; dynamic;
procedure DropDown; dynamic;
procedure SetStyle(Value: TComboBoxStyle); virtual;
property DropDownCount: Integer default 8;
property EditHandle: HWnd;
property ItemHeight: Integer;
property ListHandle: HWnd;
property MaxLength: Integer default 0;
property ParentColor default False;
property Sorted: Boolean default False;
property Style: TComboBoxStyle default csDropDown;
property OnChange: TNotifyEvent;
property OnDropDown: TNotifyEvent;
property OnDrawItem: TDrawItemEvent;
property OnMeasureItem: TMeasureItemEvent;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Clear;
procedure SelectAll;
property Canvas: TCanvas;
property DroppedDown: Boolean;
property Items: TStrings;
property ItemIndex: Integer;
property SelLength: Integer;
property SelStart: Integer;
property SelText: string;
published
property TabStop default True;
end;
TComboBox = class(TCustomComboBox)
published
property Style; {Must be published before Items}
property Color;
property Ctl3D;
property DragMode;
property DragCursor;
property DropDownCount;
property Enabled;
property Font;
property ImeMode;
property ImeName;
property ItemHeight;
property Items;
property MaxLength;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property Sorted;
property TabOrder;
property TabStop;
property Text;
property Visible;
property OnChange;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnDrawItem;
property OnDropDown;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMeasureItem;
property OnStartDrag;
end;
TButtonControl = class(TWinControl)
protected
procedure WndProc(var Message: TMessage); override;
end;
TButton = class(TButtonControl)
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWnd; override;
procedure SetButtonStyle(ADefault: Boolean); virtual;
public
constructor Create(AOwner: TComponent); override;
procedure Click; override;
published
property Cancel: Boolean default False;
property Caption;
property Default: Boolean default False;
property DragCursor;
property DragMode;
property Enabled;
property Font;
property ModalResult: TModalResult default 0;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property TabStop default True;
property Visible;
property OnClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
TCheckBoxState = (cbUnchecked, cbChecked, cbGrayed);
TCustomCheckBox = class(TButtonControl)
protected
procedure Toggle; virtual;
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWindowHandle(const Params: TCreateParams); override;
procedure CreateWnd; override;
property Alignment: TLeftRight default taRightJustify;
property AllowGrayed: Boolean default False;
property Checked: Boolean;
property State: TCheckBoxState default cbUnchecked;
public
constructor Create(AOwner: TComponent); override;
published
property TabStop default True;
end;
TCheckBox = class(TCustomCheckBox)
published
property Alignment;
property AllowGrayed;
property Caption;
property Checked;
property Color;
property Ctl3D;
property DragCursor;
property DragMode;
property Enabled;
property Font;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property State;
property TabOrder;
property TabStop;
property Visible;
property OnClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
TRadioButton = class(TButtonControl)
protected
procedure SetChecked(Value: Boolean);
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWindowHandle(const Params: TCreateParams); override;
procedure CreateWnd; override;
public
constructor Create(AOwner: TComponent); override;
published
property Alignment: TLeftRight default taRightJustify;
property Caption;
property Checked: Boolean default False;
property Color;
property Ctl3D;
property DragCursor;
property DragMode;
property Enabled;
property Font;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
TListBoxStyle = (lbStandard, lbOwnerDrawFixed, lbOwnerDrawVariable);
TCustomListBox = class(TWinControl)
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure CreateWnd; override;
procedure DestroyWnd; override;
procedure WndProc(var Message: TMessage); override;
procedure DragCanceled; override;
procedure DrawItem(Index: Integer; Rect: TRect;
State: TOwnerDrawState); virtual;
procedure MeasureItem(Index: Integer; var Height: Integer); virtual;
property BorderStyle: TBorderStyle default bsSingle;
property Columns: Integer default 0;
property ExtendedSelect: Boolean default True;
property IntegralHeight: Boolean default False;
property ItemHeight: Integer;
property MultiSelect: Boolean default False;
property ParentColor default False;
property Sorted: Boolean default False;
property Style: TListBoxStyle default lbStandard;
property TabWidth: Integer default 0;
property OnDrawItem: TDrawItemEvent;
property OnMeasureItem: TMeasureItemEvent;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Clear;
function ItemAtPos(Pos: TPoint; Existing: Boolean): Integer;
function ItemRect(Index: Integer): TRect;
property Canvas: TCanvas;
property Items: TStrings;
property ItemIndex: Integer;
property SelCount: Integer;
property Selected[Index: Integer]: Boolean;
property TopIndex: Integer;
published
property TabStop default True;
end;
TListBox = class(TCustomListBox)
published
property Align;
property BorderStyle;
property Color;
property Columns;
property Ctl3D;
property DragCursor;
property DragMode;
property Enabled;
property ExtendedSelect;
property Font;
property ImeMode;
property ImeName;
property IntegralHeight;
property ItemHeight;
property Items;
property MultiSelect;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property Sorted;
property Style;
property TabOrder;
property TabStop;
property TabWidth;
property Visible;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnDrawItem;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMeasureItem;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
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)
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 Ctl3D;
property DragCursor;
property DragMode;
property Enabled;
property Kind: TScrollBarKind default sbHorizontal;
property LargeChange: TScrollBarInc default 1;
property Max: Integer default 100;
property Min: Integer default 0;
property ParentCtl3D;
property ParentShowHint;
property PopupMenu;
property Position: Integer default 0;
property ShowHint;
property SmallChange: TScrollBarInc default 1;
property TabOrder;
property TabStop default True;
property Visible;
property OnChange: TNotifyEvent;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnScroll: TScrollEvent;
property OnStartDrag;
end;
implementation