129 lines
5.2 KiB
C#
129 lines
5.2 KiB
C#
//
|
|
// NewDialog.Designer.cs
|
|
//
|
|
// Author:
|
|
// Michael Becker <alcexhim@gmail.com>
|
|
//
|
|
// Copyright (c) 2019
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
using System;
|
|
|
|
using MBS.Framework.UserInterface;
|
|
using MBS.Framework.UserInterface.Controls;
|
|
using MBS.Framework.UserInterface.Dialogs;
|
|
using MBS.Framework.UserInterface.Layouts;
|
|
|
|
namespace UniversalEditor.UserInterface.Dialogs
|
|
{
|
|
partial class NewDialog
|
|
{
|
|
private TextBox txtFileName = null;
|
|
private TextBox txtFilePath = null;
|
|
|
|
private CheckBox chkAddToSolution = null;
|
|
private TextBox txtSolutionName = null;
|
|
|
|
private ListView tvObjectModel = new ListView();
|
|
private DefaultTreeModel tmObjectModel = null;
|
|
|
|
private ListView tvTemplate = new ListView();
|
|
private DefaultTreeModel tmTemplate = null;
|
|
private TextBox txtSearch = null;
|
|
|
|
private Label lblName = null;
|
|
private Label lblLocation = null;
|
|
private Label lblProjectName = null;
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
this.Layout = new BoxLayout(Orientation.Vertical);
|
|
|
|
this.txtSearch = new TextBox();
|
|
txtSearch.Changed += txtSearch_Changed;
|
|
this.Controls.Add(txtSearch, new BoxLayout.Constraints(false, true));
|
|
|
|
tmObjectModel = new DefaultTreeModel(new Type[] { typeof(string), typeof(string) });
|
|
tmTemplate = new DefaultTreeModel(new Type[] { typeof(string), typeof(string) });
|
|
|
|
tvObjectModel.Model = tmObjectModel;
|
|
tvObjectModel.SelectionChanged += tvObjectModel_SelectionChanged;
|
|
tvTemplate.Model = tmTemplate;
|
|
// tvTemplate.Mode = ListViewMode.LargeIcon;
|
|
|
|
tvObjectModel.Columns.Add(new ListViewColumnText(tmObjectModel.Columns[0], "Name"));
|
|
tvObjectModel.Columns.Add(new ListViewColumnText(tmObjectModel.Columns[1], "Description"));
|
|
tvObjectModel.HeaderStyle = ColumnHeaderStyle.None;
|
|
|
|
tvTemplate.Columns.Add(new ListViewColumnText(tmTemplate.Columns[0], "Name"));
|
|
tvTemplate.Columns.Add(new ListViewColumnText(tmTemplate.Columns[1], "Description"));
|
|
tvTemplate.HeaderStyle = ColumnHeaderStyle.None;
|
|
tvTemplate.SelectionChanged += tvTemplate_SelectionChanged;
|
|
|
|
SplitContainer boxTreeViewAndListView = new SplitContainer();
|
|
boxTreeViewAndListView.Orientation = Orientation.Vertical;
|
|
boxTreeViewAndListView.Panel1.Layout = new BoxLayout(Orientation.Horizontal);
|
|
boxTreeViewAndListView.Panel2.Layout = new BoxLayout(Orientation.Horizontal);
|
|
|
|
boxTreeViewAndListView.Panel1.Controls.Add(tvObjectModel, new BoxLayout.Constraints(true, true, 16));
|
|
boxTreeViewAndListView.Panel2.Controls.Add(tvTemplate, new BoxLayout.Constraints(true, true, 16, BoxLayout.PackType.End));
|
|
|
|
this.Controls.Add(boxTreeViewAndListView, new BoxLayout.Constraints(true, true, 16));
|
|
|
|
this.txtFileName = new TextBox();
|
|
this.txtFilePath = new TextBox();
|
|
this.txtSolutionName = new TextBox();
|
|
|
|
this.lblName = new Label ("_Name:");
|
|
this.lblName.HorizontalAlignment = HorizontalAlignment.Left;
|
|
this.lblLocation = new Label ("_Location:");
|
|
this.lblLocation.HorizontalAlignment = HorizontalAlignment.Left;
|
|
|
|
this.lblProjectName = new Label ((Mode == NewDialogMode.File ? "Project" : "Solution") + " na_me:");
|
|
this.lblProjectName.HorizontalAlignment = HorizontalAlignment.Left;
|
|
|
|
this.txtFileName.Changed += txtFileName_Changed;
|
|
|
|
Container tableParams = new Container();
|
|
tableParams.Layout = new GridLayout();
|
|
tableParams.Controls.Add(lblName, new GridLayout.Constraints(0, 0));
|
|
tableParams.Controls.Add(txtFileName, new GridLayout.Constraints(0, 1, 1, 1, ExpandMode.Horizontal));
|
|
tableParams.Controls.Add(lblLocation, new GridLayout.Constraints(1, 0));
|
|
tableParams.Controls.Add(txtFilePath, new GridLayout.Constraints(1, 1, 1, 1, ExpandMode.Horizontal));
|
|
|
|
this.chkAddToSolution = new CheckBox();
|
|
this.chkAddToSolution.Text = "Add to " + (Mode == NewDialogMode.File ? "project" : "solution");
|
|
tableParams.Controls.Add(chkAddToSolution, new GridLayout.Constraints(2, 0, 1, 2, ExpandMode.Horizontal));
|
|
|
|
tableParams.Controls.Add(this.lblProjectName, new GridLayout.Constraints(3, 0));
|
|
tableParams.Controls.Add(txtSolutionName, new GridLayout.Constraints(3, 1, 1, 1, ExpandMode.Horizontal));
|
|
|
|
this.Controls.Add(tableParams, new BoxLayout.Constraints(false, false, 16, BoxLayout.PackType.End));
|
|
|
|
|
|
this.Buttons.Add(new Button(StockType.New, DialogResult.None));
|
|
this.Buttons.Add(new Button(StockType.Cancel, DialogResult.Cancel));
|
|
|
|
this.Buttons[0].StockType = StockType.New;
|
|
DefaultButton = this.Buttons[0];
|
|
this.Buttons[0].Click += cmdOK_Click;
|
|
|
|
this.Text = "New File";
|
|
this.MinimumSize = new MBS.Framework.Drawing.Dimension2D (500, 400);
|
|
this.Size = new MBS.Framework.Drawing.Dimension2D (600, 500);
|
|
}
|
|
|
|
}
|
|
}
|