(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / System.Windows.Forms / WINELib / Control.cs
blob2791867bec8d92222c0770f4c5252395b1f6be78
1 //
2 // System.Windows.Forms.Control.cs
3 //
4 // Author:
5 // stubbed out by Jaak Simm (jaaksimm@firm.ee)
6 // Dennis Hayes (dennish@rayetk.com)
7 // WINELib implementation started by John Sohn (jsohn@columbus.rr.com)
8 //
9 // (C) Ximian, Inc., 2002
12 using System.ComponentModel;
13 using System.Drawing;
14 using System.Collections;
16 namespace System.Windows.Forms {
18 /// <summary>
19 /// Defines the base class for controls, which are components with
20 /// visual representation.
21 /// </summary>
23 public class Control : Component , ISynchronizeInvoke, IWin32Window {
25 // Helper NativeWindow class to dispatch messages back
26 // to the Control class
27 protected class ControlNativeWindow : NativeWindow {
29 private Control control;
31 public ControlNativeWindow (Control control) : base() {
32 this.control = control;
35 protected override void WndProc (ref Message m) {
36 base.WndProc (ref m);
38 control.WndProc (ref m);
42 // FIXME: not sure if dervied classes should have access
43 protected ControlNativeWindow window;
44 private ControlCollection childControls;
45 private Control parent;
47 // private fields
48 // it seems these are stored in case the window is not created,
49 // corresponding properties (below) need to check if window
50 // is created or not and react accordingly
51 string accessibleDefaultActionDescription;
52 string accessibleDescription;
53 string accessibleName;
54 AccessibleRole accessibleRole;
55 bool allowDrop;
56 AnchorStyles anchor;
57 Color backColor;
58 Image backgroundImage;
59 //BindingContext bindingContext;
60 Rectangle bounds;
61 bool causesValidation;
62 //ContextMenu contextMenu;
63 DockStyle dock;
64 bool enabled;
65 Font font;
66 Color foreColor;
67 ImeMode imeMode;
68 bool isAccessible;
69 // Point location; // using bounds to store location
70 string name;
71 Region region;
72 RightToLeft rightToLeft;
73 bool tabStop;
74 string text;
75 bool visible;
77 // --- Constructors ---
79 //Compact Framework //only Control()
80 public Control ()
82 CreateControlsInstance ();
84 accessibleDefaultActionDescription = null;
85 accessibleDescription = null;
86 accessibleName = null;
87 accessibleRole = AccessibleRole.Default;
88 allowDrop = false;
89 anchor = AnchorStyles.Top | AnchorStyles.Left;
90 //backColor = Control.DefaultBackColor;
91 backgroundImage = null;
92 bounds = new Rectangle();
93 // bindingContext = null;
94 causesValidation = true;
95 // contextMenu = null;
96 dock = DockStyle.None;
97 enabled = true;
98 // font = Control.DefaultFont;
99 // foreColor = Control.DefaultForeColor;
100 imeMode = ImeMode.Inherit;
101 isAccessible = false;
102 // location = new Point (0,0); should be from OS
103 name = "";
104 region = null;
105 rightToLeft = RightToLeft.Inherit;
106 tabStop = false;
107 text = "";
108 visible = true;
109 parent = null;
110 window = null;
113 // according to docs, the constructors do not create
114 // the (HWND) window
115 public Control (string text) : this()
117 Text = text;
118 // Win32.SetWindowTextA (Handle, text);
121 public Control (Control parent, string text) : this (text)
123 Parent = parent;
124 // Win32.SetParent (Handle, parent.Handle);
127 public Control (string text, int left, int top,
128 int width, int height) : this(text)
130 Left = left;
131 Top = top;
132 Width = width;
133 Height = height;
134 //Win32.SetWindowPos (Handle, (IntPtr) 0, left, top,
135 // width, height, 0);
138 public Control (Control parent,string text,int left, int top,
139 int width,int height) : this (parent, text)
141 Left = left;
142 Top = top;
143 Width = width;
144 Height = height;
145 // Win32.SetWindowPos (Handle, (IntPtr) 0, left, top,
146 // width, height, 0);
149 // for internal use only, create a control class
150 // for an existing, created HWND
151 private Control (IntPtr existingHandle)
153 window = (ControlNativeWindow) NativeWindow.FromHandle (
154 existingHandle);
157 // --- Properties ---
158 // Properties only supporting .NET framework, not stubbed out:
159 // - protected bool RenderRightToLeft {get;}
160 // - public IWindowTarget WindowTarget {get; set;}
161 //[MonoTODO]
162 //public AccessibleObject AccessibilityObject {
163 // get {
164 // throw new NotImplementedException ();
165 // }
168 public string AccessibleDefaultActionDescription {
169 get {
170 return accessibleDefaultActionDescription;
172 set {
173 accessibleDefaultActionDescription = value;
177 public string AccessibleDescription {
178 get {
179 return accessibleDescription;
181 set {
182 accessibleDescription=value;
186 public string AccessibleName {
187 get {
188 return accessibleName;
190 set {
191 accessibleName=value;
195 public AccessibleRole AccessibleRole {
196 get {
197 return accessibleRole;
199 set {
200 accessibleRole=value;
204 public virtual bool AllowDrop {
205 get {
206 return allowDrop;
208 set {
209 allowDrop=value;
213 public virtual AnchorStyles Anchor {
214 get {
215 return anchor;
217 set {
218 anchor=value;
222 //Compact Framework
223 public virtual Color BackColor {
224 get {
225 if (IsHandleCreated) {
226 IntPtr dc = Win32.GetDC (Handle);
227 uint bgColor = Win32.GetBkColor (dc);
228 Win32.ReleaseDC (Handle, dc);
229 int r = (int) (bgColor & 0xFF);
230 int g = (int) ((bgColor >> 8) & 0xFF);
231 int b = (int) ((bgColor >> 16) & 0xFF);
232 return Color.FromArgb (r, g, b);
233 } else return backColor;
235 set {
236 backColor = value;
237 if (IsHandleCreated) {
238 IntPtr dc = Win32.GetDC (Handle);
239 Win32.SetBkColor (dc, (uint) value.ToArgb());
240 Win32.ReleaseDC (Handle, dc);
245 public virtual Image BackgroundImage {
246 get {
247 return backgroundImage;
249 set {
250 backgroundImage = value;
251 // FIXME: force redraw
255 // waiting for BindingContext
256 //public virtual BindingContext BindingContext {
257 // get {
258 // //return bindingContext;
259 // throw new NotImplementedException ();
260 // }
261 // set {
262 // //bindingContext=value;
263 // throw new NotImplementedException ();
264 // }
267 //Compact Framework
268 public int Bottom {
269 get {
270 return Top + Height;
274 //Compact Framework
275 public Rectangle Bounds {
276 get {
277 if (IsHandleCreated) {
278 Win32.RECT rect = new Win32.RECT();
279 Win32.GetWindowRect (Handle, ref rect);
280 return new Rectangle ((int) rect.left,
281 (int) rect.top,
282 (int) rect.right,
283 (int) rect.bottom);
284 } else return bounds;
286 set {
287 if (IsHandleCreated)
288 Win32.SetWindowPos (
289 Handle, (IntPtr) 0, value.X, value.Y,
290 value.Width, value.Height, 0);
291 else bounds = value;
295 public bool CanFocus {
296 get {
297 if (IsHandleCreated && Visible && Enabled)
298 return true;
299 return false;
303 [MonoTODO]
304 public bool CanSelect {
305 get {
306 // if (ControlStyles.Selectable &&
307 // isContainedInAnotherControl &&
308 // parentIsVisiable && isVisialbe &&
309 // parentIsEnabled && isEnabled) {
310 // return true;
311 // }
312 // return false;
314 throw new NotImplementedException ();
318 //Compact Framework
319 public bool Capture {
320 get {
321 if (IsHandleCreated) {
322 IntPtr captured = Win32.GetCapture ();
323 if (Handle == captured)
324 return true;
326 return false;
328 set {
329 if (IsHandleCreated) {
330 if (value)
331 Win32.SetCapture (Handle);
332 else {
333 IntPtr captured = Win32.GetCapture ();
335 // if this window is in capture state
336 // release it
337 if (Handle == captured)
338 Win32.ReleaseCapture ();
344 public bool CausesValidation {
345 get {
346 return causesValidation;
348 set {
349 causesValidation=value;
353 //Compact Framework
354 public Rectangle ClientRectangle {
355 get {
356 if (IsHandleCreated) {
357 Win32.RECT rect = new Win32.RECT();
358 Win32.GetClientRect (Handle, ref rect);
359 return new Rectangle ((int) rect.left,
360 (int) rect.top,
361 (int) rect.right,
362 (int) rect.bottom);
365 // FIXME: is the correct return value for
366 // window who's handle is not created
367 return new Rectangle (0, 0, 0, 0);
371 //Compact Framework
372 [MonoTODO]
373 public Size ClientSize {
374 get {
375 // FIXME: use GetSystemMetrics and/or
376 // GetClientRect here?
377 throw new NotImplementedException ();
379 set {
380 throw new NotImplementedException ();
384 [MonoTODO]
385 public string CompanyName {
386 get {
387 throw new NotImplementedException ();
391 public bool ContainsFocus {
392 get {
393 if (IsHandleCreated) {
394 IntPtr focusedWindow = Win32.GetFocus();
395 if (focusedWindow == Handle)
396 return true;
398 return false;
402 //Compact Framework
403 //[MonoTODO]
404 //public virtual ContextMenu ContextMenu {
405 // get {
406 // //return contextMenu;
407 // throw new NotImplementedException ();
408 // }
409 // set {
410 // //contextMenu=value;
411 // throw new NotImplementedException ();
412 // }
415 public ControlCollection Controls {
416 get { return childControls; }
419 public bool Created {
420 get {
421 if (Handle != (IntPtr) 0)
422 return true;
423 return false;
427 protected virtual CreateParams CreateParams {
428 get {
429 CreateParams createParams = new CreateParams ();
430 createParams.Caption = Text;
431 createParams.ClassName = "mono_native_window";
432 createParams.X = Left;
433 createParams.Y = Top;
434 createParams.Width = Width;
435 createParams.Height = Height;
436 createParams.ClassStyle = 0;
437 createParams.ExStyle = 0;
438 createParams.Param = 0;
440 if (parent != null)
441 createParams.Parent = parent.Handle;
442 else
443 createParams.Parent = (IntPtr) 0;
445 createParams.Style = (int) Win32.WS_OVERLAPPEDWINDOW;
447 return createParams;
451 [MonoTODO]
452 public virtual Cursor Cursor {
453 get {
454 throw new NotImplementedException ();
456 set {
457 throw new NotImplementedException ();
461 //Compact Framework
462 //[MonoTODO]
463 // waiting for BindingContext
464 //public ControlBindingsCollection DataBindings {
465 // get {
466 // throw new NotImplementedException ();
467 // }
470 public static Color DefaultBackColor {
471 get {
472 // FIXME: use GetSystemMetrics?
473 //return SystemColors.Control;
474 throw new NotImplementedException ();
478 //[MonoTODO]
479 // FIXME: use GetSystemMetrics?
480 //public static Font DefaultFont {
481 // FIXME: get current system font from GenericSansSerif
482 // call ArgumentException not called
483 // get {
484 // throw new NotImplementedException ();
485 //return (FontFamily.GenericSansSerif);
486 // }
489 public static Color DefaultForeColor {
490 get {
491 // FIXME: use GetSystemMetrics?
492 //return SystemColors.ControlText;
493 throw new NotImplementedException ();
497 protected virtual ImeMode DefaultImeMode {
498 get {
499 //return ImeMode.Inherit;
500 throw new NotImplementedException ();
504 [MonoTODO]
505 protected virtual Size DefaultSize {
506 get {
507 // FIXME: use GetSystemMetrics?
508 throw new NotImplementedException ();
512 public virtual Rectangle DisplayRectangle {
513 get {
514 return ClientRectangle;
518 [MonoTODO]
519 public bool Disposing {
520 get {
521 throw new NotImplementedException ();
525 public virtual DockStyle Dock {
526 get {
527 return dock;
529 set {
530 dock=value;
534 //Compact Framework
535 public virtual bool Enabled {
536 get {
537 return Win32.IsWindowEnabled (Handle);
539 set {
540 Win32.EnableWindow (Handle, value);
544 //Compact Framework
545 public virtual bool Focused {
546 get {
547 return ContainsFocus;
551 //Compact Framework
552 // [MonoTODO]
553 //public virtual Font Font {
554 // CHECKME:
555 // get {
556 //return font;
557 // throw new NotImplementedException ();
558 // }
559 // set {
560 //font=value;
561 // throw new NotImplementedException ();
562 // }
565 [MonoTODO]
566 protected int FontHeight {
567 get {
568 throw new NotImplementedException ();
570 set {
571 throw new NotImplementedException ();
575 //Compact Framework
576 public virtual Color ForeColor {
577 get {
578 return foreColor;
580 set {
581 foreColor = value;
585 public bool HasChildren {
586 get {
587 if (childControls.Count >0)
588 return true;
589 return false;
593 //Compact Framework
594 public int Height {
595 get {
596 if (IsHandleCreated) {
597 // FIXME: GetWindowPos
599 return bounds.Height;
601 set {
602 bounds.Height = value;
603 if (IsHandleCreated) {
604 // FIXME: SetWindowPos
609 public ImeMode ImeMode {
610 // CHECKME:
611 get {
612 return imeMode;
614 set {
615 imeMode=value;
619 public bool IsAccessible {
620 // CHECKME:
621 get {
622 return isAccessible;
623 } // default is false
624 set {
625 isAccessible=value;
629 public bool IsDisposed {
630 get {
631 if (Handle == (IntPtr) 0)
632 return true;
633 return false;
637 public bool IsHandleCreated {
638 get {
639 if (Handle != (IntPtr) 0)
640 return true;
641 return false;
645 //Compact Framework
646 public int Left {
647 get {
648 if (IsHandleCreated) {
649 // FIXME: GetWindowPos
650 return 0;
651 } else return bounds.X;
653 set {
654 bounds.X = value;
656 if (IsHandleCreated) {
657 // FIXME: SetWindowPos
662 //Compact Framework
663 public Point Location {
664 // CHECKME:
665 get {
666 return new Point (Top, Left);
668 set {
669 bounds.X = value.X;
670 bounds.Y = value.Y;
672 if (IsHandleCreated) {
673 // FIXME: SetWindowPos
679 [MonoTODO]
680 public static Keys ModifierKeys {
681 get {
682 throw new NotImplementedException ();
686 //Compact Framework
687 [MonoTODO]
688 public static MouseButtons MouseButtons {
689 get {
690 // FIXME: use GetAsycKeyState?
691 throw new NotImplementedException ();
695 //Compact Framework
696 public static Point MousePosition {
697 get {
698 Win32.POINT point = new Win32.POINT();
699 Win32.GetCursorPos (ref point);
700 return new Point ( (int) point.x, (int) point.y);
704 public string Name {
705 // CHECKME:
706 get {
707 return name;
709 set {
710 name=value;
714 //Compact Framework
715 public Control Parent {
716 get {
717 return parent;
718 //IntPtr parent = Win32.GetParent (Handle);
719 //return FromHandle (parent);
721 set {
722 Console.WriteLine ("setting parent");
723 parent = value;
725 Console.WriteLine ("add ourself to the parents control");
726 // add ourself to the parents control
727 parent.Controls.Add (this);
729 Console.WriteLine ("SetParent");
730 if (IsHandleCreated) {
731 Console.WriteLine ("Handle created");
732 Win32.SetParent (Handle, value.Handle);
737 [MonoTODO]
738 public string ProductName {
739 get {
740 throw new NotImplementedException ();
744 [MonoTODO]
745 public string ProductVersion {
746 get {
747 throw new NotImplementedException ();
751 [MonoTODO]
752 public bool RecreatingHandle {
753 get {
754 throw new NotImplementedException ();
758 public Region Region {
759 // CHECKME:
760 get {
761 return region;
763 set {
764 region=value;
768 [MonoTODO]
769 protected bool ResizeRedraw {
770 get {
771 throw new NotImplementedException ();
773 set {
774 throw new NotImplementedException ();
778 //Compact Framework
779 public int Right {
780 get {
781 return Left + Width;
785 [MonoTODO]
786 public virtual RightToLeft RightToLeft {
787 // CHECKME:
788 get {
789 return rightToLeft;
791 set {
792 rightToLeft=value;
796 [MonoTODO]
797 protected virtual bool ShowFocusCues {
798 get {
799 throw new NotImplementedException ();
803 [MonoTODO]
804 protected bool ShowKeyboardCues {
805 get {
806 throw new NotImplementedException ();
810 [MonoTODO]
811 public override ISite Site {
812 get {
813 throw new NotImplementedException ();
815 set {
816 throw new NotImplementedException ();
820 //Compact Framework
821 [MonoTODO]
822 public Size Size {
823 get {
824 throw new NotImplementedException ();
826 set {
827 throw new NotImplementedException ();
831 [MonoTODO]
832 public int TabIndex {
833 get {
834 throw new NotImplementedException ();
836 set {
837 throw new NotImplementedException ();
841 public bool TabStop {
842 // CHECKME:
843 get {
844 return tabStop;
846 set {
847 tabStop = value;
851 [MonoTODO]
852 public object Tag {
853 get {
854 throw new NotImplementedException ();
856 set {
857 throw new NotImplementedException ();
861 //Compact Framework
862 public virtual string Text {
863 get {
864 if (IsHandleCreated) {
865 String text = "";
866 int length = Win32.GetWindowTextLengthA (Handle);
867 Win32.GetWindowTextA (Handle, ref text, length);
868 return text;
869 } else return text;
871 set {
872 text = value;
874 if (IsHandleCreated)
875 Win32.SetWindowTextA (Handle, value);
879 //Compact Framework
880 public int Top {
881 get {
882 if (IsHandleCreated) {
883 // FIXME: GetWindowPos
884 return 0;
885 } else return bounds.Top;
887 set {
888 bounds.Y = value;
890 if (IsHandleCreated) {
891 // FIXME: SetWindowPos
896 [MonoTODO]
897 public Control TopLevelControl {
898 get {
899 throw new NotImplementedException ();
903 //Compact Framework
904 public bool Visible {
905 get {
906 throw new NotImplementedException ();
908 set {
909 if (value)
910 Win32.ShowWindow (
911 Handle, Win32.SW_SHOW);
912 else
913 Win32.ShowWindow (
914 Handle, Win32.SW_HIDE);
918 //Compact Framework
919 public int Width {
920 get {
921 if (IsHandleCreated) {
922 // FIXME: GetWindowPos
924 return bounds.Width;
926 set {
927 bounds.Width = value;
928 if (IsHandleCreated) {
929 // FIXME: SetWindowPos
934 /// --- methods ---
935 /// internal .NET framework supporting methods, not stubbed out:
936 /// - protected virtual void NotifyInvalidate(Rectangle invalidatedArea)
937 /// - protected void RaiseDragEvent(object key,DragEventArgs e);
938 /// - protected void RaiseKeyEvent(object key,KeyEventArgs e);
939 /// - protected void RaiseMouseEvent(object key,MouseEventArgs e);
940 /// - protected void RaisePaintEvent(object key,PaintEventArgs e);
941 /// - protected void ResetMouseEventArgs();
943 [MonoTODO]
944 protected void AccessibilityNotifyClients (
945 AccessibleEvents accEvent,int childID)
947 throw new NotImplementedException ();
950 //Compact Framework
951 [MonoTODO]
952 public void BringToFront ()
954 throw new NotImplementedException ();
957 public bool Contains (Control ctl)
959 return childControls.Contains (ctl);
962 public void CreateControl ()
964 CreateHandle ();
967 //[MonoTODO]
968 //AccessibleObject not ready
969 //protected virtual AccessibleObject CreateAccessibilityInstance() {
970 // throw new NotImplementedException ();
973 protected virtual ControlCollection CreateControlsInstance ()
975 childControls = new ControlCollection (this);
976 return childControls;
979 //Compact Framework
980 [MonoTODO]
981 public Graphics CreateGraphics ()
983 throw new NotImplementedException ();
986 protected virtual void CreateHandle ()
988 window = new ControlNativeWindow (this);
990 window.CreateHandle (CreateParams);
993 protected virtual void DefWndProc (ref Message m)
995 window.DefWndProc(ref m);
998 protected virtual void DestroyHandle ()
1000 window.DestroyHandle ();
1003 [MonoTODO]
1004 protected override void Dispose (bool disposing)
1006 throw new NotImplementedException ();
1009 [MonoTODO]
1010 public DragDropEffects DoDragDrop (
1011 object data, DragDropEffects allowedEffects)
1013 throw new NotImplementedException ();
1016 //public object EndInvoke(IAsyncResult asyncResult):
1017 //look under ISynchronizeInvoke methods
1019 [MonoTODO]
1020 public Form FindForm ()
1022 throw new NotImplementedException ();
1025 //Compact Framework
1026 public bool Focus ()
1028 if (Win32.SetFocus (Handle) != (IntPtr) 0)
1029 return true;
1030 return false;
1033 [MonoTODO]
1034 public static Control FromChildHandle (IntPtr handle)
1036 throw new NotImplementedException ();
1039 public static Control FromHandle (IntPtr handle)
1041 Control control = new Control (handle);
1042 return control;
1045 [MonoTODO]
1046 public Control GetChildAtPoint (Point pt)
1048 throw new NotImplementedException ();
1051 // [MonoTODO]
1052 //public IContainerControl GetContainerControl ()
1054 // throw new NotImplementedException ();
1057 [MonoTODO]
1058 public Control GetNextControl (Control ctl, bool forward)
1060 throw new NotImplementedException ();
1063 [MonoTODO]
1064 protected bool GetStyle (ControlStyles flag)
1066 throw new NotImplementedException ();
1069 [MonoTODO]
1070 protected bool GetTopLevel ()
1072 throw new NotImplementedException ();
1075 //Compact Framework
1076 public void Hide ()
1078 if (IsHandleCreated)
1079 Win32.ShowWindow (Handle, Win32.SW_HIDE);
1082 [MonoTODO]
1083 protected virtual void InitLayout ()
1085 throw new NotImplementedException ();
1088 //Compact Framework
1089 public void Invalidate ()
1091 if (IsHandleCreated) {
1092 Win32.RECT rect = (Win32.RECT) null;
1093 Win32.InvalidateRect (Handle, ref rect, true);
1097 [MonoTODO]
1098 public void Invalidate (bool invalidateChildren)
1100 throw new NotImplementedException ();
1103 //Compact Framework
1104 public void Invalidate (Rectangle rc)
1106 if (IsHandleCreated) {
1107 Win32.RECT rect = new Win32.RECT();
1108 rect.left = rc.Left;
1109 rect.top = rc.Top;
1110 rect.right = rc.Right;
1111 rect.bottom = rc.Bottom;
1112 Win32.InvalidateRect (Handle, ref rect, true);
1116 //[MonoTODO]
1117 public void Invalidate(Region region)
1119 throw new NotImplementedException ();
1122 [MonoTODO]
1123 public void Invalidate (Rectangle rc, bool invalidateChildren)
1125 throw new NotImplementedException ();
1128 //[MonoTODO]
1129 public void Invalidate(Region region,bool invalidateChildren)
1131 throw new NotImplementedException ();
1134 [MonoTODO]
1135 protected void InvokeGotFocus (Control toInvoke, EventArgs e)
1137 throw new NotImplementedException ();
1140 [MonoTODO]
1141 protected void InvokeLostFocus (Control toInvoke, EventArgs e)
1143 throw new NotImplementedException ();
1146 [MonoTODO]
1147 protected void InvokeOnClick (Control toInvoke, EventArgs e)
1149 throw new NotImplementedException ();
1152 [MonoTODO]
1153 protected void InvokePaint (Control c, PaintEventArgs e)
1155 throw new NotImplementedException ();
1158 [MonoTODO]
1159 protected void InvokePaintBackground (
1160 Control c,PaintEventArgs e)
1162 throw new NotImplementedException ();
1165 [MonoTODO]
1166 protected virtual bool IsInputChar (char charCode)
1168 throw new NotImplementedException ();
1171 [MonoTODO]
1172 protected virtual bool IsInputKey (Keys keyData)
1174 throw new NotImplementedException ();
1177 [MonoTODO]
1178 public static bool IsMnemonic (char charCode,string text)
1180 throw new NotImplementedException ();
1183 // methods used with events:
1184 protected virtual void OnBackColorChanged (EventArgs e)
1186 if (BackColorChanged != null)
1187 BackColorChanged (this, e);
1190 protected virtual void OnBackgroundImageChanged (EventArgs e)
1192 if (BackgroundImageChanged != null)
1193 BackgroundImageChanged (this, e);
1196 protected virtual void OnBindingContextChanged (EventArgs e)
1198 if (BindingContextChanged != null)
1199 BindingContextChanged (this, e);
1202 protected virtual void OnCausesValidationChanged (EventArgs e)
1204 if (CausesValidationChanged != null)
1205 CausesValidationChanged (this, e);
1208 protected virtual void OnChangeUICues(UICuesEventArgs e)
1210 if (ChangeUICues != null)
1211 ChangeUICues (this, e);
1214 //Compact Framework
1215 protected virtual void OnClick (EventArgs e)
1217 if (Click != null)
1218 Click (this, e);
1222 protected virtual void OnContextMenuChanged (EventArgs e)
1224 if (ContextMenuChanged != null)
1225 ContextMenuChanged (this, e);
1228 protected virtual void OnControlAdded (ControlEventArgs e)
1230 if (ControlAdded != null)
1231 ControlAdded (this, e);
1234 protected virtual void OnControlRemoved (ControlEventArgs e)
1236 if (ControlRemoved != null)
1237 ControlRemoved (this, e);
1240 protected virtual void OnCreateControl ()
1245 protected virtual void OnCursorChanged (EventArgs e)
1247 if (CursorChanged != null)
1248 CursorChanged (this, e);
1251 protected virtual void OnDockChanged (EventArgs e)
1253 if (DockChanged != null)
1254 DockChanged (this, e);
1257 protected virtual void OnDoubleClick (EventArgs e)
1259 if (DoubleClick != null)
1260 DoubleClick (this, e);
1263 protected virtual void OnDragDrop (DragEventArgs e)
1265 if (DragDrop != null)
1266 DragDrop (this, e);
1269 protected virtual void OnDragEnter (DragEventArgs e)
1271 if (DragEnter != null)
1272 DragEnter (this, e);
1275 protected virtual void OnDragLeave (EventArgs e)
1277 if (DragLeave != null)
1278 DragLeave (this, e);
1281 protected virtual void OnDragOver (DragEventArgs e)
1283 if (DragOver != null)
1284 DragOver (this, e);
1287 //Compact Framework
1288 protected virtual void OnEnabledChanged (EventArgs e)
1290 if (EnabledChanged != null)
1291 EnabledChanged (this, e);
1294 protected virtual void OnEnter (EventArgs e)
1296 if (Enter != null)
1297 Enter (this, e);
1300 protected virtual void OnFontChanged (EventArgs e)
1302 if (FontChanged != null)
1303 FontChanged (this, e);
1306 protected virtual void OnForeColorChanged (EventArgs e)
1308 if (ForeColorChanged != null)
1309 ForeColorChanged (this, e);
1312 protected virtual void OnGiveFeedback (GiveFeedbackEventArgs e)
1314 if (GiveFeedback != null)
1315 GiveFeedback (this, e);
1318 //Compact Framework
1319 protected virtual void OnGotFocus (EventArgs e)
1321 if (GotFocus != null)
1322 GotFocus (this, e);
1325 protected virtual void OnHandleCreated (EventArgs e)
1327 Console.WriteLine ("OnHandleCreated");
1329 if (HandleCreated != null)
1330 HandleCreated (this, e);
1332 // create all child windows
1333 IEnumerator cw = childControls.GetEnumerator();
1335 while (cw.MoveNext()) {
1336 Console.WriteLine ("Adding Control");
1337 Control control = (Control) cw.Current;
1338 control.CreateControl ();
1339 control.Show ();
1343 protected virtual void OnHandleDestroyed (EventArgs e)
1345 if (HandleDestroyed != null)
1346 HandleDestroyed (this, e);
1349 protected virtual void OnHelpRequested (HelpEventArgs e)
1351 if (HelpRequested != null)
1352 HelpRequested (this, e);
1355 protected virtual void OnImeModeChanged (EventArgs e)
1357 if (ImeModeChanged != null)
1358 ImeModeChanged (this, e);
1361 protected virtual void OnInvalidated (InvalidateEventArgs e)
1363 if (Invalidated != null)
1364 Invalidated (this, e);
1367 //Compact Framework
1368 protected virtual void OnKeyDown (KeyEventArgs e)
1370 if (KeyDown != null)
1371 KeyDown (this, e);
1374 //Compact Framework
1375 protected virtual void OnKeyPress (KeyPressEventArgs e)
1377 if (KeyPress != null)
1378 KeyPress (this, e);
1381 //Compact Framework
1382 protected virtual void OnKeyUp (KeyEventArgs e)
1384 if (KeyUp != null)
1385 KeyUp (this, e);
1389 protected virtual void OnLayout (LayoutEventArgs e)
1391 if (Layout != null)
1392 Layout (this, e);
1395 protected virtual void OnLeave (EventArgs e)
1397 if (Leave != null)
1398 Leave (this, e);
1401 protected virtual void OnLocationChanged (EventArgs e)
1403 if (LocationChanged != null)
1404 LocationChanged (this, e);
1407 //Compact Framework
1408 protected virtual void OnLostFocus (EventArgs e)
1410 if (LostFocus != null)
1411 LostFocus (this, e);
1414 //Compact Framework
1415 protected virtual void OnMouseDown (MouseEventArgs e)
1417 if (MouseDown != null)
1418 MouseDown (this, e);
1421 protected virtual void OnMouseEnter (EventArgs e)
1423 if (MouseEnter != null)
1424 MouseEnter (this, e);
1427 protected virtual void OnMouseHover (EventArgs e)
1429 if (MouseHover != null)
1430 MouseHover (this, e);
1433 protected virtual void OnMouseLeave (EventArgs e)
1435 if (MouseLeave != null)
1436 MouseLeave (this, e);
1439 //Compact Framework
1440 protected virtual void OnMouseMove (MouseEventArgs e)
1442 if (MouseMove != null)
1443 MouseMove (this, e);
1446 //Compact Framework
1447 protected virtual void OnMouseUp (MouseEventArgs e)
1449 if (MouseUp != null)
1450 MouseUp (this, e);
1453 protected virtual void OnMouseWheel (MouseEventArgs e)
1455 if (MouseWheel != null)
1456 MouseWheel (this, e);
1459 protected virtual void OnMove (EventArgs e)
1461 if (Move != null)
1462 Move (this, e);
1465 protected virtual void OnNotifyMessage (Message m)
1470 //Compact Framework
1471 protected virtual void OnPaint (PaintEventArgs e)
1473 if (Paint != null)
1474 Paint (this, e);
1477 //Compact Framework
1478 protected virtual void OnPaintBackground (PaintEventArgs e)
1483 protected virtual void OnParentBackColorChanged (EventArgs e)
1485 if (BackColorChanged != null)
1486 BackColorChanged (this, e);
1489 protected virtual void OnParentBackgroundImageChanged (
1490 EventArgs e)
1492 if (BackgroundImageChanged != null)
1493 BackgroundImageChanged (this, e);
1496 protected virtual void OnParentBindingContextChanged (
1497 EventArgs e)
1499 if (BindingContextChanged != null)
1500 BindingContextChanged (this, e);
1503 //Compact Framework
1504 protected virtual void OnParentChanged (EventArgs e)
1506 if (ParentChanged != null)
1507 ParentChanged (this, e);
1510 protected virtual void OnParentEnabledChanged (EventArgs e)
1512 if (EnabledChanged != null)
1513 EnabledChanged (this, e);
1516 protected virtual void OnParentFontChanged (EventArgs e)
1518 if (FontChanged != null)
1519 FontChanged (this, e);
1522 protected virtual void OnParentForeColorChanged (EventArgs e)
1524 if (ForeColorChanged != null)
1525 ForeColorChanged (this, e);
1528 protected virtual void OnParentRightToLeftChanged (
1529 EventArgs e)
1531 if (RightToLeftChanged != null)
1532 RightToLeftChanged (this, e);
1535 protected virtual void OnParentVisibleChanged (EventArgs e)
1537 if (VisibleChanged != null)
1538 VisibleChanged (this, e);
1541 protected virtual void OnQueryContinueDrag (
1542 QueryContinueDragEventArgs e)
1544 if (QueryContinueDrag != null)
1545 QueryContinueDrag (this, e);
1548 //Compact Framework
1549 protected virtual void OnResize (EventArgs e)
1551 if (Resize != null)
1552 Resize (this, e);
1555 protected virtual void OnRightToLeftChanged (EventArgs e)
1557 if (RightToLeftChanged != null)
1558 RightToLeftChanged (this, e);
1561 protected virtual void OnSizeChanged (EventArgs e)
1563 if (SizeChanged != null)
1564 SizeChanged (this, e);
1567 protected virtual void OnStyleChanged (EventArgs e)
1569 if (StyleChanged != null)
1570 StyleChanged (this, e);
1573 protected virtual void OnSystemColorsChanged (EventArgs e)
1575 if (SystemColorsChanged != null)
1576 SystemColorsChanged (this, e);
1579 protected virtual void OnTabIndexChanged (EventArgs e)
1581 if (TabIndexChanged != null)
1582 TabIndexChanged (this, e);
1585 protected virtual void OnTabStopChanged (EventArgs e)
1587 if (TabStopChanged != null)
1588 TabStopChanged (this, e);
1591 //Compact Framework
1592 protected virtual void OnTextChanged (EventArgs e)
1594 if (TextChanged != null)
1595 TextChanged (this, e);
1598 [MonoTODO] // this doesn't seem to be documented
1599 // protected virtual void OnTextAlignChanged (EventArgs e) {
1600 // TextAlignChanged (this, e);
1601 // }
1603 protected virtual void OnValidated (EventArgs e)
1605 if (Validated != null)
1606 Validated (this, e);
1609 [MonoTODO]
1610 // CancelEventArgs not ready
1611 //protected virtual void OnValidating(CancelEventArgs e)
1613 // throw new NotImplementedException ();
1616 [MonoTODO]
1617 protected virtual void OnVisibleChanged (EventArgs e)
1619 if (VisibleChanged != null)
1620 VisibleChanged (this, e);
1622 // --- end of methods for events ---
1625 [MonoTODO]
1626 public void PerformLayout ()
1628 throw new NotImplementedException ();
1631 [MonoTODO]
1632 public void PerformLayout (Control affectedControl,
1633 string affectedProperty)
1635 throw new NotImplementedException ();
1638 //Compact Framework
1639 [MonoTODO]
1640 public Point PointToClient (Point p)
1642 throw new NotImplementedException ();
1645 //Compact Framework
1646 [MonoTODO]
1647 public Point PointToScreen (Point p)
1649 throw new NotImplementedException ();
1652 [MonoTODO]
1653 public virtual bool PreProcessMessage (ref Message msg)
1655 throw new NotImplementedException ();
1658 [MonoTODO]
1659 protected virtual bool ProcessCmdKey (ref Message msg,
1660 Keys keyData)
1662 throw new NotImplementedException ();
1665 [MonoTODO]
1666 protected virtual bool ProcessDialogChar (char charCode)
1668 throw new NotImplementedException ();
1671 [MonoTODO]
1672 protected virtual bool ProcessDialogKey (Keys keyData)
1674 throw new NotImplementedException ();
1677 [MonoTODO]
1678 protected virtual bool ProcessKeyEventArgs (ref Message m)
1680 throw new NotImplementedException ();
1683 [MonoTODO]
1684 protected internal virtual bool ProcessKeyMessage (
1685 ref Message m)
1687 throw new NotImplementedException ();
1690 [MonoTODO]
1691 protected virtual bool ProcessKeyPreview (ref Message m)
1693 throw new NotImplementedException ();
1696 [MonoTODO]
1697 protected virtual bool ProcessMnemonic (char charCode)
1699 throw new NotImplementedException ();
1702 // used when properties/values of Control
1703 // are big enough to warrant recreating the HWND
1704 protected void RecreateHandle()
1706 CreateHandle ();
1710 //Compact Framework
1711 [MonoTODO]
1712 public Rectangle RectangleToClient (Rectangle r)
1714 throw new NotImplementedException ();
1717 //Compact Framework
1718 [MonoTODO]
1719 public Rectangle RectangleToScreen (Rectangle r)
1721 throw new NotImplementedException ();
1724 [MonoTODO]
1725 protected static bool ReflectMessage (IntPtr hWnd,
1726 ref Message m)
1728 throw new NotImplementedException ();
1731 //Compact Framework
1732 public virtual void Refresh ()
1734 Win32.RECT rect = (Win32.RECT) null;
1735 Win32.InvalidateRect (Handle, ref rect, true);
1736 Win32.UpdateWindow (Handle);
1739 [MonoTODO]
1740 public virtual void ResetBackColor ()
1742 throw new NotImplementedException ();
1745 [MonoTODO]
1746 public void ResetBindings ()
1748 throw new NotImplementedException ();
1751 [MonoTODO]
1752 public virtual void ResetFont ()
1754 throw new NotImplementedException ();
1757 [MonoTODO]
1758 public virtual void ResetForeColor ()
1760 throw new NotImplementedException ();
1763 [MonoTODO]
1764 public void ResetImeMode ()
1766 throw new NotImplementedException ();
1769 [MonoTODO]
1770 public virtual void ResetRightToLeft ()
1772 throw new NotImplementedException ();
1775 [MonoTODO]
1776 public virtual void ResetText ()
1778 throw new NotImplementedException ();
1781 [MonoTODO]
1782 public void ResumeLayout ()
1784 throw new NotImplementedException ();
1787 [MonoTODO]
1788 public void ResumeLayout (bool performLayout)
1790 throw new NotImplementedException ();
1793 [MonoTODO]
1794 protected ContentAlignment RtlTranslateAlignment (
1795 ContentAlignment align)
1797 throw new NotImplementedException ();
1800 [MonoTODO]
1801 protected HorizontalAlignment RtlTranslateAlignment (
1802 HorizontalAlignment align)
1804 throw new NotImplementedException ();
1807 [MonoTODO]
1808 protected LeftRightAlignment RtlTranslateAlignment (
1809 LeftRightAlignment align)
1811 throw new NotImplementedException ();
1814 [MonoTODO]
1815 protected ContentAlignment RtlTranslateContent (
1816 ContentAlignment align)
1818 throw new NotImplementedException ();
1821 [MonoTODO]
1822 protected HorizontalAlignment RtlTranslateHorizontal (
1823 HorizontalAlignment align)
1825 throw new NotImplementedException ();
1828 [MonoTODO]
1829 protected LeftRightAlignment RtlTranslateLeftRight (
1830 LeftRightAlignment align)
1832 throw new NotImplementedException ();
1835 [MonoTODO]
1836 public void Scale (float ratio)
1838 throw new NotImplementedException ();
1841 [MonoTODO]
1842 public void Scale (float dx,float dy)
1844 throw new NotImplementedException ();
1847 [MonoTODO]
1848 protected virtual void ScaleCore (float dx, float dy)
1850 throw new NotImplementedException ();
1853 [MonoTODO]
1854 public void Select ()
1856 throw new NotImplementedException ();
1859 [MonoTODO]
1860 protected virtual void Select (bool directed,bool forward)
1862 throw new NotImplementedException ();
1865 [MonoTODO]
1866 public bool SelectNextControl (Control ctl, bool forward,
1867 bool tabStopOnly,
1868 bool nested, bool wrap)
1870 throw new NotImplementedException ();
1873 //Compact Framework
1874 [MonoTODO]
1875 public void SendToBack ()
1877 throw new NotImplementedException ();
1880 [MonoTODO]
1881 public void SetBounds (int x, int y, int width, int height)
1883 throw new NotImplementedException ();
1886 [MonoTODO]
1887 public void SetBounds (int x, int y, int width, int height,
1888 BoundsSpecified specified)
1890 throw new NotImplementedException ();
1893 [MonoTODO]
1894 protected virtual void SetBoundsCore (
1895 int x, int y, int width, int height,
1896 BoundsSpecified specified)
1898 throw new NotImplementedException ();
1901 [MonoTODO]
1902 protected virtual void SetClientSizeCore (int x, int y)
1904 throw new NotImplementedException ();
1907 [MonoTODO]
1908 protected void SetStyle (ControlStyles flag, bool value)
1910 throw new NotImplementedException ();
1913 protected void SetTopLevel (bool value)
1915 if (value)
1916 // FIXME: verify on whether this is supposed
1917 // to activate/deactive the window
1918 Win32.SetWindowPos (Handle,
1919 (IntPtr) Win32.HWND_NOTOPMOST,
1920 0, 0, 0, 0, 0);
1921 else
1922 // FIXME: this does not make sense but
1923 // the docs say the window is hidden
1924 Win32.ShowWindow (Handle, Win32.SW_HIDE);
1927 [MonoTODO]
1928 protected virtual void SetVisibleCore (bool value)
1930 throw new NotImplementedException ();
1933 //Compact Framework
1934 public void Show ()
1936 Win32.ShowWindow (Handle, Win32.SW_SHOW);
1939 [MonoTODO]
1940 public void SuspendLayout ()
1942 throw new NotImplementedException ();
1945 //Compact Framework
1946 public void Update ()
1948 Win32.UpdateWindow (Handle);
1951 [MonoTODO]
1952 protected void UpdateBounds ()
1954 throw new NotImplementedException ();
1957 [MonoTODO]
1958 protected void UpdateBounds (int x, int y, int width, int height)
1960 throw new NotImplementedException ();
1963 [MonoTODO]
1964 protected void UpdateBounds (
1965 int x, int y, int width, int height, int clientWidth,
1966 int clientHeight)
1968 throw new NotImplementedException ();
1971 [MonoTODO]
1972 protected void UpdateStyles ()
1974 throw new NotImplementedException ();
1977 [MonoTODO]
1978 protected void UpdateZOrder ()
1980 throw new NotImplementedException ();
1983 // WndProc - calls appriate On... function for the give
1984 // message
1986 // These On... functions do not appear to be called by
1987 // WndProc:
1989 // background color/image handled by WinForms
1990 // OnBackColorChanged
1991 // OnBackgroundImageChanged
1992 // OnForeColorChanged
1993 // OnPaintBackground
1995 // controls are added/removed by WinForms
1996 // OnControlAdded
1997 // OnControlRemoved
1998 // OnCreateControl
2000 // OnBindingContextChanged
2001 // OnCausesValidationChanged
2002 // OnChangeUICues
2003 // OnContextMenuChanged
2004 // OnRightToLeftChanged
2005 // OnGiveFeedback
2006 // OnLayout
2007 // OnDockChanged
2008 // OnCursorChanged
2009 // OnTextAlignChanged
2010 // OnValidated
2011 // OnValidating
2012 // OnTabIndexChanged
2013 // OnTabStopChanged
2014 // OnLocationChanged
2016 // FIXME: may be one of the WM_IME_ messages
2017 // OnImeModeChanged
2019 // InvalidateRect is called by no Invalidate message exists
2020 // OnInvalidated
2022 // these messages ARE not called by WNDPROC according to docs
2023 // OnParentBackColorChanged
2024 // OnParentBackgroundImageChanged
2025 // OnParentBindingContextChanged
2026 // OnParentChanged
2027 // OnParentEnabledChanged
2028 // OnParentFontChanged
2029 // OnParentForeColorChanged
2030 // OnParentRightToLeftChanged
2031 // OnParentVisibleChanged
2033 protected virtual void WndProc(ref Message m)
2035 EventArgs eventArgs = new EventArgs ();
2036 // FIXME: paintEventArgs is not being created properly
2037 PaintEventArgs paintEventArgs = new PaintEventArgs (
2038 new Graphics(), new Rectangle());
2040 switch (m.Msg) {
2042 case Win32.WM_CREATE:
2043 Console.WriteLine ("WM_CREATE");
2044 OnHandleCreated (eventArgs);
2045 break;
2046 case Win32.WM_LBUTTONDBLCLK:
2047 OnDoubleClick (eventArgs);
2048 break;
2049 // OnDragDrop
2050 // OnDragEnter
2051 // OnDragLeave
2052 // OnDragOver
2053 // OnQueryContinueDrag
2054 case Win32.WM_ENABLE:
2055 OnEnabledChanged (eventArgs);
2056 break;
2057 case Win32.WM_SETFOCUS:
2058 OnEnter (eventArgs);
2059 OnGotFocus (eventArgs);
2060 break;
2061 case Win32.WM_FONTCHANGE:
2062 OnFontChanged (eventArgs);
2063 break;
2064 case Win32.WM_DESTROY:
2065 OnHandleDestroyed (eventArgs);
2066 break;
2067 case Win32.WM_HELP:
2068 // FIXME:
2069 //OnHelpRequested (eventArgs);
2070 break;
2071 case Win32.WM_KEYDOWN:
2072 // FIXME:
2073 // OnKeyDown (eventArgs);
2074 break;
2075 case Win32.WM_CHAR:
2076 // FIXME:
2077 // OnKeyPress (eventArgs);
2078 break;
2079 case Win32.WM_KEYUP:
2080 // FIXME:
2081 // OnKeyUp (eventArgs);
2082 break;
2083 case Win32.WM_KILLFOCUS:
2084 OnLeave (eventArgs);
2085 OnLostFocus (eventArgs);
2086 break;
2087 case Win32.WM_LBUTTONDOWN:
2088 // FIXME:
2089 // OnMouseDown (eventArgs);
2090 break;
2091 case Win32.WM_MOUSEACTIVATE:
2092 OnMouseEnter (eventArgs);
2093 break;
2094 case Win32.WM_MOUSEHOVER: // called by TrackMouseEvent
2095 OnMouseHover (eventArgs);
2096 break;
2097 case Win32.WM_MOUSELEAVE: // called by TrackMouseEvent
2098 OnMouseLeave (eventArgs);
2099 break;
2100 case Win32.WM_MOUSEMOVE:
2101 // FIXME:
2102 // OnMouseMove (eventArgs);
2103 break;
2104 case Win32.WM_LBUTTONUP:
2105 // FIXME:
2106 // OnMouseUp (eventArgs);
2107 break;
2108 case Win32.WM_MOUSEWHEEL:
2109 // FIXME:
2110 // OnMouseWheel (eventArgs);
2111 break;
2112 case Win32.WM_MOVE:
2113 OnMove (eventArgs);
2114 break;
2115 case Win32.WM_NOTIFY:
2116 // FIXME: get NM_CLICKED msg from pnmh
2117 // OnClick (eventArgs);
2118 // OnNotifyMessage (eventArgs);
2119 case Win32.WM_PAINT:
2120 OnPaint (paintEventArgs);
2121 break;
2122 case Win32.WM_SIZE:
2123 OnResize (eventArgs);
2124 OnSizeChanged (eventArgs);
2125 break;
2126 case Win32.WM_STYLECHANGED:
2127 OnStyleChanged (eventArgs);
2128 break;
2129 case Win32.WM_SYSCOLORCHANGE:
2130 OnSystemColorsChanged (eventArgs);
2131 break;
2132 case Win32.WM_SETTEXT:
2133 OnTextChanged (eventArgs);
2134 break;
2135 case Win32.WM_SHOWWINDOW:
2136 OnVisibleChanged (eventArgs);
2137 break;
2138 // default:
2139 // DefWndProc (ref m);
2140 // break;
2144 /// --- Control: events ---
2145 public event EventHandler BackColorChanged;// {
2146 // add {
2147 // throw new NotImplementedException ();
2148 // }
2149 // remove {
2150 // throw new NotImplementedException ();
2151 // }
2152 // }
2154 public event EventHandler BackgroundImageChanged; //{
2155 // add {
2156 // throw new NotImplementedException ();
2157 // }
2158 // remove {
2159 // throw new NotImplementedException ();
2160 // }
2161 // }
2163 public event EventHandler BindingContextChanged; // {
2164 // add {
2165 // throw new NotImplementedException ();
2166 // }
2167 // remove {
2168 // throw new NotImplementedException ();
2169 // }
2170 // }
2172 public event EventHandler CausesValidationChanged; // {
2173 // add {
2174 // throw new NotImplementedException ();
2175 // }
2176 // remove {
2177 // throw new NotImplementedException ();
2178 // }
2179 // }
2181 public event UICuesEventHandler ChangeUICues; // {
2182 // add {
2183 // throw new NotImplementedException ();
2184 // }
2185 // remove {
2186 // throw new NotImplementedException ();
2187 // }
2188 // }
2190 //Compact Framework
2191 public event EventHandler Click; // {
2192 // add {
2193 // throw new NotImplementedException ();
2194 // }
2195 // remove {
2196 // throw new NotImplementedException ();
2197 // }
2198 // }
2200 public event EventHandler ContextMenuChanged;
2202 public event ControlEventHandler ControlAdded; // {
2203 // add {
2204 // throw new NotImplementedException ();
2205 // }
2206 // remove {
2207 // throw new NotImplementedException ();
2208 // }
2209 // }
2211 public event ControlEventHandler ControlRemoved; // {
2212 // add {
2213 // throw new NotImplementedException ();
2214 // }
2215 // remove {
2216 // throw new NotImplementedException ();
2217 // }
2218 // }
2220 public event EventHandler CursorChanged; // {
2221 // add {
2222 // throw new NotImplementedException ();
2223 // }
2224 // remove {
2225 // throw new NotImplementedException ();
2226 // }
2227 // }
2229 public event EventHandler DockChanged; // {
2230 // add {
2231 // throw new NotImplementedException ();
2232 // }
2233 // remove {
2234 // throw new NotImplementedException ();
2235 // }
2236 // }
2238 public event EventHandler DoubleClick; // {
2239 // add {
2240 // throw new NotImplementedException ();
2241 // }
2242 // remove {
2243 // throw new NotImplementedException ();
2244 // }
2245 // }
2247 public event DragEventHandler DragDrop; // {
2248 // add {
2249 // throw new NotImplementedException ();
2250 // }
2251 // remove {
2252 // throw new NotImplementedException ();
2253 // }
2254 // }
2256 public event DragEventHandler DragEnter; // {
2257 // add {
2258 // throw new NotImplementedException ();
2259 // }
2260 // remove {
2261 // throw new NotImplementedException ();
2262 // }
2263 // }
2265 public event EventHandler DragLeave; // {
2266 // add {
2267 // throw new NotImplementedException ();
2268 // }
2269 // remove {
2270 // throw new NotImplementedException ();
2271 // }
2272 // }
2274 public event DragEventHandler DragOver; // {
2275 // add {
2276 // throw new NotImplementedException ();
2277 // }
2278 // remove {
2279 // throw new NotImplementedException ();
2280 // }
2281 // }
2283 //Compact Framework
2284 public event EventHandler EnabledChanged; // {
2285 // add {
2286 // throw new NotImplementedException ();
2287 // }
2288 // remove {
2289 // throw new NotImplementedException ();
2290 // }
2291 // }
2293 public event EventHandler Enter; // {
2294 // add {
2295 // throw new NotImplementedException ();
2296 // }
2297 // remove {
2298 // throw new NotImplementedException ();
2299 // }
2300 // }
2302 public event EventHandler FontChanged; // {
2303 // add {
2304 // throw new NotImplementedException ();
2305 // }
2306 // remove {
2307 // throw new NotImplementedException ();
2308 // }
2309 // }
2311 public event EventHandler ForeColorChanged; // {
2312 // add {
2313 // throw new NotImplementedException ();
2314 // }
2315 // remove {
2316 // throw new NotImplementedException ();
2317 // }
2318 // }
2320 public event GiveFeedbackEventHandler GiveFeedback; // {
2321 // add {
2322 // throw new NotImplementedException ();
2323 // }
2324 // remove {
2325 // throw new NotImplementedException ();
2326 // }
2327 // }
2329 //Compact Framework
2330 public event EventHandler GotFocus; // {
2331 // add {
2332 // throw new NotImplementedException ();
2333 // }
2334 // remove {
2335 // throw new NotImplementedException ();
2336 // }
2337 // }
2339 public event EventHandler HandleCreated; // {
2340 // add {
2341 // throw new NotImplementedException ();
2342 // }
2343 // remove {
2344 // throw new NotImplementedException ();
2345 // }
2346 // }
2348 public event EventHandler HandleDestroyed; // {
2349 // add {
2350 // throw new NotImplementedException ();
2351 // }
2352 // remove {
2353 // throw new NotImplementedException ();
2354 // }
2355 // }
2357 public event HelpEventHandler HelpRequested; // {
2358 // add {
2359 // throw new NotImplementedException ();
2360 // }
2361 // remove {
2362 // throw new NotImplementedException ();
2363 // }
2364 // }
2366 public event EventHandler ImeModeChanged; // {
2367 // add {
2368 // throw new NotImplementedException ();
2369 // }
2370 // remove {
2371 // throw new NotImplementedException ();
2372 // }
2373 // }
2375 public event InvalidateEventHandler Invalidated; // {
2376 // add {
2377 // throw new NotImplementedException ();
2378 // }
2379 // remove {
2380 // throw new NotImplementedException ();
2381 // }
2382 // }
2384 //Compact Framework
2385 public event KeyEventHandler KeyDown; // {
2386 // add {
2387 // throw new NotImplementedException ();
2388 // }
2389 // remove {
2390 // throw new NotImplementedException ();
2391 // }
2392 // }
2394 //Compact Framework
2395 public event KeyPressEventHandler KeyPress; // {
2396 // add {
2397 // throw new NotImplementedException ();
2398 // }
2399 // remove {
2400 // throw new NotImplementedException ();
2401 // }
2402 // }
2404 //Compact Framework
2405 public event KeyEventHandler KeyUp; // {
2406 // add {
2407 // throw new NotImplementedException ();
2408 // }
2409 // remove {
2410 // throw new NotImplementedException ();
2411 // }
2412 // }
2414 public event LayoutEventHandler Layout; // {
2415 // add {
2416 // throw new NotImplementedException ();
2417 // }
2418 // remove {
2419 // throw new NotImplementedException ();
2420 // }
2421 // }
2423 public event EventHandler Leave; // {
2424 // add {
2425 // throw new NotImplementedException ();
2426 // }
2427 // remove {
2428 // throw new NotImplementedException ();
2429 // }
2430 // }
2432 public event EventHandler LocationChanged; // {
2433 // add {
2434 // throw new NotImplementedException ();
2435 // }
2436 // remove {
2437 // throw new NotImplementedException ();
2438 // }
2439 // }
2441 //Compact Framework
2442 public event EventHandler LostFocus; // {
2443 // add {
2444 // throw new NotImplementedException ();
2445 // }
2446 // remove {
2447 // throw new NotImplementedException ();
2448 // }
2449 // }
2451 //Compact Framework
2452 public event MouseEventHandler MouseDown; // {
2453 // add {
2454 // throw new NotImplementedException ();
2455 // }
2456 // remove {
2457 // throw new NotImplementedException ();
2458 // }
2459 // }
2461 public event EventHandler MouseEnter; // {
2462 // add {
2463 // throw new NotImplementedException ();
2464 // }
2465 // remove {
2466 // throw new NotImplementedException ();
2467 // }
2468 // }
2470 public event EventHandler MouseHover; // {
2471 // add {
2472 // throw new NotImplementedException ();
2473 // }
2474 // remove {
2475 // throw new NotImplementedException ();
2476 // }
2477 // }
2479 public event EventHandler MouseLeave; // {
2480 // add {
2481 // throw new NotImplementedException ();
2482 // }
2483 // remove {
2484 // throw new NotImplementedException ();
2485 // }
2486 // }
2488 //Compact Framework
2489 public event MouseEventHandler MouseMove; // {
2490 // add {
2491 // throw new NotImplementedException ();
2492 // }
2493 // remove {
2494 // throw new NotImplementedException ();
2495 // }
2496 // }
2498 //Compact Framework
2499 public event MouseEventHandler MouseUp; // {
2500 // add {
2501 // throw new NotImplementedException ();
2502 // }
2503 // remove {
2504 // throw new NotImplementedException ();
2505 // }
2506 // }
2508 public event MouseEventHandler MouseWheel; // {
2509 // add {
2510 // throw new NotImplementedException ();
2511 // }
2512 // remove {
2513 // throw new NotImplementedException ();
2514 // }
2515 // }
2517 public event EventHandler Move; // {
2518 // add {
2519 // throw new NotImplementedException ();
2520 // }
2521 // remove {
2522 // throw new NotImplementedException ();
2523 // }
2524 // }
2526 //Compact Framework
2527 public event PaintEventHandler Paint; // {
2528 // add {
2529 // throw new NotImplementedException ();
2530 // }
2531 // remove {
2532 // throw new NotImplementedException ();
2533 // }
2534 // }
2536 //Compact Framework
2537 public event EventHandler ParentChanged; // {
2538 // add {
2539 // throw new NotImplementedException ();
2540 // }
2541 // remove {
2542 // throw new NotImplementedException ();
2543 // }
2544 // }
2546 public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp; // {
2547 // add {
2548 // throw new NotImplementedException ();
2549 // }
2550 // remove {
2551 // throw new NotImplementedException ();
2552 // }
2553 // }
2555 public event QueryContinueDragEventHandler QueryContinueDrag; // {
2556 // add {
2557 // throw new NotImplementedException ();
2558 // }
2559 // remove {
2560 // throw new NotImplementedException ();
2561 // }
2562 // }
2564 //Compact Framework
2565 public event EventHandler Resize; // {
2566 // add {
2567 // throw new NotImplementedException ();
2568 // }
2569 // remove {
2570 // throw new NotImplementedException ();
2571 // }
2572 // }
2574 public event EventHandler RightToLeftChanged; // {
2575 // add {
2576 // throw new NotImplementedException ();
2577 // }
2578 // remove {
2579 // throw new NotImplementedException ();
2580 // }
2581 // }
2583 public event EventHandler SizeChanged; // {
2584 // add {
2585 // throw new NotImplementedException ();
2586 // }
2587 // remove {
2588 // throw new NotImplementedException ();
2589 // }
2590 // }
2592 public event EventHandler StyleChanged; // {
2593 // add {
2594 // throw new NotImplementedException ();
2595 // }
2596 // remove {
2597 // throw new NotImplementedException ();
2598 // }
2599 // }
2601 public event EventHandler SystemColorsChanged; // {
2602 // add {
2603 // throw new NotImplementedException ();
2604 // }
2605 // remove {
2606 // throw new NotImplementedException ();
2607 // }
2608 // }
2610 public event EventHandler TabIndexChanged; // {
2611 // add {
2612 // throw new NotImplementedException ();
2613 // }
2614 // remove {
2615 // throw new NotImplementedException ();
2616 // }
2617 // }
2619 public event EventHandler TabStopChanged; // {
2620 // add {
2621 // throw new NotImplementedException ();
2622 // }
2623 // remove {
2624 // throw new NotImplementedException ();
2625 // }
2626 // }
2628 //Compact Framework
2629 public event EventHandler TextChanged; // {
2630 // add {
2631 // throw new NotImplementedException ();
2632 // }
2633 // remove {
2634 // throw new NotImplementedException ();
2635 // }
2636 // }
2638 public event EventHandler Validated; // {
2639 // add {
2640 // throw new NotImplementedException ();
2641 // }
2642 // remove {
2643 // throw new NotImplementedException ();
2644 // }
2645 // }
2647 [MonoTODO]
2648 // CancelEventHandler not yet defined
2649 //public event CancelEventHandler Validating {
2650 // add {
2651 // throw new NotImplementedException ();
2652 // }
2653 // remove {
2654 // throw new NotImplementedException ();
2655 // }
2658 public event EventHandler VisibleChanged; // {
2659 // add {
2660 // throw new NotImplementedException ();
2661 // }
2662 // remove {
2663 // throw new NotImplementedException ();
2664 // }
2665 // }
2667 /// --- IWin32Window properties
2668 public IntPtr Handle {
2669 get {
2670 if (window != null)
2671 return window.Handle;
2672 return (IntPtr) 0;
2676 /// --- ISynchronizeInvoke properties ---
2677 [MonoTODO]
2678 public bool InvokeRequired {
2679 get { throw new NotImplementedException (); }
2682 /// --- ISynchronizeInvoke methods ---
2683 [MonoTODO]
2684 public IAsyncResult BeginInvoke (Delegate method)
2686 throw new NotImplementedException ();
2689 [MonoTODO]
2690 public IAsyncResult BeginInvoke (Delegate method,
2691 object[] args)
2693 throw new NotImplementedException ();
2696 [MonoTODO]
2697 public object EndInvoke (IAsyncResult asyncResult)
2699 throw new NotImplementedException ();
2702 //Compact Framework
2703 [MonoTODO]
2704 public object Invoke (Delegate method)
2706 throw new NotImplementedException ();
2709 [MonoTODO]
2710 public object Invoke (Delegate method,object[] args)
2712 throw new NotImplementedException ();
2715 /// sub-class: Control.ControlAccessibleObject
2716 /// <summary>
2717 /// Provides information about a control that can be used by an accessibility application.
2718 /// </summary>
2719 public class ControlAccessibleObject /*: AccessibleObject*/ {
2720 // AccessibleObject not ready to be base class
2721 /// --- ControlAccessibleObject.constructor ---
2722 [MonoTODO]
2723 public ControlAccessibleObject (Control ownerControl)
2725 throw new NotImplementedException ();
2729 /// --- ControlAccessibleObject Properties ---
2730 [MonoTODO]
2731 // public override string DefaultAction {
2732 // get { throw new NotImplementedException (); }
2733 // }
2735 [MonoTODO]
2736 // public override string Description {
2737 // get { throw new NotImplementedException (); }
2738 // }
2740 [MonoTODO]
2741 public IntPtr Handle {
2742 get { throw new NotImplementedException (); }
2743 set { throw new NotImplementedException (); }
2746 [MonoTODO]
2747 // public override string Help {
2748 // get { throw new NotImplementedException (); }
2749 // }
2751 [MonoTODO]
2752 // public override string KeyboardShortcut {
2753 // get { throw new NotImplementedException (); }
2754 // }
2756 [MonoTODO]
2757 // public override string Name {
2758 // get { throw new NotImplementedException (); }
2759 // set { throw new NotImplementedException (); }
2760 // }
2762 [MonoTODO]
2763 public Control Owner {
2764 get { throw new NotImplementedException (); }
2767 [MonoTODO]
2768 // public override AccessibleRole Role {
2769 // get { throw new NotImplementedException (); }
2770 // }
2773 /// --- ControlAccessibleObject Methods ---
2774 [MonoTODO]
2775 // public override int GetHelpTopic(out string fileName)
2776 // {
2777 // throw new NotImplementedException ();
2778 // }
2780 [MonoTODO]
2781 public void NotifyClients (AccessibleEvents accEvent)
2783 throw new NotImplementedException ();
2786 [MonoTODO]
2787 public void NotifyClients (AccessibleEvents accEvent,
2788 int childID)
2790 throw new NotImplementedException ();
2793 [MonoTODO]
2794 public override string ToString ()
2796 throw new NotImplementedException ();
2800 /// sub-class: Control.ControlCollection
2801 /// <summary>
2802 /// Represents a collection of Control objects
2803 /// </summary>
2804 public class ControlCollection : IList, ICollection, IEnumerable, ICloneable {
2806 private ArrayList collection = new ArrayList ();
2807 private Control owner;
2809 /// --- ControlCollection.constructor ---
2810 public ControlCollection (Control owner)
2812 this.owner = owner;
2815 /// --- ControlCollection Properties ---
2816 public int Count {
2817 get { return collection.Count; }
2820 public bool IsReadOnly {
2821 get { return collection.IsReadOnly; }
2824 public virtual Control this [int index] {
2825 get { return (Control) collection[index]; }
2828 public virtual void Add (Control value)
2830 collection.Add (value);
2833 public virtual void AddRange (Control[] controls)
2835 collection.AddRange (controls);
2838 public virtual void Clear ()
2840 collection.Clear ();
2843 public bool Contains (Control control)
2845 return collection.Contains (control);
2848 public void CopyTo (Array dest,int index)
2850 collection.CopyTo (dest, index);
2853 [MonoTODO]
2854 public override bool Equals (object other)
2856 throw new NotImplementedException ();
2859 //inherited
2860 //public static bool Equals(object o1, object o2) {
2861 // throw new NotImplementedException ();
2864 [MonoTODO]
2865 public int GetChildIndex (Control child)
2867 throw new NotImplementedException ();
2870 public IEnumerator GetEnumerator ()
2872 return collection.GetEnumerator ();
2875 [MonoTODO]
2876 public override int GetHashCode ()
2878 throw new NotImplementedException ();
2881 public int IndexOf (Control control)
2883 return collection.IndexOf (control);
2886 public virtual void Remove (Control value)
2888 collection.Remove (value);
2891 public void RemoveAt (int index)
2893 collection.RemoveAt (index);
2896 [MonoTODO]
2897 public void SetChildIndex (Control child,int newIndex)
2899 throw new NotImplementedException ();
2902 /// --- ControlCollection.IClonable methods ---
2903 [MonoTODO]
2904 object ICloneable.Clone ()
2906 throw new NotImplementedException ();
2909 /// --- ControlCollection.IList properties ---
2910 bool IList.IsFixedSize {
2911 get { return collection.IsFixedSize; }
2914 object IList.this [int index] {
2915 get { return collection[index]; }
2916 set { collection[index] = value; }
2919 object ICollection.SyncRoot {
2920 get { return collection.SyncRoot; }
2923 bool ICollection.IsSynchronized {
2924 get { return collection.IsSynchronized; }
2927 /// --- ControlCollection.IList methods ---
2928 int IList.Add (object control)
2930 return collection.Add (control);
2933 bool IList.Contains (object control)
2935 return collection.Contains (control);
2938 int IList.IndexOf (object control)
2940 return collection.IndexOf (control);
2943 void IList.Insert (int index,object value)
2945 collection.Insert (index, value);
2948 void IList.Remove (object control)
2950 collection.Remove (control);
2952 } // --- end of Control.ControlCollection ---