📄 jvinspector.pas
字号:
procedure Insert(const Index: Integer; const Item: TJvCustomInspectorItem);
procedure ScrollInView;
procedure Sort;
function GetEditorText: string;
property AutoUpdate: Boolean read GetAutoUpdate write SetAutoUpdate;
property Count: Integer read GetCount;
property Data: TJvCustomInspectorData read GetData;
property DisplayIndex: Integer read GetDisplayIndex write SetDisplayIndex;
property DisplayName: string read GetDisplayName write SetDisplayName;
property FullName: string read GetFullName;
property DisplayValue: string read GetDisplayValue write SetDisplayValue;
property Editing: Boolean read GetEditing;
property Expanded: Boolean read GetExpanded write SetExpanded;
property Flags: TInspectorItemFlags read GetFlags write SetFlags;
property Hidden: Boolean read GetHidden write SetHidden;
property Height: Integer read GetHeight write SetHeight;
property HeightFactor: Integer read GetHeightFactor write SetHeightFactor;
property Inspector: TJvCustomInspector read GetInspector;
property Items[const I: Integer]: TJvCustomInspectorItem read GetItems; default;
property Level: Integer read GetLevel;
property Multiline: Boolean read GetMultiline write SetMultiline;
property Name: string read GetName;
property Parent: TJvCustomInspectorItem read GetParent;
property QualifiedNames: Boolean read GetQualifiedNames write SetQualifiedNames;
property ReadOnly: Boolean read GetReadOnly write SetReadOnly;
property Rects[const RectKind: TInspectorPaintRect]: TRect read GetRects write SetRects;
property RowSizing: TJvInspectorItemSizing read GetRowSizing write SetRowSizing;
property SortKind: TInspectorItemSortKind read GetSortKind write SetSortKind;
property UserData: Pointer read FUserData write FUserData;
property Visible: Boolean read GetVisible write SetVisible;
property OnCompare: TInspectorItemSortCompare read FOnCompare write SetOnCompare;
property OnValueChanged: TNotifyEvent read FOnValueChanged write FOnValueChanged;
property OnGetValueList: TInspectorItemGetValueListEvent read FOnGetValueList write FOnGetValueList;
property DropDownCount: Integer read FDropDownCount write FDropDownCount;
end;
TJvInspectorCustomCategoryItem = class(TJvCustomInspectorItem)
private
FName: string;
protected
function GetName: string; override;
function IsCategory: Boolean; override;
procedure SetFlags(const Value: TInspectorItemFlags); override;
public
property Name write FName;
end;
TJvInspectorCompoundColumn = class(TPersistent)
private
FItem: TJvCustomInspectorItem;
FParent: TJvInspectorCustomCompoundItem;
FWidth: Integer;
FWidthSet: Integer;
protected
function GetItem: TJvCustomInspectorItem;
function GetWidth: Integer;
function GetWidthSet: Integer;
procedure SetItem(Value: TJvCustomInspectorItem);
procedure SetWidth(Value: Integer);
procedure SetWidthExternal(Value: Integer);
procedure SetWidthSet(Value: Integer);
property Parent: TJvInspectorCustomCompoundItem read FParent;
public
constructor Create(const AParent: TJvInspectorCustomCompoundItem; const AItem: TJvCustomInspectorItem);
procedure BeforeDestruction; override;
property Item: TJvCustomInspectorItem read GetItem write SetItem;
property Width: Integer read GetWidth write SetWidthExternal;
property WidthSet: Integer read GetWidthSet;
end;
TJvInspectorCustomCompoundItem = class(TJvCustomInspectorItem)
private
FCompoundItemFlags: TInspectorCompoundItemFlags;
FColumns: TObjectList;
FSelectedColumnIdx: Integer;
protected
function AddColumnPrim(const Item: TJvCustomInspectorItem): Integer; overload; virtual;
function AddColumnPrim(const ItemIndex: Integer): Integer; overload; virtual;
procedure DeleteColumnPrim(const Column: TJvInspectorCompoundColumn); overload; virtual;
procedure DeleteColumnPrim(const Index: Integer); overload; virtual;
procedure DeleteColumnPrim(const Item: TJvCustomInspectorItem); overload; virtual;
procedure DivideRect(const RectKind: TInspectorPaintRect; const Value: TRect); virtual;
procedure EditKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); override;
function GetColumnCount: Integer; virtual;
function GetColumns(I: Integer): TJvInspectorCompoundColumn; virtual;
function GetDisplayName: string; override;
{$IFDEF VCL}
function GetEditCtrl: TCustomEdit; override;
{$ENDIF VCL}
{$IFDEF VisualCLX}
function GetEditCtrl: TOpenEdit; override;
{$ENDIF VisualCLX}
function GetEditCtrlDestroying: Boolean; override;
function GetEditing: Boolean; override;
function GetSelectedColumn: TJvInspectorCompoundColumn; virtual;
function GetSelectedColumnIndex: Integer; virtual;
function GetSingleName: Boolean;
function GetSingleNameUseFirstCol: Boolean;
function IndexOfColumnPrim(const Col: TJvInspectorCompoundColumn): Integer; overload; virtual;
function IndexOfColumnPrim(const Item: TJvCustomInspectorItem): Integer; overload; virtual;
procedure InsertColumnPrim(const Index: Integer; const Item: TJvCustomInspectorItem); overload; virtual;
procedure InsertColumnPrim(const Index, ItemIndex: Integer); overload; virtual;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
procedure RecalcColumnWidths(const SetColumn: TJvInspectorCompoundColumn = nil); virtual;
procedure SetCompoundItemFlags(Value: TInspectorCompoundItemFlags);
procedure SetDisplayName(Value: string); override;
procedure SetEditing(const Value: Boolean); override;
procedure SetFlags(const Value: TInspectorItemFlags); override;
procedure SetFocus; override;
procedure SetRects(const RectKind: TInspectorPaintRect; Value: TRect); override;
procedure SetSelectedColumn(Value: TJvInspectorCompoundColumn); virtual;
procedure SetSelectedColumnIndex(Value: Integer); virtual;
procedure SetSingleName(Value: Boolean);
procedure SetSingleNameUseFirstCol(Value: Boolean);
property ColumnCount: Integer read GetColumnCount;
property Columns[I: Integer]: TJvInspectorCompoundColumn read GetColumns;
property CompoundItemFlags: TInspectorCompoundItemFlags read FCompoundItemFlags write SetCompoundItemFlags;
property SelectedColumn: TJvInspectorCompoundColumn read GetSelectedColumn write SetSelectedColumn;
property SelectedColumnIndex: Integer read GetSelectedColumnIndex write SetSelectedColumnIndex;
property SingleName: Boolean read GetSingleName write SetSingleName;
property SingleNameUseFirstCol: Boolean read GetSingleNameUseFirstCol write SetSingleNameUseFirstCol;
public
constructor Create(const AParent: TJvCustomInspectorItem; const AData: TJvCustomInspectorData); override;
procedure BeforeDestruction; override;
procedure DoneEdit(const CancelEdits: Boolean = False); override;
procedure DrawEditor(const ACanvas: TCanvas); override;
procedure DrawName(const ACanvas: TCanvas); override;
procedure DrawValue(const ACanvas: TCanvas); override;
function EditFocused: Boolean; override;
procedure InitEdit; override;
end;
TJvInspectorCompoundItem = class(TJvInspectorCustomCompoundItem)
public
function AddColumn(const Item: TJvCustomInspectorItem): Integer; overload;
function AddColumn(const ItemIndex: Integer): Integer; overload;
procedure DeleteColumn(const Column: TJvInspectorCompoundColumn); overload;
procedure DeleteColumn(const Index: Integer); overload;
procedure DeleteColumn(const Item: TJvCustomInspectorItem); overload;
function IndexOfColumn(const Col: TJvInspectorCompoundColumn): Integer; overload;
function IndexOfColumn(const Item: TJvCustomInspectorItem): Integer; overload;
procedure InsertColumn(const Index: Integer; const Item: TJvCustomInspectorItem); overload;
procedure InsertColumn(const Index, ItemIndex: Integer); overload;
property ColumnCount;
property Columns;
property CompoundItemFlags;
property SelectedColumn;
property SelectedColumnIndex;
property SingleName;
property SingleNameUseFirstCol;
end;
TJvInspectorIntegerItem = class(TJvCustomInspectorItem)
protected
function GetDisplayValue: string; override;
procedure SetDisplayValue(const Value: string); override;
end;
TJvInspectorEnumItem = class(TJvCustomInspectorItem)
protected
function GetDisplayValue: string; override;
procedure GetValueList(const Strings: TStrings); override;
procedure SetDisplayValue(const Value: string); override;
procedure SetFlags(const Value: TInspectorItemFlags); override;
end;
TJvInspectorFloatItem = class(TJvCustomInspectorItem)
protected
FFormat: string;
function GetDisplayValue: string; override;
procedure SetDisplayValue(const Value: string); override;
public
constructor Create(const AParent: TJvCustomInspectorItem;
const AData: TJvCustomInspectorData); override;
published
property Format: string read FFormat write FFormat;
end;
TJvInspectorSetItem = class(TJvCustomInspectorItem)
private
FItemSetFlags: TInspectorSetFlags;
protected
function CanEdit: Boolean; override;
procedure CreateMembers; virtual;
procedure DeleteMembers; virtual;
function GetCreateMemberItems: Boolean; virtual;
function GetDisplayValue: string; override;
function GetEditString: Boolean; virtual;
function GetRenderAsCategory: Boolean; virtual;
function GetItemSetFlags: TInspectorSetFlags; virtual;
procedure InvalidateMetaData; override;
function IsCategory: Boolean; override;
procedure SetCreateMemberItems(const Value: Boolean); virtual;
procedure SetDisplayValue(const Value: string); override;
procedure SetEditString(const Value: Boolean); virtual;
procedure SetRenderAsCategory(const Value: Boolean); virtual;
procedure SetFlags(const Value: TInspectorItemFlags); override;
procedure SetItemSetFlags(const Value: TInspectorSetFlags); virtual;
public
constructor Create(const AParent: TJvCustomInspectorItem;
const AData: TJvCustomInspectorData); override;
published
property ItemSetFlags: TInspectorSetFlags read GetItemSetFlags
write SetItemSetFlags;
property CreateMemberItems: Boolean read GetCreateMemberItems
write SetCreateMemberItems;
property EditString: Boolean read GetEditString write SetEditString;
property RenderAsCategory: Boolean read GetRenderAsCategory write SetRenderAsCategory;
end;
TJvInspectorCharItem = class(TJvCustomInspectorItem)
protected
function GetDisplayValue: string; override;
procedure SetDisplayValue(const Value: string); override;
end;
TJvInspectorInt64Item = class(TJvCustomInspectorItem)
protected
function GetDisplayValue: string; override;
procedure SetDisplayValue(const Value: string); override;
end;
TJvInspectorStringItem = class(TJvCustomInspectorItem)
protected
function GetDisplayValue: string; override;
procedure SetDisplayValue(const Value: string); override;
end;
TJvInspectorClassItem = class(TJvCustomInspectorItem)
private
FItemClassFlags: TInspectorClassFlags;
FLastMemberInstance: TObject;
protected
procedure CreateMembers; virtual;
function CanEdit: Boolean; override;
procedure DeleteMembers; virtual;
function GetCreateMemberItems: Boolean; virtual;
function GetDisplayValue: string; override;
function GetItemClassFlags: TInspectorClassFlags; virtual;
function GetRenderAsCategory: Boolean; virtual;
function GetShowClassName: Boolean; virtual;
procedure InvalidateItem; override;
procedure InvalidateMetaData; override;
function IsCategory: Boolean; override;
procedure SetCreateMemberItems(const Value: Boolean); virtual;
procedure SetDisplayValue(const Value: string); override;
procedure SetItemClassFlags(Value: TInspectorClassFlags); virtual;
procedure SetRenderAsCategory(const Value: Boolean); virtual;
procedure SetShowClassName(const Value: Boolean); virtual;
public
constructor Create(const AParent: TJvCustomInspectorItem;
const AData: TJvCustomInspectorData); override;
property CreateMemberItems: Boolean read GetCreateMemberItems write SetCreateMemberItems;
property ItemClassFlags: TInspectorClassFlags read GetItemClassFlags writ
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -