private PlotToolBarButton CreateButton(IDesignerHost host, PlotToolBarCommandStyle command) { PlotToolBarButton plotToolBarButton = (PlotToolBarButton)host.CreateComponent(typeof(PlotToolBarButton)); plotToolBarButton.Command = command; base.Buttons.Add(plotToolBarButton); return(plotToolBarButton); }
public void SetupButton(PlotToolBarButton value) { if (value.Command == PlotToolBarCommandStyle.TrackingResume) { value.DropDownMenu = this.m_MenuResume; value.Style = ToolBarButtonStyle.DropDownButton; } else if (value.Command == PlotToolBarCommandStyle.Copy) { value.DropDownMenu = this.m_MenuCopy; value.Style = ToolBarButtonStyle.DropDownButton; } }
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); } } } } }