示例#1
0
        private PlotToolBarButton CreateButton(IDesignerHost host, PlotToolBarCommandStyle command)
        {
            PlotToolBarButton plotToolBarButton = (PlotToolBarButton)host.CreateComponent(typeof(PlotToolBarButton));

            plotToolBarButton.Command = command;
            base.Buttons.Add(plotToolBarButton);
            return(plotToolBarButton);
        }
示例#2
0
 private void ToolBarAdapter_Changed(object sender, EventArgs e)
 {
     if (this.Plot != null)
     {
         PlotToolBarAdapter toolBarAdapter = this.Plot.ToolBarAdapter;
         for (int i = 0; i < base.Buttons.Count; i++)
         {
             PlotToolBarButton plotToolBarButton = base.Buttons[i] as PlotToolBarButton;
             if (plotToolBarButton != null)
             {
                 PlotToolBarCommandStyle command = plotToolBarButton.Command;
                 if (command == PlotToolBarCommandStyle.TrackingResume)
                 {
                     plotToolBarButton.Enabled = toolBarAdapter.AxesTrackingAnyDisabled;
                 }
                 if (command == PlotToolBarCommandStyle.TrackingPause)
                 {
                     plotToolBarButton.Enabled = toolBarAdapter.AxesTrackingAnyEnabled;
                 }
                 if (command == PlotToolBarCommandStyle.AxesScroll)
                 {
                     plotToolBarButton.Pushed = (toolBarAdapter.AxisMouseMode == PlotAxisMouseMode.Scroll);
                 }
                 if (command == PlotToolBarCommandStyle.AxesZoom)
                 {
                     plotToolBarButton.Pushed = (toolBarAdapter.AxisMouseMode == PlotAxisMouseMode.Zoom);
                 }
                 if (command == PlotToolBarCommandStyle.Select)
                 {
                     plotToolBarButton.Pushed = (toolBarAdapter.DataViewMouseMode == PlotDataViewMouseMode.Select);
                 }
                 if (command == PlotToolBarCommandStyle.ZoomBox)
                 {
                     plotToolBarButton.Pushed = (toolBarAdapter.DataViewMouseMode == PlotDataViewMouseMode.ZoomBox);
                 }
                 if (command == PlotToolBarCommandStyle.DataCursor)
                 {
                     plotToolBarButton.Pushed = (toolBarAdapter.DataViewMouseMode == PlotDataViewMouseMode.DataCursor);
                 }
             }
         }
     }
 }
示例#3
0
 public PlotToolBarButton()
 {
     this.Command     = PlotToolBarCommandStyle.TrackingResume;
     base.Style       = ToolBarButtonStyle.PushButton;
     base.ToolTipText = "Tracking Resume";
 }