mirror of
https://github.com/LBPUnion/UnionPatcher.git
synced 2025-07-31 21:28:41 +00:00
Make buttons do something
This commit is contained in:
parent
d0ea2955a0
commit
bf1da1b931
1 changed files with 37 additions and 5 deletions
|
@ -1,8 +1,40 @@
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using Eto.Drawing;
|
using Eto.Drawing;
|
||||||
using Eto.Forms;
|
using Eto.Forms;
|
||||||
|
|
||||||
namespace UnionPatcher.Gui {
|
namespace UnionPatcher.Gui {
|
||||||
public class MainForm : Form {
|
public class MainForm : Form {
|
||||||
|
public static Control CreatePatchButton() {
|
||||||
|
var control = new Button() {
|
||||||
|
Text = "Patch!",
|
||||||
|
TabIndex = 3,
|
||||||
|
};
|
||||||
|
|
||||||
|
control.Click += delegate {
|
||||||
|
Console.WriteLine("patch button clicked");
|
||||||
|
};
|
||||||
|
|
||||||
|
return control;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Control CreateHelpButton() {
|
||||||
|
var control = new Button() {
|
||||||
|
Text = "Help",
|
||||||
|
TabIndex = 4,
|
||||||
|
};
|
||||||
|
|
||||||
|
control.Click += delegate {
|
||||||
|
var process = new Process();
|
||||||
|
|
||||||
|
process.StartInfo.UseShellExecute = true;
|
||||||
|
process.StartInfo.FileName = "https://www.lbpunion.com";
|
||||||
|
process.Start();
|
||||||
|
};
|
||||||
|
|
||||||
|
return control;
|
||||||
|
}
|
||||||
|
|
||||||
public MainForm() {
|
public MainForm() {
|
||||||
this.Title = "Union Patcher";
|
this.Title = "Union Patcher";
|
||||||
this.ClientSize = new Size(500, 160);
|
this.ClientSize = new Size(500, 160);
|
||||||
|
@ -12,19 +44,19 @@ namespace UnionPatcher.Gui {
|
||||||
Rows = {
|
Rows = {
|
||||||
new TableRow(
|
new TableRow(
|
||||||
new TableCell(new Label { Text = "EBOOT.elf: ", VerticalAlignment = VerticalAlignment.Center }),
|
new TableCell(new Label { Text = "EBOOT.elf: ", VerticalAlignment = VerticalAlignment.Center }),
|
||||||
new TableCell(new FilePicker())
|
new TableCell(new FilePicker { TabIndex = 0 })
|
||||||
),
|
),
|
||||||
new TableRow(
|
new TableRow(
|
||||||
new TableCell(new Label { Text = "Server URL: ", VerticalAlignment = VerticalAlignment.Center }),
|
new TableCell(new Label { Text = "Server URL: ", VerticalAlignment = VerticalAlignment.Center }),
|
||||||
new TableCell(new TextBox())
|
new TableCell(new TextBox { TabIndex = 1 })
|
||||||
),
|
),
|
||||||
new TableRow(
|
new TableRow(
|
||||||
new TableCell(new Label { Text = "Output filename: ", VerticalAlignment = VerticalAlignment.Center }),
|
new TableCell(new Label { Text = "Output filename: ", VerticalAlignment = VerticalAlignment.Center }),
|
||||||
new TableCell(new TextBox())
|
new TableCell(new TextBox { TabIndex = 2 })
|
||||||
),
|
),
|
||||||
new TableRow(
|
new TableRow(
|
||||||
new TableCell(new Button { Text = "Help" }),
|
new TableCell(CreateHelpButton()),
|
||||||
new TableCell(new Button { Text = "Patch!" })
|
new TableCell(CreatePatchButton())
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue