📄 ezbasicctrls.pas
字号:
// unknown bug in BCB
Function GetMapHeader: TEzMapHeader;
procedure SetMapHeader(const Value: TEzMapHeader);
{$ENDIF}
Protected
Function GetNumLayers: Integer; Override;
Procedure SetNumLayers( Value: Integer ); Override;
Function GetExtension: TEzRect; Override;
Procedure SetExtension( Const Value: TEzRect ); Override;
Function GetCurrentLayer: String; Override;
Procedure SetCurrentLayer( Const Value: String ); Override;
Function GetAerialViewLayer: String; Override;
Procedure SetAerialViewLayer( Const Value: String ); Override;
Function GetLastView: TEzRect; Override;
Procedure SetLastView( Const Value: TEzRect ); Override;
Function GetCoordsUnits: TEzCoordsUnits; Override;
Procedure SetCoordsUnits( Value: TEzCoordsUnits ); Override;
Function GetCoordSystem: TEzCoordSystem; Override;
Procedure SetCoordSystem( Value: TEzCoordSystem ); Override;
Function GetIsAreaClipped: boolean; Override;
Procedure SetIsAreaClipped( Value: Boolean ); Override;
Function GetAreaClipped: TEzRect; Override;
Procedure SetAreaClipped( Const Value: TEzRect ); Override;
Function GetClipAreaKind: TEzClipAreaKind; Override;
Procedure SetClipAreaKind( Value: TEzClipAreaKind ); Override;
Public
Procedure Initialize; Override;
Property MapHeader: TEzMapHeader {$IFDEF BCB} Read GetMapHeader Write SetMapHeader {$ELSE} Read FMapHeader Write FMapHeader {$ENDIF};
End;
{-------------------------------------------------------------------------------}
{ TEzDrawBox }
{-------------------------------------------------------------------------------}
TEzScaleBar = Class;
TEzDrawBox = Class( TEzBaseDrawBox )
Private
FScaleBar: TEzScaleBar;
Procedure SetScaleBar( Value: TEzScaleBar );
function GetAbout: TEzAbout;
procedure SetAbout(const Value: TEzAbout);
Protected
{$IFDEF FALSE}
Procedure SetParent( AParent: TWinControl ); Override;
{$ENDIF}
Procedure UpdateViewport( WCRect: TEzRect ); Override;
Procedure ViewChanged( Sender: TObject ); Override;
Procedure Notification( AComponent: TComponent; Operation: TOperation ); Override;
Public
Function CurrentScale: Double;
Published
Property About: TEzAbout read GetAbout write SetAbout;
Property ScaleBar: TEzScaleBar read FScaleBar write SetScaleBar;
Property GIS;
Property DefaultScaleUnits default suInches;
{ inherited }
Property NumDecimals;
Property DelayShowHint;
Property PartialSelect;
Property StackedSelect;
Property NoPickFilter;
Property SymbolMarker;
Property SnapToGuidelines;
Property SnapToGuidelinesDist;
Property ScreenGrid;
Property ShowMapExtents;
Property ShowLayerExtents;
Property GridInfo;
Property RubberPen;
Property ScrollBars;
Property FlatScrollBar;
Property BlinkCount;
Property BlinkRate;
Property DropRepeat;
{ inherited }
Property OnGridError;
Property OnHScroll;
Property OnVScroll;
Property OnHChange;
Property OnVChange;
Property OnBeforeScroll;
Property OnAfterScroll;
Property OnBeginRepaint;
Property OnEndRepaint;
Property OnMouseMove2D;
Property OnMouseDown2D;
Property OnMouseUp2D;
Property OnPaint;
{ drawbox specific events }
Property OnEntityDblClick;
Property OnBeforeInsert;
Property OnAfterInsert;
Property OnBeforeSelect;
Property OnAfterSelect;
Property OnAfterUnSelect;
Property OnZoomChange;
Property OnEntityChanged;
Property OnShowHint;
Property OnSelectionChanged;
Property OnCustomClick;
End;
{------------------------------------------------------------------------------}
// TEzSymbolsBox
{------------------------------------------------------------------------------}
TEzSymbolsBox = Class( TEzBaseDrawBox )
Private
FShowExtension: Boolean;
function GetAbout: TEzAbout;
procedure SetAbout(const Value: TEzAbout);
{$IFDEF BCB}
Function GetShowExtension: Boolean;
procedure SetShowExtension(const Value: Boolean);
{$ENDIF}
Protected
Procedure UpdateViewport( WCRect: TEzRect ); Override;
Public
Constructor Create( AOwner: TComponent ); Override;
Destructor Destroy; Override;
Procedure CreateNewEditor;
Procedure PopulateFrom( Symbol: TEzSymbol );
Procedure PopulateTo( Symbol: TEzSymbol );
Published
Property About: TEzAbout read GetAbout write SetAbout;
Property ShowExtension: Boolean Read {$IFDEF BCB}GetShowExtension{$ELSE}FShowExtension{$ENDIF} Write {$IFDEF BCB}SetShowExtension {$ELSE} FShowExtension {$ENDIF} default True;
{ inherited }
Property NumDecimals;
Property PartialSelect;
Property StackedSelect;
Property NoPickFilter;
Property SnapToGuidelines;
Property SnapToGuidelinesDist;
Property ScreenGrid;
Property GridInfo;
Property RubberPen;
Property ScrollBars;
Property FlatScrollBar;
{ inherited }
Property OnGridError;
Property OnHScroll;
Property OnVScroll;
Property OnHChange;
Property OnVChange;
Property OnBeginRepaint;
Property OnEndRepaint;
Property OnMouseMove2D;
Property OnMouseDown2D;
Property OnMouseUp2D;
Property OnPaint;
{ drawbox specific events }
Property OnBeforeInsert;
Property OnAfterInsert;
Property OnBeforeSelect;
Property OnAfterSelect;
Property OnAfterUnSelect;
Property OnZoomChange;
Property OnEntityChanged;
Property OnSelectionChanged;
End;
{-------------------------------------------------------------------------------}
// Aerial view BOX
{-------------------------------------------------------------------------------}
TEzAerialView = Class( TEzBaseDrawBox )
Private
FParentView: TEzBaseDrawBox;
FInnerColor: TColor;
FOuterColor: TColor;
FShowInverted: Boolean;
FSavedDrawLimit: Integer;
Procedure SetParentView( Const Value: TEzBaseDrawBox );
function GetAbout: TEzAbout;
procedure SetAbout(const Value: TEzAbout);
{$IFDEF BCB}
Function GetShowInverted: Boolean;
Procedure SetShowInverted( Value: Boolean );
Function GetInnerColor: TColor;
Procedure SetInnerColor( Value: TColor );
Function GetOuterColor: TColor;
Procedure SetOuterColor( Value: TColor );
Function GetParentView: TEzBaseDrawBox;
{$ENDIF}
Protected
Procedure UpdateViewport( WCRect: TEzRect ); Override;
Procedure Notification( AComponent: TComponent; Operation: TOperation ); Override;
Public
Constructor Create( AOwner: TComponent ); Override;
Procedure BeginRepaint; Override;
Procedure EndRepaint; Override;
Published
Property About: TEzAbout read GetAbout write SetAbout;
Property ShowInverted: Boolean {$IFDEF BCB}Read GetShowInverted Write SetSHowInverted {$ELSE} Read FShowInverted Write FShowInverted {$ENDIF};
Property InnerColor: TColor {$IFDEF BCB}Read GetInnerColor write SetInnerColor{$ELSE}Read FInnerColor Write FInnerColor{$ENDIF};
Property OuterColor: TColor {$IFDEF BCB}Read GetOuterColor write SetOuterColor{$ELSE}Read FOuterColor Write FOuterColor{$ENDIF};
Property ParentView: TEzBaseDrawBox {$IFDEF BCB}Read GetParentView {$ELSE}Read FParentView{$ENDIF} Write SetParentView;
{ inherited }
Property ShowMapExtents;
Property ShowLayerExtents;
{ inherited }
Property OnBeginRepaint;
Property OnEndRepaint;
Property OnMouseMove2D;
Property OnMouseDown2D;
Property OnMouseUp2D;
Property OnPaint;
{ drawbox specific events }
Property OnZoomChange;
End;
{-------------------------------------------------------------------------------}
// an in-memory r-tree
{-------------------------------------------------------------------------------}
{ TMemRTNode }
TMemRTNode = Class( TRTNode )
Public
Procedure Read( NId: Integer ); Override;
Procedure Write; Override;
Procedure AddNodeToFile; Override;
Procedure DeleteNodeFromFile; Override;
End;
{ TMemRTree an in memory r-tree implementation }
TMemRTree = Class( TRTree )
Private
IdxOpened: Boolean;
FList: TList;
Catalog: TRTCatalog;
Function Get( Index: Integer ): PDiskPage;
Public
Destructor Destroy; Override;
Function CreateNewNode: TRTNode; Override;
Procedure Clear;
Function Open( Const Name: String; Mode: Word ): integer; Override;
Procedure Close; Override;
Function CreateIndex( Const Name: String; Multiplier: Integer ): integer; Override;
Procedure FlushFiles; Override;
Procedure ReadCatalog( Var IdxInfo: TRTCatalog ); Override;
Procedure WriteCatalog( Const IdxInfo: TRTCatalog ); Override;
Procedure DropIndex; Override;
Function PageCount: Integer;
Procedure LoadFromStream( Stream: TStream );
Procedure SaveToStream( Stream: TStream );
Property DiskPagePtr[Index: Integer]: PDiskPage Read Get;
End;
{ TEzScaleBar component }
TEzBarAppearance = ( apBlockAlternate, apBlock, apRuller );
TEzResizePosition = (rpNone, rpUpperLeft, rpUpperRight, rpLowerLeft, rpLowerRight );
TEzScaleBar = class(TCustomControl)
private
FResizePosition: TEzResizePosition;
FMoving : Boolean ;
FOnMove : TNotifyEvent ;
FFont : TFont;
FColor : TColor;
FLinesPen : TPen;
FMinorBrush: TBrush;
FMajorBrush: TBrush;
FAppearance: TEzBarAppearance;
FIntervalLengthUnits: TEzScaleUnits;
FIntervalLength: Double;
FIntervalNumber: Integer;
FBarHeight: Integer;
FNumDecimals: Integer;
FUnits: TEzCoordsUnits;
FShowTrailingZeros: Boolean;
FTransparent: Boolean;
{ temp data }
FPaintSuspended: Boolean;
FNeedReposition: Boolean;
procedure SetFont(const Value: TFont);
procedure SetColor(const Value: TColor);
procedure SetAppearance(const Value: TEzBarAppearance);
procedure SetIntervalLength(const Value: Double);
procedure SetIntervalLengthUnits(const Value: TEzScaleUnits);
procedure SetBarHeight(const Value: Integer);
procedure SetIntervalNumber(const Value: Integer);
procedure SetNumDecimals(const Value: Integer);
procedure WMMove(var Message: TWMMove); message WM_MOVE ;
procedure SetLinesPen(const Value: TPen);
procedure SetUnits(const Value: TEzCoordsUnits);
procedure SetMajorBrush(const Value: TBrush);
procedure SetMinorBrush(const Value: TBrush);
procedure SetShowTrailingZeros(const Value: Boolean);
procedure SetTransparent(const Value: Boolean);
function GetAbout: TEzAbout;
procedure SetAbout(const Value: TEzAbout);
protected
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y:Integer); override ;
procedure Paint; override ;
public
{$IFDEF IS_OCX}
FOCX_Owner : IUnknown;
{$ENDIF}
constructor Create(AOwner: TComponent) ; override ;
destructor Destroy; override;
procedure Reposition;
Procedure SaveToInifile( const FileName: string );
Procedure LoadFromInifile( const Filename: string );
procedure NeededDimensions( ACanvas: TCanvas; Const UnitsFactor: Double;
var NeededWidth, NeededHeight: Integer;
var RealDist: Double; var ScaleDistPixels, ATextHeight: Integer );
procedure PaintTo( ACanvas: TCanvas; Const ARect: TRect;
const UnitsFactor: Double; AWidth, AHeight: Integer; const RealDist: Double;
ScaleDistPixels, TotalTextHeight: Integer );
published
Property About: TEzAbout read GetAbout write SetAbout;
Property Font: TFont read FFont write SetFont;
Property Color: TColor read FColor write SetColor;
Property Appearance: TEzBarAppearance read FAppearance write SetAppearance default apBlock;
Property LinesPen: TPen read FLinesPen write SetLinesPen;
Property MinorBrush: TBrush read FMinorBrush write SetMinorBrush;
Property MajorBrush: TBrush read FMajorBrush write SetMajorBrush;
Property IntervalLengthUnits: TEzScaleUnits read FIntervalLengthUnits write SetIntervalLengthUnits default suInches;
Property IntervalLength: Double read FIntervalLength write SetIntervalLength;
Property BarHeight: Integer read FBarHeight write SetBarHeight default 16;
Property IntervalNumber: Integer read FIntervalNumber write SetIntervalNumber default 3;
Property NumDecimals: Integer read FNumDecimals write SetNumDecimals default 2;
Property ResizePosition: TEzResizePosition read FResizePosition write FResizePosition default rpLowerRight;
Property Units: TEzCoordsUnits read FUnits write SetUnits;
Property ShowTrailingZeros: Boolean read FShowTrailingZeros write SetShowTrailingZeros default false;
Property Transparent: Boolean read FTransparent write SetTransparent default false;
property Visible;
property ShowHint;
property OnMove : TNotifyEvent read FOnMove write FOnMove ;
end ;
{ TEzVirtualLayer - a virtual layer for several purposes }
{ TEzVirtualLayerInfo }
TEzVirtualLayerInfo = Class( TEzBaseLayerInfo )
Protected
Function GetOverlappedTextAction: TEzOverlappedTextAction; Override;
Procedure SetOverlappedTextAction( Value: TEzOverlappedTextAction ); Override;
Function GetOverlappedTextColor: TColor; Override;
Procedure SetOverlappedTextColor( Value: TColor ); Override;
Function GetTextHasShadow: Boolean; Override;
Procedure SetTextHasShadow( Value: boolean ); Override;
Function GetTextFixedSize: Byte; Override;
Procedure SetTextFixedSize( Value: Byte ); Override;
Function GetVisible: boolean; Override;
Procedure SetVisible( Value: boolean ); Override;
Function GetSelectable: boolean; Override;
Procedure SetSelectable( Value: boolean ); Override;
Function GetIsCosmethic: boolean; Override;
Procedure SetIsCosmethic( value: boolean ); Override;
Function GetExtension: TEzRect; Override;
Procedure SetExtension( Const Value: TEzRect ); Override;
Function GetIDCounter: integer; Override;
Procedure SetIDCounter( Value: integer ); Override;
Function GetIsAnimationLayer: boolean; Override;
Procedure SetIsAnimationLayer( Value: boolean ); Override;
Function GetIsIndexed: boolean; Override;
Procedure SetIsIndexed( Value: boolean ); Override;
Function GetCoordsUnits: TEzCoordsUnits; Override;
Procedure SetCoordsUnits( Value: TEzCoordsUnits ); Override;
Function GetCoordSystem: TEzCoordSystem; Override;
Procedure SetCoordSystem( Value: TEzCoordSystem ); Override;
Function GetUseAttachedDB: Boolean; Override;
Procedure SetUseAttachedDB( Value: Boolean ); Override;
Function GetLocked: Boolean; Override;
Procedure SetLocked( Value: Boolean ); Override;
End;
{ TEzVirtualLayer }
TEzVirtualLayer = Class( TEzBaseLayer )
Private
FConnectLayer: TEzBaseLayer;
FLocalVisible: Boolean;
FLocalSelectable: Boolean;
Protected
Function GetRecno: Integer; Override;
Procedure SetRecno( Value: Integer ); Override;
Function GetRecordCount: Integer; Override;
Function GetDBTable: TEzBaseTable; Override;
Function GetActive: Boolean; Override;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -