📄 ieditorbasiccomponents.pas
字号:
{$IFDEF iActiveX}
Params.Style := Params.Style and not WS_TABSTOP;
Params.Style := Params.Style and not WS_GROUP;
{$ENDIF}
end;
{$endif}
//***********************************************************************************************************************************
{$ifdef iVCL}
procedure TiComponentEditorButton.WMGetDLGCode(var Message: TMessage);
begin
inherited;
// Message.Result := DLGC_WANTALLKEYS + DLGC_WANTTAB;
end;
{$endif}
//****************************************************************************************************************************************************
procedure TiComponentEditorButton.KeyPress(var Key: Char);
var
AOwner : TCustomForm;
begin
if Key = #9 then
begin
Key := #0;
if Owner is TCustomForm then
begin
AOwner := Owner as TCustomForm;
if GetShiftDown then
TWinControlAccess(AOwner).SelectNext(AOwner.ActiveControl, False, True)
else
TWinControlAccess(AOwner).SelectNext(AOwner.ActiveControl, True, True);
end;
end;
inherited;
end;
//****************************************************************************************************************************************************
procedure TiComponentEditorButton.DoEnter;
begin
SetParentsToTopMost(Self);
inherited;
end;
//***********************************************************************************************************************************
constructor TiComponentEditorCheckBox.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
//****************************************************************************************************************************************************
procedure TiComponentEditorCheckBox.DoChange;
begin
inherited;
if not FBlockingEvents then if (Owner is TiCustomEditorForm) then (Owner as TiCustomEditorForm).UserChange;
if Assigned(OnClick) then OnClick(Self);
end;
//***********************************************************************************************************************************
procedure TiComponentEditorCheckBox.Disable;
var
TempOnClick : TNotifyEvent;
begin
TempOnClick := OnClick;
OnClick := nil;
FBlockingEvents := True;
try
Enabled := False;
Checked := False;
finally
FBlockingEvents := False;
OnClick := TempOnClick;
end;
end;
//***********************************************************************************************************************************
procedure TiComponentEditorCheckBox.Enable;
begin
Enabled := True;
end;
//***********************************************************************************************************************************
function TiComponentEditorCheckBox.GetAsBoolean: Boolean;
begin
Result := Checked;
end;
//***********************************************************************************************************************************
procedure TiComponentEditorCheckBox.SetAsBoolean(const Value: Boolean);
var
TempOnClick : TNotifyEvent;
begin
TempOnClick := OnClick;
OnClick := nil;
FBlockingEvents := True;
try
Checked := Value;
finally
FBlockingEvents := False;
OnClick := TempOnClick;
end;
end;
//***********************************************************************************************************************************
{$IFDEF iVCL}
procedure TiComponentEditorCheckBox.WMGetDLGCode(var Message: TMessage);
begin
Message.Result := DLGC_WANTALLKEYS + DLGC_WANTTAB;
end;
{$endif}
//****************************************************************************************************************************************************
procedure TiComponentEditorCheckBox.KeyPress(var Key: Char);
var
AOwner : TCustomForm;
begin
if Key = #9 then
begin
Key := #0;
if Owner is TCustomForm then
begin
AOwner := Owner as TCustomForm;
if GetShiftDown then
TWinControlAccess(AOwner).SelectNext(AOwner.ActiveControl, False, True)
else
TWinControlAccess(AOwner).SelectNext(AOwner.ActiveControl, True, True);
end;
end;
inherited;
end;
//****************************************************************************************************************************************************
procedure TiComponentEditorCheckBox.DoEnter;
begin
inherited;
// SetParentsToTopMost(Self);
end;
//***********************************************************************************************************************************
constructor TiComponentEditorRadioGroup.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
//***********************************************************************************************************************************
procedure TiComponentEditorRadioGroup.Click;
begin
inherited;
if not FBlockingEvents then if (Owner is TiCustomEditorForm) then (Owner as TiCustomEditorForm).UserChange;
end;
//***********************************************************************************************************************************
procedure TiComponentEditorRadioGroup.Disable;
var
TempOnClick : TNotifyEvent;
begin
TempOnClick := OnClick;
OnClick := nil;
FBlockingEvents := True;
try
Enabled := False;
ItemIndex := -1;
finally
FBlockingEvents := False;
OnClick := TempOnClick;
end;
end;
//***********************************************************************************************************************************
procedure TiComponentEditorRadioGroup.Enable;
begin
Enabled := True;
end;
//***********************************************************************************************************************************
function TiComponentEditorRadioGroup.GetAsInteger: Integer;
begin
Result := ItemIndex;
end;
//***********************************************************************************************************************************
procedure TiComponentEditorRadioGroup.SetAsInteger(const Value: Integer);
var
TempOnClick : TNotifyEvent;
TempOnChange : TNotifyEvent;
begin
TempOnClick := OnClick;
TempOnChange := OnChange;
OnClick := nil;
OnChange := nil;
FBlockingEvents := True;
try
ItemIndex := Value;
finally
FBlockingEvents := False;
OnClick := TempOnClick;
OnChange := TempOnChange;
end;
end;
//***********************************************************************************************************************************
procedure TiComponentEditorRadioGroup.KeyPress(var Key: Char);
var
AOwner : TCustomForm;
begin
if Key = #9 then
begin
Key := #0;
if Owner is TCustomForm then
begin
AOwner := Owner as TCustomForm;
if GetShiftDown then
TWinControlAccess(AOwner).SelectNext(AOwner.ActiveControl, False, True)
else
TWinControlAccess(AOwner).SelectNext(AOwner.ActiveControl, True, True);
end;
end;
inherited;
end;
//****************************************************************************************************************************************************
procedure TiComponentEditorRadioGroup.DoEnter;
begin
inherited;
SetParentsToTopMost(Self);
end;
//***********************************************************************************************************************************
constructor TiComponentEditorMemo.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FOriginalText := '';
end;
//***********************************************************************************************************************************
procedure TiComponentEditorMemo.Disable;
var
TempOnClick : TNotifyEvent;
begin
TempOnClick := OnClick;
OnClick := nil;
OnClick := nil;
FBlockingEvents := True;
try
Enabled := False;
Color := clBtnFace;
Text := '';
FOriginalText := '';
finally
FBlockingEvents := False;
OnClick := TempOnClick;
end;
end;
//***********************************************************************************************************************************
procedure TiComponentEditorMemo.Enable;
begin
Enabled := True;
Color := clWindow;
end;
//***********************************************************************************************************************************
function TiComponentEditorMemo.GetAsString: String;
begin
Result := Text;
end;
//***********************************************************************************************************************************
procedure TiComponentEditorMemo.SetAsString(const Value: String);
var
TempOnClick : TNotifyEvent;
TempOnChange : TNotifyEvent;
begin
TempOnClick := OnClick;
TempOnChange := OnChange;
OnClick := nil;
OnChange := nil;
FBlockingEvents := True;
try
Text := Value;
FOriginalText := Value;
finally
FBlockingEvents := False;
OnClick := TempOnClick;
OnChange := TempOnChange;
end;
end;
//***********************************************************************************************************************************
procedure TiComponentEditorMemo.KeyPress(var Key: Char);
var
AOwner : TCustomForm;
begin
if not WantReturns then
begin
if Key = #13 then
begin
DoUpdate;
Key := #0;
SelectAll;
end;
end;
if Key = #9 then
begin
Key := #0;
if Owner is TCustomForm then
begin
AOwner := Owner as TCustomForm;
if GetShiftDown then
TWinControlAccess(AOwner).SelectNext(AOwner.ActiveControl, False, True)
else
TWinControlAccess(AOwner).SelectNext(AOwner.ActiveControl, True, True);
end;
end;
inherited;
end;
//****************************************************************************************************************************************************
{$ifdef iVCL}
procedure TiComponentEditorMemo.WMGetDLGCode(var Message: TMessage);
begin
inherited;
Message.Result := Message.Result + DLGC_WANTTAB;
end;
{$endif}
//****************************************************************************************************************************************************
{$ifdef iVCL}
procedure TiComponentEditorMemo.WMKillFocus(var Message: TMessage);
begin
inherited;
DoUpdate;
end;
{$endif}
//****************************************************************************************************************************************************
procedure TiComponentEditorMemo.DoUpdate;
begin
if FOriginalText <> Text then
begin
FOriginalText := Text;
if Assigned(FOnUpdate) then FOnUpdate(Self);
if not FBlockingEvents then if (Owner is TiCustomEditorForm) then (Owner as TiCustomEditorForm).UserChange;
end;
end;
//***********************************************************************************************************************************
constructor TiComponentEditorComboBox.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
//***********************************************************************************************************************************
procedure TiComponentEditorComboBox.Click;
begin
//inherited;
if not FBlockingEvents then if (Owner is TiCustomEditorForm) then (Owner as TiCustomEditorForm).UserChange;
end;
//***********************************************************************************************************************************
procedure TiComponentEditorComboBox.Disable;
var
TempOnChange : TNotifyEvent;
begin
TempOnChange := OnChange;
OnChange := nil;
FBlockingEvents := True;
try
Enabled := False;
Color := clBtnFace;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -