Class TRbwRuler

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TRbwRuler = class(TPaintBox)

Description

TRbwRuler draws a ruler.

The orientation, scaling, number format, and position of the ruler can be controlled through properties. Rotated text will only work if a TrueType font is used.

Hierarchy

Overview

Fields

Private FPainter: TRulerPainter;

Methods

Private procedure SetRulerDesiredSpacing(const Value: integer);
Private procedure SetRulerDigits(Value: integer);
Private procedure SetRulerLinePosition(const Value: integer);
Private procedure SetRulerMajorTickLength(const Value: integer);
Private procedure SetRulerMinorTickLength(const Value: integer);
Private procedure SetRulerEnds(const Value: TRulerPositions);
Private procedure SetRulerPrecision(Value: integer);
Private procedure SetRulerPosition(const Value: TRulerPosition);
Private procedure SetRulerStart(const Value: TStart);
Private procedure SetRulerTextOffset(const Value: integer);
Private procedure SetRulerTextPosition(const Value: TTextPosition);
Private procedure SetRulerValues(const Value: TRulerValues);
Private function GetRulerDesiredSpacing: integer;
Private procedure PainterInvalidate(Sender: TObject);
Private function GetRulerDigits: integer;
Private function GetRulerEnds: TRulerPositions;
Private function GetRulerLinePosition: integer;
Private function GetRulerMajorTickLength: integer;
Private function GetRulerMinorTickLength: integer;
Private function GetRulerPosition: TRulerPosition;
Private function GetRulerPrecision: integer;
Private function GetRulerStart: TStart;
Private function GetRulerTextOffset: integer;
Private function GetRulerTextPosition: TTextPosition;
Private function GetRulerValues: TRulerValues;
Protected procedure Paint; override;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public procedure PaintRotated(ACanvas: TCanvas; const X, Y, Angle: double; const Text: string); virtual;

Properties

Public property Painter: TRulerPainter read FPainter;
Published property RulerDesiredSpacing: integer read GetRulerDesiredSpacing write SetRulerDesiredSpacing default 60;
Published property RulerDigits: integer read GetRulerDigits write SetRulerDigits;
Published property RulerEnds: TRulerPositions read GetRulerEnds write SetRulerEnds;
Published property RulerLinePosition: integer read GetRulerLinePosition write SetRulerLinePosition;
Published property RulerMajorTickLength: integer read GetRulerMajorTickLength write SetRulerMajorTickLength;
Published property RulerMinorTickLength: integer read GetRulerMinorTickLength write SetRulerMinorTickLength;
Published property RulerPosition: TRulerPosition read GetRulerPosition write SetRulerPosition;
Published property RulerPrecision: integer read GetRulerPrecision write SetRulerPrecision;
Published property RulerStart: TStart read GetRulerStart write SetRulerStart;
Published property RulerTextOffset: integer read GetRulerTextOffset write SetRulerTextOffset;
Published property RulerTextPosition: TTextPosition read GetRulerTextPosition write SetRulerTextPosition;
Published property RulerValues: TRulerValues read GetRulerValues write SetRulerValues;

Description

Fields

Private FPainter: TRulerPainter;
 

Methods

Private procedure SetRulerDesiredSpacing(const Value: integer);

See RulerDesiredSpacing.

Private procedure SetRulerDigits(Value: integer);

See RulerDigits.

Private procedure SetRulerLinePosition(const Value: integer);

See RulerLinePosition.

Private procedure SetRulerMajorTickLength(const Value: integer);

See RulerMajorTickLength.

Private procedure SetRulerMinorTickLength(const Value: integer);

See RulerMinorTickLength.

Private procedure SetRulerEnds(const Value: TRulerPositions);

See RulerEnds.

Private procedure SetRulerPrecision(Value: integer);

See RulerPrecision.

Private procedure SetRulerPosition(const Value: TRulerPosition);

See RulerPosition.

Private procedure SetRulerStart(const Value: TStart);

See RulerStart.

Private procedure SetRulerTextOffset(const Value: integer);

See RulerTextOffset.

Private procedure SetRulerTextPosition(const Value: TTextPosition);

See RulerTextPosition.

