📄 islidercomponenteditor.pas
字号:
//****************************************************************************************************************************************************
procedure TiSliderComponentEditorForm.CreateThemeInstance;
begin
iThemeInstance := TiSlider.Create(Self);
end;
//****************************************************************************************************************************************************
procedure TiSliderComponentEditorForm.CopyPropertiesToForm(Component: TWinControl);
var
iSlider : TiSlider;
begin
iSlider := Component as TiSlider;
//-------------- General ---------------------------------------------------------------------------------------------------------------------------
PositionEdit.AsFloat := iSlider.Position;
PositionMaxEdit.AsFloat := iSlider.PositionMax;
PositionMinEdit.AsFloat := iSlider.PositionMin;
CurrentMaxEdit.AsFloat := iSlider.CurrentMax;
CurrentMinEdit.AsFloat := iSlider.CurrentMin;
EndsMarginEdit.AsInteger := iSlider.EndsMargin;
ShowFocusRectCheckBox.AsBoolean := iSlider.ShowFocusRect;
EnabledCheckBox.AsBoolean := iSlider.Enabled;
ReverseScaleCheckBox.AsBoolean := iSlider.ReverseScale;
TransparentCheckBox.AsBoolean := iSlider.Transparent;
BackGroundColorPicker.Color := iSlider.BackGroundColor;
AutoFrameRateCheckBox.AsBoolean := iSlider.AutoFrameRate;
AutoCenterCheckBox.AsBoolean := iSlider.AutoCenter;
UpdateFrameRateEdit.AsInteger := iSlider.UpdateFrameRate;
KeyArrowStepSizeEdit.AsFloat := iSlider.KeyArrowStepSize;
KeyPageStepSizeEdit.AsFloat := iSlider.KeyPageStepSize;
MouseWheelStepSizeEdit.AsFloat := iSlider.MouseWheelStepSize;
BorderStyleRadioGroup.AsInteger := ord(iSlider.BorderStyle);
OrientationRadioGroup.AsInteger := ord(iSlider.Orientation);
OrientationTickMarksRadioGroup.AsInteger := ord(iSlider.OrientationTickMarks);
PrecisionStyleRadioGroup.AsInteger := ord(iSlider.PrecisionStyle);
MouseControlStyleRadioGroup.AsInteger := ord(iSlider.MouseControlStyle);
OffsetXEdit.AsInteger := iSlider.OffsetX;
OffsetYEdit.AsInteger := iSlider.OffsetY;
//-------------- Pointer/Track ---------------------------------------------------------------------------------------------------------------------
PointerHeightEdit.AsInteger := iSlider.PointerHeight;
PointerWidthEdit.AsInteger := iSlider.PointerWidth;
PointerStyleRadioGroup.AsInteger := ord(iSlider.PointerStyle);
PointerIndicatorActiveColorPicker.Color := iSlider.PointerIndicatorActiveColor;
PointerIndicatorInactiveColorPicker.Color := iSlider.PointerIndicatorInactiveColor;
TrackStyleRadioGroup.AsInteger := ord(iSlider.TrackStyle);
TrackColorPicker.Color := iSlider.TrackColor;
//-------------- Ticks -----------------------------------------------------------------------------------------------------------------------------
TickMarginEdit.AsInteger := iSlider.TickMargin;
ShowTickLabelsCheckBox.AsBoolean := iSlider.ShowTickLabels;
TickLabelPrecisionEdit.AsInteger := iSlider.TickLabelPrecision;
TickLabelMarginEdit.AsInteger := iSlider.TickLabelMargin;
ShowTicksMajorCheckBox.AsBoolean := iSlider.ShowTicksMajor;
TickMajorCountEdit.AsInteger := iSlider.TickMajorCount;
TickMajorLengthEdit.AsInteger := iSlider.TickMajorLength;
TickMajorColorPicker.Color := iSlider.TickMajorColor;
TickMajorStyleRadioGroup.AsInteger := ord(iSlider.TickMajorStyle);
ShowTicksMinorCheckBox.AsBoolean := iSlider.ShowTicksMinor;
TickMinorCountEdit.AsInteger := iSlider.TickMinorCount;
TickMinorLengthEdit.AsInteger := iSlider.TickMinorLength;
TickMinorColorPicker.Color := iSlider.TickMinorColor;
TickMinorAlignmentRadioGroup.AsInteger := ord(iSlider.TickMinorAlignment);
TickMinorStyleRadioGroup.AsInteger := ord(iSlider.TickMinorStyle);
//-------------- AutoScale --------------------------------------------------------------------------------------------------------------------------
AutoScaleDesiredTicksEdit.AsInteger := iSlider.AutoScaleDesiredTicks;
AutoScaleMaxTicksEdit.AsInteger := iSlider.AutoScaleMaxTicks;
AutoScaleEnabledCheckBox.AsBoolean := iSlider.AutoScaleEnabled;
AutoScaleStyleRadioGroup.AsInteger := ord(iSlider.AutoScaleStyle);
TickLabelFontPicker.Font.Assign(iSlider.TickLabelFont);
UpLoadOPCProperties(iSlider, iOPCBrowserPanel);
end;
//****************************************************************************************************************************************************
procedure TiSliderComponentEditorForm.CopyPropertiesToComponent(Component: TWinControl);
var
iSlider : TiSlider;
begin
iSlider := Component as TiSlider;
//-------------- General ---------------------------------------------------------------------------------------------------------------------------
iSlider.AutoScaleEnabled := False; //Required to set Min & Max before AutoScale Activates
iSlider.Position := PositionEdit.AsFloat;
iSlider.PositionMax := PositionMaxEdit.AsFloat;
iSlider.PositionMin := PositionMinEdit.AsFloat;
iSlider.CurrentMax := CurrentMaxEdit.AsFloat;
iSlider.CurrentMin := CurrentMinEdit.AsFloat;
iSlider.EndsMargin := EndsMarginEdit.AsInteger;
iSlider.ShowFocusRect := ShowFocusRectCheckBox.AsBoolean;
iSlider.Enabled := EnabledCheckBox.AsBoolean;
iSlider.ReverseScale := ReverseScaleCheckBox.AsBoolean;
iSlider.Transparent := TransparentCheckBox.AsBoolean;
iSlider.BackGroundColor := BackGroundColorPicker.Color;
iSlider.AutoFrameRate := AutoFrameRateCheckBox.AsBoolean;
iSlider.AutoCenter := AutoCenterCheckBox.AsBoolean;
iSlider.UpdateFrameRate := UpdateFrameRateEdit.AsInteger;
iSlider.KeyArrowStepSize := KeyArrowStepSizeEdit.AsFloat;
iSlider.KeyPageStepSize := KeyPageStepSizeEdit.AsFloat;
iSlider.MouseWheelStepSize := MouseWheelStepSizeEdit.AsFloat;
iSlider.BorderStyle := TiBevelStyle(BorderStyleRadioGroup.AsInteger);
iSlider.Orientation := TiOrientation(OrientationRadioGroup.AsInteger);
iSlider.OrientationTickMarks := TiOrientationSide(OrientationTickMarksRadioGroup.AsInteger);
iSlider.PrecisionStyle := TiPrecisionStyle(PrecisionStyleRadioGroup.AsInteger);
iSlider.MouseControlStyle := TiSliderMouseControlStyle(MouseControlStyleRadioGroup.AsInteger);
iSlider.OffsetX := OffsetXEdit.AsInteger;
iSlider.OffsetY := OffsetYEdit.AsInteger;
//-------------- Pointer/Track ---------------------------------------------------------------------------------------------------------------------
iSlider.PointerHeight := PointerHeightEdit.AsInteger;
iSlider.PointerWidth := PointerWidthEdit.AsInteger;
iSlider.PointerStyle := TiSliderPointerStyle(PointerStyleRadioGroup.AsInteger);
iSlider.PointerIndicatorActiveColor := PointerIndicatorActiveColorPicker.Color;
iSlider.PointerIndicatorInactiveColor := PointerIndicatorInactiveColorPicker.Color;
iSlider.TrackStyle := TiSliderTrackStyle(TrackStyleRadioGroup.AsInteger);
iSlider.TrackColor := TrackColorPicker.Color;
//-------------- Ticks -----------------------------------------------------------------------------------------------------------------------------
iSlider.TickMargin := TickMarginEdit.AsInteger;
iSlider.ShowTickLabels := ShowTickLabelsCheckBox.AsBoolean;
iSlider.TickLabelPrecision := TickLabelPrecisionEdit.AsInteger;
iSlider.TickLabelMargin := TickLabelMarginEdit.AsInteger;
iSlider.ShowTicksMajor := ShowTicksMajorCheckBox.AsBoolean;
iSlider.TickMajorCount := TickMajorCountEdit.AsInteger;
iSlider.TickMajorLength := TickMajorLengthEdit.AsInteger;
iSlider.TickMajorColor := TickMajorColorPicker.Color;
iSlider.TickMajorStyle := TiBevelStyle(TickMajorStyleRadioGroup.AsInteger);
iSlider.ShowTicksMinor := ShowTicksMinorCheckBox.AsBoolean;
iSlider.TickMinorCount := TickMinorCountEdit.AsInteger;
iSlider.TickMinorLength := TickMinorLengthEdit.AsInteger;
iSlider.TickMinorColor := TickMinorColorPicker.Color;
iSlider.TickMinorAlignment := TiTickMinorAlignment(TickMinorAlignmentRadioGroup.AsInteger);
iSlider.TickMinorStyle := TiBevelStyle(TickMinorStyleRadioGroup.AsInteger);
//-------------- AutoScale --------------------------------------------------------------------------------------------------------------------------
iSlider.AutoScaleDesiredTicks := AutoScaleDesiredTicksEdit.AsInteger;
iSlider.AutoScaleMaxTicks := AutoScaleMaxTicksEdit.AsInteger;
iSlider.AutoScaleStyle := TiAutoScaleStyle(AutoScaleStyleRadioGroup.AsInteger);
iSlider.AutoScaleEnabled := AutoScaleEnabledCheckBox.AsBoolean;
iSlider.TickLabelFont.Assign(TickLabelFontPicker.Font);
DownLoadOPCProperties(iSlider, iOPCBrowserPanel);
end;
//****************************************************************************************************************************************************
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -