protected override void AddChildNodes(object customizer, Gtk.TreeIter iter, IDialogPanelDescriptor descriptor) { if (descriptor.ID != "Configurations") { base.AddChildNodes (customizer, iter, descriptor); } else { FillConfigurations (iter); } }
int GetPanelNumber(string id) { for (int i = 0; i < wizardPanels.Count; ++i) { IDialogPanelDescriptor descriptor = (IDialogPanelDescriptor)wizardPanels[i]; if (descriptor.ID == id) { return(i); } } return(-1); }
void SetOptionPanelTo(TreeNode node) { IDialogPanelDescriptor descriptor = node.Tag as IDialogPanelDescriptor; if (descriptor != null && descriptor.DialogPanel != null && descriptor.DialogPanel.Control != null) { descriptor.DialogPanel.ReceiveDialogMessage(DialogMessage.Activated); ControlDictionary["optionControlPanel"].Controls.Clear(); ControlDictionary["optionControlPanel"].Controls.Add(descriptor.DialogPanel.Control); optionsPanelLabel.Text = descriptor.Label; } }
protected void SetOptionPanelTo(TreeNode node) { IDialogPanelDescriptor descriptor = node.Tag as IDialogPanelDescriptor; if (descriptor != null && descriptor.DialogPanel != null && descriptor.DialogPanel.Control != null) { if (!OptionPanels.Contains(descriptor.DialogPanel)) { descriptor.DialogPanel.Control.Dock = DockStyle.Fill; OptionPanels.Add(descriptor.DialogPanel); } descriptor.DialogPanel.ReceiveDialogMessage(DialogMessage.Activated); ControlDictionary["optionControlPanel"].Controls.Clear(); RightToLeftConverter.ConvertRecursive(descriptor.DialogPanel.Control); ControlDictionary["optionControlPanel"].Controls.Add(descriptor.DialogPanel.Control); optionsPanelLabel.Text = descriptor.Label; } }
/// <summary> /// Creates an item with the specified sub items. And the current /// Condition status for this item. /// </summary> public override object BuildItem(object owner, ArrayList subItems, ConditionCollection conditions) { IDialogPanelDescriptor newItem = null; StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService)); if (subItems == null || subItems.Count == 0) { if (Class != null) { newItem = new DefaultDialogPanelDescriptor(ID, stringParserService.Parse(Label), (IDialogPanel)AddIn.CreateObject(Class)); } else { newItem = new DefaultDialogPanelDescriptor(ID, stringParserService.Parse(Label)); } } else { newItem = new DefaultDialogPanelDescriptor(ID, stringParserService.Parse(Label), subItems); } return(newItem); }
protected override void OnPaint(PaintEventArgs pe) { // base.OnPaint(pe); Graphics g = pe.Graphics; g.DrawString(ResourceService.GetString("SharpDevelop.Gui.Dialogs.WizardDialog.StepsLabel"), smallFont, SystemBrushes.WindowText, 10, 24 - smallFont.Height); g.DrawLine(SystemPens.WindowText, 10, 24, Width - 10, 24); int curNumber = 0; for (int i = 0; i < wizard.WizardPanels.Count; i = wizard.GetSuccessorNumber(i)) { Font curFont = wizard.ActivePanelNumber == i ? boldFont : normalFont; IDialogPanelDescriptor descriptor = ((IDialogPanelDescriptor)wizard.WizardPanels[i]); g.DrawString((1 + curNumber) + ". " + descriptor.Label, curFont, SystemBrushes.WindowText, 10, 40 + curNumber * curFont.Height); ++curNumber; } }
protected void SetOptionPanelTo(IDialogPanelDescriptor descriptor) { if (descriptor != null && descriptor.DialogPanel != null) { descriptor.DialogPanel.ReceiveDialogMessage(DialogMessage.Activated); mainBook.CurrentPage = mainBook.PageNum (descriptor.DialogPanel.Control); if (descriptor.DialogPanel.Icon == null) { panelImage.Stock = Gtk.Stock.Preferences; } else { //FIXME: this needs to actually switch over the ImageType and use that instead of this *hack* if (descriptor.DialogPanel.Icon.Stock != null) panelImage.Stock = descriptor.DialogPanel.Icon.Stock; else panelImage.Pixbuf = descriptor.DialogPanel.Icon.Pixbuf; } optionTitle.Markup = "<span weight=\"bold\" size=\"x-large\">" + descriptor.Label + "</span>"; TreeViewOptionDialog.ShowAll (); } }
protected virtual void OnSelectNode(Gtk.TreeIter iter, IDialogPanelDescriptor descriptor) { if (treeStore.IterHasChild (iter) && (descriptor == null || descriptor.DialogPanel == null)) { Gtk.TreeIter new_iter; treeStore.IterChildren (out new_iter, iter); Gtk.TreePath new_path = treeStore.GetPath (new_iter); TreeView.ExpandToPath (new_path); TreeView.Selection.SelectPath (new_path); } else { SetOptionPanelTo (descriptor); } }
protected virtual void AddNode(string label, object customizer, Gtk.TreeIter iter, IDialogPanelDescriptor descriptor) { if (descriptor.DialogPanel != null) { // may be null, if it is only a "path" descriptor.DialogPanel.CustomizationObject = customizer; ((Gtk.Frame)descriptor.DialogPanel.Control).Shadow = Gtk.ShadowType.None; OptionPanels.Add (descriptor.DialogPanel); mainBook.AppendPage (descriptor.DialogPanel.Control, new Gtk.Label ("a")); } Gtk.TreeIter i; if (iter.Equals (Gtk.TreeIter.Zero)) { i = treeStore.AppendValues (label, descriptor); } else { i = treeStore.AppendValues (iter, label, descriptor); } AddChildNodes (customizer, i, descriptor); }
protected virtual void AddChildNodes(object customizer, Gtk.TreeIter iter, IDialogPanelDescriptor descriptor) { if (descriptor.DialogPanelDescriptors != null) { AddNodes (customizer, iter, descriptor.DialogPanelDescriptors); } }
protected override void OnSelectNode(Gtk.TreeIter iter, IDialogPanelDescriptor descriptor) { base.OnSelectNode (iter, descriptor); if (descriptor != null && descriptor.ID == "Configurations") { Gtk.TreePath path = treeStore.GetPath (iter); TreeView.ExpandRow (path, false); } }