Private procedure SetRulerValues(const Value: TRulerValues);

See RulerValues.

Private function GetRulerDesiredSpacing: integer;

See RulerDesiredSpacing.

Private procedure PainterInvalidate(Sender: TObject);

PainterInvalidate is the event handler for OnInvalidate. It calls Invalidate.

Private function GetRulerDigits: integer;

See RulerDigits.

Private function GetRulerEnds: TRulerPositions;

See RulerEnds.

Private function GetRulerLinePosition: integer;

See RulerLinePosition.

Private function GetRulerMajorTickLength: integer;

See RulerMajorTickLength.

Private function GetRulerMinorTickLength: integer;

See RulerMinorTickLength.

Private function GetRulerPosition: TRulerPosition;

See RulerPosition.

Private function GetRulerPrecision: integer;

See RulerPrecision.

Private function GetRulerStart: TStart;

See RulerStart.

Private function GetRulerTextOffset: integer;

See RulerTextOffset.

Private function GetRulerTextPosition: TTextPosition;

See RulerTextPosition.

Private function GetRulerValues: TRulerValues;

See RulerValues.

Protected procedure Paint; override;

Paint calls inherited Paint and then draws the ruler.

Public constructor Create(AOwner: TComponent); override;

Create creates and instance of TRbwRuler

Public destructor Destroy; override;

Destroy destroys the current instance of TRbwRuler. Do not call Destroy directly. Call Free instead.

Public procedure PaintRotated(ACanvas: TCanvas; const X, Y, Angle: double; const Text: string); virtual;

PaintRotated draws Text at the position X,Y at the angle specified by Angle. X and Y are in pixels (despite being real numbers). Angle is measured in degrees in a clockwise direction. The font must be a TrueType Font for PaintRotated to work properly.

Properties

Public property Painter: TRulerPainter read FPainter;
 
Published property RulerDesiredSpacing: integer read GetRulerDesiredSpacing write SetRulerDesiredSpacing default 60;

RulerDesiredSpacing is the desired spacing between major ticks in pixels. The actual spacing will, in most cases, be slightly different from RulerDesiredSpacing.

Published property RulerDigits: integer read GetRulerDigits write SetRulerDigits;

RulerDigits specifies how many digits will appear in the exponent portion of numbers on the ruler.

Published property RulerEnds: TRulerPositions read GetRulerEnds write SetRulerEnds;

RulerEnds specifies the positions, in pixels, of the starting and ending ends of the main line of the ruler.

Published property RulerLinePosition: integer read GetRulerLinePosition write SetRulerLinePosition;

RulerLinePosition specifies the distance of the main line of the ruler from the left, top, right, or bottom edge in pixels. Which one is determined by RulerPosition.

Published property RulerMajorTickLength: integer read GetRulerMajorTickLength write SetRulerMajorTickLength;

RulerMajorTickLength is the length of the major ticks in pixels.

Published property RulerMinorTickLength: integer read GetRulerMinorTickLength write SetRulerMinorTickLength;

RulerMinorTickLength is the length of the minor ticks in pixels.

Published property RulerPosition: TRulerPosition read GetRulerPosition write SetRulerPosition;

See RulerPosition.

Published property RulerPrecision: integer read GetRulerPrecision write SetRulerPrecision;

RulerPrecision specifies how many digits appear in the number in the ruler.

Published property RulerStart: TStart read GetRulerStart write SetRulerStart;

RulerStart specifies the end of the ruler that has the lower value of the ruler.

Published property RulerTextOffset: integer read GetRulerTextOffset write SetRulerTextOffset;

RulerTextOffset specifies the distance from the main line of the ruler to the labels on the ruler.

Published property RulerTextPosition: TTextPosition read GetRulerTextPosition write SetRulerTextPosition;

RulerTextPosition specifies whether the labels are inside or outside the ruler.

Published property RulerValues: TRulerValues read GetRulerValues write SetRulerValues;

RulerValues specifies the values of the lower and upper end of the ruler line. Thus the ruler represents a length equal to TRulerValues.Upper minus TRulerValues.Lower


Generated by PasDoc 0.12.1 on 2013-05-13 15:42:00