Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.WinForms
comparison FrmNewUnit.cs @ 236:8021cc097ec8
Re #382: WinForms builds from Linux/Mono fail on Windows/.Net
* Remove unnecessary ImageList from FrmNewUnit and replace with common resource
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 04 Dec 2011 14:06:49 +0000 |
parents | f9ef9b2db496 |
children | 2c3474d652e1 |
comparison
equal
deleted
inserted
replaced
235:5b8f0a6bf0b2 | 236:8021cc097ec8 |
---|---|
20 /// <summary> | 20 /// <summary> |
21 /// Summary description for FrmNewUnit. | 21 /// Summary description for FrmNewUnit. |
22 /// </summary> | 22 /// </summary> |
23 public class FrmNewUnit : IBBForm | 23 public class FrmNewUnit : IBBForm |
24 { | 24 { |
25 private System.ComponentModel.IContainer components; | |
26 private IBBoard.Windows.Forms.IBBButton bttnCancel; | 25 private IBBoard.Windows.Forms.IBBButton bttnCancel; |
27 private IBBoard.Windows.Forms.IBBLabel lblUnitList; | 26 private IBBoard.Windows.Forms.IBBLabel lblUnitList; |
28 private IBBoard.Windows.Forms.IBBButton bttnSelectUnit; | 27 private IBBoard.Windows.Forms.IBBButton bttnSelectUnit; |
29 private System.Windows.Forms.ListBox lstUnits; | 28 private System.Windows.Forms.ListBox lstUnits; |
30 private UnitType[] units; | 29 private UnitType[] units; |
31 private Army army; | 30 private Army army; |
32 private System.Windows.Forms.ImageList imageList; | |
33 private System.Windows.Forms.Label lblNewUnitWarning; | 31 private System.Windows.Forms.Label lblNewUnitWarning; |
34 private System.Windows.Forms.Label lblWarningIcon; | 32 private System.Windows.Forms.Label lblWarningIcon; |
35 | 33 |
36 public FrmNewUnit(Race race, Category cat, Army army) | 34 public FrmNewUnit(Race race, Category cat, Army army) |
37 { | 35 { |
43 | 41 |
44 for (int i = 0; i<units.Length; i++) | 42 for (int i = 0; i<units.Length; i++) |
45 { | 43 { |
46 lstUnits.Items.Add(units[i].Name); | 44 lstUnits.Items.Add(units[i].Name); |
47 } | 45 } |
48 } | |
49 | |
50 /// <summary> | |
51 /// Clean up any resources being used. | |
52 /// </summary> | |
53 protected override void Dispose( bool disposing ) | |
54 { | |
55 if( disposing ) | |
56 { | |
57 if(components != null) | |
58 { | |
59 components.Dispose(); | |
60 } | |
61 } | |
62 base.Dispose( disposing ); | |
63 } | 46 } |
64 | 47 |
65 #region Windows Form Designer generated code | 48 #region Windows Form Designer generated code |
66 /// <summary> | 49 /// <summary> |
67 /// Required method for Designer support - do not modify | 50 /// Required method for Designer support - do not modify |
68 /// the contents of this method with the code editor. | 51 /// the contents of this method with the code editor. |
69 /// </summary> | 52 /// </summary> |
70 private void InitializeComponent() | 53 private void InitializeComponent() |
71 { | 54 { |
72 this.components = new System.ComponentModel.Container(); | 55 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmNewUnit)); |
73 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmNewUnit)); | 56 this.lstUnits = new System.Windows.Forms.ListBox(); |
74 this.lstUnits = new System.Windows.Forms.ListBox(); | 57 this.bttnCancel = new IBBoard.Windows.Forms.IBBButton(); |
75 this.bttnCancel = new IBBoard.Windows.Forms.IBBButton(); | 58 this.lblUnitList = new IBBoard.Windows.Forms.IBBLabel(); |
76 this.lblUnitList = new IBBoard.Windows.Forms.IBBLabel(); | 59 this.bttnSelectUnit = new IBBoard.Windows.Forms.IBBButton(); |
77 this.bttnSelectUnit = new IBBoard.Windows.Forms.IBBButton(); | 60 this.lblNewUnitWarning = new System.Windows.Forms.Label(); |
78 this.lblNewUnitWarning = new System.Windows.Forms.Label(); | 61 this.lblWarningIcon = new System.Windows.Forms.Label(); |
79 this.imageList = new System.Windows.Forms.ImageList(this.components); | 62 this.SuspendLayout(); |
80 this.lblWarningIcon = new System.Windows.Forms.Label(); | 63 // |
81 this.SuspendLayout(); | 64 // lstUnits |
82 // | 65 // |
83 // lstUnits | 66 this.lstUnits.Location = new System.Drawing.Point(88, 8); |
84 // | 67 this.lstUnits.Name = "lstUnits"; |
85 this.lstUnits.Location = new System.Drawing.Point(88, 8); | 68 this.lstUnits.Size = new System.Drawing.Size(272, 121); |
86 this.lstUnits.Name = "lstUnits"; | 69 this.lstUnits.TabIndex = 7; |
87 this.lstUnits.Size = new System.Drawing.Size(272, 121); | 70 this.lstUnits.SelectedIndexChanged += new System.EventHandler(this.lstUnits_SelectedIndexChanged); |
88 this.lstUnits.TabIndex = 7; | 71 this.lstUnits.DoubleClick += new System.EventHandler(this.lstUnits_DoubleClick); |
89 this.lstUnits.SelectedIndexChanged += new System.EventHandler(this.lstUnits_SelectedIndexChanged); | 72 this.lstUnits.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lstUnits_MouseDown); |
90 this.lstUnits.DoubleClick += new System.EventHandler(this.lstUnits_DoubleClick); | 73 // |
91 this.lstUnits.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lstUnits_MouseDown); | 74 // bttnCancel |
92 // | 75 // |
93 // bttnCancel | 76 this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; |
94 // | 77 this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; |
95 this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; | 78 this.bttnCancel.Location = new System.Drawing.Point(8, 168); |
96 this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; | 79 this.bttnCancel.Name = "bttnCancel"; |
97 this.bttnCancel.Location = new System.Drawing.Point(8, 168); | 80 this.bttnCancel.Size = new System.Drawing.Size(80, 24); |
98 this.bttnCancel.Name = "bttnCancel"; | 81 this.bttnCancel.TabIndex = 6; |
99 this.bttnCancel.Size = new System.Drawing.Size(80, 24); | 82 this.bttnCancel.Text = "Cancel"; |
100 this.bttnCancel.TabIndex = 6; | 83 this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click); |
101 this.bttnCancel.Text = "Cancel"; | 84 // |
102 this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click); | 85 // lblUnitList |
103 // | 86 // |
104 // lblUnitList | 87 this.lblUnitList.Location = new System.Drawing.Point(0, 8); |
105 // | 88 this.lblUnitList.Name = "lblUnitList"; |
106 this.lblUnitList.Location = new System.Drawing.Point(0, 8); | 89 this.lblUnitList.Size = new System.Drawing.Size(88, 80); |
107 this.lblUnitList.Name = "lblUnitList"; | 90 this.lblUnitList.TabIndex = 5; |
108 this.lblUnitList.Size = new System.Drawing.Size(88, 80); | 91 this.lblUnitList.Text = "unit list"; |
109 this.lblUnitList.TabIndex = 5; | 92 this.lblUnitList.TextAlign = System.Drawing.ContentAlignment.TopRight; |
110 this.lblUnitList.Text = "unit list"; | 93 // |
111 this.lblUnitList.TextAlign = System.Drawing.ContentAlignment.TopRight; | 94 // bttnSelectUnit |
112 // | 95 // |
113 // bttnSelectUnit | 96 this.bttnSelectUnit.Enabled = false; |
114 // | 97 this.bttnSelectUnit.FlatStyle = System.Windows.Forms.FlatStyle.System; |
115 this.bttnSelectUnit.Enabled = false; | 98 this.bttnSelectUnit.Location = new System.Drawing.Point(256, 168); |
116 this.bttnSelectUnit.FlatStyle = System.Windows.Forms.FlatStyle.System; | 99 this.bttnSelectUnit.Name = "bttnSelectUnit"; |
117 this.bttnSelectUnit.Location = new System.Drawing.Point(256, 168); | 100 this.bttnSelectUnit.Size = new System.Drawing.Size(104, 24); |
118 this.bttnSelectUnit.Name = "bttnSelectUnit"; | 101 this.bttnSelectUnit.TabIndex = 4; |
119 this.bttnSelectUnit.Size = new System.Drawing.Size(104, 24); | 102 this.bttnSelectUnit.Text = "create unit"; |
120 this.bttnSelectUnit.TabIndex = 4; | 103 this.bttnSelectUnit.Click += new System.EventHandler(this.bttnSelectUnit_Click); |
121 this.bttnSelectUnit.Text = "create unit"; | 104 // |
122 this.bttnSelectUnit.Click += new System.EventHandler(this.bttnSelectUnit_Click); | 105 // lblNewUnitWarning |
123 // | 106 // |
124 // lblNewUnitWarning | 107 this.lblNewUnitWarning.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; |
125 // | 108 this.lblNewUnitWarning.Location = new System.Drawing.Point(48, 136); |
126 this.lblNewUnitWarning.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; | 109 this.lblNewUnitWarning.Name = "lblNewUnitWarning"; |
127 this.lblNewUnitWarning.ImageList = this.imageList; | 110 this.lblNewUnitWarning.Size = new System.Drawing.Size(312, 32); |
128 this.lblNewUnitWarning.Location = new System.Drawing.Point(48, 136); | 111 this.lblNewUnitWarning.TabIndex = 9; |
129 this.lblNewUnitWarning.Name = "lblNewUnitWarning"; | 112 this.lblNewUnitWarning.Text = "One or more unit requirements are not satisfied."; |
130 this.lblNewUnitWarning.Size = new System.Drawing.Size(312, 32); | 113 this.lblNewUnitWarning.TextAlign = System.Drawing.ContentAlignment.TopRight; |
131 this.lblNewUnitWarning.TabIndex = 9; | 114 this.lblNewUnitWarning.Visible = false; |
132 this.lblNewUnitWarning.Text = "One or more unit requirements are not satisfied."; | 115 // |
133 this.lblNewUnitWarning.TextAlign = System.Drawing.ContentAlignment.TopRight; | 116 // lblWarningIcon |
134 this.lblNewUnitWarning.Visible = false; | 117 // |
135 // | 118 this.lblWarningIcon.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.dialog_warning; |
136 // imageList | 119 this.lblWarningIcon.Location = new System.Drawing.Point(8, 136); |
137 // | 120 this.lblWarningIcon.Name = "lblWarningIcon"; |
138 this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream"))); | 121 this.lblWarningIcon.Size = new System.Drawing.Size(40, 32); |
139 this.imageList.TransparentColor = System.Drawing.Color.Transparent; | 122 this.lblWarningIcon.TabIndex = 10; |
140 this.imageList.Images.SetKeyName(0, ""); | 123 this.lblWarningIcon.Visible = false; |
141 // | 124 // |
142 // lblWarningIcon | 125 // FrmNewUnit |
143 // | 126 // |
144 this.lblWarningIcon.Image = ((System.Drawing.Image)(resources.GetObject("lblWarningIcon.Image"))); | 127 this.AcceptButton = this.bttnSelectUnit; |
145 this.lblWarningIcon.Location = new System.Drawing.Point(8, 136); | 128 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); |
146 this.lblWarningIcon.Name = "lblWarningIcon"; | 129 this.CancelButton = this.bttnCancel; |
147 this.lblWarningIcon.Size = new System.Drawing.Size(40, 32); | 130 this.ClientSize = new System.Drawing.Size(370, 196); |
148 this.lblWarningIcon.TabIndex = 10; | 131 this.Controls.Add(this.lblWarningIcon); |
149 this.lblWarningIcon.Visible = false; | 132 this.Controls.Add(this.lblNewUnitWarning); |
150 // | 133 this.Controls.Add(this.bttnCancel); |
151 // FrmNewUnit | 134 this.Controls.Add(this.lblUnitList); |
152 // | 135 this.Controls.Add(this.bttnSelectUnit); |
153 this.AcceptButton = this.bttnSelectUnit; | 136 this.Controls.Add(this.lstUnits); |
154 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); | 137 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; |
155 this.CancelButton = this.bttnCancel; | 138 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); |
156 this.ClientSize = new System.Drawing.Size(370, 196); | 139 this.MaximizeBox = false; |
157 this.Controls.Add(this.lblWarningIcon); | 140 this.MinimizeBox = false; |
158 this.Controls.Add(this.lblNewUnitWarning); | 141 this.Name = "FrmNewUnit"; |
159 this.Controls.Add(this.bttnCancel); | 142 this.ShowInTaskbar = false; |
160 this.Controls.Add(this.lblUnitList); | 143 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; |
161 this.Controls.Add(this.bttnSelectUnit); | 144 this.Text = "FrmNewUni"; |
162 this.Controls.Add(this.lstUnits); | 145 this.ResumeLayout(false); |
163 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; | |
164 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); | |
165 this.MaximizeBox = false; | |
166 this.MinimizeBox = false; | |
167 this.Name = "FrmNewUnit"; | |
168 this.ShowInTaskbar = false; | |
169 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; | |
170 this.Text = "FrmNewUni"; | |
171 this.ResumeLayout(false); | |
172 | 146 |
173 } | 147 } |
174 #endregion | 148 #endregion |
175 | 149 |
176 public UnitType SelectedUnit | 150 public UnitType SelectedUnit |