(* ImageEn Build 7.0.0.06.2637 @ 7-4-17 14:58:42.679 *) (* Copyright (c) 1998-2017 by Carlotta Calandra. All rights reserved. Copyright (c) 2011-2017 by Xequte Software. This software comes without express or implied warranty. In no case shall the author be liable for any damage or unwanted behavior of any computer hardware and/or software. Author grants you the right to include the component in your application, whether COMMERCIAL, SHAREWARE, or FREEWARE. ImageEn, IEvolution and ImageEn ActiveX may not be included in any commercial, shareware or freeware libraries or components. www.ImageEn.com *) (* File version 1006 Doc revision 1002 *) unit rulerbox; {$R-} {$Q-} {$I ie.inc} interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, {$ifdef IEHASTYPES} Types, {$endif} iexRulers, iegdiplus; type {!! TRulerBox Description TRulerBox is a ruler. It can be used to show the position of the cursor in a . Demo \Demos\Other\RulerBox\DRulerBox.dpr Methods and Properties Events !!} {$ifdef IEHASPLATFORMATTRIBUTE} [ComponentPlatformsAttribute(pidWin32 or pidWin64)] {$endif} TRulerBox = class(TCustomControl) private { Private declarations } fIERuler: TIERuler; function GetGripsPos(i: integer): double; procedure SetGripsPos(i: integer; p: double); function GetGripsColor(i: integer): TColor; procedure SetGripsColor(i: integer; p: TColor); function GetGripsMin(i: integer): double; procedure SetGripsMin(i: integer; v: double); function GetGripsMax(i: integer): double; procedure SetGripsMax(i: integer; v: double); function GetViewMin: double; procedure SetViewMin(v: double); function GetViewMax: double; procedure SetViewMax(v: double); function GetViewPos: double; procedure SetViewPos(v: double); function GetDPU: double; procedure SetDPU(v: double); function GetOffsetX: integer; procedure SetOffsetX(v: integer); function GetOffsetY: integer; procedure SetOffsetY(v: integer); function GetMinLabelSpacing: integer; procedure SetMinLabelSpacing(v: integer); function GetFrequency: double; procedure SetFrequency(v: double); function GetLabelFreq: double; procedure SetLabelFreq(v: double); function GetRuler: boolean; procedure SetRuler(v: boolean); function GetRulerColor: TColor; procedure SetRulerColor(v: TColor); function GetRulerDir: TRulerDir; procedure SetRulerDir(v: TRulerDir); function GetBackground: TColor; procedure SetBackground(bk: TColor); function GetFitInView: boolean; procedure SetFitInView(v: boolean); function GetHexLabels: boolean; procedure SetHexLabels(v: boolean); function GetInverted: boolean; procedure SetInverted(v: boolean); function GetLabelPrecision: integer; procedure SetLabelPrecision(v: integer); function GetScrollRate: double; procedure SetScrollRate(const Value: double); function GetGripsCount: integer; procedure SetGripsCount(v: integer); function GetGripKindDefault: TGripKind; procedure SetGripKindDefault(const Value: TGripKind); function GetGripsKind(i: integer): TGripKind; procedure SetGripsKind(i: integer; v: TGripKind); function GetGripsDir: TGripsDir; procedure SetGripsDir(v: TGripsDir); function GetGripColorDefault: TColor; procedure SetGripColorDefault(const Value: TColor); function GetGripPenColor: TColor; procedure SetGripPenColor(const Value: TColor); function GetGripBaseDim: integer; procedure SetGripBaseDim(v: integer); function GetMaxGripHeight: integer; procedure SetMaxGripHeight(const Value: integer); function GetOnRulerClick: TRulerClickEvent; procedure SetOnRulerClick(const Value: TRulerClickEvent); function GetOnRulerGripClick: TRulerGripClickEvent; procedure SetOnRulerGripClick(const Value: TRulerGripClickEvent); function GetOnRulerGripDblClick: TRulerGripClickEvent; procedure SetOnRulerGripDblClick(const Value: TRulerGripClickEvent); function GetOnRulerPosChange: TRulerGripPosChangeEvent; procedure SetOnRulerPosChange(const Value: TRulerGripPosChangeEvent); function GetShowBorder: boolean; procedure SetShowBorder(const Value: boolean); protected { Protected declarations } procedure WMSize(var Message: TWMSize); message WM_SIZE; procedure WMEraseBkgnd(var Message: TMessage); message WM_ERASEBKGND; procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; public { Public declarations } procedure Paint; override; constructor Create(Owner: TComponent); override; destructor Destroy; override; procedure Update(); override; procedure LockUpdate(); procedure UnlockUpdate(); property GripsPos[g: integer]: double read GetGripsPos write SetGripsPos; default; property GripsColor[g: integer]: TColor read GetGripsColor write SetGripsColor; property GripsKind[g: integer]: TGripKind read GetGripsKind write SetGripsKind; property GripsMin[g: integer]: double read GetGripsMin write SetGripsMin; property GripsMax[g: integer]: double read GetGripsMax write SetGripsMax; property ScrollRate: double read GetScrollRate write SetScrollRate; published { Published declarations } property ViewPos: double read GetViewPos write SetViewPos; property Background: TColor read GetBackground write SetBackground default clBtnFace; property GripPenColor : TColor read GetGripPenColor write SetGripPenColor default clBlack; property GripBaseDim: integer read GetGripBaseDim write SetGripBaseDim default 12; property GripsDir: TGripsDir read GetGripsDir write SetGripsDir default gdUp; property Ruler: boolean read GetRuler write SetRuler default true; property DotPerUnit: double read GetDPU write SetDPU; property Frequency: double read GetFrequency write SetFrequency; property LabelFreq: double read GetLabelFreq write SetLabelFreq; property RulerColor: TColor read GetRulerColor write SetRulerColor default clBtnFace; property RulerDir: TRulerDir read GetRulerDir write SetRulerDir default rdHorizontal; property ViewMin: double read GetViewMin write SetViewMin; property ViewMax: double read GetViewMax write SetViewMax; property LabelPrecision: integer read GetLabelPrecision write SetLabelPrecision default 3; property MinLabelSpacing: integer read GetMinLabelSpacing write SetMinLabelSpacing default 30; property GripKindDefault: TGripKind read GetGripKindDefault write SetGripKindDefault default gkTriangle; property GripColorDefault: TColor read GetGripColorDefault write SetGripColorDefault default clBtnFace; property OffsetX: integer read GetOffsetX write SetOffsetX default 0; property OffsetY: integer read GetOffsetY write SetOffsetY default 0; property Inverted: boolean read GetInverted write SetInverted default false; property FitInView: boolean read GetFitInView write SetFitInView default false; property GripsCount: integer read GetGripsCount write SetGripsCount default 1; property HexLabels: boolean read GetHexLabels write SetHexLabels default false; property ShowBorder: boolean read GetShowBorder write SetShowBorder default False; property MaxGripHeight: integer read GetMaxGripHeight write SetMaxGripHeight; property OnRulerPosChange: TRulerGripPosChangeEvent read GetOnRulerPosChange write SetOnRulerPosChange; property OnRulerGripClick: TRulerGripClickEvent read GetOnRulerGripClick write SetOnRulerGripClick; property OnRulerGripDblClick: TRulerGripClickEvent read GetOnRulerGripDblClick write SetOnRulerGripDblClick; property OnRulerClick: TRulerClickEvent read GetOnRulerClick write SetOnRulerClick; property Align; property DragCursor; property DragMode; property Enabled; property ParentShowHint; property PopupMenu; property ShowHint; property Visible; property OnClick; property OnDblClick; property OnDragDrop; property OnDragOver; property OnEndDrag; property OnMouseDown; property OnMouseMove; property OnMouseUp; property OnStartDrag; property Width; property Height; property Font; property MouseCapture; end; implementation {$R-} ///////////////////////////////////////////////////////////////////////////////////////// // // // TRULERBOX // // // ///////////////////////////////////////////////////////////////////////////////////////// constructor TRulerBox.Create(Owner: TComponent); begin inherited Create(Owner); controlstyle := controlstyle + [csOpaque]; Height := 40; Width := 300; fIERuler := TIERuler.Create( Self ); Update(); end; destructor TRulerBox.Destroy; begin FreeAndNil( fIERuler ); inherited; end; procedure TRulerBox.Update(); begin fIERuler.Update(); end; procedure TRulerBox.Paint; begin Canvas.Brush.Style := bsSolid; Canvas.Brush.Color := fIERuler.Background; Canvas.FillRect(Rect(0, 0, fIERuler.OffsetX, Height)); Canvas.FillRect(Rect(0, 0, Width, fIERuler.OffsetY)); fIERuler.DrawToCanvas( Canvas, 0, 0 ); end; procedure TRulerBox.WMEraseBkgnd(var Message: TMessage); begin Message.Result := 0; end; procedure TRulerBox.WMSize(var Message: TWMSize); begin inherited; fIERuler.UpdateSize( message.Width, message.Height ); end; procedure TRulerBox.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin inherited; fIERuler.HandleMouseDown( Button, Shift, X, Y ); end; procedure TRulerBox.MouseMove(Shift: TShiftState; X, Y: Integer); begin inherited; fIERuler.HandleMouseMove( Shift, X, Y ); end; procedure TRulerBox.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin inherited; fIERuler.HandleMouseUp( Button, Shift, X, Y ); end; procedure TRulerBox.CMFontChanged(var Message: TMessage); begin fIERuler.Font.Assign( Font ); end; {!! TRulerBox.GripsMin Declaration property GripsMin[g: integer]: double; Description Specifies the minimum position of the grip, g. !!} function TRulerBox.GetGripsMin(i: integer): double; begin result := fIERuler.GripsMin[ i ]; end; procedure TRulerBox.SetGripsMin(i: integer; v: double); begin fIERuler.GripsMin[ i ] := v; end; {!! TRulerBox.GripsMax Declaration property GripsMax[g: integer]: double; Description Specifies the max position of the grip, g. !!} function TRulerBox.GetGripsMax(i: integer): double; begin result := fIERuler.GripsMax[ i ]; end; procedure TRulerBox.SetGripsMax(i: integer; v: double); begin fIERuler.GripsMax[ i ] := v; end; {!! TRulerBox.ViewMin Declaration property ViewMin: double; Description Specifies the minimum value for property. Default: 0 !!} function TRulerBox.GetViewMin: double; begin result := fIERuler.ViewMin; end; procedure TRulerBox.SetViewMin(v: double); begin fIERuler.ViewMin := v; end; {!! TRulerBox.ViewMax Declaration property ViewMax: double; Description pecifies the maximum value for property. Default: 0 !!} function TRulerBox.GetViewMax: double; begin result := fIERuler.ViewMax; end; procedure TRulerBox.SetViewMax(v: double); begin fIERuler.ViewMax := v; end; {!! TRulerBox.ViewPos Declaration property ViewPos: double; Description Specifies the initial position of the view (i.e. where 0 is within the view). Default: 0 !!} function TRulerBox.GetViewPos: double; begin result := fIERuler.ViewPos; end; procedure TRulerBox.SetViewPos(v: double); begin fIERuler.ViewPos := v; end; {!! TRulerBox.DotPerUnit Declaration property DotPerUnit: double; Description Specifies the number of pixels per logical unit. Default: 1 !!} function TRulerBox.GetDPU: double; begin result := fIERuler.DotPerUnit; end; procedure TRulerBox.SetDPU(v: double); begin fIERuler.DotPerUnit := v; end; {!! TRulerBox.OffsetX Declaration property OffsetX: integer; Description Specifies the horizontal offset where the ruler begins. Default: 0 !!} function TRulerBox.GetOffsetX: integer; begin result := fIERuler.OffsetX; end; procedure TRulerBox.SetOffsetX(v: integer); begin fIERuler.OffsetX := v; end; {!! TRulerBox.OffsetY Declaration property OffsetY: integer; Description Specifies the vertical offset where the ruler begins. Default: 0 !!} function TRulerBox.GetOffsetY: integer; begin result := fIERuler.OffsetY; end; procedure TRulerBox.SetOffsetY(v: integer); begin fIERuler.OffsetY := v; end; {!! TRulerBox.MinLabelSpacing Declaration property MinLabelSpacing: integer; Description Specifies the spacing between (center of) labels. To reduce crowding, labels positioned closer than this value are not shown. If MinLabelSpacing is 0 then labels are always drawn. Default: 30 !!} function TRulerBox.GetMinLabelSpacing: integer; begin result := fIERuler.MinLabelSpacing; end; procedure TRulerBox.SetMinLabelSpacing(v: integer); begin fIERuler.MinLabelSpacing := v; end; {!! TRulerBox.Frequency Declaration property Frequency: double; Description Specifies the number of logical units where ticks are shown. Use to configure labels and longer tick marks. Default: 10 !!} function TRulerBox.GetFrequency: double; begin result := fIERuler.Frequency; end; procedure TRulerBox.SetFrequency(v: double); begin fIERuler.Frequency := v; end; {!! TRulerBox.LabelFreq Declaration property LabelFreq: double; Description Specifies the number of logical units where to show labels (and longer tick marks). Use to configure short tick marks. Default: 40 !!} function TRulerBox.GetLabelFreq: double; begin result := fIERuler.LabelFrequency; end; procedure TRulerBox.SetLabelFreq(v: double); begin fIERuler.LabelFrequency := v; end; {!! TRulerBox.Ruler Declaration property Ruler: boolean; Description Specify whether a measurement block is drawn on the ruler. Default: True Example // Show only grips RulerBox1.Ruler := False; !!} function TRulerBox.GetRuler: boolean; begin result := fIERuler.ShowRuler; end; procedure TRulerBox.SetRuler(v: boolean); begin fIERuler.ShowRuler := v; end; {!! TRulerBox.RulerColor Declaration property RulerColor: TColor; Description Specifies the color of the measurement block of the ruler. Note: This value may be overridden if is enabled. Default: clBtnFace !!} function TRulerBox.GetRulerColor: TColor; begin result := fIERuler.RulerColor; end; procedure TRulerBox.SetRulerColor(v: TColor); begin fIERuler.RulerColor := v; end; {!! TRulerBox.RulerDir Declaration property RulerDir: ; Description Specifies the direction of the ruler (horizontal or vertical). Default: rdHorizontal Example // Configure ruler along the top of a TImageEnView RulerBox1.RulerDir := rdHorizontal; // Configure ruler along the left of a TImageEnView RulerBox1.RulerDir := rdVertical; !!} function TRulerBox.GetRulerDir: TRulerDir; begin result := fIERuler.RulerDir; end; procedure TRulerBox.SetRulerDir(v: TRulerDir); begin fIERuler.RulerDir := v; end; {!! TRulerBox.Background Declaration property Background: TColor; Description Specifies the color of the background (non-ruler area). Default: clBtnFace !!} // return -1 = none function TRulerBox.GetBackground: TColor; begin result := fIERuler.Background; end; procedure TRulerBox.SetBackground(bk: TColor); begin fIERuler.Background := bk; end; {!! TRulerBox.FitInView Declaration property FitInView: boolean; Description If enabled, is automatically adjusted to ensure that the range of the ruler (from to ) fits within the viewing area. Default: False !!} function TRulerBox.GetFitInView: boolean; begin result := fIERuler.FitInView; end; procedure TRulerBox.SetFitInView(v: boolean); begin fIERuler.FitInView := v; end; {!! TRulerBox.HexLabels Declaration property HexLabels: boolean; Description If HexLabels is True, the labels are shown in hexadecimal notation. Default: False !!} function TRulerBox.GetHexLabels: boolean; begin result := fIERuler.HexLabels; end; procedure TRulerBox.SetHexLabels(v: boolean); begin fIERuler.HexLabels := v; end; {!! TRulerBox.Inverted Declaration property Inverted: boolean; Description When true the ruler is painted from right to left. Default: False. !!} function TRulerBox.GetInverted: boolean; begin result := fIERuler.Inverted; end; procedure TRulerBox.SetInverted(v: boolean); begin fIERuler.Inverted := v; end; {!! TRulerBox.LabelPrecision Declaration property LabelPrecision: integer; Description Specifies the number of decimal places shown for values in the ruler. Default: 3 !!} function TRulerBox.GetLabelPrecision: integer; begin result := fIERuler.LabelPrecision; end; procedure TRulerBox.SetLabelPrecision(v: integer); begin fIERuler.LabelPrecision := v; end; {!! TRulerBox.ScrollRate Declaration property ScrollRate: double; Description Specifies the scroll rate used when moving a grip out of ruler borders. Default: 1.0 !!} function TRulerBox.GetScrollRate: double; begin result := fIERuler.ScrollRate; end; procedure TRulerBox.SetScrollRate(const Value: double); begin fIERuler.ScrollRate := Value; end; {!! TRulerBox.ShowBorder Declaration property ShowBorder: boolean; Description Specify whether a border is displayed below the ruler. Default: False !!} function TRulerBox.GetShowBorder: boolean; begin Result := fIERuler.ShowBorder; end; procedure TRulerBox.SetShowBorder(const Value: boolean); begin fIERuler.ShowBorder := Value; end; {!! TRulerBox.GripsPos Declaration property GripsPos[g: integer]: double; Description Specifies the current position of the grip, g. !!} function TRulerBox.GetGripsPos(i: integer): double; begin result := fIERuler.GripsPos[ i ]; end; procedure TRulerBox.SetGripsPos(i: integer; p: double); begin fIERuler.GripsPos[ i ] := p; end; {!! TRulerBox.GripsCount Declaration property GripsCount: integer; Description Specifies the number of the grips. Default: 1 Examples // Add twenty grips RulerBox1.GripsCount := 20; // Set default color of grips to clSilver, but clRed for grips > 10 RulerBox1.GripColorDefault := clSilver; for i := 10 to RulerBox1.GripsCount - 1 do RulerBox1.GripsColor[ i ] := clRed; !!} function TRulerBox.GetGripsCount: integer; begin result := fIERuler.GripsCount; end; procedure TRulerBox.SetGripsCount(v: integer); begin fIERuler.GripsCount := v; end; {!! TRulerBox.GripKindDefault Declaration property GripKindDefault: ; Description Specifies the default style for all grips. This style will be assigned to any grips for which you have not set a custom style using . The width of the grip is specified by . Default: gkTriangle Example // Set default style of grips to gkTriangle, but gkArrow2 to grips > 10 RulerBox1.GripKindDefault := gkTriangle; for i := 10 to RulerBox1.GripsCount - 1 do RulerBox1.GripsKind[ i ] := gkArrow2; !!} function TRulerBox.GetGripKindDefault: TGripKind; begin result := fIERuler.GripKindDefault; end; procedure TRulerBox.SetGripKindDefault(const Value: TGripKind); begin fIERuler.GripKindDefault := Value; end; {!! TRulerBox.GripsKind Declaration property GripsKind[g: integer]: ; Description Specifies the style of the grip, g (triangle, arrow, etc). Notes: - The default style for grips is specified by . Use when you want individual grips with different styles. - The width of the grip is specified by . Example // Set default style of grips to gkTriangle, but gkArrow2 to grips > 10 RulerBox1.GripKindDefault := gkTriangle; for i := 10 to RulerBox1.GripsCount - 1 do RulerBox1.GripsKind[ i ] := gkArrow2; !!} function TRulerBox.GetGripsKind(i: integer): TGripKind; begin result := fIERuler.GripsKind[ i ]; end; procedure TRulerBox.SetGripsKind(i: integer; v: TGripKind); begin fIERuler.GripsKind[ i ] := v; end; {!! TRulerBox.GripsDir Declaration property GripsDir: ; Description Specifies the direction of the grips (up or down). Note: On a vertical ruler, gdUp implies left, whereas gdDown is Right. Default: gdUp !!} function TRulerBox.GetGripsDir: TGripsDir; begin Result := fIERuler.GripsDir; end; procedure TRulerBox.SetGripsDir(v: TGripsDir); begin fIERuler.GripsDir := v; end; {!! TRulerBox.GripColorDefault Declaration property GripColorDefault: TColor; Description Specifies the brush color of all grips. This color will be assigned to any grips for which you have not set a custom color using . Notes: - You can set the pen color with - This value may be overridden if is enabled. Default: clBtnFace Example // Set default color of grips to clSilver, but clRed to grips > 10 RulerBox1.GripColorDefault := clSilver; for i := 10 to RulerBox1.GripsCount - 1 do RulerBox1.GripsColor[ i ] := clRed; !!} function TRulerBox.GetGripColorDefault: TColor; begin result := fIERuler.GripColorDefault; end; procedure TRulerBox.SetGripColorDefault(const Value: TColor); begin fIERuler.GripColorDefault := Value; end; {!! TRulerBox.GripsColor Declaration property GripsColor[g: integer]: TColor; Description Specifies the brush color of the grip, g. Note: The default color of all grips is set by . Use GripsColor to assign custom colors to specific grips. You can set the pen color with Example // Set default color of grips to clSilver, but clRed for grips > 10 RulerBox1.GripColorDefault := clSilver; for i := 10 to RulerBox1.GripsCount - 1 do RulerBox1.GripsColor[ i ] := clRed; !!} function TRulerBox.GetGripsColor(i: integer): TColor; begin result := fIERuler.GripsColor[ i ]; end; procedure TRulerBox.SetGripsColor(i: integer; p: TColor); begin fIERuler.GripsColor[ i ] := p; end; {!! TRulerBox.GripPenColor Declaration property GripPenColor: TColor; Description Specifies the pen (border) color of all grips. Notes: - The brush color is specified by , or for individual grips with . - This value may be overridden if is enabled. Default: clBlack !!} function TRulerBox.GetGripPenColor: TColor; begin result := fIERuler.GripPenColor; end; procedure TRulerBox.SetGripPenColor(const Value: TColor); begin fIERuler.GripPenColor := Value; end; {!! TRulerBox.GripBaseDim Declaration property GripBaseDim: integer; Description Specifies the width of grip triangles in pixels. Default: 12 See also: !!} function TRulerBox.GetGripBaseDim: integer; begin result := fIERuler.GripBaseDim; end; procedure TRulerBox.SetGripBaseDim(v: integer); begin fIERuler.GripBaseDim := v; end; {!! TRulerBox.MaxGripHeight Declaration property MaxGripHeight: integer; Description Specifies the maximum height of the grip. Default: 15 !!} function TRulerBox.GetMaxGripHeight: integer; begin result := fIERuler.MaxGripHeight; end; procedure TRulerBox.SetMaxGripHeight(const Value: integer); begin fIERuler.MaxGripHeight := Value; end; {!! TRulerBox.LockUpdate Declaration procedure LockUpdate(); Description Prevents redrawing of the control while you are setting many properties. Call LockUpdate before setting properties, and then to resume drawing. Note: Multiple LockUpdate can be in use at once. The control will not be updated until an equal number of calls have been made. Example RulerBox1.LockUpdate(); RulerBox1.DotPerUnit := 1; RulerBox1.Frequency := 20; RulerBox1.LabelFreq := 100; RulerBox1.UnlockUpdate(); !!} procedure TRulerBox.LockUpdate(); begin fIERuler.LockUpdate(); end; {!! TRulerBox.UnlockUpdate Declaration procedure UnlockUpdate(); Description Prevents redrawing of the control while you are setting many properties. Call before setting properties, and then UnlockUpdate to resume drawing. Note: Multiple can be in use at once. The control will not be updated until an equal number of UnlockUpdate calls have been made. Example RulerBox1.LockUpdate(); RulerBox1.DotPerUnit := 1; RulerBox1.Frequency := 20; RulerBox1.LabelFreq := 100; RulerBox1.UnlockUpdate(); !!} procedure TRulerBox.UnlockUpdate(); begin fIERuler.UnlockUpdate(); end; {!! TRulerBox.OnRulerClick Declaration property OnRulerClick: ; Description Occurs when the user clicks the ruler. Example procedure TForm1.RulerClick(Sender: TObject; RulerDir: TRulerDir; Ps: double); begin case RulerDir of rdHorizontal : ShowMessage( 'Horizontal ruler clicked at: ' + FloatToStr( Ps )); rdVertical : ShowMessage( 'Vertical ruler clicked at: ' + FloatToStr( Ps )); end; end; !!} function TRulerBox.GetOnRulerClick: TRulerClickEvent; begin result := fIERuler.fOnRulerClick; end; procedure TRulerBox.SetOnRulerClick(const Value: TRulerClickEvent); begin fIERuler.fOnRulerClick := Value; end; {!! TRulerBox.OnRulerGripClick Declaration property OnRulerGripClick: ; Description Occurs when the user clicks on a grip. Example procedure TForm1.RulerGripClick(Sender: TObject; RulerDir: TRulerDir; Grip: integer; GripPos: Double); begin case RulerDir of rdHorizontal : ShowMessage( format( 'Grip %d clicked on horizontal ruler', [ Grip ])); rdVertical : ShowMessage( format( 'Grip %d clicked on vertical ruler', [ Grip ])); end; end; !!} function TRulerBox.GetOnRulerGripClick: TRulerGripClickEvent; begin result := fIERuler.fOnRulerGripClick; end; procedure TRulerBox.SetOnRulerGripClick(const Value: TRulerGripClickEvent); begin fIERuler.fOnRulerGripClick := Value; end; {!! TRulerBox.OnRulerGripDblClick Declaration property OnRulerGripDblClick: ; Description Occurs when the user double-clicks a grip. Example procedure TForm1.RulerGripDblClick(Sender: TObject; RulerDir: TRulerDir; Grip: integer; GripPos: Double); begin case RulerDir of rdHorizontal : ShowMessage( format( 'Grip %d double-clicked on horizontal ruler', [ Grip ])); rdVertical : ShowMessage( format( 'Grip %d double-clicked on vertical ruler', [ Grip ])); end; end; !!} function TRulerBox.GetOnRulerGripDblClick: TRulerGripClickEvent; begin result := fIERuler.fOnRulerGripDblClick; end; procedure TRulerBox.SetOnRulerGripDblClick(const Value: TRulerGripClickEvent); begin fIERuler.fOnRulerGripDblClick := Value; end; {!! TRulerBox.OnRulerPosChange Declaration property OnRulerPosChange: ; Description Occurs when changes. Example procedure TForm1.RulerPosChange(Sender: TObject; RulerDir: TRulerDir; Grip: integer; NewPos: Double); begin case RulerDir of rdHorizontal : ShowMessage( format( 'Grip %d moved on horizontal ruler', [ Grip ])); rdVertical : ShowMessage( format( 'Grip %d moved on vertical ruler', [ Grip ])); end; end; !!} function TRulerBox.GetOnRulerPosChange: TRulerGripPosChangeEvent; begin result := fIERuler.fOnRulerGripPosChange; end; procedure TRulerBox.SetOnRulerPosChange(const Value: TRulerGripPosChangeEvent); begin fIERuler.fOnRulerGripPosChange := Value; end; end.