| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289 |
- {========================================================================}
- {= (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 MMPanel;
- {$I COMPILER.INC}
- {$DEFINE FLOATCALC}
- interface
- uses
- {$IFDEF WIN32}
- Windows,
- {$ELSE}
- WinTypes,
- WinProcs,
- {$ENDIF}
- SysUtils,
- Messages,
- Classes,
- Graphics,
- Controls,
- Forms,
- Dialogs,
- ExtCtrls,
- Menus,
- MMObj,
- MMUtils,
- MMString,
- MMMath,
- MMMulDiv,
- MMMrkLst;
- type
- {-- TMMPanel ---------------------------------------------------------}
- TMMPanel = class(TMMCustomPanel)
- published
- property OnClick;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- {$IFDEF WIN32}
- property OnStartDrag;
- {$ENDIF}
- property Align;
- property Alignment;
- property Bevel;
- property DragCursor;
- property DragMode;
- property Enabled;
- property Caption;
- property Color;
- property Ctl3D;
- property Font;
- property ParentColor;
- property ParentCtl3D;
- property ParentFont;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property TabOrder;
- property TabStop;
- property Visible;
- end;
- {-- TMMBorder --------------------------------------------------------}
- TMMBorder = class(TMMGraphicControl)
- public
- constructor Create(AOwner: TComponent); override;
- published
- property OnClick;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDrag;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property Align;
- property Bevel;
- property DragCursor;
- property DragMode;
- property Enabled;
- property Color;
- property ParentColor;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property Transparent;
- property Visible;
- property Width default 185;
- property Height default 41;
- end;
- type
- TMarkerShift = (mkNone, mkLocator, mkMarkerA, mkMarkerB, mkMarkerAB, mkMarkerBA,mkListMarker);
- TMarkerChangeEvent = procedure(Sender: TObject; var Value: Longint) of Object;
- TMarkersChangeEvent = procedure(Sender: TObject; Shift: TMarkerShift; var ValueA, ValueB: Longint) of Object;
- TRangeChangeEvent = procedure(Sender: TObject; Min, Max: Longint) of Object;
- {-- TMMCustomMarkerPanel --------------------------------------------}
- TMMCustomMarkerPanel = class(TMMCustomPanel)
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- function X_ToPixelNoLimit(X_Value: longint): Longint; virtual;
- function X_ToPixel(X_Value: longint): integer; virtual;
- function PixelTo_X(X: integer): Longint; virtual;
- function Y_ToPixelNoLimit(Y_Value: Longint): Longint; virtual;
- function Y_ToPixel(Y_Value: Longint): integer; virtual;
- function PixelTo_Y(Y: integer): Longint; virtual;
- function FindListMarker(X: integer): integer;
- function IsAnyMarker(X: integer): Boolean;
- function IsLocator(X: integer): Boolean;
- function IsMarkerA(X: integer): Boolean;
- function IsMarkerB(X: integer): Boolean;
- function IsListMarker(X: integer): Boolean;
- function IsGridX(X: integer; var Value: Longint): Boolean; virtual;
- function IsGridY(Y: integer; var Value: Longint): Boolean; virtual;
- procedure SetMinMax(Min, Max: Longint); virtual;
- procedure SetMinMaxY(Min, Max: Longint); virtual;
- procedure SetRangeAll(MinX, MaxX, MinY, MaxY, YBase: Longint); virtual;
- procedure SetDispAll(MinX, MaxX, MinY, MaxY: Longint); virtual;
- property MouseCapture;
- protected
- property OnTrackBegin: TNotifyEvent read FOnTrackBegin write FOnTrackBegin;
- property OnTrack: TNotifyEvent read FOnTrack write FOnTrack;
- property OnTrackEnd: TNotifyEvent read FOnTrackEnd write FOnTrackEnd;
- property OnHelpLocatorChanged: TMarkerChangeEvent read FOnHelpLocatorChanged write FOnHelpLocatorChanged;
- property OnLocatorChanged: TMarkerChangeEvent read FOnLocatorChanged write FOnLocatorChanged;
- property OnMarkerAChanged: TMarkerChangeEvent read FOnMarkerAChanged write FOnMarkerAChanged;
- property OnMarkerBChanged: TMarkerChangeEvent read FOnMarkerBChanged write FOnMarkerBChanged;
- property OnMarkersChanged: TMarkersChangeEvent read FOnMarkersChanged write FOnMarkersChanged;
- property OnRangeChanged: TRangeChangeEvent read FOnRangeChanged write FOnRangeChanged;
- property AutoScroll: Boolean read FAutoScroll write FAutoScroll default True;
- property UseHelpLocator: Boolean read FUseHelpLocator write SetUseHelpLocator default True;
- property UseLocator: Boolean read FUseLocator write SetUseLocator default True;
- property UseMarkers: Boolean read FUseMarkers write SetUseMarkers default False;
- property CorralLocator: Boolean read FCorralLocator write FCorralLocator default True;
- property HelpLocator: Longint read FHelpLocator write SetHelpLocator default -1;
- property Locator: Longint read FLocator write SetLocator default -1;
- property MarkerA: Longint read FMarkerA write SetMarkerA default -1;
- property MarkerB: Longint read FMarkerB write SetMarkerB default -1;
- property HelpLocatorColor : TColor index 0 read FHelpLocColor write SetColors default clSilver;
- property LocatorColor : TColor index 1 read FLocColor write SetColors default clLime;
- property MarkerAColor : TColor index 2 read FMarkAColor write SetColors default clRed;
- property MarkerBColor : TColor index 3 read FMarkBColor write SetColors default clRed;
- property GridColor: TColor index 4 read FGridColor write SetColors default clGray;
- property DrawSolid: Boolean read FDrawSolid write SetDrawSolid default False;
- property DrawGriff: Boolean read FDrawGriff write SetDrawGriff default False;
- property DrawGridX: Boolean read FDrawGridX write SetDrawGridX default False;
- property DrawGridY: Boolean read FDrawGridY write SetDrawGridY default False;
- property GridWidthX: Float read FGridWidthX write SetGridWidthX;
- property GridWidthY: Float read FGridWidthY write SetGridWidthY;
- property SnapToGrid: Boolean read FSnapToGrid write FSnapToGrid default False;
- property SnapRange: integer read FSnapRange write FSnapRange default 3;
- property RangeMinX: Longint read FRangeMinX write SetRangeMinX default 0;
- property RangeMaxX: Longint read FRangeMaxX write SetRangeMaxX default 1000;
- property RangeMinY: Longint read FRangeMinY write SetRangeMinY default 0;
- property RangeMaxY: Longint read FRangeMaxY write SetRangeMaxY default 1000;
- property BaseY: Longint read FBaseY write SetBaseY default 500;
- property DispMinX: Longint read FDispMinX write SetDispMinX default 0;
- property DispMaxX: Longint read FDispMaxX write SetDispMaxX default 1000;
- property DispMinY: Longint read FDispMinY write SetDispMinY default 0;
- property DispMaxY: Longint read FDispMaxY write SetDispMaxY default 1000;
- property MarkerList: TMMMarkerList read FMarkerList write SetMarkerList;
- end;
- {-- TMMMarkerPanel --------------------------------------------------}
- TMMMarkerPanel = class(TMMCustomMarkerPanel)
- public
- property MarkerList;
- published
- property OnClick;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- {$IFDEF WIN32}
- property OnStartDrag;
- {$ENDIF}
- property OnTrackBegin;
- property OnTrack;
- property OnTrackEnd;
- property OnHelpLocatorChanged;
- property OnLocatorChanged;
- property OnMarkerAChanged;
- property OnMarkerBChanged;
- property OnMarkersChanged;
- property OnRangeChanged;
- property Align;
- property Alignment;
- property Bevel;
- property DragCursor;
- property DragMode;
- property Enabled;
- property Color;
- property Ctl3D;
- property ParentFont;
- property ParentColor;
- property ParentCtl3D;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property TabOrder;
- property TabStop;
- property Visible;
- property AutoScroll;
- property CorralLocator;
- property UseHelpLocator;
- property UseLocator;
- property UseMarkers;
- property HelpLocator;
- property Locator;
- property GridWidthX;
- property GridWidthY;
- property SnapToGrid;
- property SnapRange;
- property MarkerA;
- property MarkerB;
- property LocatorColor;
- property MarkerAColor;
- property MarkerBColor;
- property GridColor;
- property DrawSolid;
- property DrawGriff;
- property DrawGridX;
- property DrawGridY;
- property RangeMinX;
- property RangeMaxX;
- property RangeMinY;
- property RangeMaxY;
- property BaseY;
- property DispMinX;
- property DispMaxX;
- property DispMinY;
- property DispMaxY;
- end;
- implementation
|