⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iswitchrockercomponenteditor.pas

📁 iocopm3.04源码,一套很好的工控开发工具
💻 PAS
字号:
{*******************************************************}
{                                                       }
{       TiSwitchRockerComponentEditor                   }
{                                                       }
{       Copyright (c) 1997,2003 Iocomp Software         }
{                                                       }
{*******************************************************}
{$I iInclude.inc}

{$ifdef iVCL}unit  iSwitchRockerComponentEditor;{$endif}
{$ifdef iCLX}unit QiSwitchRockerComponentEditor;{$endif}

interface

uses
  {$I iIncludeUsesForms.inc}

  {$IFDEF iVCL} iComponentEditorForm,  iTypes,  iSwitchRocker,{$ENDIF}
  {$IFDEF iCLX}QiComponentEditorForm, QiTypes, QiSwitchRocker,{$ENDIF}

  {$IFDEF iVCL}  StdCtrls,  ExtCtrls,  Controls,  ComCtrls, Classes,  iComponentEditorThemePanel,  iComponentEditorButtonPanel,  iEditorBasicComponents,  iOPCBrowserPanel,  iAboutPanel,
  iRadioGroup, iComponent, iVCLComponent, iCustomComponent, iCheckBox;{$ENDIF}
  {$IFDEF iCLX} QStdCtrls, QExtCtrls, QControls, QComCtrls, Classes, QiComponentEditorThemePanel, QiComponentEditorButtonPanel, QiEditorBasicComponents, QiOPCBrowserPanel, QiAboutPanel;{$ENDIF}

type
  TiSwitchRockerComponentEditorForm = class(TiComponentEditorForm)
    PageControl: TiComponentEditorPageControl;
    GeneralTabSheet: TTabSheet;
    ActiveCheckBox: TiComponentEditorCheckBox;
    EnabledCheckBox: TiComponentEditorCheckBox;
    IndicatorGroupBox: TGroupBox;
    Label4: TLabel;
    IndicatorMarginEdit: TiComponentEditorEdit;
    IndicatorMarginUpDown: TiUpDown;
    ShowFocusRectCheckBox: TiComponentEditorCheckBox;
    Label5: TLabel;
    BorderMarginEdit: TiComponentEditorEdit;
    BorderMarginUpDown: TiUpDown;
    IndicatorActiveColorPicker: TiComponentEditorColorPicker;
    Label3: TLabel;
    MouseControlStyleRadioGroup: TiComponentEditorRadioGroup;
    TransparentCheckBox: TiComponentEditorCheckBox;
    AboutTabSheet: TTabSheet;
    iComponentEditorButtonPanel1: TiComponentEditorButtonPanel;
    ThemeTabSheet: TTabSheet;
    iComponentEditorThemePanel: TiComponentEditorThemePanel;
    OPCTabSheet: TTabSheet;
    iOPCBrowserPanel: TiOPCBrowserPanel;
    iAboutPanel1: TiAboutPanel;
    Label31: TLabel;
    Label76: TLabel;
    UpdateFrameRateUpDown: TiUpDown;
    BackGroundColorPicker: TiComponentEditorColorPicker;
    UpdateFrameRateEdit: TiComponentEditorEdit;
    AutoFrameRateCheckBox: TiComponentEditorCheckBox;
  protected
    procedure CreateThemeInstance; override;
    procedure CopyPropertiesToForm     (Component: TWinControl); override;
    procedure CopyPropertiesToComponent(Component: TWinControl); override;
  end;

var
  iSwitchRockerComponentEditorForm: TiSwitchRockerComponentEditorForm;

implementation

{$R *.dfm}
//****************************************************************************************************************************************************
procedure TiSwitchRockerComponentEditorForm.CreateThemeInstance;
begin
  iThemeInstance := TiSwitchRocker.Create(Self);
end;
//****************************************************************************************************************************************************
procedure TiSwitchRockerComponentEditorForm.CopyPropertiesToForm(Component: TWinControl);
var
  iSwitchRocker : TiSwitchRocker;
begin
  iSwitchRocker := Component as TiSwitchRocker;

  ActiveCheckBox.AsBoolean              := iSwitchRocker.Active;
  EnabledCheckBox.AsBoolean             := iSwitchRocker.Enabled;
  ShowFocusRectCheckBox.AsBoolean       := iSwitchRocker.ShowFocusRect;
  TransparentCheckBox.AsBoolean         := iSwitchRocker.Transparent;

  BorderMarginEdit.AsInteger            := iSwitchRocker.BorderMargin;
  BackGroundColorPicker.Color           := iSwitchRocker.BackGroundColor;
  AutoFrameRateCheckBox.AsBoolean       := iSwitchRocker.AutoFrameRate;
  UpdateFrameRateEdit.AsInteger         := iSwitchRocker.UpdateFrameRate;

  MouseControlStyleRadioGroup.AsInteger := ord(iSwitchRocker.MouseControlStyle);

  IndicatorMarginEdit.AsInteger         := iSwitchRocker.IndicatorMargin;
  IndicatorActiveColorPicker.Color      := iSwitchRocker.IndicatorActiveColor;

  UpLoadOPCProperties(iSwitchRocker, iOPCBrowserPanel);
end;
//****************************************************************************************************************************************************
procedure TiSwitchRockerComponentEditorForm.CopyPropertiesToComponent(Component: TWinControl);
var
  iSwitchRocker : TiSwitchRocker;
begin
  iSwitchRocker := Component as TiSwitchRocker;

  iSwitchRocker.Active               := ActiveCheckBox.AsBoolean;
  iSwitchRocker.Enabled              := EnabledCheckBox.AsBoolean;
  iSwitchRocker.ShowFocusRect        := ShowFocusRectCheckBox.AsBoolean;
  iSwitchRocker.Transparent          := TransparentCheckBox.AsBoolean;

  iSwitchRocker.BorderMargin         := BorderMarginEdit.AsInteger;
  iSwitchRocker.BackGroundColor      := BackGroundColorPicker.Color;
  iSwitchRocker.AutoFrameRate        := AutoFrameRateCheckBox.AsBoolean;
  iSwitchRocker.UpdateFrameRate      := UpdateFrameRateEdit.AsInteger;

  iSwitchRocker.MouseControlStyle    := TiMouseControlStyle(MouseControlStyleRadioGroup.AsInteger);

  iSwitchRocker.IndicatorMargin      := IndicatorMarginEdit.AsInteger;
  iSwitchRocker.IndicatorActiveColor := IndicatorActiveColorPicker.Color;

  DownLoadOPCProperties(iSwitchRocker, iOPCBrowserPanel);
end;
//****************************************************************************************************************************************************
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -