/// <summary> /// Initializes a new instance of <see cref="DrawBackGroundEventArgs" /> with supplied arguments. /// </summary> /// <param name="graphics">Graphics surface where drawing has to be done.</param> /// <param name="bounds"><see cref="ZeroitToxicButton" /> control's boundry.</param> /// <param name="appearance">Appearance of current <see cref="ZeroitToxicButton" /></param> /// <param name="bar">Related <see cref="ZeroitToxicButton" /></param> public DrawBackGroundEventArgs(Graphics graphics, Rectangle bounds, AppearanceBar appearance, ZeroitToxicButton bar) { Graphics = graphics; Bounds = bounds; Appearance = appearance; Bar = bar; }
/// <summary> /// Initializes a new instance of the <see cref="AppearanceEditorUI"/> class. /// </summary> /// <param name="original">The original.</param> public AppearanceEditorUI(ZeroitToxicButton original) { this.original = original; appBar = (AppearanceBar)original.Appearance.Bar.Clone(); appItem = (AppearanceItem)original.Appearance.Item.Clone(); InitializeComponent(); pgrdBar.SelectedObject = original.Appearance.Bar; pgrdItem.SelectedObject = original.Appearance.Item; lbxTemplate.Items.AddRange(new object[] { Properties.Resources.THEME_VS2005, Properties.Resources.THEME_CLASSIC, Properties.Resources.THEME_BLUE, Properties.Resources.THEME_OLIVE, Properties.Resources.THEME_ROYAL, Properties.Resources.THEME_SILVER }); lbxTemplate.SelectedIndex = 0; bBar.Appearance.Bar.Assign(appBar); bBar.Appearance.Item.Assign(appItem); bBar.ThemeProperty.UseTheme = false; bBar.SetThemeDefaults(); bBar.RefreshControl(); lblCurrentStyle.Text = Properties.Resources.LBL_CURRENT_STYLE; lblApply.Text = Properties.Resources.LNK_APPLYTHEME; lblAvailableTheme.Text = Properties.Resources.LBL_AVAILABLE_THEME; lblLoad.Text = Properties.Resources.LNK_LOAD; lblPreview.Text = Properties.Resources.LBL_PREVIEW; lblReload.Text = Properties.Resources.LNK_RELOAD; lblReset.Text = Properties.Resources.LNK_RESET; lblSave.Text = Properties.Resources.LNK_SAVETHEME; Text = Properties.Resources.FORM_TEXT; }
/// <summary> /// Clears the buttons. /// </summary> protected virtual void ClearButtons() { ZeroitToxicButton.Items.Clear(); ZeroitToxicButton.RefreshControl(); ZeroitToxicButton.Invalidate(); RefreshComponent(); }
/// <summary> /// Initializes a new instance of <see cref="DrawItemEventArgs" /> with supplied arguments. /// </summary> /// <param name="ge">Graphics object where drawing will be done</param> /// <param name="bounds">Bound of <see cref="BarItem" /></param> /// <param name="item"><see cref="BarItem" /> to draw</param> /// <param name="state"><see cref="Enums.State" /> or <see cref="BarItem" /></param> /// <param name="bar"><see cref="ZeroitToxicButton" /> control</param> public DrawItemsEventArgs(Graphics ge, Rectangle bounds, BarItem item, State state, ZeroitToxicButton bar) { Handeled = false; Graphics = ge; Bounds = bounds; Item = item; State = state; Bar = bar; }
/// <summary> /// Adds the button. /// </summary> protected virtual void AddButton() { var item = new BarItem(ZeroitToxicButton); ZeroitToxicButton.Items.Add(item); ZeroitToxicButton.RefreshControl(); ZeroitToxicButton.Invalidate(); RefreshComponent(); }
/// <summary> /// Deletes the button. /// </summary> protected virtual void DeleteButton() { if (ZeroitToxicButton.SelectedItem == null) { return; } ZeroitToxicButton.Items.Remove(ZeroitToxicButton.SelectedItem); if (ZeroitToxicButton.Items.Count > 0) { ZeroitToxicButton.Items[0].Selected = true; } ZeroitToxicButton.RefreshControl(); ZeroitToxicButton.Invalidate(); RefreshComponent(); }
/// <summary> /// Initializes a new instance of the <see cref="BarItem" /> class with Specified owner of <see cref="BarItem" /> /// </summary> /// <param name="owner">The owner.</param> public BarItem(ZeroitToxicButton owner) { this.owner = owner; caption = GetCaption(); enabled = true; Height = 0; imageIndex = -1; MouseDown = false; MouseOver = false; selected = false; Top = 0; tag = null; toolTipText = caption; appearance = new AppearanceItem(); appearance.AppearanceChanged += OnAppearanceChanged; }
/// <summary> /// Initializes the designer with the specified component. /// </summary> /// <param name="component">The <see cref="T:System.ComponentModel.IComponent" /> to associate with the designer.</param> public override void Initialize(IComponent component) { base.Initialize(component); buttonBar = (ZeroitToxicButton)component; buttonBar.ThemeProperty.ThemeChanged += delegate { RefreshComponent(); }; buttonBar.SelectionChanged += delegate { RefreshComponent(); }; buttonBar.ItemsChanging += delegate { RefreshComponent(); }; buttonBar.ItemsClearing += delegate { RefreshComponent(); }; buttonBar.ItemsInserting += delegate { RefreshComponent(); }; buttonBar.ItemsRemoving += delegate { RefreshComponent(); }; buttonBar.ItemClick += delegate { RefreshComponent(); }; buttonBar.Appearance.Bar.AppearanceChanged += delegate { RefreshComponent(); }; buttonBar.Appearance.Item.AppearanceChanged += delegate { RefreshComponent(); }; designerActionList = new ZeroitToxicButtonDesignerActionList(buttonBar); actionListCollection.Add(designerActionList); }
/// <summary> /// Initializes a new instance of the <see cref="BarItem" /> class. /// </summary> public BarItem() { caption = string.Empty; enabled = true; Height = 0; imageIndex = -1; MouseDown = false; MouseOver = false; owner = null; selected = false; Top = 0; tag = null; toolTipText = string.Empty; appearance = new AppearanceItem(); appearance.AppearanceChanged += OnAppearanceChanged; showBorder = ShowBorder.Inherit; }
/// <summary> /// Imports this instance. /// </summary> protected virtual void Import() { using (var dlg = new OpenFileDialog()) { dlg.Filter = Properties.Resources.XML_FILE; if (dlg.ShowDialog() != DialogResult.OK) { return; } using (var fs = new FileStream(dlg.FileName, FileMode.Open)) { var serializer = new XmlSerializer(typeof(Appearance)); var app = (Zeroit.Framework.MiscControls.Appearance)serializer.Deserialize(fs); ZeroitToxicButton.Appearance.Assign(app); ZeroitToxicButton.SetThemeDefaults(); ZeroitToxicButton.Refresh(); } } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); var barItem1 = new Zeroit.Framework.MiscControls.BarItem(); var barItem2 = new Zeroit.Framework.MiscControls.BarItem(); var barItem3 = new Zeroit.Framework.MiscControls.BarItem(); var barItem4 = new Zeroit.Framework.MiscControls.BarItem(); var barItem5 = new BarItem(); var barItem6 = new BarItem(); this.pnlTop = new System.Windows.Forms.Panel(); this.pnlRight = new System.Windows.Forms.Panel(); this.tabMain = new System.Windows.Forms.TabControl(); this.tpBar = new System.Windows.Forms.TabPage(); this.pgrdBar = new System.Windows.Forms.PropertyGrid(); this.tpItems = new System.Windows.Forms.TabPage(); this.pgrdItem = new System.Windows.Forms.PropertyGrid(); this.lblCurrentStyle = new System.Windows.Forms.Label(); this.pnlLeft = new System.Windows.Forms.Panel(); this.lblReload = new System.Windows.Forms.LinkLabel(); this.lblReset = new System.Windows.Forms.LinkLabel(); this.lblSave = new System.Windows.Forms.LinkLabel(); this.lblLoad = new System.Windows.Forms.LinkLabel(); this.lblPreview = new System.Windows.Forms.Label(); this.bBar = new Zeroit.Framework.MiscControls.ZeroitToxicButton(this.components); this.lblAvailableTheme = new System.Windows.Forms.Label(); this.lblApply = new System.Windows.Forms.LinkLabel(); this.lbxTemplate = new System.Windows.Forms.ListBox(); this.pnlBottom = new System.Windows.Forms.Panel(); this.btnCancel = new System.Windows.Forms.Button(); this.btnOK = new System.Windows.Forms.Button(); this.pnlTop.SuspendLayout(); this.pnlRight.SuspendLayout(); this.tabMain.SuspendLayout(); this.tpBar.SuspendLayout(); this.tpItems.SuspendLayout(); this.pnlLeft.SuspendLayout(); this.pnlBottom.SuspendLayout(); this.SuspendLayout(); // // pnlTop // this.pnlTop.Controls.Add(this.pnlRight); this.pnlTop.Controls.Add(this.pnlLeft); this.pnlTop.Dock = System.Windows.Forms.DockStyle.Top; this.pnlTop.Location = new System.Drawing.Point(0, 0); this.pnlTop.Name = "pnlTop"; this.pnlTop.Size = new System.Drawing.Size(420, 441); this.pnlTop.TabIndex = 0; // // pnlRight // this.pnlRight.Controls.Add(this.tabMain); this.pnlRight.Controls.Add(this.lblCurrentStyle); this.pnlRight.Dock = System.Windows.Forms.DockStyle.Fill; this.pnlRight.Location = new System.Drawing.Point(179, 0); this.pnlRight.Name = "pnlRight"; this.pnlRight.Size = new System.Drawing.Size(241, 441); this.pnlRight.TabIndex = 1; // // tabMain // this.tabMain.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tabMain.Controls.Add(this.tpBar); this.tabMain.Controls.Add(this.tpItems); this.tabMain.Location = new System.Drawing.Point(3, 26); this.tabMain.Name = "tabMain"; this.tabMain.SelectedIndex = 0; this.tabMain.Size = new System.Drawing.Size(235, 409); this.tabMain.TabIndex = 2; // // tpBar // this.tpBar.Controls.Add(this.pgrdBar); this.tpBar.Location = new System.Drawing.Point(4, 22); this.tpBar.Name = "tpBar"; this.tpBar.Padding = new System.Windows.Forms.Padding(3); this.tpBar.Size = new System.Drawing.Size(227, 383); this.tpBar.TabIndex = 0; this.tpBar.Text = global::Zeroit.Framework.MiscControls.Properties.Resources.TAB_BAR; this.tpBar.UseVisualStyleBackColor = true; // // pgrdBar // this.pgrdBar.CommandsVisibleIfAvailable = false; this.pgrdBar.Dock = System.Windows.Forms.DockStyle.Fill; this.pgrdBar.HelpVisible = false; this.pgrdBar.Location = new System.Drawing.Point(3, 3); this.pgrdBar.Name = "pgrdBar"; this.pgrdBar.PropertySort = System.Windows.Forms.PropertySort.NoSort; this.pgrdBar.Size = new System.Drawing.Size(221, 377); this.pgrdBar.TabIndex = 1; this.pgrdBar.ToolbarVisible = false; // // tpItems // this.tpItems.Controls.Add(this.pgrdItem); this.tpItems.Location = new System.Drawing.Point(4, 22); this.tpItems.Name = "tpItems"; this.tpItems.Padding = new System.Windows.Forms.Padding(3); this.tpItems.Size = new System.Drawing.Size(227, 383); this.tpItems.TabIndex = 1; this.tpItems.Text = global::Zeroit.Framework.MiscControls.Properties.Resources.TAB_ITEMS; this.tpItems.UseVisualStyleBackColor = true; // // pgrdItem // this.pgrdItem.CommandsVisibleIfAvailable = false; this.pgrdItem.Dock = System.Windows.Forms.DockStyle.Fill; this.pgrdItem.HelpVisible = false; this.pgrdItem.Location = new System.Drawing.Point(3, 3); this.pgrdItem.Name = "pgrdItem"; this.pgrdItem.PropertySort = System.Windows.Forms.PropertySort.NoSort; this.pgrdItem.Size = new System.Drawing.Size(221, 377); this.pgrdItem.TabIndex = 2; this.pgrdItem.ToolbarVisible = false; // // lblCurrentStyle // this.lblCurrentStyle.AutoSize = true; this.lblCurrentStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle) ((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline)))); this.lblCurrentStyle.Location = new System.Drawing.Point(6, 9); this.lblCurrentStyle.Name = "lblCurrentStyle"; this.lblCurrentStyle.Size = new System.Drawing.Size(80, 13); this.lblCurrentStyle.TabIndex = 0; this.lblCurrentStyle.Text = "Current Style"; // // pnlLeft // this.pnlLeft.Controls.Add(this.lblReload); this.pnlLeft.Controls.Add(this.lblReset); this.pnlLeft.Controls.Add(this.lblSave); this.pnlLeft.Controls.Add(this.lblLoad); this.pnlLeft.Controls.Add(this.lblPreview); this.pnlLeft.Controls.Add(this.bBar); this.pnlLeft.Controls.Add(this.lblAvailableTheme); this.pnlLeft.Controls.Add(this.lblApply); this.pnlLeft.Controls.Add(this.lbxTemplate); this.pnlLeft.Dock = System.Windows.Forms.DockStyle.Left; this.pnlLeft.Location = new System.Drawing.Point(0, 0); this.pnlLeft.Name = "pnlLeft"; this.pnlLeft.Size = new System.Drawing.Size(179, 441); this.pnlLeft.TabIndex = 0; // // lblReload // this.lblReload.AutoSize = true; this.lblReload.Location = new System.Drawing.Point(6, 213); this.lblReload.Name = "lblReload"; this.lblReload.Size = new System.Drawing.Size(41, 13); this.lblReload.TabIndex = 8; this.lblReload.TabStop = true; this.lblReload.Text = "Re&load"; this.lblReload.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnReloadClicked); // // lblReset // this.lblReset.AutoSize = true; this.lblReset.Location = new System.Drawing.Point(6, 194); this.lblReset.Name = "lblReset"; this.lblReset.Size = new System.Drawing.Size(35, 13); this.lblReset.TabIndex = 7; this.lblReset.TabStop = true; this.lblReset.Text = "&Reset"; this.lblReset.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnResetClick); // // lblSave // this.lblSave.AutoSize = true; this.lblSave.Location = new System.Drawing.Point(6, 175); this.lblSave.Name = "lblSave"; this.lblSave.Size = new System.Drawing.Size(68, 13); this.lblSave.TabIndex = 6; this.lblSave.TabStop = true; this.lblSave.Text = "&Save Theme"; this.lblSave.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnSaveClick); // // lblLoad // this.lblLoad.AutoSize = true; this.lblLoad.Location = new System.Drawing.Point(6, 156); this.lblLoad.Name = "lblLoad"; this.lblLoad.Size = new System.Drawing.Size(67, 13); this.lblLoad.TabIndex = 5; this.lblLoad.TabStop = true; this.lblLoad.Text = "&Load Theme"; this.lblLoad.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnLoadClick); // // lblPreview // this.lblPreview.AutoSize = true; this.lblPreview.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle) ((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline)))); this.lblPreview.Location = new System.Drawing.Point(6, 234); this.lblPreview.Name = "lblPreview"; this.lblPreview.Size = new System.Drawing.Size(52, 13); this.lblPreview.TabIndex = 3; this.lblPreview.Text = "Preview"; // // bBar // this.bBar.AutoScroll = true; this.bBar.AutoScrollMinSize = new System.Drawing.Size(0, 165); this.bBar.ButtonWidth = 150; barItem1.Caption = global::Zeroit.Framework.MiscControls.Properties.Resources.NORMAL_TEXT; barItem1.Selected = true; barItem1.Tag = "0"; barItem1.ToolTipText = global::Zeroit.Framework.MiscControls.Properties.Resources.NORMAL_TEXT; barItem2.Caption = global::Zeroit.Framework.MiscControls.Properties.Resources.DISABLED_TEXT; barItem2.Tag = "1"; barItem2.ToolTipText = global::Zeroit.Framework.MiscControls.Properties.Resources.DISABLED_TEXT; barItem3.Caption = global::Zeroit.Framework.MiscControls.Properties.Resources.SELECTED_TEXT; barItem3.Tag = "2"; barItem3.ToolTipText = global::Zeroit.Framework.MiscControls.Properties.Resources.SELECTED_TEXT; barItem4.Caption = global::Zeroit.Framework.MiscControls.Properties.Resources.CLICKED_TEXT; barItem4.Tag = "3"; barItem4.ToolTipText = global::Zeroit.Framework.MiscControls.Properties.Resources.CLICKED_TEXT; barItem5.Caption = global::Zeroit.Framework.MiscControls.Properties.Resources.HOVERED_TEXT; barItem5.Tag = "4"; barItem5.ToolTipText = global::Zeroit.Framework.MiscControls.Properties.Resources.HOVERED_TEXT; barItem6.Caption = global::Zeroit.Framework.MiscControls.Properties.Resources.SELECTED_HOVER_TEXT; barItem6.Tag = "5"; barItem6.ToolTipText = global::Zeroit.Framework.MiscControls.Properties.Resources.SELECTED_HOVER_TEXT; this.bBar.Items.AddRange(new Zeroit.Framework.MiscControls.BarItem[] { barItem1, barItem2, barItem3, barItem4, barItem5, barItem6 }); this.bBar.Location = new System.Drawing.Point(7, 250); this.bBar.Name = "bBar"; this.bBar.Padding = new System.Windows.Forms.Padding(3); this.bBar.Size = new System.Drawing.Size(150, 189); this.bBar.TabIndex = 4; this.bBar.Text = "Button Bar"; this.bBar.ThemeProperty.UseTheme = false; this.bBar.CustomDrawItems += new System.EventHandler <Zeroit.Framework.MiscControls.DrawItemsEventArgs>(this.OnCustomDrawItems); this.bBar.SelectionChanging += new Zeroit.Framework.MiscControls.ItemChangingHandler(this.OnSelectionChanging); // // lblAvailableTheme // this.lblAvailableTheme.AutoSize = true; this.lblAvailableTheme.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle) ((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline)))); this.lblAvailableTheme.Location = new System.Drawing.Point(6, 8); this.lblAvailableTheme.Name = "lblAvailableTheme"; this.lblAvailableTheme.Size = new System.Drawing.Size(103, 13); this.lblAvailableTheme.TabIndex = 0; this.lblAvailableTheme.Text = "Available themes"; // // lblApply // this.lblApply.AutoSize = true; this.lblApply.Location = new System.Drawing.Point(6, 137); this.lblApply.Name = "lblApply"; this.lblApply.Size = new System.Drawing.Size(117, 13); this.lblApply.TabIndex = 2; this.lblApply.TabStop = true; this.lblApply.Text = "&Apply to current Theme"; this.lblApply.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnApplyClick); // // lbxTemplate // this.lbxTemplate.FormattingEnabled = true; this.lbxTemplate.Location = new System.Drawing.Point(7, 26); this.lbxTemplate.Name = "lbxTemplate"; this.lbxTemplate.Size = new System.Drawing.Size(165, 108); this.lbxTemplate.TabIndex = 1; // // pnlBottom // this.pnlBottom.Controls.Add(this.btnCancel); this.pnlBottom.Controls.Add(this.btnOK); this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Fill; this.pnlBottom.Location = new System.Drawing.Point(0, 441); this.pnlBottom.Name = "pnlBottom"; this.pnlBottom.Size = new System.Drawing.Size(420, 33); this.pnlBottom.TabIndex = 1; // // btnCancel // this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnCancel.Location = new System.Drawing.Point(333, 6); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(75, 23); this.btnCancel.TabIndex = 1; this.btnCancel.Text = global::Zeroit.Framework.MiscControls.Properties.Resources.BTN_CANCEL; this.btnCancel.UseVisualStyleBackColor = true; this.btnCancel.Click += new System.EventHandler(this.OnCancelClick); // // btnOK // this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; this.btnOK.Location = new System.Drawing.Point(252, 6); this.btnOK.Name = "btnOK"; this.btnOK.Size = new System.Drawing.Size(75, 23); this.btnOK.TabIndex = 0; this.btnOK.Text = global::Zeroit.Framework.MiscControls.Properties.Resources.BTN_OK; this.btnOK.UseVisualStyleBackColor = true; this.btnOK.Click += new System.EventHandler(this.OnOKClick); // // AppearanceEditorUI // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(420, 474); this.Controls.Add(this.pnlBottom); this.Controls.Add(this.pnlTop); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "AppearanceEditorUI"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Appearance Editor"; this.pnlTop.ResumeLayout(false); this.pnlRight.ResumeLayout(false); this.pnlRight.PerformLayout(); this.tabMain.ResumeLayout(false); this.tpBar.ResumeLayout(false); this.tpItems.ResumeLayout(false); this.pnlLeft.ResumeLayout(false); this.pnlLeft.PerformLayout(); this.pnlBottom.ResumeLayout(false); this.ResumeLayout(false); }
/// <summary> /// Shows the borders. /// </summary> protected virtual void ShowBorders() { ZeroitToxicButton.ShowBorders = !ZeroitToxicButton.ShowBorders; ZeroitToxicButton.Invalidate(); RefreshComponent(); }