qiimagedisplaycomponenteditor.pas

来自「非常好用的工控组件包,LED数码管」· PAS 代码 · 共 121 行

PAS
121
字号
{*******************************************************}
{                                                       }
{       TiImageDisplayComponentEditor                   }
{                                                       }
{       Copyright (c) 1997,2003 Iocomp Software         }
{                                                       }
{*******************************************************}
{$I iInclude.inc}

{$ifdef iVCL}unit  iImageDisplayComponentEditor;{$endif}
{$ifdef iCLX}unit QiImageDisplayComponentEditor;{$endif}

interface

uses
  {$I iIncludeUsesForms.inc}

  {$IFDEF iVCL} iComponentEditorForm,  iTypes,  iImageDisplay,{$ENDIF}
  {$IFDEF iCLX}QiComponentEditorForm, QiTypes, QiImageDisplay,{$ENDIF}

  {$IFDEF iVCL}  StdCtrls,  ExtCtrls,  Controls,  ComCtrls, Classes,{$ENDIF}
  {$IFDEF iCLX} QStdCtrls, QExtCtrls, QControls, QComCtrls, Classes,{$ENDIF}

  {$IFDEF iVCL}  iComponentEditorThemePanel,  iComponentEditorButtonPanel,  iEditorBasicComponents,  iOPCBrowserPanel,  iAboutPanel,  iComponentEditorImageEditorPanel,
  iComponent, iVCLComponent, iCustomComponent, iCheckBox, iRadioGroup;{$ENDIF}
  {$IFDEF iCLX} QiComponentEditorThemePanel, QiComponentEditorButtonPanel, QiEditorBasicComponents, QiOPCBrowserPanel, QiAboutPanel, QiComponentEditorImageEditorPanel;{$ENDIF}


type
  TiImageDisplayComponentEditorForm = class(TiComponentEditorForm)
    PageControl: TiComponentEditorPageControl;
    GeneralTabSheet: TTabSheet;
    AutoSizeCheckBox: TiComponentEditorCheckBox;
    BorderStyleRadioGroup: TiComponentEditorRadioGroup;
    AboutTabSheet: TTabSheet;
    iComponentEditorButtonPanel1: TiComponentEditorButtonPanel;
    ThemeTabSheet: TTabSheet;
    iComponentEditorThemePanel: TiComponentEditorThemePanel;
    OPCTabSheet: TTabSheet;
    iOPCBrowserPanel: TiOPCBrowserPanel;
    iAboutPanel1: TiAboutPanel;
    Label31: TLabel;
    BackGroundColorPicker: TiComponentEditorColorPicker;
    ImagesTabSheet: TTabSheet;
    ImageEditorPanel: TiComponentEditorImageEditorPanel;
    Label1: TLabel;
    ImageIndexUpDown: TiUpDown;
    ImageIndexEdit: TiComponentEditorEdit;
    TimerGroupBox: TGroupBox;
    TimerAutoRepeatCheckBox: TiComponentEditorCheckBox;
    Label2: TLabel;
    TimerIntervalUpDown: TiUpDown;
    TimerIntervalEdit: TiComponentEditorEdit;
    TimerIncrementUpCheckBox: TiComponentEditorCheckBox;
    TimerEnabledCheckBox: TiComponentEditorCheckBox;
  protected
    procedure CreateThemeInstance; override;
    procedure CopyPropertiesToForm     (Component: TWinControl); override;
    procedure CopyPropertiesToComponent(Component: TWinControl); override;
  end;

var
  iImageDisplayComponentEditorForm: TiImageDisplayComponentEditorForm;

implementation

{$R *.dfm}
type
  TiImageDisplayAccess = class(TiImageDisplay) end;
//****************************************************************************************************************************************************
procedure TiImageDisplayComponentEditorForm.CreateThemeInstance;
begin
  iThemeInstance := TiImageDisplay.Create(Self);
end;
//****************************************************************************************************************************************************
procedure TiImageDisplayComponentEditorForm.CopyPropertiesToForm(Component: TWinControl);
var
  iImageDisplay : TiImageDisplay;
begin
  iImageDisplay := Component as TiImageDisplay;

  ImageIndexEdit.AsInteger           := iImageDisplay.ImageIndex;
  AutoSizeCheckBox.AsBoolean         := iImageDisplay.AutoSize;
  TimerEnabledCheckBox.AsBoolean     := iImageDisplay.TimerEnabled;
  TimerAutoRepeatCheckBox.AsBoolean  := iImageDisplay.TimerAutoRepeat;
  TimerIncrementUpCheckBox.AsBoolean := iImageDisplay.TimerIncrementUp;
  TimerIntervalEdit.AsInteger        := iImageDisplay.TimerInterval;

  BorderStyleRadioGroup.AsInteger    := ord(iImageDisplay.BorderStyle);
  BackGroundColorPicker.Color        := iImageDisplay.BackGroundColor;

  ImageEditorPanel.UpLoad(TiImageDisplayAccess(iImageDisplay).ImageList);

  UpLoadOPCProperties(iImageDisplay, iOPCBrowserPanel);
end;
//****************************************************************************************************************************************************
procedure TiImageDisplayComponentEditorForm.CopyPropertiesToComponent(Component: TWinControl);
var
  iImageDisplay : TiImageDisplay;
begin
  iImageDisplay := Component as TiImageDisplay;

  iImageDisplay.ImageIndex       :=  ImageIndexEdit.AsInteger;
  iImageDisplay.AutoSize         :=  AutoSizeCheckBox.AsBoolean;
  iImageDisplay.TimerEnabled     :=  TimerEnabledCheckBox.AsBoolean;
  iImageDisplay.TimerAutoRepeat  :=  TimerAutoRepeatCheckBox.AsBoolean;
  iImageDisplay.TimerIncrementUp :=  TimerIncrementUpCheckBox.AsBoolean;
  iImageDisplay.TimerInterval    :=  TimerIntervalEdit.AsInteger;

  iImageDisplay.BorderStyle      :=  tiBevelStyle(BorderStyleRadioGroup.AsInteger);
  iImageDisplay.BackGroundColor  :=  BackGroundColorPicker.Color;

  ImageEditorPanel.DownLoad(TiImageDisplayAccess(iImageDisplay).ImageList);

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


⌨️ 快捷键说明

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