Class TWidget (unit widget) |
Inherits from
TComponent
constructor Create(AOwner : TComponent);
- TWidget
destructor Destroy;
subclass the owner to catch all its messages
procedure CalculateWidgetArea;
work out exactly where to put the widget
procedure Click;
the form is being destroyed but only to recreate it we need to re hook everything in a short while
procedure DrawWidget;
finally we calculate the size and position of the widget
procedure SetEnabled(value: boolean);
draw the glyph centered
procedure SetFont(Value : TFont);
procedure SetGap(Value : integer);
procedure SetGlyph(Value : char);
procedure SetOffsetLeft(value: integer);
procedure SetOffsetTop(value: integer);
procedure SetVisible(value: boolean);
procedure NewWndMethod(var msg : TMessage);
"widget draw thyself" This does all the work of handling the owner forms messages.
procedure RestoreHooks(Sender : TObject);
called when the form is being recreated during a borderstyle change (for exmaple) -- rehooks the message trap
property Enabled : boolean
property Font : TFont
property Gap : integer
property Glyph : char
property Hint : string
property OffsetLeft : integer
property OffsetTop : integer
property ShowHint : boolean
property Visible : boolean
event OnClick : TNotifyEvent
DrawPressed : boolean;
FEnabled : boolean;
FFont : TFont;
FGap : integer;
FGlyph : char;
FHint : string;
FOffsetLeft : integer;
FOffsetTop : integer;
FOnClick : TNotifyEvent;
FShowHint : boolean;
FVisible : boolean;
HintWindow : TWidgetHint;
NewWndProc : TFarProc;
OldFont : TFont;
OldWndProc : TFarProc;
Pressed : boolean;
RestoreTimer : TTimer;
WidgetNumber : integer;
WidgetRect : TRect;
constructor Create(AOwner : TComponent);
TWidget
destructor Destroy;
subclass the owner to catch all its messages
procedure CalculateWidgetArea;
work out exactly where to put the widget
procedure Click;
the form is being destroyed but only to recreate it we need to re hook everything in a short while
procedure DrawWidget;
finally we calculate the size and position of the widget
procedure SetEnabled(value: boolean);
draw the glyph centered
procedure SetFont(Value : TFont);
procedure SetGap(Value : integer);
procedure SetGlyph(Value : char);
procedure SetOffsetLeft(value: integer);
procedure SetOffsetTop(value: integer);
procedure SetVisible(value: boolean);
procedure NewWndMethod(var msg : TMessage);
"widget draw thyself" This does all the work of handling the owner forms messages. What it doesn't handle it passes on down the chain of handlers.
procedure RestoreHooks(Sender : TObject);
called when the form is being recreated during a borderstyle change (for exmaple) -- rehooks the message trap
property Enabled : boolean
property Font : TFont
property Gap : integer
property Glyph : char
property Hint : string
property OffsetLeft : integer
property OffsetTop : integer
property ShowHint : boolean
property Visible : boolean
event OnClick : TNotifyEvent
DrawPressed : boolean;
FEnabled : boolean;
FFont : TFont;
FGap : integer;
FGlyph : char;
FHint : string;
FOffsetLeft : integer;
FOffsetTop : integer;
FOnClick : TNotifyEvent;
FShowHint : boolean;
FVisible : boolean;
HintWindow : TWidgetHint;
NewWndProc : TFarProc;
OldFont : TFont;
OldWndProc : TFarProc;
Pressed : boolean;
RestoreTimer : TTimer;
WidgetNumber : integer;
WidgetRect : TRect;