home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
EXTCTRLS.INT
< prev
next >
Wrap
Text File
|
1997-02-28
|
11KB
|
370 lines
{*******************************************************}
{ }
{ Delphi Visual Component Library }
{ }
{ Copyright (c) 1995,96 Borland International }
{ }
{*******************************************************}
unit ExtCtrls;
{$S-,W-,R-}
{$C PRELOAD}
interface
uses Messages, Windows, SysUtils, Classes, Controls, Forms, Menus, Graphics,
StdCtrls;
type
TShapeType = (stRectangle, stSquare, stRoundRect, stRoundSquare,
stEllipse, stCircle);
TShape = class(TGraphicControl)
protected
procedure Paint; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
procedure StyleChanged(Sender: TObject);
property Brush: TBrush;
property DragCursor;
property DragMode;
property Enabled;
property ParentShowHint;
property Pen: TPen;
property Shape: TShapeType default stRectangle;
property ShowHint;
property Visible;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
TPaintBox = class(TGraphicControl)
protected
procedure Paint; override;
public
constructor Create(AOwner: TComponent); override;
property Canvas;
published
property Align;
property Color;
property DragCursor;
property DragMode;
property Enabled;
property Font;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property Visible;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnPaint: TNotifyEvent;
property OnStartDrag;
end;
TImage = class(TGraphicControl)
protected
function GetPalette: HPALETTE; override;
procedure Paint; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property Canvas: TCanvas;
published
property Align;
property AutoSize: Boolean default False;
property Center: Boolean default False;
property DragCursor;
property DragMode;
property Enabled;
property ParentShowHint;
property Picture: TPicture;
property PopupMenu;
property ShowHint;
property Stretch: Boolean default False;
property Visible;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
TBevelStyle = (bsLowered, bsRaised);
TBevelShape = (bsBox, bsFrame, bsTopLine, bsBottomLine, bsLeftLine,
bsRightLine);
TBevel = class(TGraphicControl)
protected
procedure Paint; override;
public
constructor Create(AOwner: TComponent); override;
published
property Align;
property ParentShowHint;
property Shape: TBevelShape default bsBox;
property ShowHint;
property Style: TBevelStyle default bsLowered;
property Visible;
end;
TTimer = class(TComponent)
protected
procedure Timer; dynamic;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property Enabled: Boolean default True;
property Interval: Cardinal default 1000;
property OnTimer: TNotifyEvent;
end;
TPanelBevel = (bvNone, bvLowered, bvRaised);
TBevelWidth = 1..MaxInt;
TBorderWidth = 0..MaxInt;
TCustomPanel = class(TCustomControl)
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure AlignControls(AControl: TControl; var Rect: TRect); override;
procedure Paint; override;
procedure Resize; dynamic;
property Alignment: TAlignment default taCenter;
property BevelInner: TPanelBevel default bvNone;
property BevelOuter: TPanelBevel default bvRaised;
property BevelWidth: TBevelWidth default 1;
property BorderWidth: TBorderWidth default 0;
property BorderStyle: TBorderStyle default bsNone;
property Color default clBtnFace;
property FullRepaint: Boolean default True;
property Locked: Boolean default False;
property ParentColor default False;
property OnResize: TNotifyEvent;
public
constructor Create(AOwner: TComponent); override;
end;
TPanel = class(TCustomPanel)
published
property Align;
property Alignment;
property BevelInner;
property BevelOuter;
property BevelWidth;
property BorderWidth;
property BorderStyle;
property DragCursor;
property DragMode;
property Enabled;
property Caption;
property Color;
property Ctl3D;
property Font;
property Locked;
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 OnResize;
property OnStartDrag;
end;
TPage = class(TCustomControl)
protected
procedure ReadState(Reader: TReader); override;
procedure Paint; override;
public
constructor Create(AOwner: TComponent); override;
published
property Caption;
property Height stored False;
property TabOrder stored False;
property Visible stored False;
property Width stored False;
end;
TNotebook = class(TCustomControl)
protected
procedure CreateParams(var Params: TCreateParams); override;
function GetChildOwner: TComponent; override;
procedure GetChildren(Proc: TGetChildProc); override;
procedure ReadState(Reader: TReader); override;
procedure ShowControl(AControl: TControl); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property ActivePage: string;
property Align;
property Color;
property Ctl3D;
property DragCursor;
property DragMode;
property Font;
property Enabled;
property PageIndex: Integer default 0;
property Pages: TStrings;
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 OnPageChanged: TNotifyEvent;
property OnStartDrag;
end;
{ THeader
Purpose - Creates sectioned visual header that allows each section to be
resized with the mouse.
Features - This is a design-interactive control. In design mode, the
sections are named using the string-list editor. Each section
can now be manually resized using the right mouse button the grab
the divider and drag to the new size. Changing the section list
at design (or even run-time), will attempt to maintain the
section widths for sections that have not been changed.
Properties:
Align - Standard property.
AllowResize - If True, the control allows run-time mouse resizing of the
sections.
BorderStyle - Turns the border on and off.
Font - Standard property.
Sections - A special string-list that contains the section text.
ParentFont - Standard property.
OnSizing - Event called for each mouse move during a section resize
operation.
OnSized - Event called once the size operation is complete.
SectionWidth - Array property allowing run-time getting and setting of
each section's width. }
TSectionEvent = procedure(Sender: TObject;
ASection, AWidth: Integer) of object;
THeader = class(TCustomControl)
protected
procedure Paint; override;
procedure CreateParams(var Params: TCreateParams); override;
procedure Sizing(ASection, AWidth: Integer); dynamic;
procedure Sized(ASection, AWidth: Integer); dynamic;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property SectionWidth[X: Integer]: Integer;
published
property Align;
property AllowResize: Boolean default True;
property BorderStyle: TBorderStyle default bsSingle;
property Enabled;
property Font;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property Sections: TStrings;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
property OnSizing: TSectionEvent;
property OnSized: TSectionEvent;
end;
TCustomRadioGroup = class(TCustomGroupBox)
protected
procedure ReadState(Reader: TReader); override;
function CanModify: Boolean; virtual;
procedure GetChildren(Proc: TGetChildProc); override;
property Columns: Integer default 1;
property ItemIndex: Integer default -1;
property Items: TStrings;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
TRadioGroup = class(TCustomRadioGroup)
published
property Align;
property Caption;
property Color;
property Columns;
property Ctl3D;
property DragCursor;
property DragMode;
property Enabled;
property Font;
property ItemIndex;
property Items;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
property OnClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnStartDrag;
end;
procedure Frame3D(Canvas: TCanvas; var Rect: TRect;
TopColor, BottomColor: TColor; Width: Integer);
implementation