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

📄 ithermometercomponenteditor.pas

📁 iocopm3.04源码,一套很好的工控开发工具
💻 PAS
📖 第 1 页 / 共 2 页
字号:
procedure TiThermometerComponentEditorForm.CreateThemeInstance;
begin
  iThemeInstance := TiThermometer.Create(Self);
end;
//****************************************************************************************************************************************************
procedure TiThermometerComponentEditorForm.CopyPropertiesToForm(Component: TWinControl);
var
  iThermometer : TiThermometer;
begin
  iThermometer := Component as TiThermometer;

  //-------------- General ---------------------------------------------------------------------------------------------------------------------------
  PositionEdit.AsFloat                          := iThermometer.Position;
  PositionMaxEdit.AsFloat                       := iThermometer.PositionMax;
  PositionMinEdit.AsFloat                       := iThermometer.PositionMin;
  CurrentMaxEdit.AsFloat                        := iThermometer.CurrentMax;
  CurrentMinEdit.AsFloat                        := iThermometer.CurrentMin;
  EndsMarginEdit.AsInteger                      := iThermometer.EndsMargin;
  BackGroundColorPicker.Color                   := iThermometer.BackGroundColor;
  ReverseScaleCheckBox.AsBoolean                := iThermometer.ReverseScale;
  CachedDrawingCheckBox.AsBoolean               := iThermometer.CachedDrawing;
  TransparentCheckBox.AsBoolean                 := iThermometer.Transparent;
  AutoFrameRateCheckBox.AsBoolean               := iThermometer.AutoFrameRate;
  AutoCenterCheckBox.AsBoolean                  := iThermometer.AutoCenter;
  UpdateFrameRateEdit.AsInteger                 := iThermometer.UpdateFrameRate;

  BorderStyleRadioGroup.AsInteger               := ord(iThermometer.BorderStyle);
  OrientationRadioGroup.AsInteger               := ord(iThermometer.Orientation);
  OrientationTickMarksRadioGroup.AsInteger      := ord(iThermometer.OrientationTickMarks);
  PrecisionStyleRadioGroup.AsInteger            := ord(iThermometer.PrecisionStyle);

  OffsetXEdit.AsInteger                         := iThermometer.OffsetX;
  OffsetYEdit.AsInteger                         := iThermometer.OffsetY;
  //-------------- Indicator/Min&Max ---------------------------------------------------------------------------------------------------------
  IndicatorWidthEdit.AsInteger                  := iThermometer.IndicatorWidth;
  IndicatorBulbSizeEdit.AsInteger               := iThermometer.IndicatorBulbSize;
  IndicatorStyleComboBox.AsInteger              := ord(iThermometer.IndicatorStyle);
  IndicatorColorPicker.Color                    := iThermometer.IndicatorColor;
  IndicatorBackGroundColorPicker.Color          := iThermometer.IndicatorBackGroundColor;
  IndicatorFillReferenceStyleComboBox.AsInteger := ord(iThermometer.IndicatorFillReferenceStyle);
  IndicatorFillReferenceValueEdit.AsFloat       := iThermometer.IndicatorFillReferenceValue;

  MinMaxPointerSizeEdit.AsInteger               := iThermometer.MinMaxPointerSize;
  MinMaxPointerMarginEdit.AsInteger             := iThermometer.MinMaxPointerMargin;
  MinMaxFixedCheckBox.AsBoolean                 := iThermometer.MinMaxFixed;
  MinMaxUserCanMoveCheckBox.AsBoolean           := iThermometer.MinMaxUserCanMove;

  ShowMaxPointerCheckBox.AsBoolean              := iThermometer.ShowMaxPointer;
  MaxPointerColorPicker.Color                   := iThermometer.MaxPointerColor;

  ShowMinPointerCheckBox.AsBoolean              := iThermometer.ShowMinPointer;
  MinPointerColorPicker.Color                   := iThermometer.MinPointerColor;
  //-------------- Ticks ----------------------------------------------------------------------------------------------------------------------
  TickMarginEdit.AsInteger                      := iThermometer.TickMargin;

  ShowTickLabelsCheckBox.AsBoolean              := iThermometer.ShowTickLabels;
  TickLabelPrecisionEdit.AsInteger              := iThermometer.TickLabelPrecision;
  TickLabelMarginEdit.AsInteger                 := iThermometer.TickLabelMargin;

  ShowTicksMajorCheckBox.AsBoolean              := iThermometer.ShowTicksMajor;
  ShowTicksMajorFirstLastCheckBox.AsBoolean     := iThermometer.ShowTicksMajorFirstLast;
  TickMajorCountEdit.AsInteger                  := iThermometer.TickMajorCount;
  TickMajorLengthEdit.AsInteger                 := iThermometer.TickMajorLength;
  TickMajorColorPicker.Color                    := iThermometer.TickMajorColor;
  TickMajorStyleRadioGroup.AsInteger            := ord(iThermometer.TickMajorStyle);

  ShowTicksMinorCheckBox.AsBoolean              := iThermometer.ShowTicksMinor;
  TickMinorCountEdit.AsInteger                  := iThermometer.TickMinorCount;
  TickMinorLengthEdit.AsInteger                 := iThermometer.TickMinorLength;
  TickMinorColorPicker.Color                    := iThermometer.TickMinorColor;
  TickMinorAlignmentRadioGroup.AsInteger        := ord(iThermometer.TickMinorAlignment);
  TickMinorStyleRadioGroup.AsInteger            := ord(iThermometer.TickMinorStyle);
  //-------------- AutoScale -------------------------------------------------------------------------------------------------------------------
  AutoScaleDesiredTicksEdit.AsInteger           := iThermometer.AutoScaleDesiredTicks;
  AutoScaleMaxTicksEdit.AsInteger               := iThermometer.AutoScaleMaxTicks;
  AutoScaleEnabledCheckBox.AsBoolean            := iThermometer.AutoScaleEnabled;
  AutoScaleStyleRadioGroup.AsInteger            := ord(iThermometer.AutoScaleStyle);

  UpLoadOPCProperties(iThermometer, iOPCBrowserPanel);

  TickLabelFontPicker.Font.Assign(iThermometer.TickLabelFont);
