{========================================================================} {= (c) 1995-98 SwiftSoft Ronald Dittrich =} {========================================================================} {= All Rights Reserved =} {========================================================================} {= D 01099 Dresden = Tel.: +0351-8012255 =} {= Loewenstr.7a = info@swiftsoft.de =} {========================================================================} {= Actual versions on http://www.swiftsoft.de/mmtools.html =} {========================================================================} {= This code is for reference purposes only and may not be copied or =} {= distributed in any format electronic or otherwise except one copy =} {= for backup purposes. =} {= =} {= No Delphi Component Kit or Component individually or in a collection=} {= subclassed or otherwise from the code in this unit, or associated =} {= .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed =} {= without express permission from SwiftSoft. =} {= =} {= For more licence informations please refer to the associated =} {= HelpFile. =} {========================================================================} {= $Date: 20.01.1998 - 18:00:00 $ =} {========================================================================} Unit MMSpin; {$I COMPILER.INC} interface uses {$IFDEF WIN32} Windows, {$ELSE} WinTypes, WinProcs, {$ENDIF} SysUtils, Messages, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, Menus, Buttons, MMSystem, MMObj, MMUtils, MMString, MMButton; const InitialPause = 400; { time in ms before first repeat occurs } RepeatPause = 50; { time in ms between subsequent repeats } type TMMTimeBtnState = set of (tbFocusRect, tbAllowTimer, tbDragging); TMMFocusStyle = (fsNone,fsSolid,fsDot); TMMOrientation = (orVertical,orHorizontal); {== TMMTimerSpeedButton ================================================} TMMTimerSpeedButton = class(TMMSpeedButton) public constructor Create(aOwner: TComponent); override; destructor Destroy; override; property TimeBtnState: TMMTimeBtnState read FTimeBtnState write FTimeBtnState; property FocusColor: TColor read FFocusColor write FFocusColor; property FocusStyle: TMMFocusStyle read FFocusStyle write FFocusStyle default fsSolid; property Enabled: Boolean read GetEnabled write SetEnabled default True; property ButtonFace: Boolean read FButtonFace write SetButtonFace default False; end; {== TMMCustomSpinButton ===============================================} TMMCustomSpinButton = class(TMMCustomControl) public constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; property UpButton: TMMTimerSpeedButton read FUpButton write FUpButton; property DownButton: TMMTimerSpeedButton read FDownButton write FDownButton; property FocusStyle: TMMFocusStyle read FFocusStyle write SetFocusStyle default fsSolid; protected property OnChange: TNotifyEvent read FOnChange write FOnChange; property OnDownClick: TNotifyEvent read FOnDownClick write FOnDownClick; property OnUpClick: TNotifyEvent read FOnUpClick write FOnUpClick; { Orientation must be the first } property Orientation: TMMOrientation read FOrientation write SetOrientation default orVertical; property DownGlyph: TBitmap read GetDownGlyph write SetDownGlyph; property DownNumGlyphs: TNumGlyphs read GetDownNumGlyphs write SetDownNumGlyphs; property Enabled: Boolean read GetEnabled write SetEnabled default True; property FocusColor: TColor read FFocusColor write SetFocusColor default clBlack; property FocusControl: TWinControl read FFocusControl write SetFocusControl; property TabStop default True; property UpGlyph: TBitmap read GetUpGlyph write SetUpGlyph; property UpNumGlyphs: TNumGlyphs read GetUpNumGlyphs write SetUpNumGlyphs; property Width default 21; property Height default 28; property ButtonFace: Boolean read FButtonFace write SetButtonFace default False; property MiddleButton: Boolean read FMiddleButton write SetMiddleButton default False; property Increment: Longint read FIncrement write SetIncrement default 1; property MaxValue: LongInt read FMaxValue write SetMaxValue default 0; property MinValue: LongInt read FMinValue write SetMinValue default 100; property Value: Longint read FValue write SetValue default 0; end; {== TMMCustomSpinButton ===============================================} TMMSpinButton = class(TMMCustomSpinButton) published property OnChange; property OnDownClick; property OnUpClick; property Bevel; property Orientation; property DownGlyph; property DownNumGlyphs; property DragCursor; property DragMode; property Enabled; property FocusColor; property FocusControl; property ParentShowHint; property PopupMenu; property ShowHint; property TabStop; property TabOrder; property UpGlyph; property UpNumGlyphs; property Visible; property Width; property Height; property ButtonFace; property MiddleButton; property Increment; property MaxValue; property MinValue; property Value; end; implementation