private PlotToolBarButton CreateButton(IDesignerHost host, PlotToolBarCommandStyle command) { PlotToolBarButton plotToolBarButton = (PlotToolBarButton)host.CreateComponent(typeof(PlotToolBarButton)); plotToolBarButton.Command = command; base.Buttons.Add(plotToolBarButton); return(plotToolBarButton); }
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); } } } } }
public PlotToolBarButton() { this.Command = PlotToolBarCommandStyle.TrackingResume; base.Style = ToolBarButtonStyle.PushButton; base.ToolTipText = "Tracking Resume"; }