Class TSpin97 (unit AddOnTB97) |
Inherits from
TWinControl
constructor Create(AOwner: TComponent);
- ////////////////////////////////////////////////////////////////////////////// // TSpin97 // //////////////////////////////////////////////////////////////////////////////
procedure MouseEntered(Value: Boolean);
procedure MouseLeft(Value: Boolean);
procedure BtnClick(Sender: TObject);
if Repeating
then with FActiveButton do Repeating := False;
procedure BtnMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure BtnMouseEnter(Sender: TObject);
procedure BtnMouseExit(Sender: TObject);
procedure BtnMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure BtnMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
With this code when repeat is true, the Up/DownClick event is executed
TWICE!!!
This code is more elegant (I use the timer shipped in the TToolbarButton97)
than the code above but it doesn't work.
function CreateButton: TToolbarButton97;
procedure ArrangeButtons;
function GetDownCaption: TCaption;
////////////////////////////////////////////////////////////////////////////// TSpin97 Procedures & Functions for DOWN-Button //////////////////////////////////////////////////////////////////////////////
function GetDownGlyph: TBitmap;
function GetDownLayout: TButtonLayout;
function GetDownMargin: Integer;
function GetDownMask: TBitmap;
function GetDownNumGlyphs: TNumGlyphs;
function GetDownSpacing: Integer;
function GetUpCaption: TCaption;
////////////////////////////////////////////////////////////////////////////// TSpin97 Procedures & Functions for UP-Button //////////////////////////////////////////////////////////////////////////////
function GetUpGlyph: TBitmap;
function GetUpLayout: TButtonLayout;
function GetUpMargin: Integer;
function GetUpMask: TBitmap;
function GetUpNumGlyphs: TNumGlyphs;
function GetUpSpacing: Integer;
procedure RepeatDelayExpired(Sender: TObject);
procedure SetDownCaption(Value: TCaption);
procedure SetDownGlyph(Value: TBitmap);
procedure SetDownLayout(Value: TButtonLayout);
procedure SetDownMargin(Value:Integer);
procedure SetDownMask (Value: TBitmap);
procedure SetDownNumGlyphs(Value: TNumGlyphs);
procedure SetDownSpacing(Value: Integer);
procedure SetKind(Value: TSpin97Kind);
procedure SetUpCaption(Value: TCaption);
procedure SetUpGlyph(Value: TBitmap);
procedure SetUpLayout(Value: TButtonLayout);
procedure SetUpMargin(Value:Integer);
procedure SetUpMask (Value: TBitmap);
procedure SetUpNumGlyphs(Value: TNumGlyphs);
procedure SetUpSpacing(Value: Integer);
procedure WMSize(var Message: TWMSize);
if TSpin97 is used in a TSpinEdit97 "Delta:=2" means that a 2 pixels band is
reserved to the left of the spinbutton in order to draw his 3D aspect;
Otherwise, TSpin97 cover all his space "Delta:=0".
property Align :
property DownCaption : TCaption
property DownGlyph : TBitmap
property DownLayout : TButtonLayout
property DownMargin : Integer
property DownMask : TBitmap
property DownNumGlyphs : TNumGlyphs
property DownSpacing : Integer
property DragCursor :
property DragMode :
property Enabled :
property FocusControl : TWinControl
property Font :
property Increment : Double
property Kind : TSpin97Kind
default 0;
property ParentFont :
property ParentShowHint :
property PopupMenu :
property RepeatDelay : Integer
property Repeating : Boolean
property RepeatInterval : Integer
property ShowHint :
property UpCaption : TCaption
property UpGlyph : TBitmap
property UpLayout : TButtonLayout
property UpMargin : Integer
property UpMask : TBitmap
property UpNumGlyphs : TNumGlyphs
property UpSpacing : Integer
property Visible :
event OnDownClick : TNotifyEvent
event OnDragDrop :
event OnDragOver :
event OnEndDrag :
event OnEnter :
event OnExit :
event OnMouseDown :
event OnMouseEnter : TNotifyEvent
event OnMouseExit : TNotifyEvent
event OnMouseMove : TMouseMoveEvent
event OnMouseUp :
event OnStartDrag :
event OnUpClick : TNotifyEvent
FActiveBUtton : TToolbarButton97;
FDownButton : TToolbarButton97;
FFocusControl : TWinControl;
FIncrement : Double;
FKind : TSpin97Kind;
FOnDownClick : TNotifyEvent;
FOnMouseEnter : TNotifyEvent;
FOnMouseExit : TNotifyEvent;
FOnMouseMove : TMouseMoveEvent;
FOnUpClick : TNotifyEvent;
FRepeatDelay : Integer;
FRepeating : Boolean;
see remak in BtnMousedown procedure
FRepeatInterval : Integer;
FRepeatTimer : TTimer;
FUpButton : TToolbarButton97;
constructor Create(AOwner: TComponent);
////////////////////////////////////////////////////////////////////////////// // TSpin97 // //////////////////////////////////////////////////////////////////////////////
procedure MouseEntered(Value: Boolean);
procedure MouseLeft(Value: Boolean);
procedure BtnClick(Sender: TObject);
if Repeating
then with FActiveButton do Repeating := False;
procedure BtnMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure BtnMouseEnter(Sender: TObject);
procedure BtnMouseExit(Sender: TObject);
procedure BtnMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure BtnMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
With this code when repeat is true, the Up/DownClick event is executed
TWICE!!!
This code is more elegant (I use the timer shipped in the TToolbarButton97)
than the code above but it doesn't work.
If anybody can debug it......
if Repeating
then begin
FActiveButton := Sender as TToolbarButton97;
with FActiveButton do begin
RepeatInterval := FRepeatInterval;
RepeatDelay := FRepeatDelay;
Repeating := True;
end;
end;
function CreateButton: TToolbarButton97;
procedure ArrangeButtons;
function GetDownCaption: TCaption;
////////////////////////////////////////////////////////////////////////////// TSpin97 Procedures & Functions for DOWN-Button //////////////////////////////////////////////////////////////////////////////
function GetDownGlyph: TBitmap;
function GetDownLayout: TButtonLayout;
function GetDownMargin: Integer;
function GetDownMask: TBitmap;
function GetDownNumGlyphs: TNumGlyphs;
function GetDownSpacing: Integer;
function GetUpCaption: TCaption;
////////////////////////////////////////////////////////////////////////////// TSpin97 Procedures & Functions for UP-Button //////////////////////////////////////////////////////////////////////////////
function GetUpGlyph: TBitmap;
function GetUpLayout: TButtonLayout;
function GetUpMargin: Integer;
function GetUpMask: TBitmap;
function GetUpNumGlyphs: TNumGlyphs;
function GetUpSpacing: Integer;
procedure RepeatDelayExpired(Sender: TObject);
procedure SetDownCaption(Value: TCaption);
procedure SetDownGlyph(Value: TBitmap);
procedure SetDownLayout(Value: TButtonLayout);
procedure SetDownMargin(Value:Integer);
procedure SetDownMask (Value: TBitmap);
procedure SetDownNumGlyphs(Value: TNumGlyphs);
procedure SetDownSpacing(Value: Integer);
procedure SetKind(Value: TSpin97Kind);
procedure SetUpCaption(Value: TCaption);
procedure SetUpGlyph(Value: TBitmap);
procedure SetUpLayout(Value: TButtonLayout);
procedure SetUpMargin(Value:Integer);
procedure SetUpMask (Value: TBitmap);
procedure SetUpNumGlyphs(Value: TNumGlyphs);
procedure SetUpSpacing(Value: Integer);
procedure WMSize(var Message: TWMSize);
if TSpin97 is used in a TSpinEdit97 "Delta:=2" means that a 2 pixels band is
reserved to the left of the spinbutton in order to draw his 3D aspect;
Otherwise, TSpin97 cover all his space "Delta:=0".
property Align :
property DownCaption : TCaption
property DownGlyph : TBitmap
property DownLayout : TButtonLayout
property DownMargin : Integer
property DownMask : TBitmap
property DownNumGlyphs : TNumGlyphs
property DownSpacing : Integer
property DragCursor :
property DragMode :
property Enabled :
property FocusControl : TWinControl
property Font :
property Increment : Double
property Kind : TSpin97Kind
default 0;
property ParentFont :
property ParentShowHint :
property PopupMenu :
property RepeatDelay : Integer
property Repeating : Boolean
property RepeatInterval : Integer
property ShowHint :
property UpCaption : TCaption
property UpGlyph : TBitmap
property UpLayout : TButtonLayout
property UpMargin : Integer
property UpMask : TBitmap
property UpNumGlyphs : TNumGlyphs
property UpSpacing : Integer
property Visible :
event OnDownClick : TNotifyEvent
event OnDragDrop :
event OnDragOver :
event OnEndDrag :
event OnEnter :
event OnExit :
event OnMouseDown :
event OnMouseEnter : TNotifyEvent
event OnMouseExit : TNotifyEvent
event OnMouseMove : TMouseMoveEvent
event OnMouseUp :
event OnStartDrag :
event OnUpClick : TNotifyEvent
FActiveBUtton : TToolbarButton97;
FDownButton : TToolbarButton97;
FFocusControl : TWinControl;
FIncrement : Double;
FKind : TSpin97Kind;
FOnDownClick : TNotifyEvent;
FOnMouseEnter : TNotifyEvent;
FOnMouseExit : TNotifyEvent;
FOnMouseMove : TMouseMoveEvent;
FOnUpClick : TNotifyEvent;
FRepeatDelay : Integer;
FRepeating : Boolean;
see remak in BtnMousedown procedure
FRepeatInterval : Integer;
FRepeatTimer : TTimer;
FUpButton : TToolbarButton97;