public DetailsBrowserToolStrip(DetailsBrowserFilter detailsBrowserFilter, DetailsModel detailsModel, SearchHandler searchHandler) { InitializeComponent(); DetailsBrowserFilter = detailsBrowserFilter; DetailsModel = detailsModel; SearchHandler = searchHandler; searchComboBox = new ToolStripSpringComboBox(); toolStrip = new ToolStrip(); SuspendLayout(); // // searchComboBox // searchComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend; searchComboBox.AutoCompleteSource = AutoCompleteSource.ListItems; searchComboBox.DropDownStyle = ComboBoxStyle.DropDown; // WORKAROUND: bug since win7 - selectedindex is wrong when a datasource is bound // searchComboBox.ComboBox.DataSource = DetailsModel.Searches; // searchComboBox.DataSource = DetailsModel.Searches; searchComboBox.Dock = DockStyle.Fill; searchComboBox.Margin = new Padding(0, 0, 6, 0); searchComboBox.ComboBox.SelectionChangeCommitted += SearchComboBox_SelectionChangeCommitted; searchComboBox.KeyDown += SearchComboBox_KeyDown; searchComboBox.ComboBox.OverrideMouseWheelBehaviour(); searchComboBox.OverrideUpDownKeys(); // // toolStrip // toolStrip.Dock = DockStyle.Fill; toolStrip.CanOverflow = false; toolStrip.Items.Add(searchComboBox); // // this // Controls.Add(toolStrip); //DetailsModel.Searches.ListChanged += Searches_ListChanged; DetailsModel.SearchesChanged += DetailsModel_SearchesChanged; ResumeLayout(false); }
private void InitializeComponent() { importComboBox = new ToolStripSpringComboBox(); classComboBox = new ToolStripSpringComboBox(); memberComboBox = new ToolStripSpringComboBox(); updateTimer = new Timer(); SuspendLayout(); // // importComboBox // importComboBox.ComboBox.DrawMode = DrawMode.OwnerDrawFixed; importComboBox.DropDownStyle = ComboBoxStyle.DropDownList; importComboBox.MaxDropDownItems = 25; importComboBox.Name = "importComboBox"; importComboBox.ComboBox.DrawItem += new DrawItemEventHandler(comboBox_DrawItem); importComboBox.ComboBox.SelectionChangeCommitted += new EventHandler(comboBox_SelectionChangeCommitted); importComboBox.KeyPress += new KeyPressEventHandler(comboBox_KeyPress); importComboBox.DropDownClosed += new EventHandler(comboBox_DropDownClosed); // // classComboBox // classComboBox.ComboBox.DrawMode = DrawMode.OwnerDrawFixed; classComboBox.DropDownStyle = ComboBoxStyle.DropDownList; classComboBox.MaxDropDownItems = 25; classComboBox.Name = "classComboBox"; classComboBox.ComboBox.DrawItem += new DrawItemEventHandler(comboBox_DrawItem); classComboBox.ComboBox.SelectionChangeCommitted += new EventHandler(comboBox_SelectionChangeCommitted); classComboBox.KeyPress += new KeyPressEventHandler(comboBox_KeyPress); classComboBox.DropDownClosed += new EventHandler(comboBox_DropDownClosed); // // memberComboBox // memberComboBox.ComboBox.DrawMode = DrawMode.OwnerDrawFixed; memberComboBox.DropDownStyle = ComboBoxStyle.DropDownList; memberComboBox.MaxDropDownItems = 25; memberComboBox.Name = "memberComboBox"; memberComboBox.Padding = new Padding(0, 0, 0, 1); memberComboBox.ComboBox.DrawItem += new DrawItemEventHandler(comboBox_DrawItem); memberComboBox.ComboBox.SelectionChangeCommitted += new EventHandler(comboBox_SelectionChangeCommitted); memberComboBox.KeyPress += new KeyPressEventHandler(comboBox_KeyPress); memberComboBox.DropDownClosed += new EventHandler(comboBox_DropDownClosed); // // updateTimer // updateTimer.Tick += new EventHandler(updateTimer_Tick); // // NavigationBar // CanOverflow = false; Dock = DockStyle.Top; GripStyle = ToolStripGripStyle.Hidden; Items.AddRange(new ToolStripItem[] { importComboBox, classComboBox, memberComboBox }); Name = "NavigationBar"; Padding = new Padding(1, 1, 2, 2); Stretch = true; Visible = false; ResumeLayout(false); }
/// <summary> /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// </summary> private void InitializeComponent() { this.toolStrip = new PluginCore.Controls.ToolStripEx(); this.toggleButton = new System.Windows.Forms.ToolStripButton(); this.topMostButton = new System.Windows.Forms.ToolStripButton(); this.clearFilterButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator(); this.viewLabel = new System.Windows.Forms.ToolStripLabel(); this.logComboBox = new System.Windows.Forms.ToolStripComboBox(); this.filterLabel = new System.Windows.Forms.ToolStripLabel(); this.filterComboBox = new System.Windows.Forms.ToolStripSpringComboBox(); this.logTextBox = new System.Windows.Forms.RichTextBox(); this.toolStrip.SuspendLayout(); this.SuspendLayout(); // // toolStrip // this.toolStrip.CanOverflow = false; this.toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toggleButton, this.topMostButton, this.toolStripSeparator, this.viewLabel, this.logComboBox, this.filterLabel, this.filterComboBox, this.clearFilterButton }); this.toolStrip.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow; this.toolStrip.Location = new System.Drawing.Point(1, 0); this.toolStrip.Name = "toolStrip"; this.toolStrip.Padding = new System.Windows.Forms.Padding(1, 1, 2, 2); this.toolStrip.Size = new System.Drawing.Size(683, 30); this.toolStrip.TabIndex = 1; // // toggleButton // this.toggleButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toggleButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.toggleButton.Margin = new System.Windows.Forms.Padding(1); this.toggleButton.Name = "toggleButton"; this.toggleButton.Size = new System.Drawing.Size(23, 26); this.toggleButton.Click += new System.EventHandler(this.ToggleButtonClick); // // clearFilterButton // this.clearFilterButton.Enabled = true; this.clearFilterButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.clearFilterButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.clearFilterButton.Margin = new System.Windows.Forms.Padding(0, 1, 0, 1); this.clearFilterButton.Name = "clearFilterButton"; this.clearFilterButton.Size = new System.Drawing.Size(23, 26); this.clearFilterButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; this.clearFilterButton.Click += new System.EventHandler(this.ClearFilterButtonClick); // // topMostButton // this.topMostButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.topMostButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.topMostButton.Margin = new System.Windows.Forms.Padding(0, 1, 0, 1); this.topMostButton.Name = "topMostButton"; this.topMostButton.Size = new System.Drawing.Size(23, 26); this.topMostButton.Click += new System.EventHandler(this.TopMostButtonClick); // // toolStripSeparator // this.toolStripSeparator.Name = "toolStripSeparator"; this.toolStripSeparator.Size = new System.Drawing.Size(6, 28); // // viewLabel // this.viewLabel.Margin = new System.Windows.Forms.Padding(2, 1, 0, 1); this.viewLabel.Name = "viewLabel"; this.viewLabel.Size = new System.Drawing.Size(44, 25); this.viewLabel.Text = "View:"; // // logComboBox // this.logComboBox.Enabled = false; this.logComboBox.Items.AddRange(new Object[] { TextHelper.GetString("Label.FlashLog"), TextHelper.GetString("Label.PolicyLog") }); this.logComboBox.Name = "logComboBox"; this.logComboBox.Size = new System.Drawing.Size(120, 28); this.logComboBox.SelectedIndex = 0; this.logComboBox.DropDownStyle = ComboBoxStyle.DropDownList; this.logComboBox.SelectedIndexChanged += new System.EventHandler(this.LogComboBoxIndexChanged); // // filterLabel // this.filterLabel.Margin = new System.Windows.Forms.Padding(2, 1, 0, 1); this.filterLabel.Name = "filterLabel"; this.filterLabel.Size = new System.Drawing.Size(45, 25); this.filterLabel.Text = "Filter:"; // // filterComboBox // this.filterComboBox.Enabled = true; this.filterComboBox.Name = "filterComboBox"; this.filterComboBox.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0); this.filterComboBox.Size = new System.Drawing.Size(50, 28); this.filterComboBox.TextChanged += new System.EventHandler(this.FilterTextBoxTextChanged); // // logTextBox // this.logTextBox.BackColor = System.Drawing.SystemColors.Window; this.logTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; this.logTextBox.DetectUrls = false; this.logTextBox.Dock = System.Windows.Forms.DockStyle.Fill; this.logTextBox.Font = new System.Drawing.Font("Courier New", 8.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.logTextBox.Location = new System.Drawing.Point(1, 30); this.logTextBox.Name = "logTextBox"; this.logTextBox.ReadOnly = true; this.logTextBox.Size = new System.Drawing.Size(683, 322); this.logTextBox.TabIndex = 0; this.logTextBox.Text = ""; this.logTextBox.WordWrap = false; // // PluginUI // this.Name = "PluginUI"; this.Controls.Add(this.logTextBox); this.Controls.Add(this.toolStrip); this.Size = new System.Drawing.Size(685, 352); this.toolStrip.ResumeLayout(false); this.toolStrip.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
public GalleryBrowserToolStrip(GalleryBrowserFilter galleryBrowserFilter, GalleryModel galleryModel, Configuration.ConfigGalleryBrowserView galleryBrowserSettings, SearchHandler searchHandler) { InitializeComponent(); GalleryBrowserFilter = galleryBrowserFilter; GalleryModel = galleryModel; GalleryBrowserSettings = galleryBrowserSettings; SearchHandler = searchHandler; toolStrip = new ToolStrip(); searchComboBox = new ToolStripSpringComboBox(); filterComboBox = new ToolStripSpringComboBox(); sortTypeComboBox = new ToolStripComboBox(); sortOrderComboBox = new ToolStripComboBox(); SuspendLayout(); // // searchComboBox // searchComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend; searchComboBox.AutoCompleteSource = AutoCompleteSource.ListItems; searchComboBox.DropDownStyle = ComboBoxStyle.DropDown; searchComboBox.Dock = DockStyle.Fill; searchComboBox.Margin = new Padding(0, 0, 6, 0); searchComboBox.KeyDown += SearchComboBox_KeyDown; searchComboBox.ComboBox.SelectionChangeCommitted += SearchComboBox_SelectionChangeCommitted; // WORKAROUND: bug since win7 - selectedindex is wrong when a datasource is bound //searchComboBox.ComboBox.DataSource = galleryModel.Searches; searchComboBox.ComboBox.OverrideMouseWheelBehaviour(); searchComboBox.OverrideUpDownKeys(); // // filterComboBox // filterComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend; filterComboBox.AutoCompleteSource = AutoCompleteSource.ListItems; filterComboBox.DropDownStyle = ComboBoxStyle.DropDown; filterComboBox.Dock = DockStyle.Fill; filterComboBox.Margin = new Padding(0, 0, 6, 0); filterComboBox.KeyDown += FilterComboBox_KeyDown; filterComboBox.ComboBox.SelectedIndexChanged += ComboBox_SelectedIndexChanged; filterComboBox.ComboBox.SelectionChangeCommitted += FilterComboBox_SelectionChangeCommitted; filterComboBox.ComboBox.OverrideMouseWheelBehaviour(); filterComboBox.EnableMiddleClickToClear(); filterComboBox.OverrideUpDownKeys(); // // sortTypeComboBox // sortTypeComboBox.Text = "&Sort"; sortTypeComboBox.FlatStyle = FlatStyle.Flat; sortTypeComboBox.DropDownStyle = ComboBoxStyle.DropDownList; List <ComboBoxItem> sortTypeItems = new List <ComboBoxItem> { new ComboBoxItem("orderByNone", "None", SortTypeComboBox_None, GallerySortType.None), new ComboBoxItem("orderByTitle", "Title", SortTypeComboBox_Title, GallerySortType.Title), new ComboBoxItem("orderByLanguage", "Language", SortTypeComboBox_Language, GallerySortType.Language), new ComboBoxItem("orderByArtist", "Artist", SortTypeComboBox_Artist, GallerySortType.Artist), new ComboBoxItem("orderByGroup", "Group", SortTypeComboBox_Group, GallerySortType.Group), new ComboBoxItem("orderByTag", "Tag", SortTypeComboBox_Tag, GallerySortType.Tag), new ComboBoxItem("orderByParody", "Parody", SortTypeComboBox_Parody, GallerySortType.Parody), new ComboBoxItem("orderByCharacter", "Character", SortTypeComboBox_Character, GallerySortType.Character), new ComboBoxItem("orderByCategory", "Category", SortTypeComboBox_Category, GallerySortType.Category), new ComboBoxItem("orderByScanlator", "Scanlator", SortTypeComboBox_Scanlator, GallerySortType.Scanlator), new ComboBoxItem("orderByUploadDate", "Upload Date", SortTypeComboBox_UploadDate, GallerySortType.UploadDate), new ComboBoxItem("orderByNumPages", "Num Pages", SortTypeComboBox_NumPages, GallerySortType.NumPages), new ComboBoxItem("orderByNumFavorites", "Num Favorites", SortTypeComboBox_NumFavorites, GallerySortType.NumFavorites), new ComboBoxItem("orderById", "Id", SortTypeComboBox_Id, GallerySortType.Id), //new SortItem("orderByComiket", "Comiket", SortTypeComboBox_Comiket, GallerySortType.Comiket), //new SortItem("orderByVersion", "Version", SortTypeComboBox_Version, GallerySortType.Version), //new SortItem("orderByCensorship", "Censorship", SortTypeComboBox_Censorship, GallerySortType.Censorship), }; sortTypeComboBox.Items.AddRange(sortTypeItems.Cast <object>().ToArray()); sortTypeComboBox.ComboBox.SelectionChangeCommitted += SortTypeComboBox_SelectionChangeCommitted; sortTypeComboBox.SelectedItem = sortTypeItems.First(x => (GallerySortType)x.Tag == GalleryBrowserFilter.SortType); sortTypeComboBox.ComboBox.OverrideMouseWheelBehaviour(); sortTypeComboBox.OverrideUpDownKeys(); // // sortOrderComboBox // sortOrderComboBox.Text = "&Sort"; sortOrderComboBox.FlatStyle = FlatStyle.Flat; sortOrderComboBox.DropDownStyle = ComboBoxStyle.DropDownList; List <ComboBoxItem> sortOrderItems = new List <ComboBoxItem> { new ComboBoxItem("orderByAscending", "Ascending", SortOrderComboBox_Ascending, SortOrder.Ascending), new ComboBoxItem("orderByDescending", "Descending", SortOrderComboBox_Descending, SortOrder.Descending) }; sortOrderComboBox.Items.AddRange(sortOrderItems.Cast <object>().ToArray()); sortOrderComboBox.ComboBox.SelectionChangeCommitted += SortOrderComboBox_SelectionChangeCommitted; sortOrderComboBox.SelectedItem = sortOrderItems.First(x => (SortOrder)x.Tag == GalleryBrowserFilter.SortOrder); sortOrderComboBox.ComboBox.OverrideMouseWheelBehaviour(); sortOrderComboBox.Enabled = GalleryBrowserFilter.SortType != GallerySortType.None; sortOrderComboBox.OverrideUpDownKeys(); // // toolStrip // toolStrip.Dock = DockStyle.Fill; toolStrip.CanOverflow = false; toolStrip.Items.Add(searchComboBox); toolStrip.Items.Add(filterComboBox); toolStrip.Items.Add(sortTypeComboBox); toolStrip.Items.Add(sortOrderComboBox); // // this // Controls.Add(toolStrip); //GalleryModel.Searches.ListChanged += Searches_ListChanged; GalleryModel.SearchesChanged += GalleryModel_SearchesChanged; GalleryModel.FiltersChanged += GalleryModel_FiltersChanged; galleryBrowserFilter.SortTypeChanged += GalleryBrowserFilter_SortTypeChanged; galleryBrowserFilter.SortOrderChanged += GalleryBrowserFilter_SortOrderChanged; ResumeLayout(false); }