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

📄 ilcdmatrixcomponenteditor.pas

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

{$ifdef iVCL}unit  iLCDMatrixComponentEditor;{$endif}
{$ifdef iCLX}unit QiLCDMatrixComponentEditor;{$endif}

interface

uses
  {$I iIncludeUsesForms.inc}

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

  {$IFDEF iVCL} iComponentEditorForm,  iTypes,  iLCDMatrix,  iLCDCharacter,  iComponent,  iVCLComponent,  iCustomComponent,  iLedMatrix,{$ENDIF}
  {$IFDEF iCLX}QiComponentEditorForm, QiTypes, QiLCDMatrix, QiLCDCharacter, QiComponent, QiCLXComponent, QiCustomComponent, QiLedMatrix,{$ENDIF}

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

type
  TiLCDMatrixComponentEditorForm = class(TiComponentEditorForm)
    PageControl: TiComponentEditorPageControl;
    GeneralTabSheet: TTabSheet;
    AboutTabSheet: TTabSheet;
    iComponentEditorButtonPanel1: TiComponentEditorButtonPanel;
    ThemeTabSheet: TTabSheet;
    iComponentEditorThemePanel: TiComponentEditorThemePanel;
    iAboutPanel1: TiAboutPanel;
    Label76: TLabel;
    UpdateFrameRateUpDown: TiUpDown;
    UpdateFrameRateEdit: TiComponentEditorEdit;
    AutoFrameRateCheckBox: TiComponentEditorCheckBox;
    OPCTabSheet: TTabSheet;
    iOPCBrowserPanel: TiOPCBrowserPanel;
    OuterMarginGroupBox: TGroupBox;
    OuterMarginLeftUpDown: TiUpDown;
    OuterMarginTopUpDown: TiUpDown;
    OuterMarginBottomUpDown: TiUpDown;
    OuterMarginRightUpDown: TiUpDown;
    OuterMarginLeftEdit: TiComponentEditorEdit;
    OuterMarginTopEdit: TiComponentEditorEdit;
    OuterMarginBottomEdit: TiComponentEditorEdit;
    OuterMarginRightEdit: TiComponentEditorEdit;
    Label5: TLabel;
    BackGroundColorPicker: TiComponentEditorColorPicker;
    BorderStyleRadioGroup: TiComponentEditorRadioGroup;
    Label214: TLabel;
    TextEdit: TiComponentEditorEdit;
    Character: TTabSheet;
    CellsGroupBox: TGroupBox;
    Label193: TLabel;
    CellsSpacingHorzUpDown: TiUpDown;
    Label6: TLabel;
    Label1: TLabel;
    Label2: TLabel;
    CellsSpacingVertUpDown: TiUpDown;
    Label3: TLabel;
    CellsWidthUpDown: TiUpDown;
    CellsShowOffCheckBox: TiComponentEditorCheckBox;
    CellsSpacingHorzEdit: TiComponentEditorEdit;
    CellsColorOnPicker: TiComponentEditorColorPicker;
    CellsColorOffPicker: TiComponentEditorColorPicker;
    CellsSpacingVertEdit: TiComponentEditorEdit;
    CellsWidthEdit: TiComponentEditorEdit;
    CharacterGroupBox: TGroupBox;
    Label4: TLabel;
    CharacterSpacingHorzUpDown: TiUpDown;
    Label9: TLabel;
    CharacterSpacingVertUpDown: TiUpDown;
    CharacterSpacingHorzEdit: TiComponentEditorEdit;
    CharacterSpacingVertEdit: TiComponentEditorEdit;
    Label10: TLabel;
    CharactersetWidthUpDown: TiUpDown;
    Label7: TLabel;
    CharactersetHeightUpDown: TiUpDown;
    CharactersetWidthEdit: TiComponentEditorEdit;
    CharactersetHeightEdit: TiComponentEditorEdit;
    CharacterMatrixEditor: TiLedMatrix;
    CharacterserSavePicker: TiComponentEditorSavePicker;
    CharacterserLoadPicker: TiComponentEditorOpenPicker;
    LoadDefaultCharactersetButton: TiComponentEditorButton;
    Label8: TLabel;
    CharactersetCharactorCodeUpDown: TiUpDown;
    CharactersetCharactorCodeEdit: TiComponentEditorEdit;
    CharactersetNameLabel: TLabel;
    Label11: TLabel;
    procedure CharactersetSizeUpdate(Sender: TObject);
    procedure LoadDefaultCharactersetButtonClick(Sender: TObject);
    procedure iComponentEditorFormCreate(Sender: TObject);
    procedure iComponentEditorFormDestroy(Sender: TObject);
    procedure CharactersetCharactorCodeEditUpdate(Sender: TObject);
    procedure CharacterMatrixEditorClickIndicator(Row, Col: Integer);
    procedure CharacterserLoadPickerChange(Sender: TObject);
    procedure CharacterserSavePickerChange(Sender: TObject);
  private
    FCharacterList     : TStringList;
    FLastCharacterCode : Integer;
  protected
    procedure CreateThemeInstance; override;
    procedure CopyPropertiesToForm     (Component: TWinControl); override;
    procedure CopyPropertiesToComponent(Component: TWinControl); override;
  end;

