| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- {========================================================================}
- {= (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 MMSlider;
- {$I COMPILER.INC}
- interface
- uses
- {$IFDEF WIN32}
- Windows,
- {$ELSE}
- WinTypes,
- WinProcs,
- {$ENDIF}
- Forms,
- SysUtils,
- Messages,
- Classes,
- Graphics,
- Controls,
- Dialogs,
- ExtCtrls,
- Menus,
- MMObj,
- MMUtils,
- MMMath,
- MMString,
- MMScale;
- type
- TMMOrientation = (orVertical,orHorizontal);
- TMMThumbStyle = (tsRect,tsOwnerDraw);
- TMMGrooveStyle = (gsRect,gsOwnerDraw);
- TMMFocusAction = (faNone, faFocusThumb, faFocusRect, faFocusColor, faAll);
- TMMScalePos = (spAboveOrLeft, spBelowOrRight, spBoth);
- TMMThumbDrawEvent = procedure(Sender: TObject; aCanvas: TCanvas; aRect: TRect;
- Dragged,Focused: Boolean) of object;
- TMMGrooveDrawEvent= procedure(Sender: TObject; aCanvas: TCanvas; var aRect: TRect) of object;
- {-- TMMCustomSlider ---------------------------------------------------}
- TMMCustomSlider = class(TMMCustomControl)
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- protected
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- property OnTrack: TNotifyEvent read FOnTrack write FOnTrack;
- property OnTrackEnd: TNotifyEvent read FOnTrackEnd write FOnTrackEnd;
- property OnDrawThumb: TMMThumbDrawEvent read FOnDrawThumb write FOnDrawThumb;
- property OnDrawGroove: TMMGrooveDrawEvent read FOnDrawGroove write FOnDrawGroove;
- property TabStop default True;
- property Width default 200;
- property Height default 40;
- property Groove: TMMBevel read FGroove write SetGroove;
- property FocusAction: TMMFocusAction read FFocusAction write SetFocusAction default faFocusRect;
- property FocusColor: TColor index 0 read FFocusColor write SetColors default clActiveCaption;
- property GrooveColor: TColor index 1 read FGrooveColor write SetColors default clBtnFace;
- property ThumbColor: TColor index 2 read FThumbColor write SetColors default clBtnFace;
- property DisabledColor: TColor index 3 read FDisabledColor write SetColors default clWhite;
- property HandCursor: Boolean read FHandCursor write FHandCursor default False;
- property ThumbCursor: TCursor read FThumbCursor write FThumbCursor default crDefault;
- property MinValue: Integer read FMin write SetMin default 0;
- property MaxValue: Integer read FMax write SetMax default 10;
- property LineSize: Integer read FLineSize write FLineSize default 1;
- property PageSize: Integer read FPageSize write FPageSize default 5;
- property Orientation: TMMOrientation read FOrientation write SetOrientation default orHorizontal;
- property Position: Integer read GetPosition write SetPosition default 0;
- property GrooveSize: Byte read FGrooveSize write SetGrooveSize default 3;
- property GrooveStyle: TMMGrooveStyle read FGrooveStyle write SetGrooveStyle default gsRect;
- property ThumbWidth: Byte index 0 read FThumbWidth write SetThumbSize default 11;
- property ThumbHeight: Byte index 1 read FThumbHeight write SetThumbSize default 23;
- property ThumbStyle: TMMThumbStyle read FThumbStyle write SetThumbStyle default tsRect;
- property ThumbBorder: Boolean read FThumbBorder write SetThumbBorder default True;
- property ScaleDistance: Integer read FScaleDistance write SetScaleDist default 10;
- property ScalePosition: TMMScalePos read FScalePos write SetScalePos default spBelowOrRight;
- property Scale: TMMScale read FScale write SetScale;
- property PicLeft: TBitmap read FPicLeft write SetPicLeft;
- property PicRight: TBitmap read FPicRight write SetPicRight;
- property Logarithmic: Boolean read FLogMode write SetLogMode default False;
- property Sensitivity: Integer read FSensitivity write SetSensitivity default -24;
- end;
- {-- TMMSlider ---------------------------------------------------------}
- TMMSlider = class(TMMCustomSlider)
- published
- property OnEnter;
- property OnExit;
- property OnKeyDown;
- property OnKeyPress;
- property OnKeyUp;
- property OnChange;
- property OnTrack;
- property OnTrackEnd;
- property OnDrawThumb;
- property OnDrawGroove;
- property Align;
- property Visible;
- property Color;
- property Enabled;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property TabStop;
- property TabOrder;
- property Width;
- property Height;
- property Bevel;
- property Groove;
- property FocusAction;
- property FocusColor;
- property GrooveColor;
- property ThumbColor;
- property ThumbBorder;
- property DisabledColor;
- property HandCursor;
- property ThumbCursor;
- property MinValue;
- property MaxValue;
- property LineSize;
- property PageSize;
- property Orientation;
- property Position;
- property GrooveSize;
- property ThumbWidth;
- property ThumbHeight;
- property ThumbStyle;
- property GrooveStyle;
- property ScaleDistance;
- property ScalePosition;
- property Scale;
- property PicLeft;
- property PicRight;
- property Logarithmic;
- property Sensitivity;
- end;
- implementation
|