Form.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. // Permission is hereby granted, free of charge, to any person obtaining
  2. // a copy of this software and associated documentation files (the
  3. // "Software"), to deal in the Software without restriction, including
  4. // without limitation the rights to use, copy, modify, merge, publish,
  5. // distribute, sublicense, and/or sell copies of the Software, and to
  6. // permit persons to whom the Software is furnished to do so, subject to
  7. // the following conditions:
  8. //
  9. // The above copyright notice and this permission notice shall be
  10. // included in all copies or substantial portions of the Software.
  11. //
  12. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  13. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  15. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  16. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  17. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  18. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  19. //
  20. // Copyright (c) 2004 Novell, Inc.
  21. //
  22. // Authors:
  23. // Peter Bartok [email protected]
  24. //
  25. //
  26. // $Revision: 1.20 $
  27. // $Modtime: $
  28. // $Log: Form.cs,v $
  29. // Revision 1.20 2004/10/29 15:55:26 jordi
  30. // Menu key navigation, itemcollection completion, menu fixes
  31. //
  32. // Revision 1.19 2004/10/20 03:56:23 pbartok
  33. // - Added private FormParentWindow class which acts as the container for
  34. // our form and as the non-client area where menus are drawn
  35. // - Added/Moved required tie-ins to Jordi's menus
  36. // - Fixed/Implemented the FormStartPosition functionality
  37. //
  38. // Revision 1.18 2004/10/18 04:47:09 pbartok
  39. // - Fixed Form.ControlCollection to handle owner relations
  40. // - Added Owner/OwnedForms handling
  41. // - Implemented Z-Ordering for owned forms
  42. // - Removed unneeded private overload of ShowDialog
  43. // - Fixed ShowDialog, added the X11 incarnation of modal handling (or so I
  44. // hope)
  45. // - Fixed Close(), had wrong default
  46. // - Added firing of OnLoad event
  47. // - Added some commented out debug code for Ownership handling
  48. //
  49. // Revision 1.17 2004/10/15 12:43:19 jordi
  50. // menu work, mainmenu, subitems, etc
  51. //
  52. // Revision 1.16 2004/10/14 06:17:58 ravindra
  53. // Fixed class signature. ShowDialog (Control) is not a public method.
  54. //
  55. // Revision 1.15 2004/10/08 08:50:29 jordi
  56. // more menu work
  57. //
  58. // Revision 1.14 2004/10/02 19:05:52 pbartok
  59. // - Added KeyPreview property
  60. // - Added Menu property (still incomplete, pending Jordi's menu work)
  61. // - Implemented ProcessCmdKey
  62. // - Implemented ProcessDialogKey
  63. // - Implemented ProcessKeyPreview
  64. //
  65. // Revision 1.13 2004/10/01 17:53:26 jackson
  66. // Implement the Close method so work on MessageBox can continue.
  67. //
  68. // Revision 1.12 2004/09/23 19:08:59 jackson
  69. // Temp build fixage
  70. //
  71. // Revision 1.11 2004/09/22 20:09:44 pbartok
  72. // - Added Form.ControllCollection class
  73. // - Added handling for Form owners: Owner, OwnedForms, AddOwnedForm,
  74. // RemoveOwnedForm (still incomplete, missing on-top and common
  75. // minimize/maximize behaviour)
  76. // - Added StartPosition property (still incomplete, does not use when
  77. // creating the form)
  78. // - Added ShowDialog() methods (still incomplete, missing forcing the dialog
  79. // modal)
  80. //
  81. // Revision 1.10 2004/09/13 16:56:04 pbartok
  82. // - Fixed #region names
  83. // - Moved properties and methods into their proper #regions
  84. //
  85. // Revision 1.9 2004/09/13 16:51:29 pbartok
  86. // - Added Accept and CancelButton properties
  87. // - Added ProcessDialogKey() method
  88. //
  89. // Revision 1.8 2004/09/01 02:05:18 pbartok
  90. // - Added (partial) implementation of DialogResult; rest needs to be
  91. // implemented when the modal loop code is done
  92. //
  93. // Revision 1.7 2004/08/23 22:10:02 pbartok
  94. // - Fixed handling of WM_CLOSE message
  95. // - Removed debug output
  96. //
  97. // Revision 1.6 2004/08/22 21:10:30 pbartok
  98. // - Removed OverlappedWindow style from Control, instead it's default
  99. // now is child
  100. // - Made form windows OverlappedWindow by default
  101. //
  102. // Revision 1.5 2004/08/19 21:30:37 pbartok
  103. // - Added handling of WM_CLOSE
  104. //
  105. // Revision 1.4 2004/08/11 22:20:59 pbartok
  106. // - Signature fixes
  107. //
  108. // Revision 1.3 2004/08/04 21:13:47 pbartok
  109. // - Added AutoScale properties
  110. //
  111. // Revision 1.2 2004/07/13 15:31:45 jordi
  112. // commit: new properties and fixes form size problems
  113. //
  114. // Revision 1.1 2004/07/09 05:21:25 pbartok
  115. // - Initial check-in
  116. //
  117. //
  118. // NOT COMPLETE
  119. using System;
  120. using System.Drawing;
  121. using System.ComponentModel;
  122. using System.Collections;
  123. using System.Runtime.InteropServices;
  124. using System.Threading;
  125. namespace System.Windows.Forms {
  126. public class Form : ContainerControl {
  127. #region Local Variables
  128. internal bool closing;
  129. private static bool autoscale;
  130. private static Size autoscale_base_size;
  131. private bool is_modal;
  132. internal bool end_modal; // This var is being monitored by the application modal loop
  133. private IButtonControl accept_button;
  134. private IButtonControl cancel_button;
  135. private DialogResult dialog_result;
  136. private FormStartPosition start_position;
  137. private Form owner;
  138. private Form.ControlCollection owned_forms;
  139. private bool key_preview;
  140. private MainMenu menu;
  141. internal FormParentWindow form_parent_window;
  142. #endregion // Local Variables
  143. #region Private Classes
  144. // This class will take over for the client area
  145. internal class FormParentWindow : Control {
  146. #region FormParentWindow Class Local Variables
  147. internal Form owner;
  148. #endregion // FormParentWindow Class Local Variables
  149. #region FormParentWindow Class Constructor
  150. internal FormParentWindow(Form owner) : base() {
  151. this.owner = owner;
  152. this.Width = 250;
  153. this.Height = 250;
  154. BackColor = owner.BackColor;
  155. Text = "FormParent";
  156. this.Location = new Point(0, 0);
  157. this.Dock = DockStyle.Fill;
  158. MouseDown += new MouseEventHandler (OnMouseDownForm);
  159. MouseMove += new MouseEventHandler (OnMouseMoveForm);
  160. owner.TextChanged += new EventHandler(OnFormTextChanged);
  161. }
  162. #endregion // FormParentWindow Class Constructor
  163. #region FormParentWindow Class Protected Instance Methods
  164. protected override CreateParams CreateParams {
  165. get {
  166. CreateParams cp;
  167. cp = base.CreateParams;
  168. cp.Style = (int)(WindowStyles.WS_OVERLAPPEDWINDOW |
  169. WindowStyles.WS_VISIBLE |
  170. WindowStyles.WS_CLIPSIBLINGS |
  171. WindowStyles.WS_CLIPCHILDREN);
  172. cp.Width = 250;
  173. cp.Height = 250;
  174. #if later
  175. if (this.IsHandleCreated) {
  176. int x;
  177. int y;
  178. int width;
  179. int height;
  180. int cwidth;
  181. int cheight;
  182. XplatUI.GetWindowPos(this.window.Handle, out x, out y, out width, out height, out cwidth, out cheight);
  183. UpdateBounds(x, y, width, height);
  184. owner.UpdateBounds(x, y, width, height);
  185. }
  186. #endif
  187. return cp;
  188. }
  189. }
  190. protected override void OnResize(EventArgs e) {
  191. base.OnResize(e);
  192. //owner.SetBoundsCore(owner.Bounds.X, owner.Bounds.Y, ClientSize.Width, ClientSize.Height, BoundsSpecified.All);
  193. if (owner.menu == null) {
  194. owner.SetBoundsCore(0, 0, ClientSize.Width, ClientSize.Height, BoundsSpecified.All);
  195. } else {
  196. int menu_height;
  197. menu_height = MenuAPI.MenuBarCalcSize(DeviceContext, owner.Menu.menu_handle, ClientSize.Width);
  198. owner.SetBoundsCore(0, menu_height, ClientSize.Width, ClientSize.Height-menu_height, BoundsSpecified.All);
  199. }
  200. }
  201. protected override void OnPaint(PaintEventArgs pevent) {
  202. OnDrawMenu (pevent.Graphics);
  203. }
  204. protected override void WndProc(ref Message m) {
  205. switch((Msg)m.Msg) {
  206. case Msg.WM_CLOSE: {
  207. CancelEventArgs args = new CancelEventArgs();
  208. owner.OnClosing(args);
  209. if (!args.Cancel) {
  210. owner.OnClosed(EventArgs.Empty);
  211. owner.closing = true;
  212. base.WndProc(ref m);
  213. break;
  214. }
  215. break;
  216. }
  217. default: {
  218. base.WndProc (ref m);
  219. break;
  220. }
  221. }
  222. }
  223. #endregion // FormParentWindow Class Protected Instance Methods
  224. #region FormParentWindow Class Private Methods
  225. private void OnMouseDownForm (object sender, MouseEventArgs e) {
  226. if (owner.menu != null)
  227. owner.menu.OnMouseDown (owner, e);
  228. }
  229. private void OnMouseMoveForm (object sender, MouseEventArgs e) {
  230. if (owner.menu != null)
  231. owner.menu.OnMouseMove (owner, e);
  232. }
  233. private void OnDrawMenu (Graphics dc) {
  234. if (owner.menu != null) {
  235. Rectangle rect = new Rectangle (0,0, Width, 0);
  236. MenuAPI.DrawMenuBar (dc, owner.menu.Handle, rect);
  237. }
  238. }
  239. private void OnFormTextChanged(object sender, EventArgs e) {
  240. this.Text = ((Control)sender).Text;
  241. }
  242. #endregion // FormParentWindow Class Private Methods
  243. }
  244. #endregion // Private Classes
  245. #region Public Classes
  246. public class ControlCollection : Control.ControlCollection {
  247. Form form_owner;
  248. public ControlCollection(Form owner) : base(owner) {
  249. this.form_owner = owner;
  250. }
  251. public override void Add(Control value) {
  252. for (int i=0; i<list.Count; i++) {
  253. if (list[i]==value) {
  254. // Do we need to do anything here?
  255. return;
  256. }
  257. }
  258. list.Add(value);
  259. ((Form)value).owner=(Form)owner;
  260. }
  261. public override void Remove(Control value) {
  262. ((Form)value).owner = null;
  263. base.Remove (value);
  264. }
  265. }
  266. #endregion // Public Classes
  267. #region Public Constructor & Destructor
  268. public Form() {
  269. closing = false;
  270. is_modal = false;
  271. end_modal = false;
  272. dialog_result = DialogResult.None;
  273. start_position = FormStartPosition.WindowsDefaultLocation;
  274. key_preview = false;
  275. menu = null;
  276. owned_forms = new Form.ControlCollection(this);
  277. }
  278. #endregion // Public Constructor & Destructor
  279. #region Public Static Properties
  280. #endregion // Public Static Properties
  281. #region Public Instance Properties
  282. public IButtonControl AcceptButton {
  283. get {
  284. return accept_button;
  285. }
  286. set {
  287. accept_button = value;
  288. }
  289. }
  290. public bool AutoScale {
  291. get {
  292. return autoscale;
  293. }
  294. set {
  295. autoscale=value;
  296. }
  297. }
  298. public virtual Size AutoScaleBaseSize {
  299. get {
  300. return autoscale_base_size;
  301. }
  302. set {
  303. autoscale_base_size=value;
  304. }
  305. }
  306. public IButtonControl CancelButton {
  307. get {
  308. return cancel_button;
  309. }
  310. set {
  311. cancel_button = value;
  312. }
  313. }
  314. public DialogResult DialogResult {
  315. get {
  316. return dialog_result;
  317. }
  318. set {
  319. dialog_result = value;
  320. if (is_modal && (dialog_result != DialogResult.None)) {
  321. end_modal = true;
  322. }
  323. }
  324. }
  325. public bool KeyPreview {
  326. get {
  327. return key_preview;
  328. }
  329. set {
  330. key_preview = value;
  331. }
  332. }
  333. public MainMenu Menu {
  334. get {
  335. return menu;
  336. }
  337. set {
  338. if (menu != value) {
  339. if (value == null) {
  340. form_parent_window.Width = form_parent_window.Width; // Trigger a resize
  341. }
  342. menu = value;
  343. // To simulate the non-client are for menus we create a
  344. // new control as the 'client area' of our form. This
  345. // way, the origin stays 0,0 and we don't have to fiddle with
  346. // coordinates. The menu area is part of the original container
  347. if (menu != null) {
  348. form_parent_window.Width = form_parent_window.Width; // Trigger a resize
  349. }
  350. menu.SetForm (this);
  351. MenuAPI.SetMenuBarWindow (menu.Handle, this);
  352. }
  353. }
  354. }
  355. public bool Modal {
  356. get {
  357. return is_modal;
  358. }
  359. }
  360. public Form[] OwnedForms {
  361. get {
  362. Form[] form_list;
  363. form_list = new Form[owned_forms.Count];
  364. for (int i=0; i<owned_forms.Count; i++) {
  365. form_list[i] = (Form)owned_forms[i];
  366. }
  367. return form_list;
  368. }
  369. }
  370. public Form Owner {
  371. get {
  372. return owner;
  373. }
  374. set {
  375. if (owner != value) {
  376. if (owner != null) {
  377. owner.RemoveOwnedForm(this);
  378. }
  379. owner = value;
  380. owner.AddOwnedForm(this);
  381. if (owner != null) {
  382. XplatUI.SetTopmost(this.window.Handle, true);
  383. } else {
  384. XplatUI.SetTopmost(this.window.Handle, false);
  385. }
  386. }
  387. }
  388. }
  389. public FormStartPosition StartPosition {
  390. get {
  391. return start_position;
  392. }
  393. set {
  394. if (start_position == FormStartPosition.WindowsDefaultLocation) { // Only do this if it's not set yet
  395. start_position = value;
  396. if (form_parent_window.IsHandleCreated) {
  397. switch(start_position) {
  398. case FormStartPosition.CenterParent: {
  399. if (Parent!=null && Width>0 && Height>0) {
  400. this.Location = new Point(Parent.Size.Width/2-Width/2, Parent.Size.Height/2-Height/2);
  401. }
  402. break;
  403. }
  404. case FormStartPosition.CenterScreen: {
  405. if (Width>0 && Height>0) {
  406. Size DisplaySize;
  407. XplatUI.GetDisplaySize(out DisplaySize);
  408. this.Location = new Point(DisplaySize.Width/2-Width/2, DisplaySize.Height/2-Height/2);
  409. }
  410. break;
  411. }
  412. default: {
  413. break;
  414. }
  415. }
  416. }
  417. }
  418. }
  419. }
  420. #endregion // Public Instance Properties
  421. #region Protected Instance Properties
  422. [MonoTODO("Need to add MDI support")]
  423. protected override CreateParams CreateParams {
  424. get {
  425. CreateParams cp = new CreateParams();
  426. if (this.form_parent_window == null) {
  427. form_parent_window = new FormParentWindow(this);
  428. }
  429. cp.Caption = "ClientArea";
  430. cp.ClassName=XplatUI.DefaultClassName;
  431. cp.ClassStyle = 0;
  432. cp.ExStyle=0;
  433. cp.Param=0;
  434. cp.Parent = this.form_parent_window.window.Handle;
  435. cp.X = Left;
  436. cp.Y = Top;
  437. cp.Width = Width;
  438. cp.Height = Height;
  439. cp.Style = (int)WindowStyles.WS_CHILD;
  440. cp.Style |= (int)WindowStyles.WS_VISIBLE;
  441. cp.Style |= (int)WindowStyles.WS_CLIPSIBLINGS;
  442. cp.Style |= (int)WindowStyles.WS_CLIPCHILDREN;
  443. return cp;
  444. }
  445. }
  446. protected override Size DefaultSize {
  447. get {
  448. return new Size (250, 250);
  449. }
  450. }
  451. protected override void OnPaint (PaintEventArgs pevent)
  452. {
  453. base.OnPaint (pevent);
  454. }
  455. #endregion // Protected Instance Properties
  456. #region Public Static Methods
  457. #endregion // Public Static Methods
  458. #region Public Instance Methods
  459. public void AddOwnedForm(Form ownedForm) {
  460. owned_forms.Add(ownedForm);
  461. }
  462. public void RemoveOwnedForm(Form ownedForm) {
  463. owned_forms.Remove(ownedForm);
  464. }
  465. public DialogResult ShowDialog() {
  466. return ShowDialog(null);
  467. }
  468. public DialogResult ShowDialog(IWin32Window ownerWin32) {
  469. Control owner = null;
  470. if (ownerWin32 != null) {
  471. owner = Control.FromHandle(ownerWin32.Handle);
  472. }
  473. if (is_modal) {
  474. return DialogResult.None;
  475. }
  476. if (Visible) {
  477. throw new InvalidOperationException("Already visible forms cannot be displayed as a modal dialog. Set the Visible property to 'false' prior to calling Form.ShowDialog.");
  478. }
  479. if (!IsHandleCreated) {
  480. CreateControl();
  481. }
  482. XplatUI.SetModal(window.Handle, true);
  483. Show();
  484. is_modal = true;
  485. Application.ModalRun(this);
  486. is_modal = false;
  487. Hide();
  488. XplatUI.SetModal(window.Handle, false);
  489. return DialogResult;
  490. }
  491. public void Close ()
  492. {
  493. CancelEventArgs args = new CancelEventArgs ();
  494. OnClosing (args);
  495. if (!args.Cancel) {
  496. OnClosed (EventArgs.Empty);
  497. closing = true;
  498. return;
  499. }
  500. }
  501. #endregion // Public Instance Methods
  502. #region Protected Instance Methods
  503. protected override void CreateHandle() {
  504. base.CreateHandle ();
  505. }
  506. protected override void OnCreateControl() {
  507. base.OnCreateControl ();
  508. OnLoad(EventArgs.Empty);
  509. }
  510. protected override void OnHandleCreated(EventArgs e) {
  511. base.OnHandleCreated (e);
  512. }
  513. protected override void OnHandleDestroyed(EventArgs e) {
  514. base.OnHandleDestroyed (e);
  515. }
  516. protected override void OnResize(EventArgs e) {
  517. base.OnResize(e);
  518. }
  519. protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {
  520. if (base.ProcessCmdKey (ref msg, keyData)) {
  521. return true;
  522. }
  523. // Give our menu a shot
  524. if (menu != null) {
  525. return menu.ProcessCmdKey(ref msg, keyData);
  526. }
  527. return false;
  528. }
  529. protected override bool ProcessDialogKey(Keys keyData) {
  530. if (keyData == Keys.Enter && accept_button != null) {
  531. accept_button.PerformClick();
  532. return true;
  533. } else if (keyData == Keys.Enter && cancel_button != null) {
  534. cancel_button.PerformClick();
  535. return true;
  536. }
  537. return base.ProcessDialogKey(keyData);
  538. }
  539. protected override bool ProcessKeyPreview(ref Message msg) {
  540. if (key_preview) {
  541. if (ProcessKeyEventArgs(ref msg)) {
  542. return true;
  543. }
  544. }
  545. return base.ProcessKeyPreview (ref msg);
  546. }
  547. protected override void WndProc(ref Message m) {
  548. switch((Msg)m.Msg) {
  549. case Msg.WM_CLOSE: {
  550. CancelEventArgs args = new CancelEventArgs();
  551. OnClosing(args);
  552. if (!args.Cancel) {
  553. OnClosed(EventArgs.Empty);
  554. closing = true;
  555. base.WndProc(ref m);
  556. break;
  557. }
  558. break;
  559. }
  560. #if topmost_workaround
  561. case Msg.WM_ACTIVATE: {
  562. if (this.OwnedForms.Length>0) {
  563. XplatUI.SetZOrder(this.OwnedForms[0].window.Handle, this.window.Handle, false, false);
  564. }
  565. break;
  566. }
  567. #endif
  568. default: {
  569. base.WndProc (ref m);
  570. break;
  571. }
  572. }
  573. }
  574. #endregion // Protected Instance Methods
  575. #region Events
  576. protected virtual void OnActivated(EventArgs e) {
  577. if (Activated != null) {
  578. Activated(this, e);
  579. }
  580. }
  581. protected virtual void OnClosed(EventArgs e) {
  582. if (Closed != null) {
  583. Closed(this, e);
  584. }
  585. }
  586. protected virtual void OnClosing(System.ComponentModel.CancelEventArgs e) {
  587. if (Closing != null) {
  588. Closing(this, e);
  589. }
  590. }
  591. protected virtual void OnDeactivate(EventArgs e) {
  592. if (Deactivate != null) {
  593. Deactivate(this, e);
  594. }
  595. }
  596. protected virtual void OnInputLanguageChanged(InputLanguageChangedEventArgs e) {
  597. if (InputLanguageChanged!=null) {
  598. InputLanguageChanged(this, e);
  599. }
  600. }
  601. protected virtual void OnInputLanguageChanging(InputLanguageChangingEventArgs e) {
  602. if (InputLanguageChanging!=null) {
  603. InputLanguageChanging(this, e);
  604. }
  605. }
  606. protected virtual void OnLoad(EventArgs e) {
  607. if (Load != null) {
  608. Load(this, e);
  609. }
  610. }
  611. protected virtual void OnMaximizedBoundsChanged(EventArgs e) {
  612. if (MaximizedBoundsChanged != null) {
  613. MaximizedBoundsChanged(this, e);
  614. }
  615. }
  616. protected virtual void OnMaximumSizeChanged(EventArgs e) {
  617. if (MaximumSizeChanged != null) {
  618. MaximumSizeChanged(this, e);
  619. }
  620. }
  621. protected virtual void OnMdiChildActivate(EventArgs e) {
  622. if (MdiChildActivate != null) {
  623. MdiChildActivate(this, e);
  624. }
  625. }
  626. protected virtual void OnMenuComplete(EventArgs e) {
  627. if (MenuComplete != null) {
  628. MenuComplete(this, e);
  629. }
  630. }
  631. protected virtual void OnMenuStart(EventArgs e) {
  632. if (MenuStart != null) {
  633. MenuStart(this, e);
  634. }
  635. }
  636. protected virtual void OnMinimumSizeChanged(EventArgs e) {
  637. if (MinimumSizeChanged != null) {
  638. MinimumSizeChanged(this, e);
  639. }
  640. }
  641. public event EventHandler Activated;
  642. public event EventHandler Closed;
  643. public event CancelEventHandler Closing;
  644. public event EventHandler Deactivate;
  645. public event InputLanguageChangedEventHandler InputLanguageChanged;
  646. public event InputLanguageChangingEventHandler InputLanguageChanging;
  647. public event EventHandler Load;
  648. public event EventHandler MaximizedBoundsChanged;
  649. public event EventHandler MaximumSizeChanged;
  650. public event EventHandler MdiChildActivate;
  651. public event EventHandler MenuComplete;
  652. public event EventHandler MenuStart;
  653. public event EventHandler MinimumSizeChanged;
  654. #endregion // Events
  655. }
  656. }