/// <summary> /// Creates a new instance of the Selectbutton. /// </summary> /// <param name="ext">The extension that should be displayed by the Selector.</param> /// <param name="parentForm">The form of which this EdButton is a part.</param> public SelectButton(string ext, string folder, DynamicProjectForm parentForm) { InitializeComponent(); this._ext = ext; this._folder = folder; this._parentForm = parentForm; }
/// <summary> /// Creates a new instance of the ListSelectOption. /// </summary> /// <param name="xmlNode">The xmlNode that contains the data for the list</param> /// <param name="xsdNode">The corresponding xsdNode</param> /// <param name="p">The panel on which the option should be placed</param> /// <param name="ordered">Whether the list should be ordered or not.</param> public DocUIFileList(XmlNode xmlNode, XmlSchemaAnnotated xsdNode, Panel contentpanel, Panel overlaypanel, DynamicProjectForm parentForm) : base(xmlNode, xsdNode, contentpanel, overlaypanel, parentForm) { //init variables this.parentForm = parentForm; this.projectpath = parentForm.ProjectSystem.WorkingDirectory.FullName; ext = XmlSchemaUtilities.tryGetUnhandledAttribute(xsdNode, "ext"); folder = XmlSchemaUtilities.tryGetUnhandledAttribute(xsdNode, "folder"); string tmprel = XmlSchemaUtilities.tryGetUnhandledAttribute(xsdNode, "relative"); relative = tmprel == "true" ? true : false; DockPanel dock = new DockPanel(); // init the grid Grid g = new Grid(); g.ColumnDefinitions.Add(new ColumnDefinition()); g.ColumnDefinitions.Add(new ColumnDefinition()); g.RowDefinitions.Add(new RowDefinition()); g.RowDefinitions.Add(new RowDefinition()); // init the Components menu = new ContextMenu(); MenuItem OpenMenu = new MenuItem(); OpenMenu.Icon = ModernImageLibrary.GetImage((int)ModernImageLibrary.FileIcons.Open, 16); OpenMenu.Click += OpenMenu_Click; OpenMenu.Header = "Add"; menu.Items.Add(OpenMenu); if (folder != "") { MenuItem EditMenu = new MenuItem(); EditMenu.Click += EditMenu_Click; EditMenu.Icon = ModernImageLibrary.GetImage((int)ModernImageLibrary.FileIcons.Edit, 16); EditMenu.Header = "Edit"; menu.Items.Add(EditMenu); } MenuItem RemoveMenu = new MenuItem(); RemoveMenu.Click += RemoveMenu_Click; RemoveMenu.Icon = ModernImageLibrary.GetImage((int)ModernImageLibrary.FileIcons.Close, 16); RemoveMenu.Header = "Remove"; menu.Items.Add(RemoveMenu); Image DropMenuImage = ModernImageLibrary.GetImage((int)ModernImageLibrary.FileIcons.Shortcut, 16); DropMenuImage.ContextMenu = menu; DropMenuImage.MouseEnter += DropMenuImage_MouseEnter; StackPanel stack = new StackPanel(); stack.Children.Add(DropMenuImage); DockPanel.SetDock(stack, Dock.Right); dock.Children.Add(stack); View = new ListView() { ItemsSource = ViewCollection }; View.Height = 50; ((INotifyCollectionChanged)ViewCollection).CollectionChanged += (s, e) => { hasPendingChanges(); }; dock.Children.Add(View); //init drag en drop extras this.View.DragEnter += DropList_Drag; this.View.Drop += DropList_Drop; this.View.DragOver += DropList_Drag; this.View.AllowDrop = true; // set the Control this.Control = dock; // make the list ordered if (ordered) new ListViewDragDropManager<string>(View); setup(); }
/// <summary> /// Creates a new instance of the EditButton. /// </summary> /// <param name="pi">Files that will be opened, will always be of this project.</param> /// <param name="ext">Files that will be opened, will always have this extendsion.</param> public EditButton(string ext, DynamicProjectForm parent) { this._parent = parent; this._ext = ext; InitializeComponent(); }
public DocUIFolder(XmlNode xmlNode, XmlSchemaAnnotated xsdNode, Panel contentpanel, Panel overlaypanel, DynamicProjectForm parentForm) : base(xmlNode, xsdNode, contentpanel, overlaypanel, parentForm) { }
/// <summary> /// Creates a new instance of the FileOption /// </summary> /// <param name="xmlNode">The xmlNode containing the data.</param> /// <param name="xsdNode">The corresponding xsdNode</param> /// <param name="panel">The panel on which this option should be placed.</param> /// <param name="parentForm">The form of which this option is a part.</param> /// <param name="isMetaName">Whether metadata data is allowed and meta name or value should be chosen.</param> public DocUIFile(XmlNode xmlNode, XmlSchemaAnnotated xsdNode, Panel contentpanel, Panel overlaypanel, DynamicProjectForm parentForm) : base(xmlNode, xsdNode, contentpanel, overlaypanel, parentForm) { //init variables this.parentForm = parentForm; _projectpath = parentForm.ProjectSystem.WorkingDirectory.FullName; _ext = XmlSchemaUtilities.tryGetUnhandledAttribute(xsdNode, "ext"); _folder = XmlSchemaUtilities.tryGetUnhandledAttribute(xsdNode, "folder"); string tmprel = XmlSchemaUtilities.tryGetUnhandledAttribute(xsdNode, "relative"); _relative = tmprel == "true" ? true : false; string tmpreq = XmlSchemaUtilities.tryGetUnhandledAttribute(xsdNode, "required"); _required = tmpreq == "true" ? true : false; DockPanel panel = new DockPanel(); StackPanel buttons = new StackPanel(); //panel.Orientation = Orientation.Horizontal; panel.HorizontalAlignment = HorizontalAlignment.Stretch; buttons.Orientation = Orientation.Horizontal; buttons.HorizontalAlignment = HorizontalAlignment.Right; // init the Components menu = new ContextMenu(); MenuItem OpenMenu = new MenuItem(); OpenMenu.Icon = ModernImageLibrary.GetImage((int)ModernImageLibrary.FileIcons.Open, 16); OpenMenu.Click += OpenMenu_Click; OpenMenu.Header = "Open"; menu.Items.Add(OpenMenu); if (_folder != "") { MenuItem EditMenu = new MenuItem(); EditMenu.Click += EditMenu_Click; EditMenu.Icon = ModernImageLibrary.GetImage((int)ModernImageLibrary.FileIcons.Edit, 16); EditMenu.Header = "Edit"; menu.Items.Add(EditMenu); } MenuItem RemoveMenu = new MenuItem(); RemoveMenu.Click += RemoveMenu_Click; RemoveMenu.Icon = ModernImageLibrary.GetImage((int)ModernImageLibrary.FileIcons.Close, 16); RemoveMenu.Header = "Remove"; menu.Items.Add(RemoveMenu); Image DropMenuImage = ModernImageLibrary.GetImage((int)ModernImageLibrary.FileIcons.Shortcut, 16); DropMenuImage.ContextMenu = menu; DropMenuImage.MouseEnter += DropMenuImage_MouseEnter; _tb = new ExtendedTextBox("", "", "", _required, parentForm); _tb.TextBlock.TextChanged += (s, e) => { hasPendingChanges(); }; //positioning DockPanel.SetDock(_tb, Dock.Left); DockPanel.SetDock(DropMenuImage, Dock.Right); panel.LastChildFill = true; _tb.HorizontalAlignment = HorizontalAlignment.Stretch; panel.Children.Add(DropMenuImage); panel.Children.Add(_tb); //init drag en drop extras _tb.TextBlock.PreviewDragEnter += DropTextBox_Drag; _tb.TextBlock.PreviewDrop += DropTextBox_Drop; _tb.TextBlock.PreviewDragOver += DropTextBox_Drag; _tb.AllowDrop = true; Control = panel; setup(); }
public DocUIOrderedFileList(XmlNode xmlNode, XmlSchemaAnnotated xsdNode, Panel contentpanel, Panel overlaypanel, DynamicProjectForm parentForm) : base(xmlNode, xsdNode, contentpanel, overlaypanel, parentForm) { this.ordered = true; }