Form.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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.1 $
  27. // $Modtime: $
  28. // $Log: Form.cs,v $
  29. // Revision 1.1 2004/07/09 05:21:25 pbartok
  30. // - Initial check-in
  31. //
  32. //
  33. // NOT COMPLETE
  34. using System;
  35. using System.Drawing;
  36. using System.ComponentModel;
  37. using System.Collections;
  38. using System.Runtime.InteropServices;
  39. using System.Threading;
  40. namespace System.Windows.Forms {
  41. public class Form : ContainerControl {
  42. #region Local Variables
  43. //private static bool
  44. #endregion // Local Variables
  45. #region Public Constructor & Destructor
  46. public Form() {
  47. Console.WriteLine("Form Constructor called");
  48. //XplatUI.Version();
  49. }
  50. #endregion // Public Constructor & Destructor
  51. #region Public Static Properties
  52. #endregion // Public Static Properties
  53. #region Public Instance Properties
  54. #endregion // Public Instance Properties
  55. #region Protected Instance Properties
  56. #endregion // Public Instance Properties
  57. #region Public Static Methods
  58. #endregion // Public Static Methods
  59. #region Public Instance Methods
  60. [MonoTODO("Need to add MDI support")]
  61. protected override CreateParams CreateParams {
  62. get {
  63. CreateParams create_params = new CreateParams();
  64. create_params.Caption = "";
  65. create_params.ClassName=XplatUI.DefaultClassName;
  66. create_params.ClassStyle = 0;
  67. create_params.ExStyle=0;
  68. create_params.Parent=IntPtr.Zero;
  69. create_params.Param=0;
  70. create_params.Style |= (int)WindowStyles.WS_OVERLAPPEDWINDOW;
  71. create_params.Style |= (int)WindowStyles.WS_VISIBLE;
  72. return create_params;
  73. }
  74. }
  75. #endregion // Public Instance Methods
  76. #region Protected Instance Methods
  77. #endregion // Protected Instance Methods
  78. #region Events
  79. protected virtual void OnActivated(EventArgs e) {
  80. if (Activated != null) {
  81. Activated(this, e);
  82. }
  83. }
  84. protected virtual void OnClosed(EventArgs e) {
  85. if (Closed != null) {
  86. Closed(this, e);
  87. }
  88. }
  89. protected virtual void OnClosed(System.ComponentModel.CancelEventArgs e) {
  90. if (Closing != null) {
  91. Closing(this, e);
  92. }
  93. }
  94. protected virtual void OnDeactivate(EventArgs e) {
  95. if (Deactivate != null) {
  96. Deactivate(this, e);
  97. }
  98. }
  99. protected virtual void OnInputLanguageChanged(InputLanguageChangedEventArgs e) {
  100. if (InputLanguageChanged!=null) {
  101. InputLanguageChanged(this, e);
  102. }
  103. }
  104. protected virtual void OnInputLanguageChanging(InputLanguageChangingEventArgs e) {
  105. if (InputLanguageChanging!=null) {
  106. InputLanguageChanging(this, e);
  107. }
  108. }
  109. protected virtual void OnLoad(EventArgs e) {
  110. if (Load != null) {
  111. Load(this, e);
  112. }
  113. }
  114. protected virtual void OnMaximizedBoundsChanged(EventArgs e) {
  115. if (MaximizedBoundsChanged != null) {
  116. MaximizedBoundsChanged(this, e);
  117. }
  118. }
  119. protected virtual void OnMaximumSizeChanged(EventArgs e) {
  120. if (MaximumSizeChanged != null) {
  121. MaximumSizeChanged(this, e);
  122. }
  123. }
  124. protected virtual void OnMdiChildActivate(EventArgs e) {
  125. if (MdiChildActivate != null) {
  126. MdiChildActivate(this, e);
  127. }
  128. }
  129. protected virtual void OnMenuComplete(EventArgs e) {
  130. if (MenuComplete != null) {
  131. MenuComplete(this, e);
  132. }
  133. }
  134. protected virtual void OnMenuStart(EventArgs e) {
  135. if (MenuStart != null) {
  136. MenuStart(this, e);
  137. }
  138. }
  139. protected virtual void OnMinimumSizeChanged(EventArgs e) {
  140. if (MinimumSizeChanged != null) {
  141. MinimumSizeChanged(this, e);
  142. }
  143. }
  144. public event EventHandler Activated;
  145. public event EventHandler Closed;
  146. public event CancelEventHandler Closing;
  147. public event EventHandler Deactivate;
  148. public event InputLanguageChangedEventHandler InputLanguageChanged;
  149. public event InputLanguageChangingEventHandler InputLanguageChanging;
  150. public event EventHandler Load;
  151. public event EventHandler MaximizedBoundsChanged;
  152. public event EventHandler MaximumSizeChanged;
  153. public event EventHandler MdiChildActivate;
  154. public event EventHandler MenuComplete;
  155. public event EventHandler MenuStart;
  156. public event EventHandler MinimumSizeChanged;
  157. #endregion // Events
  158. }
  159. }