var
  iLCDMatrixComponentEditorForm: TiLCDMatrixComponentEditorForm;

implementation

type
  TiLCDMatrixAccess = class(TiLCDMatrix) end;
{$R *.dfm}
//****************************************************************************************************************************************************
procedure TiLCDMatrixComponentEditorForm.iComponentEditorFormCreate(Sender: TObject);
var
  x         : Integer;
  Character : TiLCDCharacter;
begin
  FCharacterList := TStringList.Create;

  for x := 0 to 255 do
    begin
      Character := TiLCDCharacter.Create;
      FCharacterList.AddObject('', Character);
    end;

  FLastCharacterCode := 65;
end;
//****************************************************************************************************************************************************
procedure TiLCDMatrixComponentEditorForm.iComponentEditorFormDestroy(Sender: TObject);
begin
  while FCharacterList.Count <> 0 do
    begin
      FCharacterList.Objects[0].Free;
      FCharacterList.Delete(0);
    end;
  FCharacterList.Free;
end;
//****************************************************************************************************************************************************
procedure TiLCDMatrixComponentEditorForm.CreateThemeInstance;
begin
  iThemeInstance := TiLCDMatrix.Create(Self);
end;
//****************************************************************************************************************************************************
procedure TiLCDMatrixComponentEditorForm.CopyPropertiesToForm(Component: TWinControl);
var
  x          : Integer;
  iLCDMatrix : TiLCDMatrix;
begin
  iLCDMatrix := Component as TiLCDMatrix;

  TextEdit.AsString                         := iLCDMatrix.Text;
  CellsColorOnPicker.Color                  := iLCDMatrix.CellsColorOn;
  CellsColorOffPicker.Color                 := iLCDMatrix.CellsColorOff;
  CellsShowOffCheckBox.AsBoolean            := iLCDMatrix.CellsShowOff;
  CellsWidthEdit.AsInteger                  := iLCDMatrix.CellsWidth;
  CellsSpacingHorzEdit.AsInteger            := iLCDMatrix.CellsSpacingHorz;
  CellsSpacingVertEdit.AsInteger            := iLCDMatrix.CellsSpacingVert;

  CharactersetWidthEdit.AsInteger           := iLCDMatrix.CharactersetWidth;
  CharactersetHeightEdit.AsInteger          := iLCDMatrix.CharactersetHeight;

  CharacterSpacingHorzEdit.AsInteger        := iLCDMatrix.CharacterSpacingHorz;
  CharacterSpacingVertEdit.AsInteger        := iLCDMatrix.CharacterSpacingVert;

  OuterMarginTopEdit.AsInteger              := iLCDMatrix.OuterMarginTop;
  OuterMarginBottomEdit.AsInteger           := iLCDMatrix.OuterMarginBottom;
  OuterMarginLeftEdit.AsInteger             := iLCDMatrix.OuterMarginLeft;
  OuterMarginRightEdit.AsInteger            := iLCDMatrix.OuterMarginRight;

  BackGroundColorPicker.Color               := iLCDMatrix.BackGroundColor;
  BorderStyleRadioGroup.AsInteger           := ord(iLCDMatrix.BorderStyle);
  AutoFrameRateCheckBox.AsBoolean           := iLCDMatrix.AutoFrameRate;

⌨️ 快捷键说明

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