📄 ezinspect.pas
字号:
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnMouseWheelDown;
property OnMouseWheelUp;
property OnStartDock;
property OnStartDrag;
end;
TEzPropertyType = ( ptString, ptFloat, ptInteger, ptBoolean, ptDate );
TEzBaseProperty = class(TObject)
Private
FParent: TEzBaseProperty; { who is the parent of this property }
FPropName: string;
FPropType: TEzPropertyType;
FUseEditButton: Boolean;
FValString: string;
FValFloat: Double;
FValInteger: Integer;
FValBoolean: Boolean;
FValDateTime: TDateTime;
FModified: Boolean;
FReadOnly: Boolean;
FHint: string;
FIsPropertyOfList: Boolean;
FOnChange: TNotifyEvent;
procedure SetValBoolean(const Value: Boolean);
procedure SetValFloat(const Value: Double);
procedure SetValInteger(const Value: Integer);
procedure SetValString(const Value: string);
procedure SetValDatetime(const Value: TDateTime);
Public
constructor Create( const PropName: string ); virtual;
{ this method is fired when the ellipsis button is clicked }
Procedure Edit(Inspector: TEzInspector); Dynamic;
Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Dynamic;
function AsString: string; Dynamic;
Procedure Draw(Canvas: TCanvas; ARect: TRect; AState: TGridDrawState); Dynamic;
Procedure Changed;
Function IndentLevel: Integer;
Property PropType: TEzPropertyType read FPropType write FPropType;
Property PropName: string read FPropName write FPropName;
property UseEditButton: Boolean read FUseEditButton write FUseEditButton;
property ValString: string read FValString write SetValString;
property ValFloat: Double read FValFloat write SetValFloat;
property ValInteger: Integer read FValInteger write SetValInteger;
property ValBoolean: Boolean read FValBoolean write SetValBoolean;
property ValDatetime: TDateTime read FValDatetime write SetValDatetime;
property Modified: Boolean read FModified write FModified;
property ReadOnly: Boolean read FReadOnly write FReadOnly;
property Hint: string read FHint write FHint;
property IsPropertyOfList: Boolean Read FIsPropertyOfList Write FIsPropertyOfList;
property Parent: TEzBaseProperty read FParent write FParent;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
End;
TEzBasePropertyClass = Class Of TEzBaseProperty;
TEzTreeViewProperty = Class( TEzBaseProperty )
Private
FPropertyList : TEzPropertyList;
FExpanded : Boolean;
function GetPropertyList: TEzPropertyList;
function GetExpanded: Boolean;
procedure SetExpanded(const Value: Boolean);
procedure RecurseFullExpand( Value: Boolean );
Public
Constructor Create(Const PropName : String); Override;
Destructor Destroy; Override;
Procedure AddProperty(BaseProperty : TEzBaseProperty);
Procedure FullExpand;
Procedure FullCompact;
property PropertyList : TEzPropertyList Read GetPropertyList;
property Expanded : Boolean Read GetExpanded Write SetExpanded;
End;
TEzBooleanProperty = class(TEzBaseProperty)
public
constructor Create( const PropName: string ); Override;
//Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Override;
Procedure Draw(Canvas: TCanvas; ARect: TRect; AState: TGridDrawState); override;
end;
TEzIntegerProperty = class(TEzBaseProperty)
private
FDummyNumEd: TEzNumEd;
function GetDecimals: Integer;
function GetDigits: Integer;
procedure SetDecimals(Value:Integer);
procedure SetDigits(Value:Integer);
public
constructor Create( const PropName: string ); Override;
destructor Destroy; Override;
Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Override;
Procedure Draw(Canvas: TCanvas; ARect: TRect; AState: TGridDrawState); Override;
property Decimals: Integer read GetDecimals write SetDecimals;
property Digits: Integer read GetDigits write SetDigits;
end;
TEzFloatProperty = class(TEzIntegerProperty)
public
constructor Create( const PropName: string ); Override;
Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Override;
end;
{ angle is saved in radians and edited in degrees }
TEzAngleProperty = class(TEzFloatProperty)
public
Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Override;
Procedure Draw(Canvas: TCanvas; ARect: TRect; AState: TGridDrawState); Override;
end;
TEzColorProperty = class(TEzBaseProperty)
private
FCaption: string;
FCustomText: string;
FNoneColorText: string;
FShowSystemColors: Boolean;
function GetCaption: string;
function GetCustomText: string;
function GetNoneColorText: string;
procedure SetCaption(const Value: string);
procedure SetCustomText(const Value: string);
procedure SetNoneColorText(const Value: string);
function GetShowSystemColors: Boolean;
procedure SetShowSystemColors(const Value: Boolean);
public
constructor Create( const PropName: string ); Override;
Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Override;
Procedure Draw(Canvas: TCanvas; ARect: TRect; AState: TGridDrawState); Override;
Property Caption: string read GetCaption write SetCaption;
Property CustomText: string read GetCustomText write SetCustomText;
Property NoneColorText: string read GetNoneColorText write SetNoneColorText;
Property ShowSystemColors: Boolean read GetShowSystemColors write SetShowSystemColors;
end;
TEzStringProperty = class(TEzBaseProperty)
public
constructor Create( const PropName: string ); Override;
Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Override;
end;
TEzLongTextProperty = class(TEzStringProperty)
public
constructor Create( const PropName: string ); Override;
procedure Edit(Inspector: TEzInspector); Override;
end;
TEzSelectFolderProperty= class(TEzStringProperty)
public
constructor Create( const PropName: string ); Override;
Procedure Edit(Inspector: TEzInspector); Override;
end;
TEzExpressionProperty= class(TEzStringProperty)
private
FGis: TEzBaseGis;
FLayerName: string;
{$IFDEF BCB}
function GetGis: TEzBaseGis;
function GetLayerName: string;
procedure SetGis(const Value: TEzBaseGis);
procedure SetLayerName(const Value: string);
{$ENDIF}
public
constructor Create( const PropName: string ); Override;
Procedure Edit(Inspector: TEzInspector); Override;
Property GIS: TEzBaseGis {$IFDEF BCB} read GetGis write SetGis {$ELSE} read FGis write FGis {$ENDIF};
Property LayerName: string {$IFDEF BCB} read GetLayerName write SetLayerName {$ELSE} read FLayerName write FLayerName {$ENDIF};
end;
TEzDateProperty = class(TEzBaseProperty)
public
constructor Create( const PropName: string ); Override;
Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Override;
end;
TEzTimeProperty = class(TEzBaseProperty)
public
constructor Create( const PropName: string ); Override;
Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Override;
end;
TEzDummyProperty = class(TEzBaseProperty)
public
constructor Create( const PropName: string ); Override;
end;
TEzMemoProperty = class(TEzBaseProperty)
private
FDBTable: TEzBaseTable;
FFieldNo: Integer;
{$IFDEF BCB}
function GetDBTable: TEzBaseTable;
function GetFieldNo: Integer;
procedure SetDBTable(const Value: TEzBaseTable);
procedure SetFieldNo(const Value: Integer);
{$ENDIF}
public
constructor Create( const PropName: string ); Override;
function AsString: string; Override;
procedure Edit(Inspector: TEzInspector); Override;
property DBTable: TEzBaseTable {$IFDEF BCB} read GetDBTable write SetDBTable {$ELSE} read FDBTable write FDBTable {$ENDIF};
property FieldNo: Integer {$IFDEF BCB} read GetFieldNo write SetFieldNo {$ELSE} read FFieldNo write FFieldNo {$ENDIF};
end;
TEzGraphicProperty = class(TEzBaseProperty)
private
FDBTable: TEzBaseTable;
FFieldNo: Integer;
{$IFDEF BCB}
function GetDBTable: TEzBaseTable;
function GetFieldNo: Integer;
procedure SetDBTable(const Value: TEzBaseTable);
procedure SetFieldNo(const Value: Integer);
{$ENDIF}
public
constructor Create( const PropName: string ); Override;
function AsString: string; Override;
procedure Edit(Inspector: TEzInspector); Override;
property DBTable: TEzBaseTable
{$IFDEF BCB} read GetDBTable write SetDBTable
{$ELSE} read FDBTable write FDBTable {$ENDIF};
property FieldNo: Integer
{$IFDEF BCB} read GetFieldNo write SetFieldNo
{$ELSE} read FFieldNo write FFieldNo {$ENDIF};
end;
TEzSetProperty = class( TEzTreeViewProperty )
private
FStrings: TStrings;
function GetDefined(Index: Integer): boolean;
procedure SetDefined(Index: Integer; value:boolean);
procedure StringsChanged( Sender: TObject );
procedure ThisChanged( Sender: TObject );
{$IFDEF BCB}
function GetStrings: TStrings;
{$ENDIF}
public
constructor Create( const PropName: string ); Override;
destructor Destroy; Override;
function AsString: string; Override;
property Strings: TStrings {$IFDEF BCB} read GetStrings {$ELSE} read FStrings {$ENDIF};
Property Defined[Index: Integer]: Boolean read GetDefined write SetDefined;
end;
TEzPointsProperty = class(TEzBaseProperty)
private
FVector: TEzVector;
procedure SetVector(const Value: TEzVector);
{$IFDEF BCB}
function GetVector: TEzVector;
{$ENDIF}
public
constructor Create( const PropName: string ); Override;
destructor Destroy; Override;
function AsString: string; Override;
procedure Edit(Inspector: TEzInspector); Override;
property Vector: TEzVector {$IFDEF BCB}read GetVector {$ELSE} read FVector {$ENDIF} write SetVector;
end;
TEzDefineLocalBitmapProperty = class(TEzStringProperty)
public
constructor Create( const PropName: string ); Override;
Procedure Edit(Inspector: TEzInspector); Override;
end;
TEzDefineAnyLocalImageProperty = class(TEzStringProperty)
public
constructor Create( const PropName: string ); Override;
Procedure Edit(Inspector: TEzInspector); Override;
end;
TEzFontNameProperty = class(TEzBaseProperty)
private
FTrueType: Boolean;
{$IFDEF BCB}
function GetTrueType: Boolean;
procedure SetTrueType(const Value: Boolean);
{$ENDIF}
public
constructor Create( const PropName: string ); Override;
Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Override;
property TrueType: Boolean
{$IFDEF BCB} read GetTrueType write SetTrueType
{$ELSE} read FTrueType write FTrueType {$ENDIF};
end;
TEzSymbolProperty = class(TEzBaseProperty)
public
constructor Create( const PropName: string ); Override;
Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Override;
Procedure Draw(Canvas: TCanvas; ARect: TRect; AState: TGridDrawState);Override;
end;
TEzBlocksProperty = class(TEzBaseProperty)
public
constructor Create( const PropName: string ); Override;
Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Override;
Procedure Draw(Canvas: TCanvas; ARect: TRect; AState: TGridDrawState); Override;
end;
TEzBrushstyleProperty = class(TEzBaseProperty)
public
constructor Create( const PropName: string ); Override;
Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Override;
Procedure Draw(Canvas: TCanvas; ARect: TRect; AState: TGridDrawState); Override;
end;
TEzLinetypeProperty = class(TEzBaseProperty)
public
constructor Create( const PropName: string ); Override;
Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Override;
Procedure Draw(Canvas: TCanvas; ARect: TRect; AState: TGridDrawState); Override;
end;
TEzBitmapProperty = class(TEzBaseProperty)
private
FBitmap: TBitmap;
{$IFDEF BCB}
function GetBitmap: TBitmap;
{$ENDIF}
public
constructor Create( const PropName: string ); Override;
destructor Destroy; override;
Procedure Edit(Inspector: TEzInspector); Override;
function AsString: string; Override;
property Bitmap: TBitmap {$IFDEF BCB} read GetBitmap {$ELSE} read FBitmap {$ENDIF};
end;
TEzEnumerationProperty = class(TEzBaseProperty)
private
FStrings: TStrings;
{$IFDEF BCB}
function GetStrings: TStrings;
{$ENDIF}
public
constructor Create( const PropName: string ); Override;
destructor Destroy; Override;
Procedure ShowEditor(Inspector: TEzInspector; ARect: TRect); Override;
function AsString: string; Override;
property Strings: TStrings {$IFDEF BCB} read GetStrings {$ELSE} read FStrings {$ENDIF};
end;
{ TBrowseForFolder }
_exData=record
Path:PChar;
Caption:PChar;
end;
TBrowseFlag = ( bf_BrowseForComputer, bf_BrowseForPrinter, bf_DontGoBelowDomain,
bf_statustext, bf_ReturnFSanceStors, bf_ReturnOnlyFSDIRS, bf_EditBox);
TBrowseFlags = set of TBrowseFlag;
TBrowseLocation= (bl_STANDART, bl_CUSTOM, bl_DESKTOP, bl_PROGRAMS, bl_CONTROLS,
bl_PRINTERS, bl_PERSONAL, bl_FAVORITES, bl_STARTUP, bl_RECENT, bl_SENDTO,
bl_BITBUCKET, bl_STARTMENU, bl_DESKTOPDIRECTORY, bl_DRIVES, bl_NETWORK,
bl_NETHOOD, bl_FONTS, bl_TEMPLATES, bl_COMMON_STARTMENU, bl_COMMON_PROGRAMS,
bl_COMMON_STARTUP, bl_COMMON_DESKTOPDIRECTORY, bl_APPDATA, bl_PRINTHOOD);
TBrowseForFolder = class(TComponent)
private
FBrowseInfo:TBrowseInfo;
FRoot:PItemIDList;
FDisplayName:String;
FStatusText:String;
FFolderName:String;
FORoot:TBrowseLocation;
FCaption: String;
{ Private declarations }
procedure SetFlags( Value :TBrowseFlags );
function GetFlags :TBrowseFlags;
function GetOperFlag( F :Cardinal ) :Boolean;
procedure SetOperFlag( F :Cardinal; V :Boolean );
procedure SetCaption(const Value: String);
public
{ Public declarations }
_inData:_exData;
constructor Create( anOwner :TComponent ); override;
function Execute :Boolean;
procedure SetRoot(Root:PItemIdList);
procedure SetFunction(tF:TFNBFFCallBack);
procedure SetLParam(Param:LParam);
published
{ Published declarations }
property DisplayName:String read FDisplayName;
property StatusText:String read FStatusText write FStatusText;
property FolderName:String read FFolderName write FFolderName;
property Flags :TBrowseFlags read GetFlags write SetFlags stored true;
property Root:TBrowseLocation read FoRoot write FoRoot;
property Caption:String read FCaption write SetCaption;
end;
//------------------------------TEzInspectorProvider------------------------
TPopulateAction = (epaDisplayOnlyThis, epaAdding, epaInsert, epaOverWrite);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -