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

📄 iplotmastermanager.pas

📁 iocopm3.04源码,一套很好的工控开发工具
💻 PAS
📖 第 1 页 / 共 4 页
字号:
          end;

        FEditorForm.Left := Screen.Width  div 2 - FEditorForm.Width  div 2;
        FEditorForm.Top  := Screen.Height div 2 - FEditorForm.Height div 2;

        if Assigned(TiTiPlotComponentAccess(FOwner).OnAfterOpenEditor) then TiTiPlotComponentAccess(FOwner).OnAfterOpenEditor(Self);

        case TiTiPlotComponentAccess(FOwner).EditorFormStyle of
          ipfsModal : begin
                        ShowModal;
                      end;
          else        begin
                       TCustomFormAccess(FEditorForm).FormStyle := fsStayOnTop;
                       FEditorForm.Show;
                      end;
        end;

        FMainPageControlIndex                    := GetActivePageIndex(PageControl);
        FControlPageControlIndex                 := GetActivePageIndex(ControlPageControl);
        FChannelPageControlIndex                 := GetActivePageIndex(ChannelPageControl);
        FXAxisPageControlIndex                   := GetActivePageIndex(XAxisPageControl);
        FXAxisLabelsPageControlIndex             := GetActivePageIndex(XAxisLabelsPageControl);
        FYAxisPageControlIndex                   := GetActivePageIndex(YAxisPageControl);
        FYAxisLabelsPageControlIndex             := GetActivePageIndex(YAxisLabelsPageControl);
        FDataCursorPageControlIndex              := GetActivePageIndex(DataCursorPageControl);
        FLimitPageControlIndex                   := GetActivePageIndex(LimitPageControl);
        FLabelPageControlIndex                   := GetActivePageIndex(LabelPageControl);
        FLegendPageControlIndex                  := GetActivePageIndex(LegendPageControl);
        FTablePageControlIndex                   := GetActivePageIndex(TablePageControl);
        FDataViewPageControlIndex                := GetActivePageIndex(DataViewPageControl);
        FDataViewGridLinesCustomPageControlIndex := GetActivePageIndex(DataViewGridLinesCustomPageControl);
      end;
    finally
        case TiTiPlotComponentAccess(FOwner).EditorFormStyle of
          ipfsModal : begin
                        FEditorForm.Free;
                        FEditorForm := nil;
                      end;
          else        begin
                       //Do Nothing. Handled in EditorClose.
                      end;
        end;
    end;
end;
//*************************************************************************************************************************************
procedure TiPlotMasterManager.EditorClose(Sender: TObject; var Action: TCloseAction);
begin
  case TiTiPlotComponentAccess(FOwner).EditorFormStyle of
    ipfsModal : begin
                  //Do Nothing. Handled in EditProperties
                end;
    else        begin
                  FEditorForm.Free;
                  FEditorForm := nil;
                end;
  end;
end;
//*************************************************************************************************************************************
procedure TiPlotMasterManager.BasicPropertyChanged;
begin
  if not Assigned(FEditorForm)                   then Exit;
  if (FEditorForm as TiPlotEditorForm).IsClosing then Exit;

  if FOwner is TiPlotComponent then
    with FEditorForm as TiPlotEditorForm do
      begin
        TiTiPlotComponentAccess(FOwner).AutoFrameRate                := AutoFrameRateCheckBox.AsBoolean;
        TiTiPlotComponentAccess(FOwner).UpdateFrameRate              := UpdateFrameRateEdit.AsInteger;
        TiTiPlotComponentAccess(FOwner).ClipAnnotationsToAxes        := ClipAnnotationsToAxesCheckBox.AsBoolean;
        TiTiPlotComponentAccess(FOwner).BorderStyle                  := TiBevelStyle(BorderStyleRadioGroup.AsInteger);
        TiTiPlotComponentAccess(FOwner).CopyToClipBoardFormat        := TiPlotExportFormat(CopyToClipBoardFormatComboBox.AsInteger);
        TiTiPlotComponentAccess(FOwner).DataFileColumnSeparator      := TiPlotDataFileColumnSeparator(FileColumnSeparatorComboBox.AsInteger);

        TiTiPlotComponentAccess(FOwner).BackGroundColor              := BackGroundColorPicker.Color;
        TiTiPlotComponentAccess(FOwner).BackGroundGradientDirection  := TiFillDirection(BackGroundGradientDirectionComboBox.AsInteger);
        TiTiPlotComponentAccess(FOwner).BackGroundGradientEnabled    := BackGroundGradientEnabledCheckBox.AsBoolean;
        TiTiPlotComponentAccess(FOwner).BackGroundGradientStartColor := BackGroundGradientStartColorPicker.Color;
        TiTiPlotComponentAccess(FOwner).BackGroundGradientStopColor  := BackGroundGradientStopColorPicker.Color;

        TiTiPlotComponentAccess(FOwner).OuterMarginLeft              := OuterMarginLeftEdit.AsInteger;
        TiTiPlotComponentAccess(FOwner).OuterMarginTop               := OuterMarginTopEdit.AsInteger;
        TiTiPlotComponentAccess(FOwner).OuterMarginRight             := OuterMarginRightEdit.AsInteger;
        TiTiPlotComponentAccess(FOwner).OuterMarginBottom            := OuterMarginBottomEdit.AsInteger;

        TiTiPlotComponentAccess(FOwner).TitleVisible                 := TitleVisibleCheckBox.AsBoolean;
        TiTiPlotComponentAccess(FOwner).TitleMargin                  := TitleMarginEdit.AsFloat;
        TiTiPlotComponentAccess(FOwner).TitleText                    := TitleTextEdit.AsString;

        TiTiPlotComponentAccess(FOwner).TitleFont.Assign(TitleFontPicker.Font);

        TiTiPlotComponentAccess(FOwner).LogFileName                  := ControlLogFileNameEdit.Text;
        TiTiPlotComponentAccess(FOwner).LogBufferSize                := ControlLogBufferSizeEdit.AsInteger;

        if TiTiPlotComponentAccess(FOwner).LoggingActive then
          begin
            ControlLogFileNameEdit.Enabled := False;
            ControlLogFileNamePicker.Disable;
          end
        else
          begin
            ControlLogFileNameEdit.Enabled := True;
            ControlLogFileNamePicker.Enable;
          end;

        TiTiPlotComponentAccess(FOwner).HintsShow         := HintsShowCheckBox.AsBoolean;
        TiTiPlotComponentAccess(FOwner).HintsPause        := HintsPauseEdit.AsInteger;
        TiTiPlotComponentAccess(FOwner).HintsHidePause    := HintsHidePauseEdit.AsInteger;
        TiTiPlotComponentAccess(FOwner).HintsFont.Assign(HintsFontPicker.Font);

        TiTiPlotComponentAccess(FOwner).AnnotationDefaultPenColor   := AnnotationDefaultPenColorPicker.Color;
        TiTiPlotComponentAccess(FOwner).AnnotationDefaultPenStlye   := TPenStyle(AnnotationDefaultPenStyleComboBox.AsInteger);
        TiTiPlotComponentAccess(FOwner).AnnotationDefaultPenWidth   := AnnotationDefaultPenWidthEdit.AsInteger;
        TiTiPlotComponentAccess(FOwner).AnnotationDefaultBrushColor := AnnotationDefaultBrushColorPicker.Color;
        TiTiPlotComponentAccess(FOwner).AnnotationDefaultBrushStlye := TBrushStyle(AnnotationDefaultBrushStyleComboBox.AsInteger);

        TiTiPlotComponentAccess(FOwner).AnnotationDefaultFont.Assign(AnnotationDefaultFontPicker.Font);

        TiTiPlotComponentAccess(FOwner).PrintShowDialog   := PrintShowDialogCheckBox.AsBoolean;
        TiTiPlotComponentAccess(FOwner).PrintOrientation  := TPrinterOrientation(PrintOrientationRadioGroup.AsInteger);
        TiTiPlotComponentAccess(FOwner).PrintMarginLeft   := PrintMarginLeftEdit.AsFloat;
        TiTiPlotComponentAccess(FOwner).PrintMarginTop    := PrintMarginTopEdit.AsFloat;
        TiTiPlotComponentAccess(FOwner).PrintMarginRight  := PrintMarginRightEdit.AsFloat;
        TiTiPlotComponentAccess(FOwner).PrintMarginBottom := PrintMarginBottomEdit.AsFloat;
        TiTiPlotComponentAccess(FOwner).PrintDocumentName := PrintDocumentNameEdit.AsString;

        ControlLogActivateButton.Enabled   := not TiTiPlotComponentAccess(FOwner).LoggingActive;
        ControlLogDeactivateButton.Enabled :=     TiTiPlotComponentAccess(FOwner).LoggingActive;
      end;
end;
//*************************************************************************************************************************************
procedure TiPlotMasterManager.EditLayoutObject(Sender: TObject);
begin
  if not Assigned(FEditorForm) then CreateEditor;
  with FEditorForm as TiPlotEditorForm do
    begin
      if Sender is TiPlotXAxis then
        begin
          PageControl.ActivePage := XAxesTabSheet;
          XAxisListBox.ItemIndex := XAxisListBox.Items.IndexOfObject(Sender);
        end
      else if Sender is TiPlotYAxis then
        begin
          PageControl.ActivePage := YAxesTabSheet;
          YAxisListBox.ItemIndex := YAxisListBox.Items.IndexOfObject(Sender);
        end
      else if Sender is TiPlotLegend then
        begin
          PageControl.ActivePage  := LegendTabSheet;
          LegendListBox.ItemIndex := LegendListBox.Items.IndexOfObject(Sender);
        end
      else if Sender is TiPlotTable then
        begin
          PageControl.ActivePage  := TablesTabSheet;
          TableListBox.ItemIndex := TableListBox.Items.IndexOfObject(Sender);
        end
      else if Sender is TiPlotToolBar then
        begin
          PageControl.ActivePage   := ToolBarTabSheet;
          ToolBarListBox.ItemIndex := ToolBarListBox.Items.IndexOfObject(Sender);
        end
      else if Sender is TiPlotDataView then
        begin
          PageControl.ActivePage    := DataViewTabSheet;
          DataViewListBox.ItemIndex := DataViewListBox.Items.IndexOfObject(Sender);
        end
      else if Sender is TiPlotChannelCustom then
        begin
          PageControl.ActivePage   := ChannelsTabSheet;
          ChannelListBox.ItemIndex := ChannelListBox.Items.IndexOfObject(Sender);
        end
      else if Sender is TiPlotDataCursor then
        begin
          PageControl.ActivePage      := DataCursorTabSheet;
          DataCursorListBox.ItemIndex := DataCursorListBox.Items.IndexOfObject(Sender);
        end
      else if Sender is TiPlotLimit then
        begin
          PageControl.ActivePage := LimitTabSheet;
          LimitListBox.ItemIndex := LimitListBox.Items.IndexOfObject(Sender);
        end;
      EditProperties;
    end;
end;
//*************************************************************************************************************************************
procedure TiPlotMasterManager.ShowToolBars(Value: Boolean);
var
  x : Integer;
begin
  for x := 0 to FToolBarManager.Count-1 do
    FToolBarManager.Items[x].Visible :=Value;
end;
//*************************************************************************************************************************************
procedure TiPlotMasterManager.ClearAllData;
var
  x : Integer;
begin
  for x := 0 to FChannelManager.Count-1 do
    FChannelManager.Items[x].Clear;

  for x := 0 to FXAxisManager.Count-1 do
    FXAxisManager.Items[x].ResetFirstAlign;

  for x := 0 to FYAxisManager.Count-1 do
    FYAxisManager.Items[x].ResetFirstAlign;
end;
//*************************************************************************************************************************************
procedure TiPlotMasterManager.DeSelectAll;
begin
  FPlotObjectManager.ClearAllUserSelections;
end;
//*************************************************************************************************************************************
procedure TiPlotMasterManager.SetChannelClass(const Value: TiPlotChannelCustomClass);
begin
  FChannelClass := Value;
  FChannelManager.ChannelClass := Value;
end;
//*************************************************************************************************************************************
procedure TiPlotMasterManager.DoTranslation(AForm: TCustomForm);
var
  x, y : Integer;
begin
  if not Assigned(AForm)                                                           then Exit;
  if AForm is TiPlotEditorForm then if (FEditorForm as TiPlotEditorForm).IsClosing then Exit;

  if FTranslationManager.Count = 0 then Exit;

  with AForm do                 
    begin
      Caption := FTranslationManager.FindReplacement(Caption);
      for x := 0 to ComponentCount - 1 do
        begin
          if Components[x] is TControl then
            begin
              TControlAccess(Components[x]).Caption := FTranslationManager.FindReplacement(TControlAccess(Components[x]).Caption);
            end;
          if Components[x] is TiComponentEditorCheckBox then
            begin
              (Components[x] as TiComponentEditorCheckBox).Caption := FTranslationManager.FindReplacement((Components[x] as TiComponentEditorCheckBox).Caption);
            end;
          if Components[x] is TiComponentEditorRadioGroup then
            with Components[x] as TiComponentEditorRadioGroup do
              begin
                Caption := FTranslationManager.FindReplacement(Caption);
                for y := 0 to Items.Count-1 do
                  Items.Strings[y] := FTranslationManager.FindReplacement(Items.Strings[y]);
              end;
          if Components[x] is TiComponentEditorComboBox then
            with Components[x] as TiComponentEditorComboBox do
              begin
                for y := 0 to Items.Count-1 do
                  Items.Strings[y] := FTranslationManager.FindReplacement(Items.Strings[y]);
              end;
          if Components[x] is TPopupMenu then
            with Components[x] as TPopupMenu do
              begin
                for y := 0 to Items.Count-1 do     
                  Items[y].Caption := FTranslationManager.FindReplacement(Items[y].Caption);
              end;
        end;
    end;
end;
//*************************************************************************************************************************************
end.


⌨️ 快捷键说明

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