public aboutDialog() { Text = "About"; FormBorderStyle = FormBorderStyle.FixedDialog; ControlBox = false; MaximizeBox = false; MinimizeBox = false; ShowInTaskbar = false; Size = new Size(200,170); StartPosition = FormStartPosition.CenterParent; Label version = new Label(); version.Parent = this; version.Location = new Point(20,20); version.Width = this.Width-40; version.Height = 20; version.Text = "v0.15 RC1 13 June 2005"; version.TextAlign = ContentAlignment.TopCenter; LinkLabel email = new LinkLabel(); email.Parent = this; email.Location = new Point(20,50); email.Width = version.Width; email.Height = 20; email.TextAlign = ContentAlignment.TopCenter; email.Text = "*****@*****.**"; email.LinkClicked += new LinkLabelLinkClickedEventHandler(email_LinkClicked); LinkLabel web = new LinkLabel(); web.Parent = this; web.Location = new Point(20,70); web.Width = email.Width; web.Height = 20; web.TextAlign = ContentAlignment.TopCenter; web.Text = "http://winch.pinkbile.com"; web.LinkClicked += new LinkLabelLinkClickedEventHandler(web_LinkClicked); //Ok button Win3_Button btn = new Win3_Button(); btn.Parent = this; btn.Text = "&Ok"; btn.Location = new Point(50,110); btn.Width += 20; btn.DialogResult = DialogResult.OK; AcceptButton = btn; CancelButton = btn; }
public editItemDialog(string text) { Text = "Edit item name"; FormBorderStyle = FormBorderStyle.FixedDialog; ControlBox = false; MaximizeBox = false; MinimizeBox = false; ShowInTaskbar = false; Size = new Size(500,95); StartPosition = FormStartPosition.CenterParent; //text box txtBox = new TextBox(); txtBox.Parent = this; txtBox.Location = new Point(10,10); txtBox.Size = new Size(475,txtBox.Height); txtBox.Text = text; //Cancel button Win3_Button btn = new Win3_Button(); btn.Parent = this; btn.Text = "&Cancel"; btn.Location = new Point(390,40); btn.Width += 20; btn.DialogResult = DialogResult.Cancel; CancelButton = btn; //Ok button btn = new Win3_Button(); btn.Parent = this; btn.Text = "&Ok"; btn.Location = new Point(280,40); btn.Width += 20; btn.DialogResult = DialogResult.OK; AcceptButton = btn; //media prefix button Win3_Button media = new Win3_Button(); media.Parent = this; media.Text = "&Add \"\\media\\\" prefix"; media.Location = new Point(10,40); media.Width += 60; media.Click += new System.EventHandler(media_Click); }
public window() { Text = "Dbpro (and fpsc) exe tool"; Size = new Size(630,600); int y = 10; // Load button btnLoad = new Win3_Button(); btnLoad.Parent = this; btnLoad.Text = "&Load exe"; btnLoad.Width += 50; btnLoad.Location = new Point(this.Width - btnLoad.Width -15,y); btnLoad.Anchor = AnchorStyles.Top | AnchorStyles.Right; btnLoad.Click += new EventHandler(btnLoad_Click); y += 30; // Save button btnSave = new Win3_Button(); btnSave.Parent = this; btnSave.Text = "&Save exe"; btnSave.Width += 50; btnSave.Location = new Point(this.Width - btnSave.Width -15,y); btnSave.Anchor = AnchorStyles.Top | AnchorStyles.Right; btnSave.Click += new EventHandler(btnSave_Click); y += 25; //compress with upx on save checkbox chkCompress = new CheckBox(); chkCompress.Parent = this; chkCompress.Text = "use UPX on save"; chkCompress.Width = btnSave.Width; chkCompress.Location = new Point(this.Width - chkCompress.Width -15, y); chkCompress.Anchor = AnchorStyles.Top | AnchorStyles.Right; //disable if we can't find "upx.exe" in appdir if (!File.Exists(Application.StartupPath + "\\upx.exe")) chkCompress.Enabled = false; y += 25; //Null dll resource checkbox chkNull = new CheckBox(); chkNull.Parent = this; chkNull.Text = "Null dll resources"; chkNull.Width = btnSave.Width; chkNull.Location = new Point(this.Width - chkNull.Width - 15, y); chkNull.Anchor = AnchorStyles.Top | AnchorStyles.Right; y += 25; // Extract button btnExtract = new Win3_Button(); btnExtract.Parent = this; btnExtract.Text = "E&xtract File(s)"; btnExtract.Width += 50; btnExtract.Location = new Point(this.Width - btnExtract.Width -15,y); btnExtract.Anchor = AnchorStyles.Top | AnchorStyles.Right; btnExtract.Enabled = false; btnExtract.Click += new EventHandler(btnExtract_Click); y += 30; //About button Win3_Button btnAbout = new Win3_Button(); btnAbout.Parent = this; btnAbout.Text = "&About"; btnAbout.Width += 50; btnAbout.Location = new Point(this.Width - btnAbout.Width - 15,y); btnAbout.Anchor = AnchorStyles.Top | AnchorStyles.Right; btnAbout.Click += new EventHandler(btnAbout_Click); y += 30; //Exit button Win3_Button btnExit = new Win3_Button(); btnExit.Parent = this; btnExit.Text = "E&xit"; btnExit.Width += 50; btnExit.Location = new Point(this.Width - btnExit.Width - 15,y); btnExit.Anchor = AnchorStyles.Top | AnchorStyles.Right; btnExit.Click += new EventHandler(btnExit_Click); y += 30; //display setting stuff displayBox = new GroupBox(); displayBox.Parent = this; displayBox.Text = "Display settings"; displayBox.Width = btnExit.Width; displayBox.Height = 120; displayBox.Location = new Point(this.Width - displayBox.Width - 15,y); displayBox.Anchor = AnchorStyles.Top | AnchorStyles.Right; displayBox.Enabled = false; //width label Label label = new Label(); label.Parent = displayBox; label.Text = "Width"; label.AutoSize = true; label.Location = new Point(5,20); //width textdisplayBox displayWidth = new TextBox(); displayWidth.Parent = displayBox; displayWidth.Width = displayBox.Width - label.Width - 20; displayWidth.Location = new Point(label.Left + label.Width + 5,15); //height label label = new Label(); label.Parent = displayBox; label.Text = "Height"; label.AutoSize = true; label.Location = new Point(5,45); //height textBox displayHeight = new TextBox(); displayHeight.Parent = displayBox; displayHeight.Width = displayBox.Width - label.Width - 20; displayHeight.Location = new Point(label.Left + label.Width + 5,40); //depth label label = new Label(); label.Parent = displayBox; label.Text = "Depth"; label.AutoSize = true; label.Location = new Point(5,70); //depth textBox displayDepth = new TextBox(); displayDepth.Parent = displayBox; displayDepth.Width = displayBox.Width - label.Width - 20; displayDepth.Location = new Point(label.Left + label.Width + 5, 65); //type textBox displayType = new ComboBox(); displayType.DropDownStyle = ComboBoxStyle.DropDownList; displayType.Items.Add("hidden"); displayType.Items.Add("windowed"); displayType.Items.Add("windowed desktop"); displayType.Items.Add("fullscreen exclusive"); displayType.Items.Add("windowed fullscreen"); displayType.SelectedIndex = 1; displayType.Parent = displayBox; displayType.Width = displayBox.Width - 20; displayType.Location = new Point(10,90); y += displayBox.Height + 10; //Up button btnUp = new Win3_Button(); btnUp.Parent = this; btnUp.Text = "/\\"; btnUp.Width = 30; btnUp.Height = 60; btnUp.Location = new Point(this.Width - btnUp.Width - 110,y); btnUp.Anchor = AnchorStyles.Top | AnchorStyles.Right; btnUp.Enabled = false; btnUp.Click += new EventHandler(btnUp_Click); y += btnUp.Height + 10; //down button btnDown = new Win3_Button(); btnDown.Parent = this; btnDown.Text = "\\/"; btnDown.Width = 30; btnDown.Height = 60; btnDown.Location = new Point(this.Width - btnUp.Width - 110,y); btnDown.Anchor = AnchorStyles.Top | AnchorStyles.Right; btnDown.Enabled = false; btnDown.Click += new EventHandler(btnDown_Click); y += btnDown.Height + 10; // exe name label labName = new Label(); labName.Parent = this; labName.Text = ""; labName.Location = new Point(10,10); labName.AutoSize = true; // file listview list = new ListView(); list.Parent = this; list.Location = new Point(10,30); list.Size = new Size(470,535); list.Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom; list.View = View.Details; list.Columns.Add("Name",210,HorizontalAlignment.Left); list.Columns.Add("File size",85,HorizontalAlignment.Right); list.Columns.Add("Location",170,HorizontalAlignment.Left); list.SelectedIndexChanged += new EventHandler(list_SelectedIndexChanged); // listview popup menu EventHandler mInsert = new EventHandler(mInsertOnClick); EventHandler mInsertmedia = new EventHandler(mInsertmediaOnClick); EventHandler mRemove = new EventHandler(mRemoveOnClick); EventHandler mEdit = new EventHandler(mEditOnClick); EventHandler mExtract = new EventHandler(mExtractOnClick); EventHandler mCopy = new EventHandler(mCopyOnClick); MenuItem[] ami = { new MenuItem("Insert", mInsert), new MenuItem("Insert wildcard", mInsertmedia), new MenuItem("Remove", mRemove), new MenuItem("Edit name", mEdit), new MenuItem("Extract", mExtract), new MenuItem("Copy list to clipboard",mCopy) }; list.ContextMenu = new ContextMenu(ami); list.ContextMenu.MenuItems[2].Enabled = false; list.ContextMenu.MenuItems[3].Enabled = false; list.ContextMenu.MenuItems[4].Enabled = false; list.ItemActivate += mEdit; //drag drop stuff AllowDrop = true; DragOver += new DragEventHandler(window_DragOver); DragDrop += new DragEventHandler(window_DragDrop); }
public filterDialog() { Text = "Set Filter and Prefix"; FormBorderStyle = FormBorderStyle.FixedDialog; ControlBox = false; MaximizeBox = false; MinimizeBox = false; ShowInTaskbar = false; Size = new Size(380,195); StartPosition = FormStartPosition.CenterParent; //filter GroupBox box = new GroupBox(); box.Parent = this; box.Text = "Filter"; box.Location = new Point(10,5); box.Size = new Size(355,45); //filter text box txtFilter = new TextBox(); txtFilter.Parent = box; txtFilter.Location = new Point(10,15); txtFilter.Size = new Size(170,txtFilter.Height); txtFilter.Text = "*.*"; filters = new ComboBox(); filters.Parent = box; filters.Location = new Point(190,15); filters.Width = 155; filters.DropDownStyle = ComboBoxStyle.DropDownList; filters.Items.Add("*.*"); filters.Items.Add("*.png"); filters.Items.Add("*.jpg"); filters.Items.Add("*.bmp"); filters.Items.Add("*.tga"); filters.Items.Add("*.dds"); filters.Items.Add("*.x"); filters.Items.Add("*.dbo"); filters.Items.Add("*.avi"); filters.Items.Add("*.wav"); filters.Items.Add("*.mpg"); filters.Items.Add("*.dll"); filters.SelectedIndex = 0; filters.SelectedIndexChanged += new System.EventHandler(filters_SelectedIndexChanged); //prefix box = new GroupBox(); box.Parent = this; box.Text = "Name Prefix"; box.Location = new Point(10,60); box.Size = new Size(355,70); //prefix text box txtPrefix = new TextBox(); txtPrefix.Parent = box; txtPrefix.Location = new Point(10,15); txtPrefix.Width = 335; txtPrefix.Text = "media\\"; //media checkbox chkMedia = new CheckBox(); chkMedia.Parent = box; chkMedia.Text = "\"media\\\" prefix"; chkMedia.Location = new Point(10,40); chkMedia.Checked = true; chkMedia.CheckedChanged += new System.EventHandler(chkMedia_CheckedChanged); //path button Win3_Button btnPath = new Win3_Button(); btnPath.Parent = box; btnPath.Text = "Guess prefix"; btnPath.Width = 100; btnPath.Location = new Point(245,40); btnPath.Click += new System.EventHandler(btnPath_Click); //Cancel button Win3_Button btn = new Win3_Button(); btn.Parent = this; btn.Text = "&Cancel"; btn.Location = new Point(270,140); btn.Width += 20; btn.DialogResult = DialogResult.Cancel; CancelButton = btn; //Ok button btn = new Win3_Button(); btn.Parent = this; btn.Text = "&Ok"; btn.Location = new Point(160,140); btn.Width += 20; btn.DialogResult = DialogResult.OK; AcceptButton = btn; }