📄 jvqinspector.pas
字号:
property OnItemSelected: TNotifyEvent read GetOnItemSelected write SetOnItemSelected;
property OnItemValueChanged: TInspectorItemEvent read FOnItemValueChanged write FOnItemValueChanged;
property AfterDataCreate: TInspectorDataEvent read GetAfterDataCreate write SetAfterDataCreate;
property AfterItemCreate: TInspectorItemEvent read GetAfterItemCreate write SetAfterItemCreate;
property BeforeItemCreate: TInspectorItemBeforeCreateEvent read GetBeforeItemCreate write SetBeforeItemCreate;
property BeforeSelection: TInspectorItemBeforeSelectEvent read GetBeforeSelection write SetBeforeSelection;
property Painter: TJvInspectorPainter read GetPainter write SetPainter;
property PaintGeneration: Integer read FPaintGen;
property ReadOnly: Boolean read GetReadOnly write SetReadOnly;
property RelativeDivider: Boolean read GetRelativeDivider write SetRelativeDivider;
property Root: TJvCustomInspectorItem read GetRoot;
property InspectObject: TObject read FInspectObject write SetInspectObject;
property RowSizing: Boolean read FRowSizing write FRowSizing;
property RowSizingItem: TJvCustomInspectorItem read FRowSizingItem write FRowSizingItem;
property Selected: TJvCustomInspectorItem read GetSelected;
property SelectedIndex: Integer read GetSelectedIndex write SetSelectedIndex;
property Selecting: Boolean read FSelecting write FSelecting;
property TopIndex: Integer read GetTopIndex write SetTopIndex;
property UseBands: Boolean read GetUseBands write SetUseBands;
property VisibleCount: Integer read GetVisibleCount;
property VisibleItems[const I: Integer]: TJvCustomInspectorItem read GetVisibleItems;
property WantTabs: Boolean read GetWantTabs write SetWantTabs;
property BeforeEdit: TInspectorBeforeEditEvent read FBeforeEdit write FBeforeEdit;
{ Standard TCustomControl events - these are really events fired by
the TEdit control used when editing in a cell!}
property OnEditorContextPopup: TContextPopupEvent read FOnEditorContextPopup write FOnEditorContextPopup;
property OnEditorKeyDown: TKeyEvent read FOnEditorKeyDown write FOnEditorKeyDown;
property OnEditorKeyPress: TKeyPressEvent read FOnEditorKeyPress write FOnEditorKeyPress;
property OnEditorKeyUp: TKeyEvent read FOnEditorKeyUp write FOnEditorKeyUp;
property OnEditorMouseDown: TOnJvInspectorMouseDown read FOnEditorMouseDown write FOnEditorMouseDown;
property OnItemEdit: TOnJvInspectorItemEdit read FOnItemEdit write FOnItemEdit; // User clicks Ellipsis button.
property OnItemValueError: TInspectorValueErrorEvent read FOnItemValueError write FOnItemValueError;
public
constructor Create(AOwner: TComponent); override;
procedure BeforeDestruction; override;
function BeginUpdate: Integer; virtual;
function EndUpdate: Integer; virtual;
function Focused: Boolean; override;
function FocusedItem: TJvCustomInspectorItem; virtual;
function VisibleIndex(const AItem: TJvCustomInspectorItem): Integer; virtual;
procedure RefreshValues;
procedure SetFocus; override;
procedure SaveValues;
procedure AddComponent(Instance: TObject; const CategoryName: string = ''; Expanded: Boolean = True);
procedure Clear;
end;
TJvInspector = class(TJvCustomInspector)
public
property LockCount;
property Root;
property Selected;
property SelectedIndex;
property TopIndex;
property VisibleCount;
property VisibleItems;
property InspectObject;
published
property Align;
property Anchors;
property AutoComplete default True;
property AutoDropDown default False;
property BandWidth default 150;
property BevelInner default bvNone;
property BevelOuter;
property BevelWidth;
property CollapseButton;
// (rom) this is usually handled in an overwritten Loaded
property RelativeDivider default False; // Must be defined before Divider
property Divider default 75;
property ExpandButton;
property Font;
property ItemHeight;
property Painter;
property ReadOnly default False;
property UseBands default False;
property WantTabs default False;
property AfterDataCreate;
property AfterItemCreate;
property BeforeItemCreate;
property BeforeSelection;
property OnDataValueChanged;
property OnItemSelected;
property OnItemValueChanged;
property OnItemValueError;
property OnItemEdit; // User clicks Ellipsis button.
property BeforeEdit; // Low level hook for customizing TEdit/TMemo after objects are created, just before editing.
// Standard control events
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
// Redirected editor events
property OnEditorContextPopup;
property OnEditorKeyDown;
property OnEditorKeyPress;
property OnEditorKeyUp;
property OnEditorMouseDown;
end;
TJvInspectorPainter = class(TJvComponent)
private
FBackgroundColor: TColor;
FButtonImage: TBitmap;
FCanvas: TCanvas;
FCategoryColor: TColor;
FCategoryTextColor: TColor;
FDividerColor: TColor;
FInitializing: Boolean;
FInspector: TJvCustomInspector;
FInternalCollapseButton: TBitmap;
FInternalExpandButton: TBitmap;
FItem: TJvCustomInspectorItem;
FItemIndex: Integer;
FNameColor: TColor;
FPaintRect: TRect;
FSelectedColor: TColor;
FSelectedTextColor: TColor;
FValueColor: TColor;
FDrawNameEndEllipsis: Boolean;
protected
procedure ApplyNameFont; virtual;
procedure ApplyValueFont; virtual;
procedure CalcButtonBasedRects; virtual;
procedure CalcEditBasedRects; virtual;
procedure CalcNameBasedRects; virtual;
procedure CalcValueBasedRects; virtual;
function DividerWidth: Integer; virtual;
procedure DoPaint; virtual;
function GetBackgroundColor: TColor; virtual;
function GetCategoryColor: TColor; virtual;
function GetCategoryTextColor: TColor; virtual;
function GetCollapseImage: TBitmap; virtual;
function GetDividerColor: TColor; virtual;
function GetExpandImage: TBitmap; virtual;
function GetHideSelectColor: TColor; virtual;
function GetHideSelectTextColor: TColor; virtual;
function GetNameColor: TColor; virtual;
function GetNameHeight(const AItem: TJvCustomInspectorItem): Integer; virtual;
function GetRects(const Index: TInspectorPaintRect): TRect; virtual;
function GetSelectedColor: TColor; virtual;
function GetSelectedTextColor: TColor; virtual;
function GetValueColor: TColor; virtual;
function GetDrawNameEndEllipsis: Boolean; virtual;
function GetValueHeight(const AItem: TJvCustomInspectorItem): Integer; virtual;
procedure HideEditor; virtual;
procedure InitializeColors; virtual;
function Loading: Boolean;
procedure Paint; virtual;
procedure PaintDivider(const X, YTop, YBottom: Integer); virtual;
procedure PaintItem(var ARect: TRect; const AItemIndex: Integer); overload; virtual;
procedure PaintItem(const AItem: TJvCustomInspectorItem); overload; virtual;
procedure SetBackgroundColor(const Value: TColor); virtual;
procedure SetCategoryColor(const Value: TColor); virtual;
procedure SetCategoryTextColor(const Value: TColor); virtual;
procedure SetDividerColor(const Value: TColor); virtual;
procedure SetHideSelectColor(const Value: TColor); virtual;
procedure SetHideSelectTextColor(const Value: TColor); virtual;
procedure SetNameColor(const Value: TColor); virtual;
procedure SetRects(const Index: TInspectorPaintRect; const ARect: TRect); virtual;
procedure SetSelectedColor(const Value: TColor); virtual;
procedure SetSelectedTextColor(const Value: TColor); virtual;
procedure Setup(const ACanvas: TCanvas); virtual;
procedure SetupItem; virtual;
procedure SetupRects; virtual;
procedure SetValueColor(const Value: TColor); virtual;
procedure SetDrawNameEndEllipsis(Value: Boolean); virtual;
procedure TeardownItem; virtual;
property ButtonImage: TBitmap read FButtonImage write FButtonImage;
property Canvas: TCanvas read FCanvas write FCanvas;
property Initializing: Boolean read FInitializing write FInitializing;
property Inspector: TJvCustomInspector read FInspector;
property InternalCollapseButton: TBitmap read FInternalCollapseButton;
property InternalExpandButton: TBitmap read FInternalExpandButton;
property Item: TJvCustomInspectorItem read FItem write FItem;
property ItemIndex: Integer read FItemIndex write FItemIndex;
property PaintRect: TRect read FPaintRect write FPaintRect;
property Rects[const Index: TInspectorPaintRect]: TRect read GetRects write SetRects;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure SetInspector(const AInspector: TJvCustomInspector); virtual;
property HideSelectColor: TColor read GetHideSelectColor write SetHideSelectColor;
property HideSelectTextColor: TColor read GetHideSelectTextColor write SetHideSelectTextColor;
property SelectedColor: TColor read GetSelectedColor write SetSelectedColor;
property SelectedTextColor: TColor read GetSelectedTextColor write SetSelectedTextColor;
published
property BackgroundColor: TColor read GetBackgroundColor write SetBackgroundColor;
property CategoryColor: TColor read GetCategoryColor write SetCategoryColor;
property CategoryTextColor: TColor read GetCategoryTextColor write SetCategoryTextColor;
property DividerColor: TColor read GetDividerColor write SetDividerColor;
property NameColor: TColor read GetNameColor write SetNameColor;
property ValueColor: TColor read GetValueColor write SetValueColor;
property DrawNameEndEllipsis: Boolean read GetDrawNameEndEllipsis write SetDrawNameEndEllipsis;
end;
TJvInspectorBorlandNETBasePainter = class(TJvInspectorPainter)
private
FRealButtonAreaWidth: Integer;
protected
procedure ApplyNameFont; override;
procedure ApplyValueFont; override;
procedure CalcButtonBasedRects; override;
procedure CalcEditBasedRects; override;
procedure CalcNameBasedRects; override;
procedure CalcValueBasedRects; override;
procedure SetupRects; override;
property RealButtonAreaWidth: Integer read FRealButtonAreaWidth write FRealButtonAreaWidth;
published
property BackgroundColor default clWindow;
property CategoryColor default clBtnFace;
property CategoryTextColor default clBtnText;
property NameColor default clWindowText;
property ValueColor default clWindowText;
end;
TJvInspectorBorlandPainter = class(TJvInspectorBorlandNETBasePainter)
private
FDividerLightColor: TColor;
FOnSetItemColors: TOnJvInspectorSetItemColors;
protected
function DividerWidth: Integer; override;
procedure DoPaint; override;
function GetDividerLightColor: TColor; virtual;
function GetSelectedColor: TColor; override;
function GetSelectedTextColor: TColor; override;
procedure InitializeColors; override;
procedure PaintDivider(const X, YTop, YBottom: Integer); override;
procedure SetDividerLightColor(const Value: TColor); virtual;
procedure Setup(const ACanvas: TCanvas); override;
published
property BackgroundColor default clBtnFace;
property DividerColor default clBtnShadow;
property DividerLightColor: TColor read GetDividerLightColor write SetDividerLightColor default clBtnHighlight;
property ValueColor default clNavy;
property OnSetItemColors: TOnJvInspectorSetItemColors read FOnSetItemColors write FOnSetItemColors;
end;
TJvInspectorDotNETPainter = class(TJvInspectorBorlandNETBasePainter)
private
FHideSelectColor: TColor;
FHideSelectTextColor: TColor;
FOnSetItemColors: TOnJvInspectorSetItemColors;
protected
procedure ApplyNameFont; override;
function GetHideSelectColor: TColor; override;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -