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

📄 qiswitchledcomponenteditor.pas

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

{$ifdef iVCL}unit  iSwitchLedComponentEditor;{$endif}
{$ifdef iCLX}unit QiSwitchLedComponentEditor;{$endif}

interface

uses
  {$I iIncludeUsesForms.inc}

  {$IFDEF iVCL} iComponentEditorForm,  iTypes,  iSwitchLed,{$ENDIF}
  {$IFDEF iCLX}QiComponentEditorForm, QiTypes, QiSwitchLed,{$ENDIF}

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

type
  TiSwitchLedComponentEditorForm = class(TiComponentEditorForm)
    PageControl: TiComponentEditorPageControl;
    GeneralTabSheet: TTabSheet;
    ActiveCheckBox: TiComponentEditorCheckBox;
    ActiveColorPicker: TiComponentEditorColorPicker;
    Label3: TLabel;
    AutoLedSizeCheckBox: TiComponentEditorCheckBox;
    EnabledCheckBox: TiComponentEditorCheckBox;
    IndicatorGroupBox: TGroupBox;
    Label1: TLabel;
    IndicatorHeightEdit: TiComponentEditorEdit;
    IndicatorHeightUpDown: TiUpDown;
    Label2: TLabel;
    IndicatorWidthEdit: TiComponentEditorEdit;
    IndicatorWidthUpDown: TiUpDown;
    Label4: TLabel;
    IndicatorMarginEdit: TiComponentEditorEdit;
    IndicatorMarginUpDown: TiUpDown;
    ShowFocusRectCheckBox: TiComponentEditorCheckBox;
    CaptionGroupBox: TGroupBox;
    Label8: TLabel;
    CaptionEdit: TiComponentEditorEdit;
    Label6: TLabel;
    CaptionMarginEdit: TiComponentEditorEdit;
    CaptionMarginUpDown: TiUpDown;
    CaptionFontPicker: TiComponentEditorFontPicker;
    AboutTabSheet: TTabSheet;
    iComponentEditorButtonPanel1: TiComponentEditorButtonPanel;
    ThemeTabSheet: TTabSheet;
    iComponentEditorThemePanel: TiComponentEditorThemePanel;
    WordWrapCheckBox: TiComponentEditorCheckBox;
    BorderGroupBox: TGroupBox;
    Label9: TLabel;
    BorderSizeUpDown: TiUpDown;
    BorderSizeEdit: TiComponentEditorEdit;
    Label20: TLabel;
    IndicatorAlignmentComboBox: TiComponentEditorComboBox;
    Label11: TLabel;
    CaptionAlignmentComboBox: TiComponentEditorComboBox;
    Label10: TLabel;
    BorderHighlightColorPicker: TiComponentEditorColorPicker;
    Label12: TLabel;
    BorderShadowColorPicker: TiComponentEditorColorPicker;
    GlyphTabSheet: TTabSheet;
    GlyphPicker: TiComponentEditorOpenPicker;
    GlyphPreviewGroupBox: TGroupBox;
    GlyphImage: TImage;
    OPCTabSheet: TTabSheet;
    iOPCBrowserPanel: TiOPCBrowserPanel;
    iAboutPanel1: TiAboutPanel;
    Label31: TLabel;
    Label76: TLabel;
    UpdateFrameRateUpDown: TiUpDown;
    BackGroundColorPicker: TiComponentEditorColorPicker;
    UpdateFrameRateEdit: TiComponentEditorEdit;
    AutoFrameRateCheckBox: TiComponentEditorCheckBox;
    procedure GlyphPickerChange(Sender: TObject);
  protected
    procedure CreateThemeInstance; override;
    procedure CopyPropertiesToForm     (Component: TWinControl); override;
    procedure CopyPropertiesToComponent(Component: TWinControl); override;
  end;

var
  iSwitchLedComponentEditorForm: TiSwitchLedComponentEditorForm;

implementation

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

  ActiveCheckBox.AsBoolean               := iSwitchLed.Active;
  AutoLedSizeCheckBox.AsBoolean          := iSwitchLed.AutoLedSize;
  WordWrapCheckBox.AsBoolean             := iSwitchLed.WordWrap;
  ShowFocusRectCheckBox.AsBoolean        := iSwitchLed.ShowFocusRect;
  EnabledCheckBox.AsBoolean              := iSwitchLed.Enabled;
  ActiveColorPicker.Color                := iSwitchLed.ActiveColor;
  BackGroundColorPicker.Color            := iSwitchLed.BackGroundColor;
  AutoFrameRateCheckBox.AsBoolean        := iSwitchLed.AutoFrameRate;
  UpdateFrameRateEdit.AsInteger          := iSwitchLed.UpdateFrameRate;

  CaptionEdit.AsString                   := iSwitchLed.Caption;
  CaptionMarginEdit.AsInteger            := iSwitchLed.CaptionMargin;
  CaptionAlignmentComboBox.AsInteger     := Ord(iSwitchLed.CaptionAlignment);

  IndicatorAlignmentComboBox.AsInteger   := ord(iSwitchLed.IndicatorAlignment);
  IndicatorHeightEdit.AsInteger          := iSwitchLed.IndicatorHeight;
  IndicatorWidthEdit.AsInteger           := iSwitchLed.IndicatorWidth;
  IndicatorMarginEdit.AsInteger          := iSwitchLed.IndicatorMargin;

  BorderSizeEdit.AsInteger               := iSwitchLed.BorderSize;
  BorderHighlightColorPicker.Color       := iSwitchLed.BorderHighlightColor;
  BorderShadowColorPicker.Color          := iSwitchLed.BorderShadowColor;

  UpLoadOPCProperties(iSwitchLed, iOPCBrowserPanel);

  CaptionFontPicker.Font.Assign(iSwitchLed.CaptionFont);
  GlyphImage.Picture.Assign(iSwitchLed.Glyph);
end;
//****************************************************************************************************************************************************
procedure TiSwitchLedComponentEditorForm.CopyPropertiesToComponent(Component: TWinControl);
var
  iSwitchLed : TiSwitchLed;
begin
  iSwitchLed := Component as TiSwitchLed;

  iSwitchLed.Active               := ActiveCheckBox.AsBoolean;
  iSwitchLed.AutoLedSize          := AutoLedSizeCheckBox.AsBoolean;
  iSwitchLed.WordWrap             := WordWrapCheckBox.AsBoolean;
  iSwitchLed.ShowFocusRect        := ShowFocusRectCheckBox.AsBoolean;
  iSwitchLed.Enabled              := EnabledCheckBox.AsBoolean;
  iSwitchLed.ActiveColor          := ActiveColorPicker.Color;
  iSwitchLed.BackGroundColor      := BackGroundColorPicker.Color;
  iSwitchLed.AutoFrameRate        := AutoFrameRateCheckBox.AsBoolean;
  iSwitchLed.UpdateFrameRate      := UpdateFrameRateEdit.AsInteger;

  iSwitchLed.Caption              := CaptionEdit.AsString;
  iSwitchLed.CaptionMargin        := CaptionMarginEdit.AsInteger;
  iSwitchLed.CaptionAlignment     := TiSwitchLedCaptionAlignment(CaptionAlignmentComboBox.AsInteger);

  iSwitchLed.IndicatorAlignment   := TiSideAlignment(IndicatorAlignmentComboBox.AsInteger);
  iSwitchLed.IndicatorHeight      := IndicatorHeightEdit.AsInteger;
  iSwitchLed.IndicatorWidth       := IndicatorWidthEdit.AsInteger;
  iSwitchLed.IndicatorMargin      := IndicatorMarginEdit.AsInteger;

  iSwitchLed.BorderSize           := BorderSizeEdit.AsInteger;
  iSwitchLed.BorderHighlightColor := BorderHighlightColorPicker.Color;
  iSwitchLed.BorderShadowColor    := BorderShadowColorPicker.Color;

  DownLoadOPCProperties(iSwitchLed, iOPCBrowserPanel);

  iSwitchLed.CaptionFont.Assign(CaptionFontPicker.Font);
  iSwitchLed.Glyph.Assign(GlyphImage.Picture);
end;
//****************************************************************************************************************************************************
procedure TiSwitchLedComponentEditorForm.GlyphPickerChange(Sender: TObject);
begin
  GlyphImage.Picture.LoadFromFile(GlyphPicker.FileName);
end;
//****************************************************************************************************************************************************
end.

⌨️ 快捷键说明

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