public GUI() { this.Text = "Prince"; // Delegate used by drag and drop asyncOpenFile = new AsyncOpenFile(this.OpenFile); asyncOpenFiles = new AsyncOpenFiles(this.OpenFiles); // Accept files dropped from Explorer this.AllowDrop = true; this.DragEnter += new DragEventHandler(Form_DragEnter); this.DragDrop += new DragEventHandler(Form_DragDrop); // Open file dialog openDlg = new OpenFileDialog(); openDlg.Multiselect = true; openDlg.Filter = "All web content|*.html;*.htm;*.svg;*.xht;*.xhtml;*.xml;*.css;*.js|"+ "Documents (HTML, XML, SVG)|*.html;*.htm;*.svg;*.xht;*.xhtml;*.xml|"+ "Style sheets (CSS)|*.css|"+ "Scripts (*.js)|*.js|"+ "All files (*.*)|*.*"; // Save file dialog saveDlg = new SaveFileDialog(); saveDlg.OverwritePrompt = false; saveDlg.DefaultExt = "pdf"; saveDlg.Filter = "PDF files|*.pdf|"+ "All files (*.*)|*.*"; // TreeView for files tv = new TreeView(); tv.Dock = DockStyle.Fill; tv.ShowNodeToolTips = true; tv.AllowDrop = true; tv.Nodes.Add("Documents"); tv.Nodes.Add("Style sheets"); tv.Nodes.Add("Scripts"); tv.Nodes[0].NodeFont = new Font(tv.Font, FontStyle.Bold); tv.Nodes[1].NodeFont = new Font(tv.Font, FontStyle.Bold); tv.Nodes[2].NodeFont = new Font(tv.Font, FontStyle.Bold); tv.KeyDown += new KeyEventHandler(TreeView_KeyDown); tv.AfterSelect += new TreeViewEventHandler(TreeView_AfterSelect); tv.ItemDrag += new ItemDragEventHandler(TreeView_ItemDrag); tv.DragEnter += new DragEventHandler(TreeView_DragEnter); tv.DragDrop += new DragEventHandler(TreeView_DragDrop); // ListView for output log lv = new ListView(); lv.Dock = DockStyle.Fill; lv.View = View.Details; lv.Columns.Add("Status", -2); lv.Columns.Add("Location", -2); lv.Columns.Add("Message", -2); // Split SplitContainer split = new SplitContainer(); split.Dock = DockStyle.Fill; split.FixedPanel = FixedPanel.Panel2; split.Orientation = Orientation.Horizontal; split.Panel1.Controls.Add(tv); split.Panel2.Controls.Add(lv); this.Controls.Add(split); setupMenu(); setupStatusStrip(); }
public GUI() { this.Text = "Prince"; // Delegate used by drag and drop asyncOpenFile = new AsyncOpenFile(this.OpenFile); asyncOpenFiles = new AsyncOpenFiles(this.OpenFiles); // Accept files dropped from Explorer this.AllowDrop = true; this.DragEnter += new DragEventHandler(Form_DragEnter); this.DragDrop += new DragEventHandler(Form_DragDrop); // Open file dialog openDlg = new OpenFileDialog(); openDlg.Multiselect = true; openDlg.Filter = "All web content|*.html;*.htm;*.svg;*.xht;*.xhtml;*.xml;*.css;*.js|" + "Documents (HTML, XML, SVG)|*.html;*.htm;*.svg;*.xht;*.xhtml;*.xml|" + "Style sheets (CSS)|*.css|" + "Scripts (*.js)|*.js|" + "All files (*.*)|*.*"; // Save file dialog saveDlg = new SaveFileDialog(); saveDlg.OverwritePrompt = false; saveDlg.DefaultExt = "pdf"; saveDlg.Filter = "PDF files|*.pdf|" + "All files (*.*)|*.*"; // TreeView for files tv = new TreeView(); tv.Dock = DockStyle.Fill; tv.ShowNodeToolTips = true; tv.AllowDrop = true; tv.Nodes.Add("Documents"); tv.Nodes.Add("Style sheets"); tv.Nodes.Add("Scripts"); tv.Nodes[0].NodeFont = new Font(tv.Font, FontStyle.Bold); tv.Nodes[1].NodeFont = new Font(tv.Font, FontStyle.Bold); tv.Nodes[2].NodeFont = new Font(tv.Font, FontStyle.Bold); tv.KeyDown += new KeyEventHandler(TreeView_KeyDown); tv.AfterSelect += new TreeViewEventHandler(TreeView_AfterSelect); tv.ItemDrag += new ItemDragEventHandler(TreeView_ItemDrag); tv.DragEnter += new DragEventHandler(TreeView_DragEnter); tv.DragDrop += new DragEventHandler(TreeView_DragDrop); // ListView for output log lv = new ListView(); lv.Dock = DockStyle.Fill; lv.View = View.Details; lv.Columns.Add("Status", -2); lv.Columns.Add("Location", -2); lv.Columns.Add("Message", -2); // Split SplitContainer split = new SplitContainer(); split.Dock = DockStyle.Fill; split.FixedPanel = FixedPanel.Panel2; split.Orientation = Orientation.Horizontal; split.Panel1.Controls.Add(tv); split.Panel2.Controls.Add(lv); this.Controls.Add(split); setupMenu(); setupStatusStrip(); }