ToolStripManagerTest.cs 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. //
  2. // ToolStripManagerTest.cs
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining
  5. // a copy of this software and associated documentation files (the
  6. // "Software"), to deal in the Software without restriction, including
  7. // without limitation the rights to use, copy, modify, merge, publish,
  8. // distribute, sublicense, and/or sell copies of the Software, and to
  9. // permit persons to whom the Software is furnished to do so, subject to
  10. // the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be
  13. // included in all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  18. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  19. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  20. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  21. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. //
  23. // Copyright (c) 2006 Jonathan Pobst
  24. //
  25. // Authors:
  26. // Jonathan Pobst ([email protected])
  27. //
  28. #if NET_2_0
  29. using System;
  30. using System.Collections.Generic;
  31. using System.Text;
  32. using NUnit.Framework;
  33. using System.Drawing;
  34. using System.Windows.Forms;
  35. namespace MonoTests.System.Windows.Forms
  36. {
  37. [TestFixture]
  38. public class ToolStripManagerTest : TestHelper
  39. {
  40. [Test]
  41. [Ignore ("This has to run all by itself. Toolstrips in other tests register themselves and mess this up.")]
  42. public void BehaviorFindToolStrip ()
  43. {
  44. // Default stuff
  45. Assert.AreEqual (null, ToolStripManager.FindToolStrip (string.Empty), "A1");
  46. Assert.AreEqual (null, ToolStripManager.FindToolStrip ("MyStrip"), "A2");
  47. ToolStrip ts = new ToolStrip ();
  48. ts.Name = "MyStrip";
  49. // Basic operation
  50. Assert.AreSame (ts, ToolStripManager.FindToolStrip ("MyStrip"), "A3");
  51. // Dispose removes them
  52. ts.Dispose ();
  53. Assert.AreEqual (null, ToolStripManager.FindToolStrip ("MyStrip"), "A4");
  54. ts = new ToolStrip ();
  55. ts.Name = "MyStrip1";
  56. MenuStrip ms = new MenuStrip ();
  57. ms.Name = "MyStrip2";
  58. // Basic operation
  59. Assert.AreSame (ts, ToolStripManager.FindToolStrip ("MyStrip1"), "A5");
  60. Assert.AreSame (ms, ToolStripManager.FindToolStrip ("MyStrip2"), "A6");
  61. // Find unnamed strip
  62. StatusStrip ss = new StatusStrip ();
  63. Assert.AreEqual (ss, ToolStripManager.FindToolStrip (string.Empty), "A7");
  64. // Always return first unnamed strip
  65. ContextMenuStrip cms = new ContextMenuStrip ();
  66. Assert.AreEqual (ss, ToolStripManager.FindToolStrip (string.Empty), "A8");
  67. // Remove first unnamed strip, returns second one
  68. ss.Dispose ();
  69. Assert.AreEqual (cms, ToolStripManager.FindToolStrip (string.Empty), "A9");
  70. // ContextMenuStrips are included
  71. cms.Name = "Context";
  72. Assert.AreEqual (cms, ToolStripManager.FindToolStrip ("Context"), "A10");
  73. }
  74. [Test]
  75. public void MethodIsShortcutValid ()
  76. {
  77. Assert.AreEqual (true, ToolStripManager.IsValidShortcut (Keys.F1), "A1");
  78. Assert.AreEqual (true, ToolStripManager.IsValidShortcut (Keys.F7), "A1");
  79. Assert.AreEqual (true, ToolStripManager.IsValidShortcut (Keys.Shift | Keys.F1), "A1");
  80. Assert.AreEqual (true, ToolStripManager.IsValidShortcut (Keys.Control | Keys.F1), "A1");
  81. Assert.AreEqual (false, ToolStripManager.IsValidShortcut (Keys.Shift), "A1");
  82. Assert.AreEqual (false, ToolStripManager.IsValidShortcut (Keys.Alt), "A1");
  83. Assert.AreEqual (false, ToolStripManager.IsValidShortcut (Keys.D6), "A1");
  84. Assert.AreEqual (true, ToolStripManager.IsValidShortcut (Keys.Control | Keys.S), "A1");
  85. Assert.AreEqual (false, ToolStripManager.IsValidShortcut (Keys.L), "A1");
  86. }
  87. [Test]
  88. public void BehaviorTwoShortcuts ()
  89. {
  90. ToolStripMenuItem tsmi = new ToolStripMenuItem ();
  91. tsmi.ShortcutKeys = Keys.Control | Keys.D;
  92. ToolStripMenuItem tsmi2 = new ToolStripMenuItem ();
  93. tsmi2.ShortcutKeys = Keys.Control | Keys.D;
  94. Assert.AreEqual (Keys.Control | Keys.D, tsmi.ShortcutKeys, "A1");
  95. Assert.AreEqual (Keys.Control | Keys.D, tsmi2.ShortcutKeys, "A2");
  96. ToolStrip ts = new ToolStrip ();
  97. ts.Items.Add (tsmi);
  98. ts.Items.Add (tsmi2);
  99. Assert.AreEqual (Keys.Control | Keys.D, tsmi.ShortcutKeys, "A3");
  100. Assert.AreEqual (Keys.Control | Keys.D, tsmi2.ShortcutKeys, "A4");
  101. }
  102. [Test]
  103. public void MethodMergeToolStripsAppend ()
  104. {
  105. // MergeAction = Append
  106. ToolStrip ts1 = new ToolStrip ();
  107. ToolStrip ts2 = new ToolStrip ();
  108. ts1.Items.Add ("ts1-A");
  109. ts1.Items.Add ("ts1-B");
  110. ts1.Items.Add ("ts1-C");
  111. ts1.Items.Add ("ts1-D");
  112. ts2.Items.Add ("ts2-A");
  113. ts2.Items.Add ("ts2-B");
  114. ts2.Items.Add ("ts2-C");
  115. ts2.Items.Add ("ts2-D");
  116. ToolStripManager.Merge (ts2, ts1);
  117. Assert.AreEqual (8, ts1.Items.Count, "M1");
  118. Assert.AreEqual (0, ts2.Items.Count, "M2");
  119. Assert.AreEqual ("ts1-A", ts1.Items[0].Text, "M3-1");
  120. Assert.AreEqual ("ts1-B", ts1.Items[1].Text, "M3-2");
  121. Assert.AreEqual ("ts1-C", ts1.Items[2].Text, "M3-3");
  122. Assert.AreEqual ("ts1-D", ts1.Items[3].Text, "M3-4");
  123. Assert.AreEqual ("ts2-A", ts1.Items[4].Text, "M3-5");
  124. Assert.AreEqual ("ts2-B", ts1.Items[5].Text, "M3-6");
  125. Assert.AreEqual ("ts2-C", ts1.Items[6].Text, "M3-7");
  126. Assert.AreEqual ("ts2-D", ts1.Items[7].Text, "M3-8");
  127. ToolStripManager.RevertMerge (ts1, ts2);
  128. Assert.AreEqual (4, ts1.Items.Count, "M4");
  129. Assert.AreEqual (4, ts2.Items.Count, "M5");
  130. Assert.AreEqual ("ts1-A", ts1.Items[0].Text, "M6-1");
  131. Assert.AreEqual ("ts1-B", ts1.Items[1].Text, "M6-2");
  132. Assert.AreEqual ("ts1-C", ts1.Items[2].Text, "M6-3");
  133. Assert.AreEqual ("ts1-D", ts1.Items[3].Text, "M6-4");
  134. Assert.AreEqual ("ts2-A", ts2.Items[0].Text, "M6-5");
  135. Assert.AreEqual ("ts2-B", ts2.Items[1].Text, "M6-6");
  136. Assert.AreEqual ("ts2-C", ts2.Items[2].Text, "M6-7");
  137. Assert.AreEqual ("ts2-D", ts2.Items[3].Text, "M6-8");
  138. // Do merge twice, as it helps verify things got back
  139. // to the proper state in the unmerge
  140. ToolStripManager.Merge (ts2, ts1);
  141. Assert.AreEqual (8, ts1.Items.Count, "M7");
  142. Assert.AreEqual (0, ts2.Items.Count, "M8");
  143. Assert.AreEqual ("ts1-A", ts1.Items[0].Text, "M9-1");
  144. Assert.AreEqual ("ts1-B", ts1.Items[1].Text, "M9-2");
  145. Assert.AreEqual ("ts1-C", ts1.Items[2].Text, "M9-3");
  146. Assert.AreEqual ("ts1-D", ts1.Items[3].Text, "M9-4");
  147. Assert.AreEqual ("ts2-A", ts1.Items[4].Text, "M9-5");
  148. Assert.AreEqual ("ts2-B", ts1.Items[5].Text, "M9-6");
  149. Assert.AreEqual ("ts2-C", ts1.Items[6].Text, "M9-7");
  150. Assert.AreEqual ("ts2-D", ts1.Items[7].Text, "M9-8");
  151. ToolStripManager.RevertMerge (ts1, ts2);
  152. Assert.AreEqual (4, ts1.Items.Count, "M10");
  153. Assert.AreEqual (4, ts2.Items.Count, "M11");
  154. Assert.AreEqual ("ts1-A", ts1.Items[0].Text, "M12-1");
  155. Assert.AreEqual ("ts1-B", ts1.Items[1].Text, "M12-2");
  156. Assert.AreEqual ("ts1-C", ts1.Items[2].Text, "M12-3");
  157. Assert.AreEqual ("ts1-D", ts1.Items[3].Text, "M12-4");
  158. Assert.AreEqual ("ts2-A", ts2.Items[0].Text, "M12-5");
  159. Assert.AreEqual ("ts2-B", ts2.Items[1].Text, "M12-6");
  160. Assert.AreEqual ("ts2-C", ts2.Items[2].Text, "M12-7");
  161. Assert.AreEqual ("ts2-D", ts2.Items[3].Text, "M12-8");
  162. }
  163. [Test]
  164. public void MethodMergeToolStripsInsert ()
  165. {
  166. // MergeAction = Insert
  167. ToolStrip ts1 = new ToolStrip ();
  168. ToolStrip ts2 = new ToolStrip ();
  169. ts1.Items.Add ("ts1-A");
  170. ts1.Items.Add ("ts1-B");
  171. ts1.Items.Add ("ts1-C");
  172. ts1.Items.Add ("ts1-D");
  173. ts2.Items.Add ("ts2-A");
  174. ts2.Items.Add ("ts2-B");
  175. ts2.Items.Add ("ts2-C");
  176. ts2.Items.Add ("ts2-D");
  177. ts2.Items[0].MergeAction = MergeAction.Insert;
  178. ts2.Items[0].MergeIndex = 2;
  179. ts2.Items[1].MergeAction = MergeAction.Insert;
  180. ts2.Items[2].MergeAction = MergeAction.Insert;
  181. ts2.Items[2].MergeIndex = 12;
  182. ts2.Items[3].MergeAction = MergeAction.Insert;
  183. ts2.Items[3].MergeIndex = 0;
  184. ToolStripManager.Merge (ts2, ts1);
  185. Assert.AreEqual (7, ts1.Items.Count, "M1");
  186. Assert.AreEqual (1, ts2.Items.Count, "M2");
  187. Assert.AreEqual ("ts2-D", ts1.Items[0].Text, "M3-1");
  188. Assert.AreEqual ("ts1-A", ts1.Items[1].Text, "M3-2");
  189. Assert.AreEqual ("ts1-B", ts1.Items[2].Text, "M3-3");
  190. Assert.AreEqual ("ts2-A", ts1.Items[3].Text, "M3-4");
  191. Assert.AreEqual ("ts1-C", ts1.Items[4].Text, "M3-5");
  192. Assert.AreEqual ("ts1-D", ts1.Items[5].Text, "M3-6");
  193. Assert.AreEqual ("ts2-C", ts1.Items[6].Text, "M3-7");
  194. Assert.AreEqual ("ts2-B", ts2.Items[0].Text, "M3-8");
  195. ToolStripManager.RevertMerge (ts1, ts2);
  196. Assert.AreEqual (4, ts1.Items.Count, "M4");
  197. Assert.AreEqual (4, ts2.Items.Count, "M5");
  198. Assert.AreEqual ("ts1-A", ts1.Items[0].Text, "M6-1");
  199. Assert.AreEqual ("ts1-B", ts1.Items[1].Text, "M6-2");
  200. Assert.AreEqual ("ts1-C", ts1.Items[2].Text, "M6-3");
  201. Assert.AreEqual ("ts1-D", ts1.Items[3].Text, "M6-4");
  202. Assert.AreEqual ("ts2-A", ts2.Items[0].Text, "M6-5");
  203. Assert.AreEqual ("ts2-B", ts2.Items[1].Text, "M6-6");
  204. Assert.AreEqual ("ts2-C", ts2.Items[2].Text, "M6-7");
  205. Assert.AreEqual ("ts2-D", ts2.Items[3].Text, "M6-8");
  206. // Do merge twice, as it helps verify things got back
  207. // to the proper state in the unmerge
  208. ToolStripManager.Merge (ts2, ts1);
  209. Assert.AreEqual (7, ts1.Items.Count, "M7");
  210. Assert.AreEqual (1, ts2.Items.Count, "M8");
  211. Assert.AreEqual ("ts2-D", ts1.Items[0].Text, "M9-1");
  212. Assert.AreEqual ("ts1-A", ts1.Items[1].Text, "M9-2");
  213. Assert.AreEqual ("ts1-B", ts1.Items[2].Text, "M9-3");
  214. Assert.AreEqual ("ts2-A", ts1.Items[3].Text, "M9-4");
  215. Assert.AreEqual ("ts1-C", ts1.Items[4].Text, "M9-5");
  216. Assert.AreEqual ("ts1-D", ts1.Items[5].Text, "M9-6");
  217. Assert.AreEqual ("ts2-C", ts1.Items[6].Text, "M9-7");
  218. Assert.AreEqual ("ts2-B", ts2.Items[0].Text, "M9-8");
  219. ToolStripManager.RevertMerge (ts1, ts2);
  220. Assert.AreEqual (4, ts1.Items.Count, "M10");
  221. Assert.AreEqual (4, ts2.Items.Count, "M11");
  222. Assert.AreEqual ("ts1-A", ts1.Items[0].Text, "M12-1");
  223. Assert.AreEqual ("ts1-B", ts1.Items[1].Text, "M12-2");
  224. Assert.AreEqual ("ts1-C", ts1.Items[2].Text, "M12-3");
  225. Assert.AreEqual ("ts1-D", ts1.Items[3].Text, "M12-4");
  226. Assert.AreEqual ("ts2-A", ts2.Items[0].Text, "M12-5");
  227. Assert.AreEqual ("ts2-B", ts2.Items[1].Text, "M12-6");
  228. Assert.AreEqual ("ts2-C", ts2.Items[2].Text, "M12-7");
  229. Assert.AreEqual ("ts2-D", ts2.Items[3].Text, "M12-8");
  230. }
  231. [Test]
  232. public void MethodMergeToolStripsRemove ()
  233. {
  234. // MergeAction = Remove
  235. ToolStrip ts1 = new ToolStrip ();
  236. ToolStrip ts2 = new ToolStrip ();
  237. ts1.Items.Add ("ts1-A");
  238. ts1.Items.Add ("ts1-B");
  239. ts1.Items.Add ("ts1-C");
  240. ts1.Items.Add ("ts1-D");
  241. ts2.Items.Add ("ts1-A");
  242. ts2.Items.Add ("ts1-B");
  243. ts2.Items.Add ("ts1-C");
  244. ts2.Items.Add ("ts1-D");
  245. ts2.Items[0].MergeAction = MergeAction.Remove;
  246. ts2.Items[1].MergeAction = MergeAction.Remove;
  247. ts2.Items[2].MergeAction = MergeAction.Remove;
  248. ts2.Items[3].MergeAction = MergeAction.Remove;
  249. // Both the item from ts1 and ts2 must have the same Text for Remove to work,
  250. // so I need to give these a Name so I can differentiate them later.
  251. ts1.Items[0].Name = "ts1-A";
  252. ts1.Items[1].Name = "ts1-B";
  253. ts1.Items[2].Name = "ts1-C";
  254. ts1.Items[3].Name = "ts1-D";
  255. ts2.Items[0].Name = "ts2-A";
  256. ts2.Items[1].Name = "ts2-B";
  257. ts2.Items[2].Name = "ts2-C";
  258. ts2.Items[3].Name = "ts2-D";
  259. ToolStripManager.Merge (ts2, ts1);
  260. Assert.AreEqual (0, ts1.Items.Count, "M1");
  261. Assert.AreEqual (4, ts2.Items.Count, "M2");
  262. Assert.AreEqual ("ts2-A", ts2.Items[0].Name, "M3-5");
  263. Assert.AreEqual ("ts2-B", ts2.Items[1].Name, "M3-6");
  264. Assert.AreEqual ("ts2-C", ts2.Items[2].Name, "M3-7");
  265. Assert.AreEqual ("ts2-D", ts2.Items[3].Name, "M3-8");
  266. ToolStripManager.RevertMerge (ts1, ts2);
  267. Assert.AreEqual (4, ts1.Items.Count, "M4");
  268. Assert.AreEqual (4, ts2.Items.Count, "M5");
  269. Assert.AreEqual ("ts1-A", ts1.Items[0].Name, "M6-1");
  270. Assert.AreEqual ("ts1-B", ts1.Items[1].Name, "M6-2");
  271. Assert.AreEqual ("ts1-C", ts1.Items[2].Name, "M6-3");
  272. Assert.AreEqual ("ts1-D", ts1.Items[3].Name, "M6-4");
  273. Assert.AreEqual ("ts2-A", ts2.Items[0].Name, "M6-5");
  274. Assert.AreEqual ("ts2-B", ts2.Items[1].Name, "M6-6");
  275. Assert.AreEqual ("ts2-C", ts2.Items[2].Name, "M6-7");
  276. Assert.AreEqual ("ts2-D", ts2.Items[3].Name, "M6-8");
  277. // Do merge twice, as it helps verify things got back
  278. // to the proper state in the unmerge
  279. ToolStripManager.Merge (ts2, ts1);
  280. Assert.AreEqual (0, ts1.Items.Count, "M7");
  281. Assert.AreEqual (4, ts2.Items.Count, "M8");
  282. Assert.AreEqual ("ts2-A", ts2.Items[0].Name, "M9-5");
  283. Assert.AreEqual ("ts2-B", ts2.Items[1].Name, "M9-6");
  284. Assert.AreEqual ("ts2-C", ts2.Items[2].Name, "M9-7");
  285. Assert.AreEqual ("ts2-D", ts2.Items[3].Name, "M9-8");
  286. ToolStripManager.RevertMerge (ts1, ts2);
  287. Assert.AreEqual (4, ts1.Items.Count, "M10");
  288. Assert.AreEqual (4, ts2.Items.Count, "M11");
  289. Assert.AreEqual ("ts1-A", ts1.Items[0].Name, "M12-1");
  290. Assert.AreEqual ("ts1-B", ts1.Items[1].Name, "M12-2");
  291. Assert.AreEqual ("ts1-C", ts1.Items[2].Name, "M12-3");
  292. Assert.AreEqual ("ts1-D", ts1.Items[3].Name, "M12-4");
  293. Assert.AreEqual ("ts2-A", ts2.Items[0].Name, "M12-5");
  294. Assert.AreEqual ("ts2-B", ts2.Items[1].Name, "M12-6");
  295. Assert.AreEqual ("ts2-C", ts2.Items[2].Name, "M12-7");
  296. Assert.AreEqual ("ts2-D", ts2.Items[3].Name, "M12-8");
  297. }
  298. [Test]
  299. public void MethodMergeToolStripsReplace ()
  300. {
  301. // MergeAction = Replace
  302. ToolStrip ts1 = new ToolStrip ();
  303. ToolStrip ts2 = new ToolStrip ();
  304. ts1.Items.Add ("ts1-A");
  305. ts1.Items.Add ("ts1-B");
  306. ts1.Items.Add ("ts1-C");
  307. ts1.Items.Add ("ts1-D");
  308. ts2.Items.Add ("ts1-A");
  309. ts2.Items.Add ("ts1-B");
  310. ts2.Items.Add ("ts1-C");
  311. ts2.Items.Add ("ts1-D");
  312. ts2.Items[0].MergeAction = MergeAction.Replace;
  313. ts2.Items[1].MergeAction = MergeAction.Replace;
  314. ts2.Items[2].MergeAction = MergeAction.Replace;
  315. ts2.Items[3].MergeAction = MergeAction.Replace;
  316. // Both the item from ts1 and ts2 must have the same Text for Replace to work,
  317. // so I need to give these a Name so I can differentiate them later.
  318. ts1.Items[0].Name = "ts1-A";
  319. ts1.Items[1].Name = "ts1-B";
  320. ts1.Items[2].Name = "ts1-C";
  321. ts1.Items[3].Name = "ts1-D";
  322. ts2.Items[0].Name = "ts2-A";
  323. ts2.Items[1].Name = "ts2-B";
  324. ts2.Items[2].Name = "ts2-C";
  325. ts2.Items[3].Name = "ts2-D";
  326. ToolStripManager.Merge (ts2, ts1);
  327. Assert.AreEqual (4, ts1.Items.Count, "M1");
  328. Assert.AreEqual (0, ts2.Items.Count, "M2");
  329. Assert.AreEqual ("ts2-A", ts1.Items[0].Name, "M3-5");
  330. Assert.AreEqual ("ts2-B", ts1.Items[1].Name, "M3-6");
  331. Assert.AreEqual ("ts2-C", ts1.Items[2].Name, "M3-7");
  332. Assert.AreEqual ("ts2-D", ts1.Items[3].Name, "M3-8");
  333. ToolStripManager.RevertMerge (ts1, ts2);
  334. Assert.AreEqual (4, ts1.Items.Count, "M4");
  335. Assert.AreEqual (4, ts2.Items.Count, "M5");
  336. Assert.AreEqual ("ts1-A", ts1.Items[0].Name, "M6-1");
  337. Assert.AreEqual ("ts1-B", ts1.Items[1].Name, "M6-2");
  338. Assert.AreEqual ("ts1-C", ts1.Items[2].Name, "M6-3");
  339. Assert.AreEqual ("ts1-D", ts1.Items[3].Name, "M6-4");
  340. Assert.AreEqual ("ts2-A", ts2.Items[0].Name, "M6-5");
  341. Assert.AreEqual ("ts2-B", ts2.Items[1].Name, "M6-6");
  342. Assert.AreEqual ("ts2-C", ts2.Items[2].Name, "M6-7");
  343. Assert.AreEqual ("ts2-D", ts2.Items[3].Name, "M6-8");
  344. // Do merge twice, as it helps verify things got back
  345. // to the proper state in the unmerge
  346. ToolStripManager.Merge (ts2, ts1);
  347. Assert.AreEqual (4, ts1.Items.Count, "M7");
  348. Assert.AreEqual (0, ts2.Items.Count, "M8");
  349. Assert.AreEqual ("ts2-A", ts1.Items[0].Name, "M9-5");
  350. Assert.AreEqual ("ts2-B", ts1.Items[1].Name, "M9-6");
  351. Assert.AreEqual ("ts2-C", ts1.Items[2].Name, "M9-7");
  352. Assert.AreEqual ("ts2-D", ts1.Items[3].Name, "M9-8");
  353. ToolStripManager.RevertMerge (ts1, ts2);
  354. Assert.AreEqual (4, ts1.Items.Count, "M10");
  355. Assert.AreEqual (4, ts2.Items.Count, "M11");
  356. Assert.AreEqual ("ts1-A", ts1.Items[0].Name, "M12-1");
  357. Assert.AreEqual ("ts1-B", ts1.Items[1].Name, "M12-2");
  358. Assert.AreEqual ("ts1-C", ts1.Items[2].Name, "M12-3");
  359. Assert.AreEqual ("ts1-D", ts1.Items[3].Name, "M12-4");
  360. Assert.AreEqual ("ts2-A", ts2.Items[0].Name, "M12-5");
  361. Assert.AreEqual ("ts2-B", ts2.Items[1].Name, "M12-6");
  362. Assert.AreEqual ("ts2-C", ts2.Items[2].Name, "M12-7");
  363. Assert.AreEqual ("ts2-D", ts2.Items[3].Name, "M12-8");
  364. }
  365. [Test]
  366. public void MethodMergeToolStripsMatchOnly ()
  367. {
  368. MenuStrip ms1 = new MenuStrip ();
  369. MenuStrip ms2 = new MenuStrip ();
  370. ToolStripMenuItem tsmi1 = (ToolStripMenuItem)ms1.Items.Add ("File");
  371. ToolStripMenuItem tsmi2 = (ToolStripMenuItem)ms2.Items.Add ("File");
  372. tsmi1.DropDownItems.Add ("New 1");
  373. tsmi1.DropDownItems.Add ("Open 1");
  374. tsmi2.DropDownItems.Add ("New 2");
  375. tsmi2.DropDownItems.Add ("Open 2");
  376. tsmi2.MergeAction = MergeAction.MatchOnly;
  377. ToolStripManager.Merge (ms2, ms1);
  378. Assert.AreEqual (4, tsmi1.DropDownItems.Count, "M1");
  379. Assert.AreEqual (0, tsmi2.DropDownItems.Count, "M2");
  380. Assert.AreEqual ("New 1", tsmi1.DropDownItems[0].Text, "M3-1");
  381. Assert.AreEqual ("Open 1", tsmi1.DropDownItems[1].Text, "M3-2");
  382. Assert.AreEqual ("New 2", tsmi1.DropDownItems[2].Text, "M3-3");
  383. Assert.AreEqual ("Open 2", tsmi1.DropDownItems[3].Text, "M3-4");
  384. ToolStripManager.RevertMerge (ms1, ms2);
  385. Assert.AreEqual (2, tsmi1.DropDownItems.Count, "M4");
  386. Assert.AreEqual (2, tsmi2.DropDownItems.Count, "M5");
  387. Assert.AreEqual ("New 1", tsmi1.DropDownItems[0].Text, "M6-1");
  388. Assert.AreEqual ("Open 1", tsmi1.DropDownItems[1].Text, "M6-2");
  389. Assert.AreEqual ("New 2", tsmi2.DropDownItems[0].Text, "M6-3");
  390. Assert.AreEqual ("Open 2", tsmi2.DropDownItems[1].Text, "M6-4");
  391. // Do merge twice, as it helps verify things got back
  392. // to the proper state in the unmerge
  393. ToolStripManager.Merge (ms2, ms1);
  394. Assert.AreEqual (4, tsmi1.DropDownItems.Count, "M7");
  395. Assert.AreEqual (0, tsmi2.DropDownItems.Count, "M8");
  396. Assert.AreEqual ("New 1", tsmi1.DropDownItems[0].Text, "M9-1");
  397. Assert.AreEqual ("Open 1", tsmi1.DropDownItems[1].Text, "M9-2");
  398. Assert.AreEqual ("New 2", tsmi1.DropDownItems[2].Text, "M9-3");
  399. Assert.AreEqual ("Open 2", tsmi1.DropDownItems[3].Text, "M9-4");
  400. ToolStripManager.RevertMerge (ms1, ms2);
  401. Assert.AreEqual (2, tsmi1.DropDownItems.Count, "M10");
  402. Assert.AreEqual (2, tsmi2.DropDownItems.Count, "M11");
  403. Assert.AreEqual ("New 1", tsmi1.DropDownItems[0].Text, "M12-1");
  404. Assert.AreEqual ("Open 1", tsmi1.DropDownItems[1].Text, "M12-2");
  405. Assert.AreEqual ("New 2", tsmi2.DropDownItems[0].Text, "M12-3");
  406. Assert.AreEqual ("Open 2", tsmi2.DropDownItems[1].Text, "M12-4");
  407. }
  408. [Test] // For bug #81477
  409. public void MethodMergeRecursive ()
  410. {
  411. MenuStrip ms1 = new MenuStrip ();
  412. MenuStrip ms2 = new MenuStrip ();
  413. ToolStripMenuItem tsmi1 = (ToolStripMenuItem)ms1.Items.Add ("File");
  414. ToolStripMenuItem tsmi2 = (ToolStripMenuItem)ms2.Items.Add ("File");
  415. tsmi1.DropDownItems.Add ("New 1");
  416. tsmi1.DropDownItems.Add ("Open 1");
  417. tsmi2.DropDownItems.Add ("New 2");
  418. tsmi2.DropDownItems.Add ("Open 2");
  419. tsmi2.DropDownItems[0].MergeAction = MergeAction.Insert;
  420. tsmi2.DropDownItems[0].MergeIndex = 0;
  421. tsmi2.MergeAction = MergeAction.MatchOnly;
  422. ToolStripManager.Merge (ms2, ms1);
  423. Assert.AreEqual ("New 2", tsmi1.DropDownItems[0].Text, "M13");
  424. }
  425. [Test]
  426. [ExpectedException (typeof (ArgumentNullException))]
  427. public void MethodMergeANE1 ()
  428. {
  429. ToolStrip ts = new ToolStrip ();
  430. ts.Name = "moose";
  431. ToolStripManager.Merge (null, "moose");
  432. }
  433. [Test]
  434. [ExpectedException (typeof (ArgumentNullException))]
  435. public void MethodMergeANE2 ()
  436. {
  437. ToolStrip ts = new ToolStrip ();
  438. ToolStripManager.Merge (ts, (string)null);
  439. }
  440. [Test]
  441. [ExpectedException (typeof (ArgumentException))]
  442. public void MethodMergeAE ()
  443. {
  444. ToolStrip ts = new ToolStrip ();
  445. ts.Name = "mergeae";
  446. ToolStripManager.Merge (ts, "mergeae");
  447. }
  448. [Test]
  449. [ExpectedException (typeof (ArgumentNullException))]
  450. public void MethodMergeANE3 ()
  451. {
  452. ToolStrip ts = new ToolStrip ();
  453. ToolStripManager.Merge (null, ts);
  454. }
  455. [Test]
  456. [ExpectedException (typeof (ArgumentNullException))]
  457. public void MethodMergeANE4 ()
  458. {
  459. ToolStrip ts = new ToolStrip ();
  460. ToolStripManager.Merge (ts, (ToolStrip)null);
  461. }
  462. [Test]
  463. [ExpectedException (typeof (ArgumentException))]
  464. public void MethodMergeAE2 ()
  465. {
  466. ToolStrip ts = new ToolStrip ();
  467. ToolStripManager.Merge (ts, ts);
  468. }
  469. [Test]
  470. [ExpectedException (typeof (ArgumentNullException))]
  471. public void MethodRevertMergeANE ()
  472. {
  473. ToolStrip ts = new ToolStrip ();
  474. ToolStripManager.RevertMerge (ts, null);
  475. }
  476. [Test]
  477. public void MethodMergeNothing ()
  478. {
  479. // Merge returns false if it can't successfully merge anything
  480. ToolStrip ts1 = new ToolStrip ();
  481. ToolStrip ts2 = new ToolStrip ();
  482. Assert.AreEqual (false, ToolStripManager.Merge (ts1, ts2), "K1");
  483. }
  484. [Test] // Should not throw AOORE
  485. public void Bug347669 ()
  486. {
  487. Form main = new MainForm ();
  488. main.Show ();
  489. Form frm = new Childform ();
  490. frm.MdiParent = main;
  491. frm.Show ();
  492. main.Dispose ();
  493. }
  494. private class MainForm : Form
  495. {
  496. public MainForm ()
  497. {
  498. mainMenuStrip1 = new MenuStrip ();
  499. File = new ToolStripMenuItem ();
  500. openToolStripMenuItem = new ToolStripMenuItem ();
  501. toolStripSeparator2 = new ToolStripSeparator ();
  502. Dokument = new ToolStripMenuItem ();
  503. arveToolStripMenuItem = new ToolStripMenuItem ();
  504. WareHouse = new ToolStripMenuItem ();
  505. Personnel = new ToolStripMenuItem ();
  506. Payroll = new ToolStripMenuItem ();
  507. FixedAssets = new ToolStripMenuItem ();
  508. Supplies = new ToolStripMenuItem ();
  509. GeneralLedger = new ToolStripMenuItem ();
  510. Manufacturing = new ToolStripMenuItem ();
  511. PointOfSale = new ToolStripMenuItem ();
  512. CardTerminal = new ToolStripMenuItem ();
  513. Rent = new ToolStripMenuItem ();
  514. WayBill = new ToolStripMenuItem ();
  515. CustomerRelationManagement = new ToolStripMenuItem ();
  516. toolStripSeparator8 = new ToolStripSeparator ();
  517. NewUserToolStripMenuItem = new ToolStripMenuItem ();
  518. exitToolStripMenuItem = new ToolStripMenuItem ();
  519. mainMenuStrip1.Items.AddRange (new ToolStripItem[] {
  520. File
  521. });
  522. mainMenuStrip1.Location = new Point (0, 0);
  523. mainMenuStrip1.Name = "mainMenuStrip1";
  524. mainMenuStrip1.Size = new Size (644, 24);
  525. mainMenuStrip1.TabIndex = 3;
  526. mainMenuStrip1.Text = "menuStrip1";
  527. File.DropDownItems.AddRange (new ToolStripItem[] {
  528. openToolStripMenuItem,
  529. toolStripSeparator2,
  530. Dokument,
  531. WareHouse,
  532. Personnel,
  533. Payroll,
  534. FixedAssets,
  535. Supplies,
  536. GeneralLedger,
  537. Manufacturing,
  538. PointOfSale,
  539. CardTerminal,
  540. Rent,
  541. WayBill,
  542. CustomerRelationManagement,
  543. toolStripSeparator8,
  544. NewUserToolStripMenuItem,
  545. exitToolStripMenuItem});
  546. File.MergeAction = MergeAction.Insert;
  547. File.MergeIndex = 1;
  548. File.Name = "File";
  549. File.Size = new Size (35, 20);
  550. File.Text = "&File";
  551. openToolStripMenuItem.MergeIndex = 1;
  552. openToolStripMenuItem.Name = "openToolStripMenuItem";
  553. openToolStripMenuItem.Size = new Size (196, 22);
  554. openToolStripMenuItem.Text = "Open";
  555. toolStripSeparator2.MergeIndex = 2;
  556. toolStripSeparator2.Name = "toolStripSeparator2";
  557. toolStripSeparator2.Size = new Size (193, 6);
  558. Dokument.DropDownItems.AddRange (new ToolStripItem[] {
  559. arveToolStripMenuItem
  560. });
  561. Dokument.MergeIndex = 3;
  562. Dokument.Name = "Dokument";
  563. Dokument.Size = new Size (196, 22);
  564. Dokument.Text = "&Dokument";
  565. arveToolStripMenuItem.Name = "arveToolStripMenuItem";
  566. arveToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+E";
  567. arveToolStripMenuItem.ShortcutKeys = ((Keys)((Keys.Control | Keys.E)));
  568. arveToolStripMenuItem.Size = new Size (146, 22);
  569. arveToolStripMenuItem.Text = "Arve";
  570. WareHouse.MergeIndex = 4;
  571. WareHouse.Name = "WareHouse";
  572. WareHouse.Size = new Size (196, 22);
  573. WareHouse.Text = "&Ladu";
  574. Personnel.MergeIndex = 5;
  575. Personnel.Name = "Personnel";
  576. Personnel.Size = new Size (196, 22);
  577. Personnel.Text = "&Kaader";
  578. Payroll.MergeIndex = 6;
  579. Payroll.Name = "Payroll";
  580. Payroll.Size = new Size (196, 22);
  581. Payroll.Text = "&Palk";
  582. FixedAssets.MergeIndex = 7;
  583. FixedAssets.Name = "FixedAssets";
  584. FixedAssets.Size = new Size (196, 22);
  585. FixedAssets.Text = "Test";
  586. Supplies.MergeIndex = 8;
  587. Supplies.Name = "Supplies";
  588. Supplies.Size = new Size (196, 22);
  589. Supplies.Text = "Sample";
  590. GeneralLedger.MergeIndex = 9;
  591. GeneralLedger.Name = "GeneralLedger";
  592. GeneralLedger.Size = new Size (196, 22);
  593. GeneralLedger.Text = "Blah";
  594. Manufacturing.MergeIndex = 10;
  595. Manufacturing.Name = "Manufacturing";
  596. Manufacturing.Size = new Size (196, 22);
  597. Manufacturing.Text = "&Tootmine";
  598. PointOfSale.MergeIndex = 11;
  599. PointOfSale.Name = "PointOfSale";
  600. PointOfSale.Size = new Size (196, 22);
  601. PointOfSale.Text = "IceCream";
  602. CardTerminal.MergeIndex = 12;
  603. CardTerminal.Name = "CardTerminal";
  604. CardTerminal.Size = new Size (196, 22);
  605. CardTerminal.Text = "Terminal";
  606. Rent.MergeIndex = 13;
  607. Rent.Name = "Rent";
  608. Rent.Size = new Size (196, 22);
  609. Rent.Text = "Rent";
  610. WayBill.MergeIndex = 14;
  611. WayBill.Name = "WayBill";
  612. WayBill.Size = new Size (196, 22);
  613. WayBill.Text = "WayBill";
  614. CustomerRelationManagement.MergeIndex = 15;
  615. CustomerRelationManagement.Name = "CustomerRelationManagement";
  616. CustomerRelationManagement.Size = new Size (196, 22);
  617. CustomerRelationManagement.Text = "CustomerRelationManagement";
  618. toolStripSeparator8.MergeAction = MergeAction.Insert;
  619. toolStripSeparator8.MergeIndex = 20;
  620. toolStripSeparator8.Name = "toolStripSeparator8";
  621. toolStripSeparator8.Size = new Size (193, 6);
  622. NewUserToolStripMenuItem.MergeIndex = 21;
  623. NewUserToolStripMenuItem.Name = "NewUserToolStripMenuItem";
  624. NewUserToolStripMenuItem.ShortcutKeys = ((Keys)((Keys.Shift |
  625. Keys.F2)));
  626. NewUserToolStripMenuItem.Size = new Size (196, 22);
  627. NewUserToolStripMenuItem.Text = "Uus kasutaja";
  628. exitToolStripMenuItem.MergeIndex = 22;
  629. exitToolStripMenuItem.Name = "exitToolStripMenuItem";
  630. exitToolStripMenuItem.Size = new Size (196, 22);
  631. exitToolStripMenuItem.Text = "Exit";
  632. AutoScaleDimensions = new SizeF (6F, 13F);
  633. AutoScaleMode = AutoScaleMode.Font;
  634. BackgroundImageLayout = ImageLayout.Center;
  635. ClientSize = new Size (644, 396);
  636. Controls.Add (mainMenuStrip1);
  637. IsMdiContainer = true;
  638. KeyPreview = false;
  639. MainMenuStrip = mainMenuStrip1;
  640. Name = "MainForm";
  641. }
  642. MenuStrip mainMenuStrip1;
  643. ToolStripMenuItem File;
  644. ToolStripMenuItem openToolStripMenuItem;
  645. ToolStripSeparator toolStripSeparator2;
  646. ToolStripMenuItem exitToolStripMenuItem;
  647. ToolStripMenuItem Dokument;
  648. ToolStripMenuItem arveToolStripMenuItem;
  649. ToolStripMenuItem WareHouse;
  650. ToolStripMenuItem Personnel;
  651. ToolStripMenuItem Payroll;
  652. ToolStripMenuItem FixedAssets;
  653. ToolStripMenuItem Supplies;
  654. ToolStripMenuItem GeneralLedger;
  655. ToolStripMenuItem Manufacturing;
  656. ToolStripMenuItem PointOfSale;
  657. ToolStripMenuItem CardTerminal;
  658. ToolStripMenuItem Rent;
  659. ToolStripMenuItem WayBill;
  660. ToolStripMenuItem CustomerRelationManagement;
  661. ToolStripSeparator toolStripSeparator8;
  662. ToolStripMenuItem NewUserToolStripMenuItem;
  663. }
  664. private class Childform : Form
  665. {
  666. public Childform ()
  667. {
  668. menuStrip1 = new MenuStrip ();
  669. fileToolStripMenuItem = new ToolStripMenuItem ();
  670. toolStripSeparator = new ToolStripSeparator ();
  671. printToolStripMenuItem = new ToolStripMenuItem ();
  672. editToolStripMenuItem = new ToolStripMenuItem ();
  673. toolStripSeparator3 = new ToolStripSeparator ();
  674. copyToolStripMenuItem = new ToolStripMenuItem ();
  675. toolStripSeparator4 = new ToolStripSeparator ();
  676. selectAllToolStripMenuItem = new ToolStripMenuItem ();
  677. toolsToolStripMenuItem = new ToolStripMenuItem ();
  678. addToolStripMenuItem = new ToolStripMenuItem ();
  679. deleteToolStripMenuItem = new ToolStripMenuItem ();
  680. filterToolStripMenuItem = new ToolStripMenuItem ();
  681. helpToolStripMenuItem = new ToolStripMenuItem ();
  682. searchToolStripMenuItem = new ToolStripMenuItem ();
  683. menuStrip1.SuspendLayout ();
  684. SuspendLayout ();
  685. menuStrip1.Items.AddRange (new ToolStripItem[] {
  686. fileToolStripMenuItem,
  687. editToolStripMenuItem,
  688. toolsToolStripMenuItem,
  689. helpToolStripMenuItem});
  690. menuStrip1.Location = new Point (0, 0);
  691. menuStrip1.Name = "menuStrip1";
  692. menuStrip1.RenderMode = ToolStripRenderMode.System;
  693. menuStrip1.Size = new Size (337, 24);
  694. menuStrip1.TabIndex = 2;
  695. menuStrip1.Text = "menuStrip1";
  696. menuStrip1.Visible = false;
  697. fileToolStripMenuItem.DropDownItems.AddRange (new ToolStripItem[] {
  698. toolStripSeparator,
  699. printToolStripMenuItem});
  700. fileToolStripMenuItem.MergeAction = MergeAction.MatchOnly;
  701. fileToolStripMenuItem.Name = "fileToolStripMenuItem";
  702. fileToolStripMenuItem.Size = new Size (35, 20);
  703. fileToolStripMenuItem.Text = "&File";
  704. toolStripSeparator.MergeAction = MergeAction.Insert;
  705. toolStripSeparator.MergeIndex = 3;
  706. toolStripSeparator.Name = "toolStripSeparator";
  707. toolStripSeparator.Size = new Size (149, 6);
  708. printToolStripMenuItem.MergeAction = MergeAction.Insert;
  709. printToolStripMenuItem.MergeIndex = 2;
  710. printToolStripMenuItem.Name = "printToolStripMenuItem";
  711. printToolStripMenuItem.ShortcutKeys = ((Keys)((Keys.Control |
  712. Keys.P)));
  713. printToolStripMenuItem.Size = new Size (152, 22);
  714. printToolStripMenuItem.Text = "&Print";
  715. editToolStripMenuItem.DropDownItems.AddRange (new ToolStripItem[] {
  716. toolStripSeparator3,
  717. copyToolStripMenuItem,
  718. toolStripSeparator4,
  719. selectAllToolStripMenuItem});
  720. editToolStripMenuItem.MergeAction = MergeAction.Insert;
  721. editToolStripMenuItem.MergeIndex = 1;
  722. editToolStripMenuItem.Name = "editToolStripMenuItem";
  723. editToolStripMenuItem.Size = new Size (59, 20);
  724. editToolStripMenuItem.Text = "&Paranda";
  725. toolStripSeparator3.Name = "toolStripSeparator3";
  726. toolStripSeparator3.Size = new Size (157, 6);
  727. copyToolStripMenuItem.Name = "copyToolStripMenuItem";
  728. copyToolStripMenuItem.ShortcutKeys = ((Keys)((Keys.Control | Keys.C)));
  729. copyToolStripMenuItem.Size = new Size (160, 22);
  730. copyToolStripMenuItem.Text = "Kopeeri";
  731. toolStripSeparator4.Name = "toolStripSeparator4";
  732. toolStripSeparator4.Size = new Size (157, 6);
  733. selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem";
  734. selectAllToolStripMenuItem.Size = new Size (160, 22);
  735. selectAllToolStripMenuItem.Text = "selectAllToolStripMenuItem";
  736. toolsToolStripMenuItem.DropDownItems.AddRange (new ToolStripItem[] {
  737. addToolStripMenuItem,
  738. deleteToolStripMenuItem,
  739. filterToolStripMenuItem});
  740. toolsToolStripMenuItem.MergeAction = MergeAction.Insert;
  741. toolsToolStripMenuItem.MergeIndex = 2;
  742. toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
  743. toolsToolStripMenuItem.Size = new Size (60, 20);
  744. toolsToolStripMenuItem.Text = "&Tegevus";
  745. addToolStripMenuItem.Name = "addToolStripMenuItem";
  746. addToolStripMenuItem.ShortcutKeys = ((Keys)((Keys.Control | Keys.N)));
  747. addToolStripMenuItem.Size = new Size (160, 22);
  748. addToolStripMenuItem.Text = "Lisa";
  749. deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
  750. deleteToolStripMenuItem.ShortcutKeys = ((Keys)((Keys.Control |
  751. Keys.T)));
  752. deleteToolStripMenuItem.Size = new Size (160, 22);
  753. deleteToolStripMenuItem.Text = "Kustuta";
  754. filterToolStripMenuItem.ImageTransparentColor =
  755. Color.Silver;
  756. filterToolStripMenuItem.Name = "filterToolStripMenuItem";
  757. filterToolStripMenuItem.ShortcutKeys = Keys.F11;
  758. filterToolStripMenuItem.Size = new Size (160, 22);
  759. filterToolStripMenuItem.Text = "Tingimus";
  760. helpToolStripMenuItem.DropDownItems.AddRange (new ToolStripItem[] {
  761. searchToolStripMenuItem});
  762. helpToolStripMenuItem.MergeAction = MergeAction.MatchOnly;
  763. helpToolStripMenuItem.Name = "helpToolStripMenuItem";
  764. helpToolStripMenuItem.Size = new Size (34, 20);
  765. helpToolStripMenuItem.Text = "&Abi";
  766. searchToolStripMenuItem.MergeAction = MergeAction.Insert;
  767. searchToolStripMenuItem.MergeIndex = 1;
  768. searchToolStripMenuItem.Name = "searchToolStripMenuItem";
  769. searchToolStripMenuItem.ShortcutKeys = Keys.F1;
  770. searchToolStripMenuItem.Size = new Size (160, 22);
  771. searchToolStripMenuItem.Text = "&Otsi teemat";
  772. AutoScaleDimensions = new SizeF (6F, 13F);
  773. ClientSize = new Size (337, 272);
  774. Controls.Add (menuStrip1);
  775. }
  776. MenuStrip menuStrip1;
  777. ToolStripMenuItem fileToolStripMenuItem;
  778. ToolStripSeparator toolStripSeparator;
  779. ToolStripMenuItem printToolStripMenuItem;
  780. ToolStripMenuItem editToolStripMenuItem;
  781. ToolStripSeparator toolStripSeparator3;
  782. ToolStripMenuItem copyToolStripMenuItem;
  783. ToolStripSeparator toolStripSeparator4;
  784. ToolStripMenuItem selectAllToolStripMenuItem;
  785. ToolStripMenuItem toolsToolStripMenuItem;
  786. ToolStripMenuItem addToolStripMenuItem;
  787. ToolStripMenuItem deleteToolStripMenuItem;
  788. ToolStripMenuItem filterToolStripMenuItem;
  789. ToolStripMenuItem helpToolStripMenuItem;
  790. ToolStripMenuItem searchToolStripMenuItem;
  791. }
  792. }
  793. }
  794. #endif