end;
//****************************************************************************************************************************************************
procedure TiThermometerComponentEditorForm.CopyPropertiesToComponent(Component: TWinControl);
var
  iThermometer : TiThermometer;
begin
  iThermometer := Component as TiThermometer;

  //-------------- General ---------------------------------------------------------------------------------------------------------------------------
  iThermometer.AutoScaleEnabled            := False;  //Required to set Min & Max before AutoScale Activates
  iThermometer.Position                    := PositionEdit.AsFloat;
  iThermometer.PositionMax                 := PositionMaxEdit.AsFloat;
  iThermometer.PositionMin                 := PositionMinEdit.AsFloat;
  iThermometer.CurrentMax                  := CurrentMaxEdit.AsFloat;
  iThermometer.CurrentMin                  := CurrentMinEdit.AsFloat;
  iThermometer.EndsMargin                  := EndsMarginEdit.AsInteger;
  iThermometer.BackGroundColor             := BackGroundColorPicker.Color;
  iThermometer.CachedDrawing               := CachedDrawingCheckBox.AsBoolean;
  iThermometer.ReverseScale                := ReverseScaleCheckBox.AsBoolean;
  iThermometer.Transparent                 := TransparentCheckBox.AsBoolean;
  iThermometer.AutoFrameRate               := AutoFrameRateCheckBox.AsBoolean;
  iThermometer.AutoCenter                  := AutoCenterCheckBox.AsBoolean;
  iThermometer.UpdateFrameRate             := UpdateFrameRateEdit.AsInteger;

  iThermometer.BorderStyle                 := TiBevelStyle(BorderStyleRadioGroup.AsInteger);
  iThermometer.Orientation                 := TiOrientation(OrientationRadioGroup.AsInteger);
  iThermometer.OrientationTickMarks        := TiOrientationSide(OrientationTickMarksRadioGroup.AsInteger);
  iThermometer.PrecisionStyle              := TiPrecisionStyle(PrecisionStyleRadioGroup.AsInteger);

  iThermometer.OffsetX                     := OffsetXEdit.AsInteger;
  iThermometer.OffsetY                     := OffsetYEdit.AsInteger;
  //-------------- Indicator/Min&Max ------------------------------------------------------------------------------------------------------------------
  iThermometer.IndicatorWidth              := IndicatorWidthEdit.AsInteger;
  iThermometer.IndicatorBulbSize           := IndicatorBulbSizeEdit.AsInteger;
  iThermometer.IndicatorStyle              := TiThermometerIndicatorStyle(IndicatorStyleComboBox.AsInteger);
  iThermometer.IndicatorColor              := IndicatorColorPicker.Color;
  iThermometer.IndicatorBackGroundColor    := IndicatorBackGroundColorPicker.Color;
  iThermometer.IndicatorFillReferenceStyle := TiPointerFillReferenceStyle(IndicatorFillReferenceStyleComboBox.AsInteger);
  iThermometer.IndicatorFillReferenceValue := IndicatorFillReferenceValueEdit.AsFloat;

  iThermometer.MinMaxPointerSize           := MinMaxPointerSizeEdit.AsInteger;
  iThermometer.MinMaxPointerMargin         := MinMaxPointerMarginEdit.AsInteger;
  iThermometer.MinMaxFixed                 := MinMaxFixedCheckBox.AsBoolean;
  iThermometer.MinMaxUserCanMove           := MinMaxUserCanMoveCheckBox.AsBoolean;

  iThermometer.ShowMaxPointer              := ShowMaxPointerCheckBox.AsBoolean;
  iThermometer.MaxPointerColor             := MaxPointerColorPicker.Color;

  iThermometer.ShowMinPointer              := ShowMinPointerCheckBox.AsBoolean;
  iThermometer.MinPointerColor             := MinPointerColorPicker.Color;
  //-------------- Ticks -----------------------------------------------------------------------------------------------------------------------------
  iThermometer.TickMargin                  := TickMarginEdit.AsInteger;

  iThermometer.ShowTickLabels              := ShowTickLabelsCheckBox.AsBoolean;
  iThermometer.TickLabelPrecision          := TickLabelPrecisionEdit.AsInteger;
  iThermometer.TickLabelMargin             := TickLabelMarginEdit.AsInteger;

  iThermometer.ShowTicksMajor              := ShowTicksMajorCheckBox.AsBoolean;
  iThermometer.TickMajorCount              := TickMajorCountEdit.AsInteger;
  iThermometer.TickMajorLength             := TickMajorLengthEdit.AsInteger;
  iThermometer.TickMajorColor              := TickMajorColorPicker.Color;
  iThermometer.TickMajorStyle              := TiBevelStyle(TickMajorStyleRadioGroup.AsInteger);

  iThermometer.ShowTicksMinor              := ShowTicksMinorCheckBox.AsBoolean;
  iThermometer.ShowTicksMajorFirstLast     := ShowTicksMajorFirstLastCheckBox.AsBoolean;
  iThermometer.TickMinorCount              := TickMinorCountEdit.AsInteger;
  iThermometer.TickMinorLength             := TickMinorLengthEdit.AsInteger;
  iThermometer.TickMinorColor              := TickMinorColorPicker.Color;
  iThermometer.TickMinorAlignment          := TiTickMinorAlignment(TickMinorAlignmentRadioGroup.AsInteger);
  iThermometer.TickMinorStyle              := TiBevelStyle(TickMinorStyleRadioGroup.AsInteger);
  //-------------- AutoScale --------------------------------------------------------------------------------------------------------------------------
  iThermometer.AutoScaleDesiredTicks       := AutoScaleDesiredTicksEdit.AsInteger;
  iThermometer.AutoScaleMaxTicks           := AutoScaleMaxTicksEdit.AsInteger;
  iThermometer.AutoScaleStyle              := TiAutoScaleStyle(AutoScaleStyleRadioGroup.AsInteger);
  iThermometer.AutoScaleEnabled            := AutoScaleEnabledCheckBox.AsBoolean;

  DownLoadOPCProperties(iThermometer, iOPCBrowserPanel);

  iThermometer.TickLabelFont.Assign(TickLabelFontPicker.Font);
end;
//****************************************************************************************************************************************************
end.

⌨️ 快捷键说明

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