public ToolBarComboBoxCommand(Type commandGroup, int commandID, int fillCommandID, ComboBoxToolBarButton button) : base(commandGroup, commandID, button) { this._selectedIndex = -1; if (fillCommandID != 0) { this._fillCommand = new ToolBarComboBoxCommand(commandGroup, fillCommandID, 0, button); } }
public ToolBarComboBoxButtonEventArgs(ComboBoxToolBarButton button) { this._button = button; }
private void InitializeComponent() { MxToolBar bar = new MxToolBar(); ToolBarButton button = new ToolBarButton(); ToolBarButton button2 = new ToolBarButton(); ImageList list = new ImageList(); this._commandBar = new CommandBar(); this._printButton = new MxToolBarButton(); this._closeButton = new MxToolBarButton(); this._firstButton = new MxToolBarButton(); this._lastButton = new MxToolBarButton(); this._nextButton = new MxToolBarButton(); this._prevButton = new MxToolBarButton(); this._zoomButton = new ComboBoxToolBarButton(); this._settingsButton = new MxToolBarButton(); this._onePageButton = new MxToolBarButton(); this._twoPagesButton = new MxToolBarButton(); this._fourPagesButton = new MxToolBarButton(); this._preview = new PrintPreviewControl(); this._statusBar = new MxStatusBar(); this._textPanel = new MxStatusBarPanel(); this._progressPanel = new ProgressStatusBarPanel(); this._pageIndexPanel = new MxStatusBarPanel(); list.ImageSize = new Size(0x10, 0x10); list.TransparentColor = Color.Fuchsia; list.ColorDepth = ColorDepth.Depth32Bit; list.Images.AddStrip(new Bitmap(typeof(PrintPreviewDialog), "PrintPreviewCommands.bmp")); this._printButton.Text = "Print"; this._printButton.ToolTipText = "Print this document"; this._printButton.ImageIndex = 0; this._printButton.Tag = 1; this._printButton.Enabled = false; this._closeButton.Text = "Close"; this._closeButton.ToolTipText = "Close and return to document"; this._closeButton.ImageIndex = 1; this._closeButton.Tag = 2; this._firstButton.ToolTipText = "Go to the first page"; this._firstButton.ImageIndex = 2; this._firstButton.Tag = 5; this._firstButton.Enabled = false; this._prevButton.ToolTipText = "Go to the previous page"; this._prevButton.ImageIndex = 3; this._prevButton.Tag = 4; this._prevButton.Enabled = false; this._nextButton.ToolTipText = "Go to the next page"; this._nextButton.ImageIndex = 4; this._nextButton.Tag = 3; this._nextButton.Enabled = false; this._lastButton.ToolTipText = "Go to the last page"; this._lastButton.ImageIndex = 5; this._lastButton.Tag = 6; this._lastButton.Enabled = false; this._zoomButton.Text = "_____________"; this._zoomButton.ComboBoxItems = new string[] { "Fit to Window", "25%", "50%", "100%", "150%", "200%" }; this._settingsButton.ToolTipText = "Printer Settings"; this._settingsButton.ImageIndex = 6; this._settingsButton.Tag = 7; this._onePageButton.ToolTipText = "One Page at a time"; this._onePageButton.ImageIndex = 7; this._onePageButton.Tag = 8; this._onePageButton.Pushed = true; this._onePageButton.Enabled = false; this._twoPagesButton.ToolTipText = "Two pages at a time"; this._twoPagesButton.ImageIndex = 8; this._twoPagesButton.Tag = 9; this._twoPagesButton.Enabled = false; this._fourPagesButton.ToolTipText = "Four pages at a time"; this._fourPagesButton.ImageIndex = 9; this._fourPagesButton.Tag = 10; this._fourPagesButton.Enabled = false; button.Style = ToolBarButtonStyle.Separator; button2.Style = ToolBarButtonStyle.Separator; bar.Divider = false; bar.Appearance = ToolBarAppearance.Flat; bar.TextAlign = ToolBarTextAlign.Right; bar.Wrappable = false; bar.ShowToolTips = true; bar.DropDownArrows = false; bar.TabIndex = 0; bar.ImageList = list; bar.ButtonClick += new ToolBarButtonClickEventHandler(this.OnToolBarButtonClicked); bar.ComboBoxCreated += new ToolBarComboBoxButtonEventHandler(this.OnToolBarComboBoxCreated); bar.Buttons.AddRange(new ToolBarButton[] { this._printButton, this._settingsButton, this._closeButton, button, this._zoomButton, this._onePageButton, this._twoPagesButton, this._fourPagesButton, button2, this._firstButton, this._prevButton, this._nextButton, this._lastButton }); this._commandBar.Dock = DockStyle.Top; this._commandBar.TabIndex = 0; this._commandBar.Controls.Add(bar); this._preview.Dock = DockStyle.Fill; this._preview.TabIndex = 1; this._preview.TabStop = false; this._preview.StartPageChanged += new EventHandler(this.OnPreviewStartPageChanged); this._textPanel.AutoSize = StatusBarPanelAutoSize.Spring; this._progressPanel.MinWidth = 0x80; this._progressPanel.Width = 0x80; this._pageIndexPanel.Alignment = HorizontalAlignment.Center; this._pageIndexPanel.AutoSize = StatusBarPanelAutoSize.Contents; this._pageIndexPanel.MinWidth = 0x80; this._statusBar.Dock = DockStyle.Bottom; this._statusBar.TabStop = false; this._statusBar.ShowPanels = true; this._statusBar.Panels.AddRange(new StatusBarPanel[] { this._textPanel, this._progressPanel, this._pageIndexPanel }); this.Text = "Print Preview"; base.Size = new Size(800, 600); base.MinimumSize = new Size(200, 150); base.ShowInTaskbar = false; base.MinimizeBox = false; base.SizeGripStyle = SizeGripStyle.Show; base.StartPosition = FormStartPosition.CenterParent; base.Icon = new Icon(typeof(PrintPreviewDialog), "PrintPreviewDialog.ico"); base.Controls.AddRange(new Control[] { this._preview, this._commandBar, this._statusBar }); }
private void InitializeHelpToolBar() { ComboBoxToolBarButton button = new ComboBoxToolBarButton(); button.DropDownStyle = ComboBoxStyle.DropDown; button.InitialText = "Type keywords to search online help"; button.ToolTipText = "Search for help by keywords"; button.Text = new string('_', 30); button.ImageIndex = 0; this.cm.AddCommand(button, typeof(GlobalCommands), 0x25c, 0x25d); this.helpToolBar.Buttons.Add(button); this.cm.AddToolBar(this.helpToolBar); }
private void AddToolBarComboBoxButton(Hashtable table, System.Type commandGroup, int commandID, int fillCommandID, string helpText, int width, ComboBoxStyle style, object[] items, string initialText) { ComboBoxToolBarButton button = new ComboBoxToolBarButton(); button.DropDownStyle = style; button.ComboBoxItems = items; button.ToolTipText = helpText; button.Text = new string('_', width); button.InitialText = initialText; button.ImageIndex = 0; table[commandID] = button; this.cm.AddCommand(button, commandGroup, commandID, fillCommandID); }
public void AddCommand(ComboBoxToolBarButton button, Type commandGroup, int commandID, int fillCommandID) { ToolBarComboBoxCommand command = new ToolBarComboBoxCommand(commandGroup, commandID, fillCommandID, button); button.Command = command; this._toolBarButtons.Add(button); this.AddCommand(command); }
public void AddCommand(ComboBoxToolBarButton button, Type commandGroup, int commandID) { this.AddCommand(button, commandGroup, commandID, 0); }
private void InitializeComponent() { Panel panel = new Panel(); ImageList list = new ImageList(); ImageList list2 = new ImageList(); list.ImageSize = new Size(0x10, 0x10); list.TransparentColor = Color.Green; list.ColorDepth = ColorDepth.Depth32Bit; list.Images.AddStrip(new Bitmap(typeof(ClassViewToolWindow), "ClassViewTreeImages.bmp")); list2.ImageSize = new Size(0x10, 0x10); list2.TransparentColor = Color.Red; list2.ColorDepth = ColorDepth.Depth32Bit; list2.Images.AddStrip(new Bitmap(typeof(ClassViewToolWindow), "ClassViewToolBar.bmp")); System.Type commandGroup = typeof(ClassViewCommands); this._commandManager = new CommandManager(base.ServiceProvider, this); this._toolBar1 = new MxToolBar(); this._toolBar1.Appearance = ToolBarAppearance.Flat; this._toolBar1.Divider = false; this._toolBar1.DropDownArrows = true; this._toolBar1.ShowToolTips = true; this._toolBar1.TabIndex = 0; this._toolBar1.TextAlign = ToolBarTextAlign.Right; this._toolBar1.Wrappable = false; this._toolBar1.ImageList = list2; if (!this._searchOnly) { MxToolBarButton button = new MxToolBarButton(); MxToolBarButton button2 = new MxToolBarButton(); MxToolBarButton button3 = new MxToolBarButton(); MxToolBarButton button4 = new MxToolBarButton(); MxToolBarButton button5 = new MxToolBarButton(); ToolBarButton button6 = new ToolBarButton(); button2.ImageIndex = 1; button2.ToolTipText = "Browse By Assembly"; button.ImageIndex = 2; button.ToolTipText = "Browse By Namespace"; button3.ImageIndex = 3; button3.ToolTipText = "Sort Alphabetically"; button4.ImageIndex = 4; button4.ToolTipText = "Sort By Class Type"; button5.ImageIndex = 5; button5.ToolTipText = "Sort By Visibility"; button6.Style = ToolBarButtonStyle.Separator; if (!ClassViewPackage.IsClassBrowserApplication) { MxToolBarButton button7 = new MxToolBarButton(); MxToolBarButton button8 = new MxToolBarButton(); MxToolBarButton button9 = new MxToolBarButton(); MxToolBarButton button10 = new MxToolBarButton(); MxToolBarButton button11 = new MxToolBarButton(); ComboBoxToolBarButton button12 = new ComboBoxToolBarButton(); ToolBarButton button13 = new ToolBarButton(); button7.ImageIndex = 0; button7.ToolTipText = "Browse Search Results"; button8.ImageIndex = 7; button8.ToolTipText = "View Non-Public Classes"; button9.ImageIndex = 6; button9.ToolTipText = "Add/Remove Assemblies"; button10.ImageIndex = 8; button10.ToolTipText = "Find By Type Name"; button11.ImageIndex = 9; button11.ToolTipText = "Find By Member Name"; button12.DropDownStyle = ComboBoxStyle.DropDown; button12.Text = new string('_', 0x16); button12.InitialText = "Enter Name to Search"; button12.ToolTipText = "Search for a Class"; button13.Style = ToolBarButtonStyle.Separator; this._toolBar1.Buttons.AddRange(new ToolBarButton[] { button, button2, button7, button6, button3, button4, button5, button13, button8, button9 }); this._toolBar2 = new MxToolBar(); this._toolBar2.Appearance = ToolBarAppearance.Flat; this._toolBar2.Divider = false; this._toolBar2.DropDownArrows = false; this._toolBar2.ShowToolTips = true; this._toolBar2.TabIndex = 0; this._toolBar2.TextAlign = ToolBarTextAlign.Right; this._toolBar2.Wrappable = false; this._toolBar2.ImageList = list2; this._toolBar2.Buttons.AddRange(new ToolBarButton[] { button12 }); this._commandManager.AddCommand(button7, commandGroup, 15); this._commandManager.AddCommand(button8, commandGroup, 0x10); this._commandManager.AddCommand(button9, commandGroup, 1); this._commandManager.AddCommand(button12, commandGroup, 5); this._commandManager.AddToolBar(this._toolBar2); } else { this._toolBar1.Buttons.AddRange(new ToolBarButton[] { button, button2, button6, button3, button4, button5 }); } this._commandManager.AddCommand(button, commandGroup, 14); this._commandManager.AddCommand(button2, commandGroup, 13); this._commandManager.AddCommand(button3, commandGroup, 10); this._commandManager.AddCommand(button4, commandGroup, 11); this._commandManager.AddCommand(button5, commandGroup, 12); this._commandManager.AddToolBar(this._toolBar1); } else { MxToolBarButton button14 = new MxToolBarButton(); MxToolBarButton button15 = new MxToolBarButton(); ComboBoxToolBarButton button16 = new ComboBoxToolBarButton(); ToolBarButton button17 = new ToolBarButton(); button14.ImageIndex = 8; button14.ToolTipText = "Find By Type Name"; button14.Text = "Types"; button15.ImageIndex = 9; button15.ToolTipText = "Find By Member Name"; button15.Text = "Members"; button16.DropDownStyle = ComboBoxStyle.DropDown; button16.Text = new string('_', 0x2d); button16.InitialText = "Enter Name to Search"; button16.ToolTipText = "Search for a Class"; button17.Style = ToolBarButtonStyle.Separator; this._toolBar1.Buttons.AddRange(new ToolBarButton[] { button14, button15, button17, button16 }); this._commandManager.AddCommand(button14, commandGroup, 6); this._commandManager.AddCommand(button15, commandGroup, 7); this._commandManager.AddCommand(button16, commandGroup, 5); this._commandManager.AddToolBar(this._toolBar1); } panel.SuspendLayout(); base.SuspendLayout(); panel.BackColor = SystemColors.ControlDark; panel.Dock = DockStyle.Fill; panel.DockPadding.All = 1; panel.TabIndex = 1; if (!this._searchOnly) { this._treeView = new MxTreeView(); this._treeView.BorderStyle = BorderStyle.None; this._treeView.Dock = DockStyle.Fill; this._treeView.HideSelection = false; this._treeView.ShowLines = false; this._treeView.TabIndex = 0; this._treeView.ImageList = list; this._treeView.AfterCollapse += new TreeViewEventHandler(this.OnAfterCollapseTreeView); this._treeView.AfterSelect += new TreeViewEventHandler(this.OnAfterSelectTreeView); this._treeView.BeforeCollapse += new TreeViewCancelEventHandler(this.OnBeforeCollapseTreeView); this._treeView.BeforeExpand += new TreeViewCancelEventHandler(this.OnBeforeExpandTreeView); this._treeView.NodeDoubleClick += new TreeViewEventHandler(this.OnNodeDoubleClickTreeView); panel.Controls.Add(this._treeView); } if (!ClassViewPackage.IsClassBrowserApplication || this._searchOnly) { ColumnHeader header = new ColumnHeader(); ColumnHeader header2 = new ColumnHeader(); header.Text = "Class"; header2.Text = "Namespace"; if (this._searchOnly) { header.Width = 200; header2.Width = 240; } else { header.Width = 0x87; header2.Width = 240; } this._listView = new MxListView(); this._listView.BorderStyle = BorderStyle.None; this._listView.Dock = DockStyle.Fill; this._listView.HideSelection = false; this._listView.FullRowSelect = true; this._listView.TabIndex = 0; this._listView.SmallImageList = list; this._listView.View = View.Details; this._listView.HeaderStyle = ColumnHeaderStyle.Nonclickable; this._listView.LabelWrap = false; this._listView.MultiSelect = false; this._listView.FlatScrollBars = true; this._listView.ShowToolTips = true; this._listView.WatermarkText = "No Classes Found"; this._listView.Sorting = SortOrder.Ascending; this._listView.Columns.Add(header); this._listView.Columns.Add(header2); if (this._searchOnly) { ColumnHeader header3 = new ColumnHeader(); header3.Width = 200; header3.Text = "Member"; this._listView.Columns.Add(header3); } if (this.Mode == ClassViewToolWindowMode.Browse) { this._listView.Visible = false; } this._listView.DoubleClick += new EventHandler(this.OnDoubleClickListView); this._listView.SelectedIndexChanged += new EventHandler(this.OnSelectedIndexChangedListView); panel.Controls.Add(this._listView); } if (ClassViewPackage.IsClassBrowserApplication || this._searchOnly) { base.Controls.AddRange(new Control[] { panel, this._toolBar1 }); } else { base.Controls.AddRange(new Control[] { panel, this._toolBar2, this._toolBar1 }); } if (!this._searchOnly) { this.Text = "Classes"; if (ClassViewPackage.IsClassBrowserApplication) { base.Icon = new Icon(typeof(ClassViewToolWindowBase), "ClassBrowseToolWindow.ico"); } else { base.Icon = new Icon(typeof(ClassViewToolWindowBase), "ClassViewToolWindow.ico"); } } else { this.Text = "Search"; base.Icon = new Icon(typeof(ClassViewToolWindowBase), "ClassSearchToolWindow.ico"); } panel.ResumeLayout(false); base.ResumeLayout(false); }