private void AddTaskItem(Expando ep) { dt.DefaultView.RowFilter = "parentNo = '" + ep.Tag.ToString() + "'"; for (int i = 0; i < dt.DefaultView.Count; i++) { TaskItem taskItem = new TaskItem(); taskItem.Name = dt.DefaultView[i]["formName"].ToString(); taskItem.Text = dt.DefaultView[i]["menuName"].ToString(); taskItem.Tag = dt.DefaultView[i]["menuNo"]; //taskItem.Click += new EventHandler(taskItem_Click); ep.Items.Add(taskItem); } }
private void AddExpando() { dt.DefaultView.RowFilter = "isModel =1"; for (int i = 0; i < dt.DefaultView.Count; i++) { Expando expando = new Expando(); expando.ItemClick += new System.EventHandler(expando_ItemClick); expando.StateChanged += new ExpandoEventHandler(expando_StateChanged); expando.AutoLayout = true; expando.Name = dt.DefaultView[i]["picture"].ToString(); expando.Tag = dt.DefaultView[i]["menuNo"]; AddTaskItem(expando); expando.Collapsed = true; expando.CustomSettings.NormalBackColor = HDIC_Command.setColor(); taskPane1.Expandos.Add(expando); dt.DefaultView.RowFilter = "isModel =1"; } }
private void frmMenuExplorer_Load(object sender, EventArgs e) { //Create the Group Vible Panel Commands foreach (PluginGroup mg in ContextManager.Context.GetPluginManager().Groups) { if (mg.Visible == 1) { Expando _Expando = new Expando(); _Expando.Text = mg.Name; _Expando.TitleImage = mg.Image; _Expando.Animate = true; _Expando.AutoLayout = true; _Expando.SpecialGroup = true; _Expando.ForeColor = Color.Black; _tpKonekti.Expandos.Add(_Expando); foreach (PluginCommand cm in mg.Commands) { if (cm.Visible == 1) { TaskItem _CurrentTaskItem = new TaskItem(); _CurrentTaskItem.Text = cm.Name; _CurrentTaskItem.Image = cm.Image; _CurrentTaskItem.Tag = cm.Id; //Save the plugin _CurrentTaskItem.Click += new EventHandler(_CurrentGroupMenu_Click); _Expando.Items.Add(_CurrentTaskItem); } } } } // foreverblue.dll is a cut down version of the the // forever blue theme. do not attempt to use this as // a proper theme for XP as Windows may crash due to // several images being removed from the dll to keep // file sizes down. the original forever blue theme // can be found at http://www.themexp.org/ this._tpKonekti.UseCustomTheme(ContextManager.Context.GetAppPath() + "foreverblue.dll"); }
private void CreateRulesUI() { Expando groupPanel; foreach (ReplacementRulesGroup group in this.rules.RuleGroups) { groupPanel = new Expando(); groupPanel.CustomSettings.NormalBackColor = Color.FromArgb(255, 214, 223, 247); groupPanel.CustomSettings.NormalBorder.Bottom = 1; groupPanel.CustomSettings.NormalBorder.Left = 1; groupPanel.CustomSettings.NormalBorder.Right = 1; groupPanel.CustomSettings.NormalBorder.Top = 0; groupPanel.CustomSettings.NormalBorderColor = Color.White; groupPanel.CustomSettings.NormalPadding = new XPExplorerBar.Padding(0, 0, 0, 0); groupPanel.CustomSettings.SpecialBackColor = Color.FromArgb(255, 239, 243, 255); groupPanel.CustomSettings.SpecialBorder.Bottom = 1; groupPanel.CustomSettings.SpecialBorder.Left = 1; groupPanel.CustomSettings.SpecialBorder.Right = 1; groupPanel.CustomSettings.SpecialBorder.Top = 0; groupPanel.CustomSettings.SpecialBorderColor = Color.White; groupPanel.CustomSettings.SpecialPadding = new XPExplorerBar.Padding(12, 10, 12, 10); groupPanel.Padding.Left = 0; groupPanel.Padding.Top = 0; groupPanel.Padding.Right = 0; groupPanel.Padding.Bottom = 0; groupPanel.Margin = new Padding(0, 0, 0, 0); groupPanel.SystemSettings.TaskItem.FontDecoration = FontStyle.Underline; groupPanel.SystemSettings.TaskItem.HotLinkColor = Color.FromArgb(255, 66, 142, 255); groupPanel.SystemSettings.TaskItem.LinkColor = Color.FromArgb(255, 33, 93, 198); groupPanel.SystemSettings.TaskItem.Margin = new Margin(0, 0, 0, 0); groupPanel.SystemSettings.TaskItem.Padding = new XPExplorerBar.Padding(6, 0, 4, 0); groupPanel.CustomHeaderSettings.GradientOffset = (float)0.5; groupPanel.CustomHeaderSettings.Margin = 15; groupPanel.CustomHeaderSettings.NormalAlignment = ContentAlignment.MiddleLeft; groupPanel.CustomHeaderSettings.NormalBackColor = Color.Transparent; groupPanel.CustomHeaderSettings.NormalBorder.Bottom = 0; groupPanel.CustomHeaderSettings.NormalBorder.Top = 2; groupPanel.CustomHeaderSettings.NormalBorder.Left = 2; groupPanel.CustomHeaderSettings.NormalBorder.Right = 2; groupPanel.CustomHeaderSettings.NormalBorderColor = Color.FromArgb(255, 198, 211, 247); groupPanel.CustomHeaderSettings.NormalGradientEndColor = Color.FromArgb(255, 49, 106, 197); groupPanel.CustomHeaderSettings.NormalGradientStartColor = Color.White; groupPanel.CustomHeaderSettings.NormalPadding = new XPExplorerBar.Padding(10, 0, 1, 0); groupPanel.CustomHeaderSettings.NormalTitleColor = Color.FromArgb(255, 33, 93, 198); groupPanel.CustomHeaderSettings.NormalTitleHotColor = Color.FromArgb(255, 66, 142, 255); groupPanel.CustomHeaderSettings.SpecialBackColor = Color.Transparent; groupPanel.CustomHeaderSettings.SpecialBorder.Bottom = 0; groupPanel.CustomHeaderSettings.SpecialBorder.Top = 2; groupPanel.CustomHeaderSettings.SpecialBorder.Left = 2; groupPanel.CustomHeaderSettings.SpecialBorder.Right = 2; groupPanel.CustomHeaderSettings.SpecialGradientEndColor = Color.FromArgb(255, 49, 106, 197); groupPanel.CustomHeaderSettings.SpecialGradientStartColor = Color.White; groupPanel.CustomHeaderSettings.SpecialPadding = new XPExplorerBar.Padding(10, 0, 0, 0); groupPanel.CustomHeaderSettings.SpecialTitleColor = Color.White; groupPanel.CustomHeaderSettings.SpecialTitleHotColor = Color.FromArgb(255, 66, 142, 255); groupPanel.CustomHeaderSettings.TitleFont = new Font("Tahoma", 8); groupPanel.CustomHeaderSettings.TitleRadius = 5; groupPanel.CustomHeaderSettings.TitleGradient = true; groupPanel.AutoLayout = true; groupPanel.ContextMenuStrip = this.groupPanelContextMenu; groupPanel.AllowDrop = true; groupPanel.DragEnter += this.GroupPanel_DragEnter; groupPanel.DragDrop += this.GroupPanel_DragDrop; ReplacementRuleUI rulePanel; for (int rulePos = 0; rulePos < group.Rules.Count; rulePos++) { rulePanel = new ReplacementRuleUI(group.Rules[rulePos], this.TagNames, groupPanel); Button deleteRule = new Button { Location = new Point(763, 3), Name = "deleteRule", Size = new Size(80, 20), AutoSizeMode = AutoSizeMode.GrowOnly, AutoSize = true, TabIndex = 6, Text = "Delete rule" }; deleteRule.Click += this.DeleteRule_Click; rulePanel.Width = rulePanel.Width + deleteRule.Bounds.Width + rulePanel.Margin.Horizontal; rulePanel.Controls.Add(deleteRule); groupPanel.Items.Add(rulePanel); } this.taskPane1.Expandos.Add(groupPanel); } }
/// <summary> /// Initializes a new instance of the ExpandoInfo class with default settings /// </summary> public ExpandoInfo() { // set background color values this.specialBackColor = Color.Transparent; this.normalBackColor = Color.Transparent; // set border values this.specialBorder = new Border(1, 0, 1, 1); this.specialBorderColor = Color.Transparent; this.normalBorder = new Border(1, 0, 1, 1); this.normalBorderColor = Color.Transparent; // set padding values this.specialPadding = new Padding(12, 10, 12, 10); this.normalPadding = new Padding(12, 10, 12, 10); this.specialBackImage = null; this.normalBackImage = null; this.watermarkAlignment = ContentAlignment.BottomRight; this.owner = null; }
private void SetExpandoImage(Expando exp, Bitmap collapsed, Bitmap expanded) { if (exp.Collapsed) { exp.CustomHeaderSettings.NormalBackImage = collapsed; } else { exp.CustomHeaderSettings.NormalBackImage = expanded; } }
/// <summary> /// Checks the height. /// </summary> /// <param name="expando">The expando.</param> /// <remarks>Documented by Dev05</remarks> private void CheckHeight(Expando expando) { if (Loading) return; while (taskPaneInformations.PreferredSize.Height > taskPaneInformations.Height) { foreach (Expando exp in CollabsidableExpandos) { if (FirstUse && exp == expandoTreeView) continue; if (exp != expando && !exp.Collapsed) { exp.Collapsed = true; break; } } if (CollabsidableExpandos.Count == 0) return; } }
/// <summary> /// Initializes a new instance of the ExpandoEventArgs class with specific Expando /// </summary> /// <param name="expando">The Expando that generated the event</param> public ExpandoEventArgs(Expando expando) { this.expando = expando; }
private ReplacementRulesGroup GetRulesGroupFromGroupPanel(Expando groupPanel) { int groupIndex = this.taskPane1.Expandos.IndexOf(groupPanel); return this.rules.RuleGroups[groupIndex]; }
/// <summary> /// Initializes a new instance of the Expando.ItemCollection class /// </summary> /// <param name="owner">An Expando representing the expando that owns /// the Control collection</param> public ItemCollection(Expando owner) : base() { if (owner == null) { throw new ArgumentNullException("owner"); } this.owner = owner; }
/// <summary> /// Initializes a new instance of the ExpandoEventArgs class with default settings /// </summary> public ExpandoEventArgs() { expando = null; }
/// <summary> /// Returns an Expando that contains the deserialized ExpandoSurrogate data /// </summary> /// <returns>An Expando that contains the deserialized ExpandoSurrogate data</returns> public Expando Save() { Expando expando = new Expando(); ((ISupportInitialize) expando).BeginInit(); expando.SuspendLayout(); expando.Name = this.Name; expando.Text = this.Text; expando.Size = this.Size; expando.Location = this.Location; expando.BackColor = ThemeManager.ConvertStringToColor(this.BackColor); expando.ExpandedHeight = this.ExpandedHeight; expando.customSettings = this.CustomSettings.Save(); expando.customSettings.Expando = expando; expando.customHeaderSettings = this.CustomHeaderSettings.Save(); expando.customHeaderSettings.Expando = expando; expando.TitleImage = ThemeManager.ConvertByteArrayToImage(this.TitleImage); expando.Watermark = ThemeManager.ConvertByteArrayToImage(this.Watermark); expando.Animate = this.Animate; expando.ShowFocusCues = this.ShowFocusCues; expando.Collapsed = this.Collapsed; expando.CanCollapse = this.CanCollapse; expando.SpecialGroup = this.SpecialGroup; expando.Enabled = this.Enabled; expando.Visible = this.Visible; expando.AutoLayout = this.AutoLayout; expando.Anchor = this.Anchor; expando.Dock = this.Dock; expando.Font = new Font(this.FontName, this.FontSize, this.FontDecoration); expando.Tag = ThemeManager.ConvertByteArrayToObject(this.Tag); foreach (Object o in this.Items) { TaskItem ti = ((TaskItem.TaskItemSurrogate) o).Save(); expando.Items.Add(ti); } ((ISupportInitialize) expando).EndInit(); expando.ResumeLayout(false); return expando; }
/// <summary> /// Populates the ExpandoSurrogate with data that is to be /// serialized from the specified Expando /// </summary> /// <param name="expando">The Expando that contains the data /// to be serialized</param> public void Load(Expando expando) { this.Name = expando.Name; this.Text = expando.Text; this.Size = expando.Size; this.Location = expando.Location; this.BackColor = ThemeManager.ConvertColorToString(expando.BackColor); this.ExpandedHeight = expando.ExpandedHeight; this.CustomSettings = new ExpandoInfo.ExpandoInfoSurrogate(); this.CustomSettings.Load(expando.CustomSettings); this.CustomHeaderSettings = new HeaderInfo.HeaderInfoSurrogate(); this.CustomHeaderSettings.Load(expando.CustomHeaderSettings); this.Animate = expando.Animate; this.ShowFocusCues = expando.ShowFocusCues; this.Collapsed = expando.Collapsed; this.CanCollapse = expando.CanCollapse; this.SpecialGroup = expando.SpecialGroup; this.TitleImage = ThemeManager.ConvertImageToByteArray(expando.TitleImage); this.Watermark = ThemeManager.ConvertImageToByteArray(expando.Watermark); this.Enabled = expando.Enabled; this.Visible = expando.Visible; this.AutoLayout = expando.AutoLayout; this.Anchor = expando.Anchor; this.Dock = expando.Dock; this.FontName = expando.Font.FontFamily.Name; this.FontSize = expando.Font.SizeInPoints; this.FontDecoration = expando.Font.Style; this.Tag = ThemeManager.ConvertObjectToByteArray(expando.Tag); for (int i=0; i<expando.Items.Count; i++) { if (expando.Items[i] is TaskItem) { TaskItem.TaskItemSurrogate tis = new TaskItem.TaskItemSurrogate(); tis.Load((TaskItem) expando.Items[i]); this.Items.Add(tis); } } }
/// <summary> /// Releases all resources used by the AnimationHelper /// </summary> public void Dispose() { if (this.animationTimer != null) { this.animationTimer.Stop(); this.animationTimer.Dispose(); this.animationTimer = null; } this.expando = null; }
/// <summary> /// Initializes a new instance of the AnimationHelper class with the specified settings /// </summary> /// <param name="expando">The Expando to be animated</param> /// <param name="animationType">The type of animation to perform</param> public AnimationHelper(Expando expando, int animationType) { this.expando = expando; this.animationType = animationType; this.animating = false; this.numAnimationSteps = NumAnimationFrames; this.animationFrameInterval = 10; // I know that this isn't the best way to do this, but I // haven't quite worked out how to do it with threads so // this will have to do for the moment this.animationTimer = new System.Windows.Forms.Timer(); this.animationTimer.Tick += new EventHandler(this.animationTimer_Tick); this.animationTimer.Interval = this.animationFrameInterval; }
/// <summary> /// Adds an array of expando objects to the collection /// </summary> /// <param name="expandos">An array of Expando objects to add /// to the collection</param> public void AddRange(Expando[] expandos) { if (expandos == null) { throw new ArgumentNullException("expandos"); } for (int i=0; i<expandos.Length; i++) { this.Add(expandos[i]); } }
private void SetExpandoCollapsed(Expando ExpandedExpando) { if (!ExpandedExpando.Collapsed) { foreach (Expando exp in taskPane1.Expandos) { if (exp != ExpandedExpando) { exp.Collapsed = true; } } } }
/// <summary> /// Calculates where the specified Expando should be located /// </summary> /// <returns>A Point that specifies where the Expando should /// be located</returns> protected internal Point CalcExpandoLocation(Expando target) { if (target == null) { throw new ArgumentNullException("target"); } int targetIndex = this.Expandos.IndexOf(target); Expando e; Point p; int y = this.DisplayRectangle.Y + this.Padding.Top; int width = this.ClientSize.Width - this.Padding.Left - this.Padding.Right; for (int i=0; i<targetIndex; i++) { e = this.Expandos[i]; if (!e.Visible) { continue; } p = new Point(this.Padding.Left, y); y += e.Height + this.Padding.Bottom; } return new Point(this.Padding.Left, y); }
/// <summary> /// "Drops" the specified Expando and moves it to the current drop point /// </summary> /// <param name="expando">The Expando to be "dropped"</param> internal void DropExpando(Expando expando) { if (this.dropPoint == Point.Empty) { return; } if (expando != null && expando.TaskPane == this) { int i = 0; int expandoIndex = this.Expandos.IndexOf(expando); for (; i<this.Expandos.Count; i++) { if (this.dropPoint.Y <= this.Expandos[i].Top) { if (i > expandoIndex) { this.Expandos.Move(expando, i-1); } else if (i < expandoIndex) { this.Expandos.Move(expando, i); } break; } } if (i == this.Expandos.Count) { this.Expandos.Move(expando, i); } } this.dropPoint = Point.Empty; this.Invalidate(false); }
/// <summary> /// Removes the specified expando from the expando collection /// </summary> /// <param name="value">The Expando to remove from the /// TaskPane.ExpandoCollection</param> public void Remove(Expando value) { if (value == null) { throw new ArgumentNullException("value"); } this.List.Remove(value); this.owner.Controls.Remove(value); this.owner.OnExpandoRemoved(new ExpandoEventArgs(value)); }
/// <summary> /// Collaspes all the Expandos contained in the TaskPane, /// except for the specified Expando which is expanded /// </summary> /// <param name="expando">The Expando that is to be expanded</param> // suggested by: PaleyX ([email protected]) // 03/06/2004 // v1.1 public void CollapseAllButOne(Expando expando) { foreach (Expando e in this.Expandos) { if (e != expando) { e.Collapsed = true; } else { expando.Collapsed = false; } } }
/// <summary> /// Moves the specified expando to the top of the expando collection /// </summary> /// <param name="value">The expando to be moved</param> public void MoveToTop(Expando value) { this.Move(value, 0); }
/// <summary> /// Moves the specified expando to the bottom of the expando collection /// </summary> /// <param name="value">The expando to be moved</param> public void MoveToBottom(Expando value) { this.Move(value, this.Count); }
/// <summary> /// Moves the specified expando to the specified indexed location /// in the expando collection /// </summary> /// <param name="value">The expando to be moved</param> /// <param name="index">The indexed location in the expando collection /// that the specified expando will be moved to</param> public void Move(Expando value, int index) { if (value == null) { throw new ArgumentNullException("value"); } // make sure the index is within range if (index < 0) { index = 0; } else if (index > this.Count) { index = this.Count; } // don't go any further if the expando is already // in the desired position or we don't contain it if (!this.Contains(value) || this.IndexOf(value) == index) { return; } this.List.Remove(value); // if the index we're supposed to move the expando to // is now greater to the number of expandos contained, // add it to the end of the list, otherwise insert it at // the specified index if (index > this.Count) { this.List.Add(value); } else { this.List.Insert(index, value); } // re-layout the controls this.owner.MatchControlCollToExpandoColl(); }
/// <summary> /// Retrieves the index of the specified expando in the expando /// collection /// </summary> /// <param name="expando">The Expando to locate in the collection</param> /// <returns>A zero-based index value that represents the position /// of the specified Expando in the TaskPane.ExpandoCollection</returns> public int IndexOf(Expando expando) { if (expando == null) { throw new ArgumentNullException("expando"); } for (int i=0; i<this.Count; i++) { if (this[i] == expando) { return i; } } return -1; }
public ReplacementRuleUI(ReplacementRule rule, string[] tagNames, Expando owner) { this.rule = rule; this.owner = owner; this.FlowDirection = FlowDirection.LeftToRight; this.MouseDown += this.RuleUIMouseDown; this.InitializeComponent(); this.tagName2.Items.Add("<>"); this.tagName3.Items.Add("<>"); this.tagName1.Items.AddRange(tagNames); this.tagName2.Items.AddRange(tagNames); this.tagName3.Items.AddRange(tagNames); this.tagName1.DataBindings.Add("Text", this.rule, "TagName1"); this.tagName2.DataBindings.Add("Text", this.rule, "TagName2"); this.tagName3.DataBindings.Add("Text", this.rule, "TagName3"); this.tagValue1.DataBindings.Add("Text", this.rule, "TagValue1"); this.tagValue2.DataBindings.Add("Text", this.rule, "TagValue2"); this.tagValue3.DataBindings.Add("Text", this.rule, "TagValue3"); }
/// <summary> /// Initializes a new instance of the HeaderInfo class with default settings /// </summary> public HeaderInfo() { // work out the default font name for the user's os. // this ignores other fonts that may be specified - need // to change parser to get font names if (Environment.OSVersion.Version.Major >= 5) { // Win2k, XP, Server 2003 this.titleFont = new Font("Tahoma", 8.25f, FontStyle.Bold); } else { // Win9x, ME, NT this.titleFont = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold); } this.margin = 15; // set title colors and alignment this.specialTitle = Color.Transparent; this.specialTitleHot = Color.Transparent; this.normalTitle = Color.Transparent; this.normalTitleHot = Color.Transparent; this.specialAlignment = ContentAlignment.MiddleLeft; this.normalAlignment = ContentAlignment.MiddleLeft; // set padding values this.specialPadding = new Padding(10, 0, 1, 0); this.normalPadding = new Padding(10, 0, 1, 0); // set border values this.specialBorder = new Border(2, 2, 2, 0); this.specialBorderColor = Color.Transparent; this.normalBorder = new Border(2, 2, 2, 0); this.normalBorderColor = Color.Transparent; this.specialBackColor = Color.Transparent; this.normalBackColor = Color.Transparent; // set background image values this.specialBackImage = null; this.normalBackImage = null; this.backImageWidth = -1; this.backImageHeight = -1; // set arrow values this.specialArrowUp = null; this.specialArrowUpHot = null; this.specialArrowDown = null; this.specialArrowDownHot = null; this.normalArrowUp = null; this.normalArrowUpHot = null; this.normalArrowDown = null; this.normalArrowDownHot = null; this.useTitleGradient = false; this.specialGradientStartColor = Color.White; this.specialGradientEndColor = SystemColors.Highlight; this.normalGradientStartColor = Color.White; this.normalGradientEndColor = SystemColors.Highlight; this.gradientOffset = 0.5f; this.titleRadius = 5; this.owner = null; this.rightToLeft = false; }
/// <summary> /// Determines whether the specified expando is a member of the /// collection /// </summary> /// <param name="expando">The Expando to locate in the collection</param> /// <returns>true if the Expando is a member of the collection; /// otherwise, false</returns> public bool Contains(Expando expando) { if (expando == null) { throw new ArgumentNullException("expando"); } return (this.IndexOf(expando) != -1); }