📄 jvtooledit.pas
字号:
property ImageKind: TJvImageKind read FImageKind write SetImageKind default ikCustom;
property Images: TCustomImageList read FImages write SetImages;
property NumGlyphs: TNumGlyphs read GetNumGlyphs write SetNumGlyphs default 1;
property OnButtonClick: TNotifyEvent read FOnButtonClick write FOnButtonClick;
property OnKeyDown: TKeyEvent read FOnKeyDown write FOnKeyDown;
property PopupAlign: TPopupAlign read FPopupAlign write FPopupAlign default epaRight;
property PopupVisible: Boolean read GetPopupVisible;
property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False;
property SettingCursor: Boolean read GetSettingCursor;
property ShowButton: Boolean read GetShowButton write SetShowButton default True;
property OnEnabledChanged: TNotifyEvent read FOnEnabledChanged write FOnEnabledChanged;
property OnPopupShown: TNotifyEvent read FOnPopupShown write FOnPopupShown;
property OnPopupHidden: TNotifyEvent read FOnPopupHidden write FOnPopupHidden;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
class function DefaultImageIndex: TImageIndex; virtual;
class function DefaultImages: TCustomImageList; virtual;
procedure DoClick;
procedure SelectAll;
{$IFDEF VisualCLX}
procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
{$ENDIF VisualCLX}
{ Backwards compatibility; moved to public&published; eventually remove }
property GlyphKind: TGlyphKind read GetGlyphKind write SetGlyphKind;
{$IFDEF VCL}
property Ctl3D;
{$ENDIF VCL}
end;
TJvComboEdit = class(TJvCustomComboEdit)
public
property Button;
published
//Polaris
property Action;
property Align;
property Alignment;
property AlwaysEnableButton;
property AlwaysShowPopup;
property Anchors;
property AutoSelect;
property AutoSize;
{$IFDEF VCL}
property AutoCompleteItems;
property AutoCompleteOptions;
property BiDiMode;
property DragCursor;
property DragKind;
property Flat;
property ImeMode;
property ImeName;
property OEMConvert;
property ParentBiDiMode;
property ParentCtl3D;
property OnEndDock;
property OnStartDock;
{$ENDIF VCL}
property BorderStyle;
property ButtonFlat;
property ButtonHint;
property ButtonWidth;
property CharCase;
property ClickKey;
property ClipboardCommands; // RDB
property Color;
property Constraints;
property DirectInput;
property DisabledColor; // RDB
property DisabledTextColor; // RDB
property DragMode;
property EditMask;
property Enabled;
property Font;
property Glyph;
property HideSelection;
property ImageIndex;
property ImageKind;
property Images;
property MaxLength;
property NumGlyphs;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ReadOnly;
property ShowHint;
property ShowButton;
property TabOrder;
property TabStop;
property Text;
property Visible;
property OnButtonClick;
property OnChange;
property OnClick;
property OnContextPopup;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown; // RDB
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseEnter;
property OnMouseLeave;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
{ TJvFileDirEdit }
{ The common parent of TJvFilenameEdit and TJvDirectoryEdit }
{ For internal use only; it's not intended to be used separately }
type
TExecOpenDialogEvent = procedure(Sender: TObject; var Name: string;
var Action: Boolean) of object;
TJvFileDirEdit = class(TJvCustomComboEdit)
private
FErrMode: Cardinal;
FMultipleDirs: Boolean;
FOnDropFiles: TNotifyEvent;
FOnBeforeDialog: TExecOpenDialogEvent;
FOnAfterDialog: TExecOpenDialogEvent;
{$IFDEF VCL}
FAcceptFiles: Boolean;
FMRUList: IUnknown;
FHistoryList: IUnknown;
FFileSystemList: IUnknown;
FAutoCompleteFileOptions: TJvAutoCompleteFileOptions;
FAutoCompleteSourceIntf: IUnknown;
procedure SetAutoCompleteFileOptions(const Value: TJvAutoCompleteFileOptions);
procedure SetDragAccept(Value: Boolean);
procedure SetAcceptFiles(Value: Boolean);
procedure WMDropFiles(var Msg: TWMDropFiles); message WM_DROPFILES;
{$IFDEF JVCLThemesEnabled}
procedure CMSysColorChange(var Msg: TMessage); message CM_SYSCOLORCHANGE;
{$ENDIF JVCLThemesEnabled}
{$ENDIF VCL}
protected
{$IFDEF VCL}
procedure CreateHandle; override;
procedure DestroyWindowHandle; override;
procedure UpdateAutoComplete; override;
function GetAutoCompleteSource: IUnknown; override;
{$ENDIF VCL}
function GetLongName: string; virtual; abstract;
function GetShortName: string; virtual; abstract;
procedure DoAfterDialog(var FileName: string; var Action: Boolean); dynamic;
procedure DoBeforeDialog(var FileName: string; var Action: Boolean); dynamic;
procedure ReceptFileDir(const AFileName: string); virtual; abstract;
procedure ClearFileList; virtual;
procedure Change; override;
procedure DisableSysErrors;
procedure EnableSysErrors;
{$IFDEF VCL}
property AutoCompleteFileOptions: TJvAutoCompleteFileOptions read FAutoCompleteFileOptions write
SetAutoCompleteFileOptions;
property AutoCompleteOptions default [acoAutoSuggest];
{$ENDIF VCL}
property ImageKind default ikDefault;
property MaxLength;
public
constructor Create(AOwner: TComponent); override;
property LongName: string read GetLongName;
property ShortName: string read GetShortName;
published
{$IFDEF VCL}
property AcceptFiles: Boolean read FAcceptFiles write SetAcceptFiles default True;
{$ENDIF VCL}
property OnBeforeDialog: TExecOpenDialogEvent read FOnBeforeDialog
write FOnBeforeDialog;
property OnAfterDialog: TExecOpenDialogEvent read FOnAfterDialog
write FOnAfterDialog;
property OnDropFiles: TNotifyEvent read FOnDropFiles write FOnDropFiles;
property OnButtonClick;
property ClipboardCommands; // RDB
property DisabledTextColor; // RDB
property DisabledColor; // RDB
end;
TFileDialogKind = (dkOpen, dkSave, dkOpenPicture, dkSavePicture);
TJvFilenameEdit = class(TJvFileDirEdit)
private
FDialog: TOpenDialog;
FDialogKind: TFileDialogKind;
FAddQuotes: Boolean;
procedure CreateEditDialog;
function GetFileName: TFileName;
function GetDefaultExt: TFileExt;
{$IFDEF VCL}
function GetFileEditStyle: TFileEditStyle;
{$ENDIF VCL}
function GetFilter: string;
function GetFilterIndex: Integer;
function GetInitialDir: string;
function GetHistoryList: TStrings;
function GetOptions: TOpenOptions;
function GetDialogTitle: string;
function GetDialogFiles: TStrings;
procedure SetDialogKind(Value: TFileDialogKind);
procedure SetFileName(const Value: TFileName);
procedure SetDefaultExt(Value: TFileExt);
{$IFDEF VCL}
procedure SetFileEditStyle(Value: TFileEditStyle);
{$ENDIF VCL}
procedure SetFilter(const Value: string);
procedure SetFilterIndex(Value: Integer);
procedure SetInitialDir(const Value: string);
procedure SetHistoryList(Value: TStrings);
procedure SetOptions(Value: TOpenOptions);
procedure SetDialogTitle(const Value: string);
function IsCustomTitle: Boolean;
function IsCustomFilter: Boolean;
protected
procedure PopupDropDown(DisableEdit: Boolean); override;
procedure ReceptFileDir(const AFileName: string); override;
procedure ClearFileList; override;
function GetLongName: string; override;
function GetShortName: string; override;
public
constructor Create(AOwner: TComponent); override;
class function DefaultImageIndex: TImageIndex; override;
property Dialog: TOpenDialog read FDialog;
property DialogFiles: TStrings read GetDialogFiles;
published
//Polaris
property Action;
property Align;
property AutoSize;
property AddQuotes: Boolean read FAddQuotes write FAddQuotes default True;
property DialogKind: TFileDialogKind read FDialogKind write SetDialogKind
default dkOpen;
property DefaultExt: TFileExt read GetDefaultExt write SetDefaultExt;
{$IFDEF VCL}
property AutoCompleteOptions;
property AutoCompleteFileOptions default [acfFileSystem];
property Flat;
property ParentCtl3D;
{ (rb) Obsolete; added 'stored False', eventually remove }
property FileEditStyle: TFileEditStyle read GetFileEditStyle write SetFileEditStyle stored False;
{$ENDIF VCL}
property FileName: TFileName read GetFileName write SetFileName stored False;
property Filter: string read GetFilter write SetFilter stored IsCustomFilter;
property FilterIndex: Integer read GetFilterIndex write SetFilterIndex default 1;
property InitialDir: string read GetInitialDir write SetInitialDir;
{ (rb) Obsolete; added 'stored False', eventually remove }
property HistoryList: TStrings read GetHistoryList write SetHistoryList stored False;
property DialogOptions: TOpenOptions read GetOptions write SetOptions
default [ofHideReadOnly];
property DialogTitle: string read GetDialogTitle write SetDialogTitle
stored IsCustomTitle;
property AutoSelect;
property ButtonHint;
property ButtonFlat;
property BorderStyle;
property CharCase;
property ClickKey;
property Color;
property DirectInput;
{$IFDEF VCL}
property DragCursor;
property BiDiMode;
property DragKind;
property ParentBiDiMode;
property ImeMode;
property ImeName;
property OnEndDock;
property OnStartDock;
{$ENDIF VCL}
property DragMode;
property EditMask;
property Enabled;
property Font;
property Glyph;
property GroupIndex;
property ImageIndex;
property Images;
property ImageKind;
property NumGlyphs;
property ButtonWidth;
property HideSelection;
property Anchors;
property Constraints;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ReadOnly;
property ShowHint;
property ShowButton;
property TabOrder;
property TabStop;
property Text;
property Visible;
property OnChange;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseEnter;
property OnMouseLeave;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
property OnContextPopup;
end;
TDirDialogKind = (dkVCL, dkWin32);
TJvDirectoryEdit = class(TJvFileDirEdit)
private
{$IFDEF VCL}
FOptions: TSelectDirOpts;
{$ENDIF VCL}
FInitialDir: string;
FDialogText: string;
FDialogKind: TDirDialogKind;
protected
FMultipleDirs: Boolean; // Polaris (???)
procedure PopupDropDown(DisableEdit: Boolean); override;
procedure ReceptFileDir(const AFileName: string); override;
function GetLongName: string; override;
function GetShortName: string; override;
public
constructor Create(AOwner: TComponent); override;
class function DefaultImageIndex: TImageIndex; override;
published
//Polaris
property Action;
property Align;
property AutoSize;
property DialogKind: TDirDialogKind read FDialogKind write FDialogKind default dkVCL;
property DialogText: string read FDialogText write FDialogText;
{$IFDEF VCL}
property AutoCompleteOptions;
property AutoCompleteFileOptions default [acfFileSystem, acfFileSysDirs];
property Flat;
property ParentCtl3D;
property DialogOptions: TSelectDirOpts read FOptions write FOptions default [sdAllowCreate];
{$ENDIF VCL}
property InitialDir: string read FInitialDir write FInitialDir;
property MultipleDirs: Boolean read FMultipleDirs write FMultipleDirs default False;
property AutoSelect;
property ButtonHint;
property ButtonFlat;
property BorderStyle;
property CharCase;
property ClickKey;
property Color;
property DirectInput;
{$IFDEF VCL}
property DragCursor;
property BiDiMode;
property ParentBiDiMode;
property ImeMode;
property ImeName;
property DragKind;
property OnEndDock;
property OnStartDock;
{$ENDIF VCL}
property DragMode;
property EditMask;
property Enabled;
property Font;
property Glyph;
property GroupIndex;
property ImageIndex;
property Images;
property ImageKind;
property NumGlyphs;
property ButtonWidth;
property HideSelection;
property Anchors;
property Constraints;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ReadOnly;
property ShowHint;
property ShowButton;
property TabOrder;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -