📄 jvdyncontrolenginedevexpcx.pas
字号:
IJvDynControlCheckListBox)
private
FIntItems: TStrings;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure ControlSetDefaultProperties;
procedure ControlSetReadOnly(Value: Boolean);
procedure ControlSetCaption(const Value: string);
procedure ControlSetTabOrder(Value: Integer);
procedure ControlSetOnEnter(Value: TNotifyEvent);
procedure ControlSetOnExit(Value: TNotifyEvent);
procedure ControlSetOnChange(Value: TNotifyEvent);
procedure ControlSetOnClick(Value: TNotifyEvent);
procedure ControlSetHint(const Value: string);
procedure ControlSetValue(Value: Variant);
function ControlGetValue: Variant;
procedure ControlSetSorted(Value: Boolean);
procedure ControlSetItems(Value: TStrings);
function ControlGetItems: TStrings;
procedure ControlSetOnDblClick(Value: TNotifyEvent);
procedure ControlSetCxProperties(Value: TCxDynControlWrapper);
//IJvDynControlCheckListBox = interface
procedure ControlSetAllowGrayed(Value: Boolean);
procedure ControlSetChecked(Index: Integer; Value: Boolean);
procedure ControlSetItemEnabled(Index: Integer; Value: Boolean);
procedure ControlSetHeader(Index: Integer; Value: Boolean);
procedure ControlSetState(Index: Integer; Value: TCheckBoxState);
function ControlGetChecked(Index: Integer): Boolean;
function ControlGetItemEnabled(Index: Integer): Boolean;
function ControlGetHeader(Index: Integer): Boolean;
function ControlGetState(Index: Integer): TCheckBoxState;
end;
TJvDynControlCxComboBox = class(TcxComboBox, IUnknown, IJvDynControl, IJvDynControlData,
IJvDynControlItems, IJvDynControlDevExpCx, IJvDynControlComboBox, IJvDynControlReadOnly)
public
procedure ControlSetDefaultProperties;
procedure ControlSetReadOnly(Value: Boolean);
procedure ControlSetCaption(const Value: string);
procedure ControlSetTabOrder(Value: Integer);
procedure ControlSetOnEnter(Value: TNotifyEvent);
procedure ControlSetOnExit(Value: TNotifyEvent);
procedure ControlSetOnChange(Value: TNotifyEvent);
procedure ControlSetOnClick(Value: TNotifyEvent);
procedure ControlSetHint(const Value: string);
procedure ControlSetValue(Value: Variant);
function ControlGetValue: Variant;
procedure ControlSetSorted(Value: Boolean);
procedure ControlSetItems(Value: TStrings);
function ControlGetItems: TStrings;
procedure ControlSetCxProperties(Value: TCxDynControlWrapper);
procedure ControlSetNewEntriesAllowed(Value: Boolean);
end;
TJvDynControlCxGroupBox = class(TcxGroupBox, IUnknown, IJvDynControl)
public
procedure ControlSetDefaultProperties;
procedure ControlSetCaption(const Value: string);
procedure ControlSetTabOrder(Value: Integer);
procedure ControlSetOnEnter(Value: TNotifyEvent);
procedure ControlSetOnExit(Value: TNotifyEvent);
procedure ControlSetOnClick(Value: TNotifyEvent);
procedure ControlSetHint(const Value: string);
end;
TJvDynControlCxPanel = class(TPanel, IUnknown, IJvDynControl, IJvDynControlPanel)
public
procedure ControlSetDefaultProperties;
procedure ControlSetCaption(const Value: string);
procedure ControlSetTabOrder(Value: Integer);
procedure ControlSetOnEnter(Value: TNotifyEvent);
procedure ControlSetOnExit(Value: TNotifyEvent);
procedure ControlSetOnClick(Value: TNotifyEvent);
procedure ControlSetHint(const Value: string);
procedure ControlSetBorder(ABevelInner: TPanelBevel; ABevelOuter: TPanelBevel; ABevelWidth: Integer; ABorderStyle: TBorderStyle; ABorderWidth: Integer);
end;
TJvDynControlCxImage = class(TcxImage, IUnknown, IJvDynControl,
IJvDynControlImage, IJvDynControlDevExpCx)
public
procedure ControlSetDefaultProperties;
procedure ControlSetCaption(const Value: string);
procedure ControlSetTabOrder(Value: Integer);
procedure ControlSetOnEnter(Value: TNotifyEvent);
procedure ControlSetOnExit(Value: TNotifyEvent);
procedure ControlSetOnClick(Value: TNotifyEvent);
procedure ControlSetHint(const Value: string);
procedure ControlSetAutoSize(Value: Boolean);
procedure ControlSetIncrementalDisplay(Value: Boolean);
procedure ControlSetCenter(Value: Boolean);
procedure ControlSetProportional(Value: Boolean);
procedure ControlSetStretch(Value: Boolean);
procedure ControlSetTransparent(Value: Boolean);
procedure ControlSetPicture(Value: TPicture);
procedure ControlSetGraphic(Value: TGraphic);
function ControlGetPicture: TPicture;
procedure ControlSetCxProperties(Value: TCxDynControlWrapper);
end;
// (rom) TScrollBox or TcxScrollBox?
TJvDynControlCxScrollBox = class(TScrollBox, IJvDynControl)
public
procedure ControlSetDefaultProperties;
procedure ControlSetCaption(const Value: string);
procedure ControlSetTabOrder(Value: Integer);
procedure ControlSetOnEnter(Value: TNotifyEvent);
procedure ControlSetOnExit(Value: TNotifyEvent);
procedure ControlSetOnClick(Value: TNotifyEvent);
procedure ControlSetHint(const Value: string);
end;
// (rom) TLabel or TcxLabel?
TJvDynControlCxLabel = class(TcxLabel, IUnknown, IJvDynControl, IJvDynControlLabel,
IJvDynControlDevExpCx)
public
procedure ControlSetDefaultProperties;
procedure ControlSetCaption(const Value: string);
procedure ControlSetTabOrder(Value: Integer);
procedure ControlSetOnEnter(Value: TNotifyEvent);
procedure ControlSetOnExit(Value: TNotifyEvent);
procedure ControlSetOnClick(Value: TNotifyEvent);
procedure ControlSetHint(const Value: string);
procedure ControlSetFocusControl(Value: TWinControl);
procedure ControlSetWordWrap(Value: Boolean);
procedure ControlSetCxProperties(Value: TCxDynControlWrapper);
end;
// (rom) Warning! TStaticText and TLabel are very different.
TJvDynControlCxStaticText = class(TcxLabel, IUnknown, IJvDynControl, IJvDynControlDevExpCx)
public
procedure ControlSetDefaultProperties;
procedure ControlSetCaption(const Value: string);
procedure ControlSetTabOrder(Value: Integer);
procedure ControlSetOnEnter(Value: TNotifyEvent);
procedure ControlSetOnExit(Value: TNotifyEvent);
procedure ControlSetOnClick(Value: TNotifyEvent);
procedure ControlSetHint(const Value: string);
procedure ControlSetCxProperties(Value: TCxDynControlWrapper);
end;
TJvDynControlCxButton = class(TcxButton, IUnknown, IJvDynControl, IJvDynControlButton,
IJvDynControlDevExpCx, IJvDynControlAction)
public
procedure ControlSetDefaultProperties;
procedure ControlSetCaption(const Value: string);
procedure ControlSetTabOrder(Value: Integer);
procedure ControlSetOnEnter(Value: TNotifyEvent);
procedure ControlSetOnExit(Value: TNotifyEvent);
procedure ControlSetOnClick(Value: TNotifyEvent);
procedure ControlSetHint(const Value: string);
procedure ControlSetGlyph(Value: TBitmap);
procedure ControlSetNumGlyphs(Value: Integer);
procedure ControlSetLayout(Value: TButtonLayout);
procedure ControlSetDefault(Value: Boolean);
procedure ControlSetCancel(Value: Boolean);
// IJvDynControlAction
procedure ControlSetAction(Value: TCustomAction);
procedure ControlSetCxProperties(Value: TCxDynControlWrapper);
end;
TJvDynControlCxRadioButton = class(TCxRadioButton, IUnknown,
IJvDynControl, IJvDynControlData, IJvDynControlDevExpCx)
public
procedure ControlSetDefaultProperties;
procedure ControlSetCaption(const Value: string);
procedure ControlSetTabOrder(Value: Integer);
procedure ControlSetOnEnter(Value: TNotifyEvent);
procedure ControlSetOnExit(Value: TNotifyEvent);
procedure ControlSetOnClick(Value: TNotifyEvent);
procedure ControlSetHint(const Value: string);
// IJvDynControlData
procedure ControlSetOnChange(Value: TNotifyEvent);
procedure ControlSetValue(Value: Variant);
function ControlGetValue: Variant;
// IJvDynControlDevExpCx
procedure ControlSetCxProperties(Value: TCxDynControlWrapper);
end;
TJvDynControlCxTreeView = class(TcxTreeView, IUnknown,
IJvDynControl, IJvDynControlTreeView,
IJvDynControlDevExpCx, IJvDynControlReadOnly)
public
procedure ControlSetDefaultProperties;
procedure ControlSetCaption(const Value: string);
procedure ControlSetTabOrder(Value: Integer);
procedure ControlSetOnEnter(Value: TNotifyEvent);
procedure ControlSetOnExit(Value: TNotifyEvent);
procedure ControlSetOnClick(Value: TNotifyEvent);
procedure ControlSetHint(const Value: string);
// IJvDynControlReadOnly
procedure ControlSetReadOnly(Value: Boolean);
// IJvDynControlTreeView
procedure ControlSetAutoExpand(Value: Boolean);
procedure ControlSetHotTrack(Value: Boolean);
procedure ControlSetShowHint(Value: Boolean);
procedure ControlSetShowLines(Value: Boolean);
procedure ControlSetShowRoot(Value: Boolean);
procedure ControlSetToolTips(Value: Boolean);
procedure ControlSetItems(Value: TTreeNodes);
function ControlGetItems: TTreeNodes;
procedure ControlSetImages(Value: TCustomImageList);
procedure ControlSetStateImages(Value: TCustomImageList);
function ControlGetSelected: TTreeNode;
procedure ControlSetOnChange(Value: TTVChangedEvent);
procedure ControlSetSortType(Value: TSortType);
// IJvDynControlDevExpCx
procedure ControlSetCxProperties(Value: TCxDynControlWrapper);
end;
TJvDynControlEngineDevExpCx = class(TJvDynControlEngine)
private
FCxProperties: TCxDynControlWrapper;
protected
procedure SetcxProperties(Value: TCxDynControlWrapper);
procedure RegisterControls; override;
public
constructor Create; override;
destructor Destroy; override;
function CreateControlClass(AControlClass: TControlClass; AOwner: TComponent; AParentControl: TWinControl; AControlName: string): TControl; override;
published
property CxProperties: TCxDynControlWrapper read FCxProperties write FCxProperties;
end;
procedure SetDynControlEngineDevExpCxDefault;
{$ENDIF USE_3RDPARTY_DEVEXPRESS_CXEDITOR}
function DynControlEngineDevExpCx: TJvDynControlEngineDevExpCx;
{$IFDEF UNITVERSIONING}
const
UnitVersioning: TUnitVersionInfo = (
RCSfile: '$RCSfile: JvDynControlEngineDevExpCx.pas,v $';
Revision: '$Revision: 1.14 $';
Date: '$Date: 2005/03/09 07:24:57 $';
LogPath: 'JVCL\run'
);
{$ENDIF UNITVERSIONING}
implementation
{$IFDEF USE_3RDPARTY_DEVEXPRESS_CXEDITOR}
uses
SysUtils, ExtDlgs,
{$IFDEF HAS_UNIT_VARIANTS}
Variants,
{$ENDIF HAS_UNIT_VARIANTS}
cxTextEdit, cxControls,
JvDynControlEngineVCL,
JvJclUtils, JvBrowseFolder, JvDynControlEngineTools;
var
IntDynControlEngineDevExpCx: TJvDynControlEngineDevExpCx = nil;
//=== { TCxDynControlWrapper } ===============================================
constructor TCxDynControlWrapper.Create;
begin
inherited Create;
FLookAndFeel := TcxLookAndFeel.Create(nil);
FStyleController := TcxEditStyleController.Create(nil);
end;
destructor TCxDynControlWrapper.Destroy;
begin
FreeAndNil(FStyleController);
FreeAndNil(FLookAndFeel);
inherited Destroy;
end;
procedure TCxDynControlWrapper.SetLookAndFeel(Value: TcxLookAndFeel);
begin
FLookAndFeel.Assign(Value);
end;
procedure TCxDynControlWrapper.SetStyleController(Value: TcxEditStyleController);
begin
FStyleController := Value;
end;
//=== { TJvDynControlCxMaskEdit } ============================================
procedure TJvDynControlCxMaskEdit.ControlSetDefaultProperties;
begin
Properties.MaskKind := emkStandard;
end;
procedure TJvDynControlCxMaskEdit.ControlSetReadOnly(Value: Boolean);
begin
Properties.ReadOnly := Value;
end;
procedure TJvDynControlCxMaskEdit.ControlSetCaption(const Value: string);
begin
end;
procedure TJvDynControlCxMaskEdit.ControlSetTabOrder(Value: Integer);
begin
TabOrder := Value;
end;
procedure TJvDynControlCxMaskEdit.ControlSetOnEnter(Value: TNotifyEvent);
begin
OnEnter := Value;
end;
procedure TJvDynControlCxMaskEdit.ControlSetOnExit(Value: TNotifyEvent);
begin
OnExit := Value;
end;
procedure TJvDynControlCxMaskEdit.ControlSetOnChange(Value: TNotifyEvent);
begin
Properties.OnChange := Value;
end;
procedure TJvDynControlCxMaskEdit.ControlSetOnClick(Value: TNotifyEvent);
begin
end;
procedure TJvDynControlCxMaskEdit.ControlSetHint(const Value: string);
begin
Hint := Value;
end;
procedure TJvDynControlCxMaskEdit.ControlSetValue(Value: Variant);
begin
Text := Value;
end;
function TJvDynControlCxMaskEdit.ControlGetValue: Variant;
begin
Result := Text;
end;
procedure TJvDynControlCxMaskEdit.ControlSetCxProperties(Value: TCxDynControlWrapper);
begin
Style.LookAndFeel.Assign(Value.LookAndFeel);
Style.StyleController := Value.StyleController;
end;
procedure TJvDynControlCxMaskEdit.ControlSetPasswordChar(Value: Char);
begin
if Value <> #0 then
Properties.EchoMode := eemPassword
else
Properties.EchoMode := eemNormal;
end;
procedure TJvDynControlCxMaskEdit.ControlSetEditMask(const Value: string);
begin
Properties.EditMask := Value;
Properties.MaskKind := emkStandard;
end;
//=== { TJvDynControlCxButtonEdit } ==========================================
procedure TJvDynControlCxButtonEdit.ControlSetDefaultProperties;
begin
Properties.OnButtonClick := IntOnButtonClick;
Properties.MaskKind := emkStandard;
end;
procedure TJvDynControlCxButtonEdit.ControlSetReadOnly(Value: Boolean);
begin
Properties.ReadOnly := Value;
end;
procedure TJvDynControlCxButtonEdit.ControlSetCaption(const Value: string);
begin
end;
procedure TJvDynControlCxButtonEdit.ControlSetTabOrder(Value: Integer);
begin
TabOrder := Value;
end;
procedure TJvDynControlCxButtonEdit.ControlSetOnEnter(Value: TNotifyEvent);
begin
OnEnter := Value;
end;
procedure TJvDynControlCxButtonEdit.ControlSetOnExit(Value: TNotifyEvent);
begin
OnExit := Value;
end;
procedure TJvDynControlCxButtonEdit.ControlSetOnChange(Value: TNotifyEvent);
begin
Properties.OnChange := Value;
end;
procedure TJvDynControlCxButtonEdit.ControlSetOnClick(Value: TNotifyEvent);
begin
end;
procedure TJvDynControlCxButtonEdit.ControlSetHint(const Value: string);
begin
Hint := Value;
end;
procedure TJvDynControlCxButtonEdit.ControlSetValue(Value: Variant);
begin
Text := Value;
end;
function TJvDynControlCxButtonEdit.ControlGetValue: Variant;
begin
Result := Text;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -