const
{$IFDEF PAIDVERS}
SDLVersionInfo = 'colorscale_r1000_full';
IsLightEd = false;
{$ELSE}
SDLVersionInfo = 'colorscale_r1000_lighted';
IsLightEd = true;
{$ENDIF}
release = 1000;
type
TMouseMoveInColorScaleEvent = procedure (Sender: TObject; InScale: boolean;
Shift: TShiftState;
rMousePos: double) of object;
TColScaleOrientation = (csoHorizontal, csoVertical);
TColorScale = class (TCustomControl)
private
FFrameSt : TFrameStyle;
FCaption : string;
FCaptColor : TColor;
FCaptPosX : integer;
FCaptPosY : integer;
FCaptSize : integer;
FCaptStyle : TFontStyles;
FSuppressPaint : boolean;
FColSclMin : double;
FColSclMax : double;
FExtendColors : boolean;
FMarginTop : integer;
FMarginBottom : integer;
FMarginLeft : integer;
FMarginRight : integer;
FFramedColors : boolean;
FColorLow : double;
FColorHigh : double;
FColScaleOrient : TColScaleOrientation;
FColorSclBkgd : TColor;
FColorScale : TColor;
FColBlackLine : TColor; { colors to draw the frame }
FColGrayLine : TColor; { -"- }
FColWhiteLine : TColor; { -"- }
FColorScheme : TColorScheme; { color scheme of frames }
FOnMMvInScale : TMouseMoveInColorScaleEvent;
FScale : TScale;
FGrafBmp : TBitMap;
procedure SetColorScheme (Value: TColorScheme);
procedure SetColorSclBkgd (Value: TColor);
procedure SetColorScale (Value: TColor);
procedure SetFrameStyle (value: TFrameStyle);
procedure SetCaptStyles (Value: TFontStyles);
procedure SetCaption (Value: string);
procedure SetCaptColor (Value: TColor);
procedure SetCaptPosX (Value: integer);
procedure SetCaptPosY (Value: integer);
procedure SetCaptSize (Value: integer);
procedure SetMarginTop (Value: integer);
procedure SetMarginBottom (Value: integer);
procedure SetMarginLeft (Value: integer);
procedure SetMarginRight (Value: integer);
procedure SetColSclMin (value: double);
procedure SetColSclMax (value: double);
procedure SetColorLow (value: double);
procedure SetColorHigh (value: double);
procedure SetColScaleOrientation (value: TColScaleOrientation);
procedure SetScaleDims;
procedure SetExtColors (value: boolean);
procedure SetFramedColors (value: boolean);
procedure SetSuppPaint (value: boolean);
procedure WMMouseMoveInScale (var Message: TWMMouse);
message WM_MOUSEMOVE;
protected
procedure ColorArrayChange(Sender: TObject);
procedure AssignTo (Dest: TPersistent); override;
procedure MouseMove (Shift: TShiftState; X,Y: integer); override;
procedure Paint; override;
procedure MouseMoveInScale (InScale: boolean; Shift: TShiftState;
RMousePos: double);
public
ColorArray : TColorArray;
procedure Assign(Source: TPersistent); override;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure SetBounds (ALeft, ATop, AWidth, AHeight: Integer); override;
property SuppressPaint: boolean
read FSuppressPaint write SetSuppPaint;
function ColorToValue (cl: TColor): double;
function ValueToColor (v: double): TColor;
published
property Align;
property Anchors;
property Caption: string read FCaption write SetCaption;
property CaptionColor: TColor read FCaptColor write SetCaptColor;
property CaptionPosX: integer read FCaptPosX write SetCaptPosX;
property CaptionPosY: integer read FCaptPosY write SetCaptPosY;
property CaptionSize: integer read FCaptSize write SetCaptSize;
property CaptionStyle: TFontStyles
read FCaptStyle write SetCaptStyles;
property ColorSclBkgd: TColor
read FColorSclBkgd write SetColorSclBkgd;
property ColorOfScale: TColor read FColorScale write SetColorScale;
property ColorScheme: TColorScheme
read FColorScheme write SetColorScheme;
property Font;
property FrameStyle: TFrameStyle
read FFrameSt write SetFrameStyle;
property ScaleRangeHigh: double read FColSclMax write SetColSclMax;
property ScaleRangeLow: double read FColSclMin write SetColSclMin;
property ExtendColors: boolean read FExtendColors write SetExtColors;
property FramedColorScale: boolean
read FFramedColors write SetFramedColors;
property ColorHigh: double read FColorHigh write SetColorHigh;
property ColorLow: double read FColorLow write SetColorLow;
property MarginTop: integer read FMarginTop write SetMarginTop;
property MarginBottom: integer
read FMarginBottom write SetMarginBottom;
property MarginLeft: integer read FMarginLeft write SetMarginLeft;
property MarginRight: integer read FMarginRight write SetMarginRight;
property Orientation: TColScaleOrientation
read FColScaleOrient write SetColScaleOrientation;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property Visible;
property OnClick;
property OnDblClick;
property OnMouseMove;
property OnMouseDown;
property OnMouseUp;
property OnMouseMoveInScale: TMouseMoveInColorScaleEvent
read FOnMMvInScale write FOnMMvInScale;
property OnMouseWheel;
property OnMouseWheelUp;
property OnMouseWheelDown;
property OnKeyPress;
property OnKeyDown;
property OnKeyUp;
end;
procedure Register;
|