forked from subtract1/GoodMerge2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLanguagePicker.cs
More file actions
69 lines (67 loc) · 2.53 KB
/
Copy pathLanguagePicker.cs
File metadata and controls
69 lines (67 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System;
using System.Xml;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
namespace GoodMerge {
public class LanguagePicker : Form {
public TreeView Tree;
private Button ButtonOK;
private ImageList Images;
public LanguagePicker(XmlNodeList xnl) {
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(GoodMerge));
Images = new ImageList();
ButtonOK = new Button();
Tree = new TreeView();
//
// Images
//
Images.ImageSize = new Size(16, 16);
Images.TransparentColor = Color.Transparent;
//
// Populate Tree
//
Images.Images.Add(Image.FromStream(Assembly.GetEntryAssembly().GetManifestResourceStream("GoodMerge.Blank.ico")));
int loop=1;
foreach (XmlNode xn in xnl) {
try {
Images.Images.Add(Image.FromStream(Assembly.GetEntryAssembly().GetManifestResourceStream("GoodMerge."+xn.Value+".ico")));
Tree.Nodes.Add(new TreeNode(xn.Value, loop, loop));
loop++;
}
catch { Tree.Nodes.Add(new TreeNode(xn.Value, 0, 0)); }
}
if (loop!=0) Tree.SelectedNode=Tree.Nodes[0];
//
// Tree
//
Tree.FullRowSelect = true;
Tree.ImageList = Images;
Tree.Location = new Point(0, 0);
Tree.ShowRootLines = false;
Tree.ClientSize = new Size(140, Tree.ItemHeight*Tree.Nodes.Count);
Tree.Scrollable=false;
//
// ButtonOK
//
ButtonOK.FlatStyle=FlatStyle.System;
ButtonOK.Location = new Point(0, Tree.Height);
ButtonOK.Size = new Size(140, 24);
ButtonOK.Text = "&OK";
ButtonOK.DialogResult=DialogResult.OK;
//
// LanguagePicker
//
this.AcceptButton=ButtonOK;
this.ClientSize = new Size(140, Tree.Height+24);
this.ControlBox = false;
this.Controls.Add(Tree);
this.Controls.Add(ButtonOK);
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.ShowInTaskbar = false;
this.StartPosition = FormStartPosition.CenterScreen;
this.Text="GoodMerge";
this.TopMost = true;
}
}
}