2 // System.Windows.Forms.Control.cs
\r
5 // stubbed out by Jaak Simm (jaaksimm@firm.ee)
\r
6 // Dennis Hayes (dennish@rayetk.com)
\r
7 // WINELib implementation started by John Sohn (jsohn@columbus.rr.com)
\r
9 // (C) Ximian, Inc., 2002
\r
12 using System.ComponentModel;
\r
13 using System.Drawing;
\r
14 using System.Collections;
\r
16 namespace System.Windows.Forms {
\r
19 /// Defines the base class for controls, which are components with
\r
20 /// visual representation.
\r
23 public class Control : Component , ISynchronizeInvoke, IWin32Window {
\r
25 // Helper NativeWindow class to dispatch messages back
\r
26 // to the Control class
\r
27 protected class ControlNativeWindow : NativeWindow {
\r
29 private Control control;
\r
31 public ControlNativeWindow (Control control) : base() {
\r
32 this.control = control;
\r
35 protected override void WndProc (ref Message m) {
\r
36 base.WndProc (ref m);
\r
38 control.WndProc (ref m);
\r
42 // FIXME: not sure if dervied classes should have access
\r
43 protected ControlNativeWindow window;
\r
44 private ControlCollection childControls;
\r
45 private Control parent;
\r
48 // it seems these are stored in case the window is not created,
\r
49 // corresponding properties (below) need to check if window
\r
50 // is created or not and react accordingly
\r
51 string accessibleDefaultActionDescription;
\r
52 string accessibleDescription;
\r
53 string accessibleName;
\r
54 AccessibleRole accessibleRole;
\r
56 AnchorStyles anchor;
\r
58 Image backgroundImage;
\r
59 //BindingContext bindingContext;
\r
61 bool causesValidation;
\r
62 //ContextMenu contextMenu;
\r
69 // Point location; // using bounds to store location
\r
72 RightToLeft rightToLeft;
\r
77 // --- Constructors ---
\r
79 //Compact Framework //only Control()
\r
82 CreateControlsInstance ();
\r
84 accessibleDefaultActionDescription = null;
\r
85 accessibleDescription = null;
\r
86 accessibleName = null;
\r
87 accessibleRole = AccessibleRole.Default;
\r
89 anchor = AnchorStyles.Top | AnchorStyles.Left;
\r
90 //backColor = Control.DefaultBackColor;
\r
91 backgroundImage = null;
\r
92 bounds = new Rectangle();
\r
93 // bindingContext = null;
\r
94 causesValidation = true;
\r
95 // contextMenu = null;
\r
96 dock = DockStyle.None;
\r
98 // font = Control.DefaultFont;
\r
99 // foreColor = Control.DefaultForeColor;
\r
100 imeMode = ImeMode.Inherit;
\r
101 isAccessible = false;
\r
102 // location = new Point (0,0); should be from OS
\r
105 rightToLeft = RightToLeft.Inherit;
\r
113 // according to docs, the constructors do not create
\r
114 // the (HWND) window
\r
115 public Control (string text) : this()
\r
118 // Win32.SetWindowTextA (Handle, text);
\r
121 public Control (Control parent, string text) : this (text)
\r
124 // Win32.SetParent (Handle, parent.Handle);
\r
127 public Control (string text, int left, int top,
\r
128 int width, int height) : this(text)
\r
134 //Win32.SetWindowPos (Handle, (IntPtr) 0, left, top,
\r
135 // width, height, 0);
\r
138 public Control (Control parent,string text,int left, int top,
\r
139 int width,int height) : this (parent, text)
\r
145 // Win32.SetWindowPos (Handle, (IntPtr) 0, left, top,
\r
146 // width, height, 0);
\r
149 // for internal use only, create a control class
\r
150 // for an existing, created HWND
\r
151 private Control (IntPtr existingHandle)
\r
153 window = (ControlNativeWindow) NativeWindow.FromHandle (
\r
157 // --- Properties ---
\r
158 // Properties only supporting .NET framework, not stubbed out:
\r
159 // - protected bool RenderRightToLeft {get;}
\r
160 // - public IWindowTarget WindowTarget {get; set;}
\r
162 //public AccessibleObject AccessibilityObject {
\r
164 // throw new NotImplementedException ();
\r
168 public string AccessibleDefaultActionDescription {
\r
170 return accessibleDefaultActionDescription;
\r
173 accessibleDefaultActionDescription = value;
\r
177 public string AccessibleDescription {
\r
179 return accessibleDescription;
\r
182 accessibleDescription=value;
\r
186 public string AccessibleName {
\r
188 return accessibleName;
\r
191 accessibleName=value;
\r
195 public AccessibleRole AccessibleRole {
\r
197 return accessibleRole;
\r
200 accessibleRole=value;
\r
204 public virtual bool AllowDrop {
\r
213 public virtual AnchorStyles Anchor {
\r
222 //Compact Framework
\r
223 public virtual Color BackColor {
\r
225 if (IsHandleCreated) {
\r
226 IntPtr dc = Win32.GetDC (Handle);
\r
227 uint bgColor = Win32.GetBkColor (dc);
\r
228 Win32.ReleaseDC (Handle, dc);
\r
229 int r = (int) (bgColor & 0xFF);
\r
230 int g = (int) ((bgColor >> 8) & 0xFF);
\r
231 int b = (int) ((bgColor >> 16) & 0xFF);
\r
232 return Color.FromArgb (r, g, b);
\r
233 } else return backColor;
\r
237 if (IsHandleCreated) {
\r
238 IntPtr dc = Win32.GetDC (Handle);
\r
239 Win32.SetBkColor (dc, (uint) value.ToArgb());
\r
240 Win32.ReleaseDC (Handle, dc);
\r
245 public virtual Image BackgroundImage {
\r
247 return backgroundImage;
\r
250 backgroundImage = value;
\r
251 // FIXME: force redraw
\r
255 // waiting for BindingContext
\r
256 //public virtual BindingContext BindingContext {
\r
258 // //return bindingContext;
\r
259 // throw new NotImplementedException ();
\r
262 // //bindingContext=value;
\r
263 // throw new NotImplementedException ();
\r
267 //Compact Framework
\r
268 public int Bottom {
\r
270 return Top + Height;
\r
274 //Compact Framework
\r
275 public Rectangle Bounds {
\r
277 if (IsHandleCreated) {
\r
278 Win32.RECT rect = new Win32.RECT();
\r
279 Win32.GetWindowRect (Handle, ref rect);
\r
280 return new Rectangle ((int) rect.left,
\r
283 (int) rect.bottom);
\r
284 } else return bounds;
\r
287 if (IsHandleCreated)
\r
288 Win32.SetWindowPos (
\r
289 Handle, (IntPtr) 0, value.X, value.Y,
\r
290 value.Width, value.Height, 0);
\r
291 else bounds = value;
\r
295 public bool CanFocus {
\r
297 if (IsHandleCreated && Visible && Enabled)
\r
304 public bool CanSelect {
\r
306 // if (ControlStyles.Selectable &&
\r
307 // isContainedInAnotherControl &&
\r
308 // parentIsVisiable && isVisialbe &&
\r
309 // parentIsEnabled && isEnabled) {
\r
314 throw new NotImplementedException ();
\r
318 //Compact Framework
\r
319 public bool Capture {
\r
321 if (IsHandleCreated) {
\r
322 IntPtr captured = Win32.GetCapture ();
\r
323 if (Handle == captured)
\r
329 if (IsHandleCreated) {
\r
331 Win32.SetCapture (Handle);
\r
333 IntPtr captured = Win32.GetCapture ();
\r
335 // if this window is in capture state
\r
337 if (Handle == captured)
\r
338 Win32.ReleaseCapture ();
\r
344 public bool CausesValidation {
\r
346 return causesValidation;
\r
349 causesValidation=value;
\r
353 //Compact Framework
\r
354 public Rectangle ClientRectangle {
\r
356 if (IsHandleCreated) {
\r
357 Win32.RECT rect = new Win32.RECT();
\r
358 Win32.GetClientRect (Handle, ref rect);
\r
359 return new Rectangle ((int) rect.left,
\r
362 (int) rect.bottom);
\r
365 // FIXME: is the correct return value for
\r
366 // window who's handle is not created
\r
367 return new Rectangle (0, 0, 0, 0);
\r
371 //Compact Framework
\r
373 public Size ClientSize {
\r
375 // FIXME: use GetSystemMetrics and/or
\r
376 // GetClientRect here?
\r
377 throw new NotImplementedException ();
\r
380 throw new NotImplementedException ();
\r
385 public string CompanyName {
\r
387 throw new NotImplementedException ();
\r
391 public bool ContainsFocus {
\r
393 if (IsHandleCreated) {
\r
394 IntPtr focusedWindow = Win32.GetFocus();
\r
395 if (focusedWindow == Handle)
\r
402 //Compact Framework
\r
404 //public virtual ContextMenu ContextMenu {
\r
406 // //return contextMenu;
\r
407 // throw new NotImplementedException ();
\r
410 // //contextMenu=value;
\r
411 // throw new NotImplementedException ();
\r
415 public ControlCollection Controls {
\r
416 get { return childControls; }
\r
419 public bool Created {
\r
421 if (Handle != (IntPtr) 0)
\r
427 protected virtual CreateParams CreateParams {
\r
429 CreateParams createParams = new CreateParams ();
\r
430 createParams.Caption = Text;
\r
431 createParams.ClassName = "mono_native_window";
\r
432 createParams.X = Left;
\r
433 createParams.Y = Top;
\r
434 createParams.Width = Width;
\r
435 createParams.Height = Height;
\r
436 createParams.ClassStyle = 0;
\r
437 createParams.ExStyle = 0;
\r
438 createParams.Param = 0;
\r
440 if (parent != null)
\r
441 createParams.Parent = parent.Handle;
\r
443 createParams.Parent = (IntPtr) 0;
\r
445 createParams.Style = (int) Win32.WS_OVERLAPPEDWINDOW;
\r
447 return createParams;
\r
452 public virtual Cursor Cursor {
\r
454 throw new NotImplementedException ();
\r
457 throw new NotImplementedException ();
\r
461 //Compact Framework
\r
463 // waiting for BindingContext
\r
464 //public ControlBindingsCollection DataBindings {
\r
466 // throw new NotImplementedException ();
\r
470 public static Color DefaultBackColor {
\r
472 // FIXME: use GetSystemMetrics?
\r
473 //return SystemColors.Control;
\r
474 throw new NotImplementedException ();
\r
479 // FIXME: use GetSystemMetrics?
\r
480 //public static Font DefaultFont {
\r
481 // FIXME: get current system font from GenericSansSerif
\r
482 // call ArgumentException not called
\r
484 // throw new NotImplementedException ();
\r
485 //return (FontFamily.GenericSansSerif);
\r
489 public static Color DefaultForeColor {
\r
491 // FIXME: use GetSystemMetrics?
\r
492 //return SystemColors.ControlText;
\r
493 throw new NotImplementedException ();
\r
497 protected virtual ImeMode DefaultImeMode {
\r
499 //return ImeMode.Inherit;
\r
500 throw new NotImplementedException ();
\r
505 protected virtual Size DefaultSize {
\r
507 // FIXME: use GetSystemMetrics?
\r
508 throw new NotImplementedException ();
\r
512 public virtual Rectangle DisplayRectangle {
\r
514 return ClientRectangle;
\r
519 public bool Disposing {
\r
521 throw new NotImplementedException ();
\r
525 public virtual DockStyle Dock {
\r
534 //Compact Framework
\r
535 public virtual bool Enabled {
\r
537 return Win32.IsWindowEnabled (Handle);
\r
540 Win32.EnableWindow (Handle, value);
\r
544 //Compact Framework
\r
545 public virtual bool Focused {
\r
547 return ContainsFocus;
\r
551 //Compact Framework
\r
553 //public virtual Font Font {
\r
557 // throw new NotImplementedException ();
\r
561 // throw new NotImplementedException ();
\r
566 protected int FontHeight {
\r
568 throw new NotImplementedException ();
\r
571 throw new NotImplementedException ();
\r
575 //Compact Framework
\r
576 public virtual Color ForeColor {
\r
585 public bool HasChildren {
\r
587 if (childControls.Count >0)
\r
593 //Compact Framework
\r
594 public int Height {
\r
596 if (IsHandleCreated) {
\r
597 // FIXME: GetWindowPos
\r
599 return bounds.Height;
\r
602 bounds.Height = value;
\r
603 if (IsHandleCreated) {
\r
604 // FIXME: SetWindowPos
\r
609 public ImeMode ImeMode {
\r
619 public bool IsAccessible {
\r
622 return isAccessible;
\r
623 } // default is false
\r
625 isAccessible=value;
\r
629 public bool IsDisposed {
\r
631 if (Handle == (IntPtr) 0)
\r
637 public bool IsHandleCreated {
\r
639 if (Handle != (IntPtr) 0)
\r
645 //Compact Framework
\r
648 if (IsHandleCreated) {
\r
649 // FIXME: GetWindowPos
\r
651 } else return bounds.X;
\r
656 if (IsHandleCreated) {
\r
657 // FIXME: SetWindowPos
\r
662 //Compact Framework
\r
663 public Point Location {
\r
666 return new Point (Top, Left);
\r
669 bounds.X = value.X;
\r
670 bounds.Y = value.Y;
\r
672 if (IsHandleCreated) {
\r
673 // FIXME: SetWindowPos
\r
680 public static Keys ModifierKeys {
\r
682 throw new NotImplementedException ();
\r
686 //Compact Framework
\r
688 public static MouseButtons MouseButtons {
\r
690 // FIXME: use GetAsycKeyState?
\r
691 throw new NotImplementedException ();
\r
695 //Compact Framework
\r
696 public static Point MousePosition {
\r
698 Win32.POINT point = new Win32.POINT();
\r
699 Win32.GetCursorPos (ref point);
\r
700 return new Point ( (int) point.x, (int) point.y);
\r
704 public string Name {
\r
714 //Compact Framework
\r
715 public Control Parent {
\r
718 //IntPtr parent = Win32.GetParent (Handle);
\r
719 //return FromHandle (parent);
\r
722 Console.WriteLine ("setting parent");
\r
725 Console.WriteLine ("add ourself to the parents control");
\r
726 // add ourself to the parents control
\r
727 parent.Controls.Add (this);
\r
729 Console.WriteLine ("SetParent");
\r
730 if (IsHandleCreated) {
\r
731 Console.WriteLine ("Handle created");
\r
732 Win32.SetParent (Handle, value.Handle);
\r
738 public string ProductName {
\r
740 throw new NotImplementedException ();
\r
745 public string ProductVersion {
\r
747 throw new NotImplementedException ();
\r
752 public bool RecreatingHandle {
\r
754 throw new NotImplementedException ();
\r
758 public Region Region {
\r
769 protected bool ResizeRedraw {
\r
771 throw new NotImplementedException ();
\r
774 throw new NotImplementedException ();
\r
778 //Compact Framework
\r
781 return Left + Width;
\r
786 public virtual RightToLeft RightToLeft {
\r
789 return rightToLeft;
\r
797 protected virtual bool ShowFocusCues {
\r
799 throw new NotImplementedException ();
\r
804 protected bool ShowKeyboardCues {
\r
806 throw new NotImplementedException ();
\r
811 public override ISite Site {
\r
813 throw new NotImplementedException ();
\r
816 throw new NotImplementedException ();
\r
820 //Compact Framework
\r
824 throw new NotImplementedException ();
\r
827 throw new NotImplementedException ();
\r
832 public int TabIndex {
\r
834 throw new NotImplementedException ();
\r
837 throw new NotImplementedException ();
\r
841 public bool TabStop {
\r
852 public object Tag {
\r
854 throw new NotImplementedException ();
\r
857 throw new NotImplementedException ();
\r
861 //Compact Framework
\r
862 public virtual string Text {
\r
864 if (IsHandleCreated) {
\r
866 int length = Win32.GetWindowTextLengthA (Handle);
\r
867 Win32.GetWindowTextA (Handle, ref text, length);
\r
869 } else return text;
\r
874 if (IsHandleCreated)
\r
875 Win32.SetWindowTextA (Handle, value);
\r
879 //Compact Framework
\r
882 if (IsHandleCreated) {
\r
883 // FIXME: GetWindowPos
\r
885 } else return bounds.Top;
\r
890 if (IsHandleCreated) {
\r
891 // FIXME: SetWindowPos
\r
897 public Control TopLevelControl {
\r
899 throw new NotImplementedException ();
\r
903 //Compact Framework
\r
904 public bool Visible {
\r
906 throw new NotImplementedException ();
\r
911 Handle, Win32.SW_SHOW);
\r
914 Handle, Win32.SW_HIDE);
\r
918 //Compact Framework
\r
921 if (IsHandleCreated) {
\r
922 // FIXME: GetWindowPos
\r
924 return bounds.Width;
\r
927 bounds.Width = value;
\r
928 if (IsHandleCreated) {
\r
929 // FIXME: SetWindowPos
\r
934 /// --- methods ---
\r
935 /// internal .NET framework supporting methods, not stubbed out:
\r
936 /// - protected virtual void NotifyInvalidate(Rectangle invalidatedArea)
\r
937 /// - protected void RaiseDragEvent(object key,DragEventArgs e);
\r
938 /// - protected void RaiseKeyEvent(object key,KeyEventArgs e);
\r
939 /// - protected void RaiseMouseEvent(object key,MouseEventArgs e);
\r
940 /// - protected void RaisePaintEvent(object key,PaintEventArgs e);
\r
941 /// - protected void ResetMouseEventArgs();
\r
944 protected void AccessibilityNotifyClients (
\r
945 AccessibleEvents accEvent,int childID)
\r
947 throw new NotImplementedException ();
\r
950 //Compact Framework
\r
952 public void BringToFront ()
\r
954 throw new NotImplementedException ();
\r
957 public bool Contains (Control ctl)
\r
959 return childControls.Contains (ctl);
\r
962 public void CreateControl ()
\r
968 //AccessibleObject not ready
\r
969 //protected virtual AccessibleObject CreateAccessibilityInstance() {
\r
970 // throw new NotImplementedException ();
\r
973 protected virtual ControlCollection CreateControlsInstance ()
\r
975 childControls = new ControlCollection (this);
\r
976 return childControls;
\r
979 //Compact Framework
\r
981 public Graphics CreateGraphics ()
\r
983 throw new NotImplementedException ();
\r
986 protected virtual void CreateHandle ()
\r
988 window = new ControlNativeWindow (this);
\r
990 window.CreateHandle (CreateParams);
\r
993 protected virtual void DefWndProc (ref Message m)
\r
995 window.DefWndProc(ref m);
\r
998 protected virtual void DestroyHandle ()
\r
1000 window.DestroyHandle ();
\r
1004 protected override void Dispose (bool disposing)
\r
1006 throw new NotImplementedException ();
\r
1010 public DragDropEffects DoDragDrop (
\r
1011 object data, DragDropEffects allowedEffects)
\r
1013 throw new NotImplementedException ();
\r
1016 //public object EndInvoke(IAsyncResult asyncResult):
\r
1017 //look under ISynchronizeInvoke methods
\r
1020 public Form FindForm ()
\r
1022 throw new NotImplementedException ();
\r
1025 //Compact Framework
\r
1026 public bool Focus ()
\r
1028 if (Win32.SetFocus (Handle) != (IntPtr) 0)
\r
1034 public static Control FromChildHandle (IntPtr handle)
\r
1036 throw new NotImplementedException ();
\r
1039 public static Control FromHandle (IntPtr handle)
\r
1041 Control control = new Control (handle);
\r
1046 public Control GetChildAtPoint (Point pt)
\r
1048 throw new NotImplementedException ();
\r
1052 //public IContainerControl GetContainerControl ()
\r
1054 // throw new NotImplementedException ();
\r
1058 public Control GetNextControl (Control ctl, bool forward)
\r
1060 throw new NotImplementedException ();
\r
1064 protected bool GetStyle (ControlStyles flag)
\r
1066 throw new NotImplementedException ();
\r
1070 protected bool GetTopLevel ()
\r
1072 throw new NotImplementedException ();
\r
1075 //Compact Framework
\r
1076 public void Hide ()
\r
1078 if (IsHandleCreated)
\r
1079 Win32.ShowWindow (Handle, Win32.SW_HIDE);
\r
1083 protected virtual void InitLayout ()
\r
1085 throw new NotImplementedException ();
\r
1088 //Compact Framework
\r
1089 public void Invalidate ()
\r
1091 if (IsHandleCreated) {
\r
1092 Win32.RECT rect = (Win32.RECT) null;
\r
1093 Win32.InvalidateRect (Handle, ref rect, true);
\r
1098 public void Invalidate (bool invalidateChildren)
\r
1100 throw new NotImplementedException ();
\r
1103 //Compact Framework
\r
1104 public void Invalidate (Rectangle rc)
\r
1106 if (IsHandleCreated) {
\r
1107 Win32.RECT rect = new Win32.RECT();
\r
1108 rect.left = rc.Left;
\r
1109 rect.top = rc.Top;
\r
1110 rect.right = rc.Right;
\r
1111 rect.bottom = rc.Bottom;
\r
1112 Win32.InvalidateRect (Handle, ref rect, true);
\r
1117 public void Invalidate(Region region)
\r
1119 throw new NotImplementedException ();
\r
1123 public void Invalidate (Rectangle rc, bool invalidateChildren)
\r
1125 throw new NotImplementedException ();
\r
1129 public void Invalidate(Region region,bool invalidateChildren)
\r
1131 throw new NotImplementedException ();
\r
1135 protected void InvokeGotFocus (Control toInvoke, EventArgs e)
\r
1137 throw new NotImplementedException ();
\r
1141 protected void InvokeLostFocus (Control toInvoke, EventArgs e)
\r
1143 throw new NotImplementedException ();
\r
1147 protected void InvokeOnClick (Control toInvoke, EventArgs e)
\r
1149 throw new NotImplementedException ();
\r
1153 protected void InvokePaint (Control c, PaintEventArgs e)
\r
1155 throw new NotImplementedException ();
\r
1159 protected void InvokePaintBackground (
\r
1160 Control c,PaintEventArgs e)
\r
1162 throw new NotImplementedException ();
\r
1166 protected virtual bool IsInputChar (char charCode)
\r
1168 throw new NotImplementedException ();
\r
1172 protected virtual bool IsInputKey (Keys keyData)
\r
1174 throw new NotImplementedException ();
\r
1178 public static bool IsMnemonic (char charCode,string text)
\r
1180 throw new NotImplementedException ();
\r
1183 // methods used with events:
\r
1184 protected virtual void OnBackColorChanged (EventArgs e)
\r
1186 if (BackColorChanged != null)
\r
1187 BackColorChanged (this, e);
\r
1190 protected virtual void OnBackgroundImageChanged (EventArgs e)
\r
1192 if (BackgroundImageChanged != null)
\r
1193 BackgroundImageChanged (this, e);
\r
1196 protected virtual void OnBindingContextChanged (EventArgs e)
\r
1198 if (BindingContextChanged != null)
\r
1199 BindingContextChanged (this, e);
\r
1202 protected virtual void OnCausesValidationChanged (EventArgs e)
\r
1204 if (CausesValidationChanged != null)
\r
1205 CausesValidationChanged (this, e);
\r
1208 protected virtual void OnChangeUICues(UICuesEventArgs e)
\r
1210 if (ChangeUICues != null)
\r
1211 ChangeUICues (this, e);
\r
1214 //Compact Framework
\r
1215 protected virtual void OnClick (EventArgs e)
\r
1217 if (Click != null)
\r
1222 protected virtual void OnContextMenuChanged (EventArgs e)
\r
1224 if (ContextMenuChanged != null)
\r
1225 ContextMenuChanged (this, e);
\r
1228 protected virtual void OnControlAdded (ControlEventArgs e)
\r
1230 if (ControlAdded != null)
\r
1231 ControlAdded (this, e);
\r
1234 protected virtual void OnControlRemoved (ControlEventArgs e)
\r
1236 if (ControlRemoved != null)
\r
1237 ControlRemoved (this, e);
\r
1240 protected virtual void OnCreateControl ()
\r
1245 protected virtual void OnCursorChanged (EventArgs e)
\r
1247 if (CursorChanged != null)
\r
1248 CursorChanged (this, e);
\r
1251 protected virtual void OnDockChanged (EventArgs e)
\r
1253 if (DockChanged != null)
\r
1254 DockChanged (this, e);
\r
1257 protected virtual void OnDoubleClick (EventArgs e)
\r
1259 if (DoubleClick != null)
\r
1260 DoubleClick (this, e);
\r
1263 protected virtual void OnDragDrop (DragEventArgs e)
\r
1265 if (DragDrop != null)
\r
1266 DragDrop (this, e);
\r
1269 protected virtual void OnDragEnter (DragEventArgs e)
\r
1271 if (DragEnter != null)
\r
1272 DragEnter (this, e);
\r
1275 protected virtual void OnDragLeave (EventArgs e)
\r
1277 if (DragLeave != null)
\r
1278 DragLeave (this, e);
\r
1281 protected virtual void OnDragOver (DragEventArgs e)
\r
1283 if (DragOver != null)
\r
1284 DragOver (this, e);
\r
1287 //Compact Framework
\r
1288 protected virtual void OnEnabledChanged (EventArgs e)
\r
1290 if (EnabledChanged != null)
\r
1291 EnabledChanged (this, e);
\r
1294 protected virtual void OnEnter (EventArgs e)
\r
1296 if (Enter != null)
\r
1300 protected virtual void OnFontChanged (EventArgs e)
\r
1302 if (FontChanged != null)
\r
1303 FontChanged (this, e);
\r
1306 protected virtual void OnForeColorChanged (EventArgs e)
\r
1308 if (ForeColorChanged != null)
\r
1309 ForeColorChanged (this, e);
\r
1312 protected virtual void OnGiveFeedback (GiveFeedbackEventArgs e)
\r
1314 if (GiveFeedback != null)
\r
1315 GiveFeedback (this, e);
\r
1318 //Compact Framework
\r
1319 protected virtual void OnGotFocus (EventArgs e)
\r
1321 if (GotFocus != null)
\r
1322 GotFocus (this, e);
\r
1325 protected virtual void OnHandleCreated (EventArgs e)
\r
1327 Console.WriteLine ("OnHandleCreated");
\r
1329 if (HandleCreated != null)
\r
1330 HandleCreated (this, e);
\r
1332 // create all child windows
\r
1333 IEnumerator cw = childControls.GetEnumerator();
\r
1335 while (cw.MoveNext()) {
\r
1336 Console.WriteLine ("Adding Control");
\r
1337 Control control = (Control) cw.Current;
\r
1338 control.CreateControl ();
\r
1343 protected virtual void OnHandleDestroyed (EventArgs e)
\r
1345 if (HandleDestroyed != null)
\r
1346 HandleDestroyed (this, e);
\r
1349 protected virtual void OnHelpRequested (HelpEventArgs e)
\r
1351 if (HelpRequested != null)
\r
1352 HelpRequested (this, e);
\r
1355 protected virtual void OnImeModeChanged (EventArgs e)
\r
1357 if (ImeModeChanged != null)
\r
1358 ImeModeChanged (this, e);
\r
1361 protected virtual void OnInvalidated (InvalidateEventArgs e)
\r
1363 if (Invalidated != null)
\r
1364 Invalidated (this, e);
\r
1367 //Compact Framework
\r
1368 protected virtual void OnKeyDown (KeyEventArgs e)
\r
1370 if (KeyDown != null)
\r
1371 KeyDown (this, e);
\r
1374 //Compact Framework
\r
1375 protected virtual void OnKeyPress (KeyPressEventArgs e)
\r
1377 if (KeyPress != null)
\r
1378 KeyPress (this, e);
\r
1381 //Compact Framework
\r
1382 protected virtual void OnKeyUp (KeyEventArgs e)
\r
1384 if (KeyUp != null)
\r
1389 protected virtual void OnLayout (LayoutEventArgs e)
\r
1391 if (Layout != null)
\r
1395 protected virtual void OnLeave (EventArgs e)
\r
1397 if (Leave != null)
\r
1401 protected virtual void OnLocationChanged (EventArgs e)
\r
1403 if (LocationChanged != null)
\r
1404 LocationChanged (this, e);
\r
1407 //Compact Framework
\r
1408 protected virtual void OnLostFocus (EventArgs e)
\r
1410 if (LostFocus != null)
\r
1411 LostFocus (this, e);
\r
1414 //Compact Framework
\r
1415 protected virtual void OnMouseDown (MouseEventArgs e)
\r
1417 if (MouseDown != null)
\r
1418 MouseDown (this, e);
\r
1421 protected virtual void OnMouseEnter (EventArgs e)
\r
1423 if (MouseEnter != null)
\r
1424 MouseEnter (this, e);
\r
1427 protected virtual void OnMouseHover (EventArgs e)
\r
1429 if (MouseHover != null)
\r
1430 MouseHover (this, e);
\r
1433 protected virtual void OnMouseLeave (EventArgs e)
\r
1435 if (MouseLeave != null)
\r
1436 MouseLeave (this, e);
\r
1439 //Compact Framework
\r
1440 protected virtual void OnMouseMove (MouseEventArgs e)
\r
1442 if (MouseMove != null)
\r
1443 MouseMove (this, e);
\r
1446 //Compact Framework
\r
1447 protected virtual void OnMouseUp (MouseEventArgs e)
\r
1449 if (MouseUp != null)
\r
1450 MouseUp (this, e);
\r
1453 protected virtual void OnMouseWheel (MouseEventArgs e)
\r
1455 if (MouseWheel != null)
\r
1456 MouseWheel (this, e);
\r
1459 protected virtual void OnMove (EventArgs e)
\r
1465 protected virtual void OnNotifyMessage (Message m)
\r
1470 //Compact Framework
\r
1471 protected virtual void OnPaint (PaintEventArgs e)
\r
1473 if (Paint != null)
\r
1477 //Compact Framework
\r
1478 protected virtual void OnPaintBackground (PaintEventArgs e)
\r
1483 protected virtual void OnParentBackColorChanged (EventArgs e)
\r
1485 if (BackColorChanged != null)
\r
1486 BackColorChanged (this, e);
\r
1489 protected virtual void OnParentBackgroundImageChanged (
\r
1492 if (BackgroundImageChanged != null)
\r
1493 BackgroundImageChanged (this, e);
\r
1496 protected virtual void OnParentBindingContextChanged (
\r
1499 if (BindingContextChanged != null)
\r
1500 BindingContextChanged (this, e);
\r
1503 //Compact Framework
\r
1504 protected virtual void OnParentChanged (EventArgs e)
\r
1506 if (ParentChanged != null)
\r
1507 ParentChanged (this, e);
\r
1510 protected virtual void OnParentEnabledChanged (EventArgs e)
\r
1512 if (EnabledChanged != null)
\r
1513 EnabledChanged (this, e);
\r
1516 protected virtual void OnParentFontChanged (EventArgs e)
\r
1518 if (FontChanged != null)
\r
1519 FontChanged (this, e);
\r
1522 protected virtual void OnParentForeColorChanged (EventArgs e)
\r
1524 if (ForeColorChanged != null)
\r
1525 ForeColorChanged (this, e);
\r
1528 protected virtual void OnParentRightToLeftChanged (
\r
1531 if (RightToLeftChanged != null)
\r
1532 RightToLeftChanged (this, e);
\r
1535 protected virtual void OnParentVisibleChanged (EventArgs e)
\r
1537 if (VisibleChanged != null)
\r
1538 VisibleChanged (this, e);
\r
1541 protected virtual void OnQueryContinueDrag (
\r
1542 QueryContinueDragEventArgs e)
\r
1544 if (QueryContinueDrag != null)
\r
1545 QueryContinueDrag (this, e);
\r
1548 //Compact Framework
\r
1549 protected virtual void OnResize (EventArgs e)
\r
1551 if (Resize != null)
\r
1555 protected virtual void OnRightToLeftChanged (EventArgs e)
\r
1557 if (RightToLeftChanged != null)
\r
1558 RightToLeftChanged (this, e);
\r
1561 protected virtual void OnSizeChanged (EventArgs e)
\r
1563 if (SizeChanged != null)
\r
1564 SizeChanged (this, e);
\r
1567 protected virtual void OnStyleChanged (EventArgs e)
\r
1569 if (StyleChanged != null)
\r
1570 StyleChanged (this, e);
\r
1573 protected virtual void OnSystemColorsChanged (EventArgs e)
\r
1575 if (SystemColorsChanged != null)
\r
1576 SystemColorsChanged (this, e);
\r
1579 protected virtual void OnTabIndexChanged (EventArgs e)
\r
1581 if (TabIndexChanged != null)
\r
1582 TabIndexChanged (this, e);
\r
1585 protected virtual void OnTabStopChanged (EventArgs e)
\r
1587 if (TabStopChanged != null)
\r
1588 TabStopChanged (this, e);
\r
1591 //Compact Framework
\r
1592 protected virtual void OnTextChanged (EventArgs e)
\r
1594 if (TextChanged != null)
\r
1595 TextChanged (this, e);
\r
1598 [MonoTODO] // this doesn't seem to be documented
\r
1599 // protected virtual void OnTextAlignChanged (EventArgs e) {
\r
1600 // TextAlignChanged (this, e);
\r
1603 protected virtual void OnValidated (EventArgs e)
\r
1605 if (Validated != null)
\r
1606 Validated (this, e);
\r
1610 // CancelEventArgs not ready
\r
1611 //protected virtual void OnValidating(CancelEventArgs e)
\r
1613 // throw new NotImplementedException ();
\r
1617 protected virtual void OnVisibleChanged (EventArgs e)
\r
1619 if (VisibleChanged != null)
\r
1620 VisibleChanged (this, e);
\r
1622 // --- end of methods for events ---
\r
1626 public void PerformLayout ()
\r
1628 throw new NotImplementedException ();
\r
1632 public void PerformLayout (Control affectedControl,
\r
1633 string affectedProperty)
\r
1635 throw new NotImplementedException ();
\r
1638 //Compact Framework
\r
1640 public Point PointToClient (Point p)
\r
1642 throw new NotImplementedException ();
\r
1645 //Compact Framework
\r
1647 public Point PointToScreen (Point p)
\r
1649 throw new NotImplementedException ();
\r
1653 public virtual bool PreProcessMessage (ref Message msg)
\r
1655 throw new NotImplementedException ();
\r
1659 protected virtual bool ProcessCmdKey (ref Message msg,
\r
1662 throw new NotImplementedException ();
\r
1666 protected virtual bool ProcessDialogChar (char charCode)
\r
1668 throw new NotImplementedException ();
\r
1672 protected virtual bool ProcessDialogKey (Keys keyData)
\r
1674 throw new NotImplementedException ();
\r
1678 protected virtual bool ProcessKeyEventArgs (ref Message m)
\r
1680 throw new NotImplementedException ();
\r
1684 protected internal virtual bool ProcessKeyMessage (
\r
1687 throw new NotImplementedException ();
\r
1691 protected virtual bool ProcessKeyPreview (ref Message m)
\r
1693 throw new NotImplementedException ();
\r
1697 protected virtual bool ProcessMnemonic (char charCode)
\r
1699 throw new NotImplementedException ();
\r
1702 // used when properties/values of Control
\r
1703 // are big enough to warrant recreating the HWND
\r
1704 protected void RecreateHandle()
\r
1710 //Compact Framework
\r
1712 public Rectangle RectangleToClient (Rectangle r)
\r
1714 throw new NotImplementedException ();
\r
1717 //Compact Framework
\r
1719 public Rectangle RectangleToScreen (Rectangle r)
\r
1721 throw new NotImplementedException ();
\r
1725 protected static bool ReflectMessage (IntPtr hWnd,
\r
1728 throw new NotImplementedException ();
\r
1731 //Compact Framework
\r
1732 public virtual void Refresh ()
\r
1734 Win32.RECT rect = (Win32.RECT) null;
\r
1735 Win32.InvalidateRect (Handle, ref rect, true);
\r
1736 Win32.UpdateWindow (Handle);
\r
1740 public virtual void ResetBackColor ()
\r
1742 throw new NotImplementedException ();
\r
1746 public void ResetBindings ()
\r
1748 throw new NotImplementedException ();
\r
1752 public virtual void ResetFont ()
\r
1754 throw new NotImplementedException ();
\r
1758 public virtual void ResetForeColor ()
\r
1760 throw new NotImplementedException ();
\r
1764 public void ResetImeMode ()
\r
1766 throw new NotImplementedException ();
\r
1770 public virtual void ResetRightToLeft ()
\r
1772 throw new NotImplementedException ();
\r
1776 public virtual void ResetText ()
\r
1778 throw new NotImplementedException ();
\r
1782 public void ResumeLayout ()
\r
1784 throw new NotImplementedException ();
\r
1788 public void ResumeLayout (bool performLayout)
\r
1790 throw new NotImplementedException ();
\r
1794 protected ContentAlignment RtlTranslateAlignment (
\r
1795 ContentAlignment align)
\r
1797 throw new NotImplementedException ();
\r
1801 protected HorizontalAlignment RtlTranslateAlignment (
\r
1802 HorizontalAlignment align)
\r
1804 throw new NotImplementedException ();
\r
1808 protected LeftRightAlignment RtlTranslateAlignment (
\r
1809 LeftRightAlignment align)
\r
1811 throw new NotImplementedException ();
\r
1815 protected ContentAlignment RtlTranslateContent (
\r
1816 ContentAlignment align)
\r
1818 throw new NotImplementedException ();
\r
1822 protected HorizontalAlignment RtlTranslateHorizontal (
\r
1823 HorizontalAlignment align)
\r
1825 throw new NotImplementedException ();
\r
1829 protected LeftRightAlignment RtlTranslateLeftRight (
\r
1830 LeftRightAlignment align)
\r
1832 throw new NotImplementedException ();
\r
1836 public void Scale (float ratio)
\r
1838 throw new NotImplementedException ();
\r
1842 public void Scale (float dx,float dy)
\r
1844 throw new NotImplementedException ();
\r
1848 protected virtual void ScaleCore (float dx, float dy)
\r
1850 throw new NotImplementedException ();
\r
1854 public void Select ()
\r
1856 throw new NotImplementedException ();
\r
1860 protected virtual void Select (bool directed,bool forward)
\r
1862 throw new NotImplementedException ();
\r
1866 public bool SelectNextControl (Control ctl, bool forward,
\r
1867 bool tabStopOnly,
\r
1868 bool nested, bool wrap)
\r
1870 throw new NotImplementedException ();
\r
1873 //Compact Framework
\r
1875 public void SendToBack ()
\r
1877 throw new NotImplementedException ();
\r
1881 public void SetBounds (int x, int y, int width, int height)
\r
1883 throw new NotImplementedException ();
\r
1887 public void SetBounds (int x, int y, int width, int height,
\r
1888 BoundsSpecified specified)
\r
1890 throw new NotImplementedException ();
\r
1894 protected virtual void SetBoundsCore (
\r
1895 int x, int y, int width, int height,
\r
1896 BoundsSpecified specified)
\r
1898 throw new NotImplementedException ();
\r
1902 protected virtual void SetClientSizeCore (int x, int y)
\r
1904 throw new NotImplementedException ();
\r
1908 protected void SetStyle (ControlStyles flag, bool value)
\r
1910 throw new NotImplementedException ();
\r
1913 protected void SetTopLevel (bool value)
\r
1916 // FIXME: verify on whether this is supposed
\r
1917 // to activate/deactive the window
\r
1918 Win32.SetWindowPos (Handle,
\r
1919 (IntPtr) Win32.HWND_NOTOPMOST,
\r
1922 // FIXME: this does not make sense but
\r
1923 // the docs say the window is hidden
\r
1924 Win32.ShowWindow (Handle, Win32.SW_HIDE);
\r
1928 protected virtual void SetVisibleCore (bool value)
\r
1930 throw new NotImplementedException ();
\r
1933 //Compact Framework
\r
1934 public void Show ()
\r
1936 Win32.ShowWindow (Handle, Win32.SW_SHOW);
\r
1940 public void SuspendLayout ()
\r
1942 throw new NotImplementedException ();
\r
1945 //Compact Framework
\r
1946 public void Update ()
\r
1948 Win32.UpdateWindow (Handle);
\r
1952 protected void UpdateBounds ()
\r
1954 throw new NotImplementedException ();
\r
1958 protected void UpdateBounds (int x, int y, int width, int height)
\r
1960 throw new NotImplementedException ();
\r
1964 protected void UpdateBounds (
\r
1965 int x, int y, int width, int height, int clientWidth,
\r
1968 throw new NotImplementedException ();
\r
1972 protected void UpdateStyles ()
\r
1974 throw new NotImplementedException ();
\r
1978 protected void UpdateZOrder ()
\r
1980 throw new NotImplementedException ();
\r
1983 // WndProc - calls appriate On... function for the give
\r
1986 // These On... functions do not appear to be called by
\r
1989 // background color/image handled by WinForms
\r
1990 // OnBackColorChanged
\r
1991 // OnBackgroundImageChanged
\r
1992 // OnForeColorChanged
\r
1993 // OnPaintBackground
\r
1995 // controls are added/removed by WinForms
\r
1997 // OnControlRemoved
\r
1998 // OnCreateControl
\r
2000 // OnBindingContextChanged
\r
2001 // OnCausesValidationChanged
\r
2003 // OnContextMenuChanged
\r
2004 // OnRightToLeftChanged
\r
2008 // OnCursorChanged
\r
2009 // OnTextAlignChanged
\r
2012 // OnTabIndexChanged
\r
2013 // OnTabStopChanged
\r
2014 // OnLocationChanged
\r
2016 // FIXME: may be one of the WM_IME_ messages
\r
2017 // OnImeModeChanged
\r
2019 // InvalidateRect is called by no Invalidate message exists
\r
2022 // these messages ARE not called by WNDPROC according to docs
\r
2023 // OnParentBackColorChanged
\r
2024 // OnParentBackgroundImageChanged
\r
2025 // OnParentBindingContextChanged
\r
2026 // OnParentChanged
\r
2027 // OnParentEnabledChanged
\r
2028 // OnParentFontChanged
\r
2029 // OnParentForeColorChanged
\r
2030 // OnParentRightToLeftChanged
\r
2031 // OnParentVisibleChanged
\r
2033 protected virtual void WndProc(ref Message m)
\r
2035 EventArgs eventArgs = new EventArgs ();
\r
2036 // FIXME: paintEventArgs is not being created properly
\r
2037 PaintEventArgs paintEventArgs = new PaintEventArgs (
\r
2038 new Graphics(), new Rectangle());
\r
2042 case Win32.WM_CREATE:
\r
2043 Console.WriteLine ("WM_CREATE");
\r
2044 OnHandleCreated (eventArgs);
\r
2046 case Win32.WM_LBUTTONDBLCLK:
\r
2047 OnDoubleClick (eventArgs);
\r
2053 // OnQueryContinueDrag
\r
2054 case Win32.WM_ENABLE:
\r
2055 OnEnabledChanged (eventArgs);
\r
2057 case Win32.WM_SETFOCUS:
\r
2058 OnEnter (eventArgs);
\r
2059 OnGotFocus (eventArgs);
\r
2061 case Win32.WM_FONTCHANGE:
\r
2062 OnFontChanged (eventArgs);
\r
2064 case Win32.WM_DESTROY:
\r
2065 OnHandleDestroyed (eventArgs);
\r
2067 case Win32.WM_HELP:
\r
2069 //OnHelpRequested (eventArgs);
\r
2071 case Win32.WM_KEYDOWN:
\r
2073 // OnKeyDown (eventArgs);
\r
2075 case Win32.WM_CHAR:
\r
2077 // OnKeyPress (eventArgs);
\r
2079 case Win32.WM_KEYUP:
\r
2081 // OnKeyUp (eventArgs);
\r
2083 case Win32.WM_KILLFOCUS:
\r
2084 OnLeave (eventArgs);
\r
2085 OnLostFocus (eventArgs);
\r
2087 case Win32.WM_LBUTTONDOWN:
\r
2089 // OnMouseDown (eventArgs);
\r
2091 case Win32.WM_MOUSEACTIVATE:
\r
2092 OnMouseEnter (eventArgs);
\r
2094 case Win32.WM_MOUSEHOVER: // called by TrackMouseEvent
\r
2095 OnMouseHover (eventArgs);
\r
2097 case Win32.WM_MOUSELEAVE: // called by TrackMouseEvent
\r
2098 OnMouseLeave (eventArgs);
\r
2100 case Win32.WM_MOUSEMOVE:
\r
2102 // OnMouseMove (eventArgs);
\r
2104 case Win32.WM_LBUTTONUP:
\r
2106 // OnMouseUp (eventArgs);
\r
2108 case Win32.WM_MOUSEWHEEL:
\r
2110 // OnMouseWheel (eventArgs);
\r
2112 case Win32.WM_MOVE:
\r
2113 OnMove (eventArgs);
\r
2115 case Win32.WM_NOTIFY:
\r
2116 // FIXME: get NM_CLICKED msg from pnmh
\r
2117 // OnClick (eventArgs);
\r
2118 // OnNotifyMessage (eventArgs);
\r
2119 case Win32.WM_PAINT:
\r
2120 OnPaint (paintEventArgs);
\r
2122 case Win32.WM_SIZE:
\r
2123 OnResize (eventArgs);
\r
2124 OnSizeChanged (eventArgs);
\r
2126 case Win32.WM_STYLECHANGED:
\r
2127 OnStyleChanged (eventArgs);
\r
2129 case Win32.WM_SYSCOLORCHANGE:
\r
2130 OnSystemColorsChanged (eventArgs);
\r
2132 case Win32.WM_SETTEXT:
\r
2133 OnTextChanged (eventArgs);
\r
2135 case Win32.WM_SHOWWINDOW:
\r
2136 OnVisibleChanged (eventArgs);
\r
2139 // DefWndProc (ref m);
\r
2144 /// --- Control: events ---
\r
2145 public event EventHandler BackColorChanged;// {
\r
2147 // throw new NotImplementedException ();
\r
2150 // throw new NotImplementedException ();
\r
2154 public event EventHandler BackgroundImageChanged; //{
\r
2156 // throw new NotImplementedException ();
\r
2159 // throw new NotImplementedException ();
\r
2163 public event EventHandler BindingContextChanged; // {
\r
2165 // throw new NotImplementedException ();
\r
2168 // throw new NotImplementedException ();
\r
2172 public event EventHandler CausesValidationChanged; // {
\r
2174 // throw new NotImplementedException ();
\r
2177 // throw new NotImplementedException ();
\r
2181 public event UICuesEventHandler ChangeUICues; // {
\r
2183 // throw new NotImplementedException ();
\r
2186 // throw new NotImplementedException ();
\r
2190 //Compact Framework
\r
2191 public event EventHandler Click; // {
\r
2193 // throw new NotImplementedException ();
\r
2196 // throw new NotImplementedException ();
\r
2200 public event EventHandler ContextMenuChanged;
\r
2202 public event ControlEventHandler ControlAdded; // {
\r
2204 // throw new NotImplementedException ();
\r
2207 // throw new NotImplementedException ();
\r
2211 public event ControlEventHandler ControlRemoved; // {
\r
2213 // throw new NotImplementedException ();
\r
2216 // throw new NotImplementedException ();
\r
2220 public event EventHandler CursorChanged; // {
\r
2222 // throw new NotImplementedException ();
\r
2225 // throw new NotImplementedException ();
\r
2229 public event EventHandler DockChanged; // {
\r
2231 // throw new NotImplementedException ();
\r
2234 // throw new NotImplementedException ();
\r
2238 public event EventHandler DoubleClick; // {
\r
2240 // throw new NotImplementedException ();
\r
2243 // throw new NotImplementedException ();
\r
2247 public event DragEventHandler DragDrop; // {
\r
2249 // throw new NotImplementedException ();
\r
2252 // throw new NotImplementedException ();
\r
2256 public event DragEventHandler DragEnter; // {
\r
2258 // throw new NotImplementedException ();
\r
2261 // throw new NotImplementedException ();
\r
2265 public event EventHandler DragLeave; // {
\r
2267 // throw new NotImplementedException ();
\r
2270 // throw new NotImplementedException ();
\r
2274 public event DragEventHandler DragOver; // {
\r
2276 // throw new NotImplementedException ();
\r
2279 // throw new NotImplementedException ();
\r
2283 //Compact Framework
\r
2284 public event EventHandler EnabledChanged; // {
\r
2286 // throw new NotImplementedException ();
\r
2289 // throw new NotImplementedException ();
\r
2293 public event EventHandler Enter; // {
\r
2295 // throw new NotImplementedException ();
\r
2298 // throw new NotImplementedException ();
\r
2302 public event EventHandler FontChanged; // {
\r
2304 // throw new NotImplementedException ();
\r
2307 // throw new NotImplementedException ();
\r
2311 public event EventHandler ForeColorChanged; // {
\r
2313 // throw new NotImplementedException ();
\r
2316 // throw new NotImplementedException ();
\r
2320 public event GiveFeedbackEventHandler GiveFeedback; // {
\r
2322 // throw new NotImplementedException ();
\r
2325 // throw new NotImplementedException ();
\r
2329 //Compact Framework
\r
2330 public event EventHandler GotFocus; // {
\r
2332 // throw new NotImplementedException ();
\r
2335 // throw new NotImplementedException ();
\r
2339 public event EventHandler HandleCreated; // {
\r
2341 // throw new NotImplementedException ();
\r
2344 // throw new NotImplementedException ();
\r
2348 public event EventHandler HandleDestroyed; // {
\r
2350 // throw new NotImplementedException ();
\r
2353 // throw new NotImplementedException ();
\r
2357 public event HelpEventHandler HelpRequested; // {
\r
2359 // throw new NotImplementedException ();
\r
2362 // throw new NotImplementedException ();
\r
2366 public event EventHandler ImeModeChanged; // {
\r
2368 // throw new NotImplementedException ();
\r
2371 // throw new NotImplementedException ();
\r
2375 public event InvalidateEventHandler Invalidated; // {
\r
2377 // throw new NotImplementedException ();
\r
2380 // throw new NotImplementedException ();
\r
2384 //Compact Framework
\r
2385 public event KeyEventHandler KeyDown; // {
\r
2387 // throw new NotImplementedException ();
\r
2390 // throw new NotImplementedException ();
\r
2394 //Compact Framework
\r
2395 public event KeyPressEventHandler KeyPress; // {
\r
2397 // throw new NotImplementedException ();
\r
2400 // throw new NotImplementedException ();
\r
2404 //Compact Framework
\r
2405 public event KeyEventHandler KeyUp; // {
\r
2407 // throw new NotImplementedException ();
\r
2410 // throw new NotImplementedException ();
\r
2414 public event LayoutEventHandler Layout; // {
\r
2416 // throw new NotImplementedException ();
\r
2419 // throw new NotImplementedException ();
\r
2423 public event EventHandler Leave; // {
\r
2425 // throw new NotImplementedException ();
\r
2428 // throw new NotImplementedException ();
\r
2432 public event EventHandler LocationChanged; // {
\r
2434 // throw new NotImplementedException ();
\r
2437 // throw new NotImplementedException ();
\r
2441 //Compact Framework
\r
2442 public event EventHandler LostFocus; // {
\r
2444 // throw new NotImplementedException ();
\r
2447 // throw new NotImplementedException ();
\r
2451 //Compact Framework
\r
2452 public event MouseEventHandler MouseDown; // {
\r
2454 // throw new NotImplementedException ();
\r
2457 // throw new NotImplementedException ();
\r
2461 public event EventHandler MouseEnter; // {
\r
2463 // throw new NotImplementedException ();
\r
2466 // throw new NotImplementedException ();
\r
2470 public event EventHandler MouseHover; // {
\r
2472 // throw new NotImplementedException ();
\r
2475 // throw new NotImplementedException ();
\r
2479 public event EventHandler MouseLeave; // {
\r
2481 // throw new NotImplementedException ();
\r
2484 // throw new NotImplementedException ();
\r
2488 //Compact Framework
\r
2489 public event MouseEventHandler MouseMove; // {
\r
2491 // throw new NotImplementedException ();
\r
2494 // throw new NotImplementedException ();
\r
2498 //Compact Framework
\r
2499 public event MouseEventHandler MouseUp; // {
\r
2501 // throw new NotImplementedException ();
\r
2504 // throw new NotImplementedException ();
\r
2508 public event MouseEventHandler MouseWheel; // {
\r
2510 // throw new NotImplementedException ();
\r
2513 // throw new NotImplementedException ();
\r
2517 public event EventHandler Move; // {
\r
2519 // throw new NotImplementedException ();
\r
2522 // throw new NotImplementedException ();
\r
2526 //Compact Framework
\r
2527 public event PaintEventHandler Paint; // {
\r
2529 // throw new NotImplementedException ();
\r
2532 // throw new NotImplementedException ();
\r
2536 //Compact Framework
\r
2537 public event EventHandler ParentChanged; // {
\r
2539 // throw new NotImplementedException ();
\r
2542 // throw new NotImplementedException ();
\r
2546 public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp; // {
\r
2548 // throw new NotImplementedException ();
\r
2551 // throw new NotImplementedException ();
\r
2555 public event QueryContinueDragEventHandler QueryContinueDrag; // {
\r
2557 // throw new NotImplementedException ();
\r
2560 // throw new NotImplementedException ();
\r
2564 //Compact Framework
\r
2565 public event EventHandler Resize; // {
\r
2567 // throw new NotImplementedException ();
\r
2570 // throw new NotImplementedException ();
\r
2574 public event EventHandler RightToLeftChanged; // {
\r
2576 // throw new NotImplementedException ();
\r
2579 // throw new NotImplementedException ();
\r
2583 public event EventHandler SizeChanged; // {
\r
2585 // throw new NotImplementedException ();
\r
2588 // throw new NotImplementedException ();
\r
2592 public event EventHandler StyleChanged; // {
\r
2594 // throw new NotImplementedException ();
\r
2597 // throw new NotImplementedException ();
\r
2601 public event EventHandler SystemColorsChanged; // {
\r
2603 // throw new NotImplementedException ();
\r
2606 // throw new NotImplementedException ();
\r
2610 public event EventHandler TabIndexChanged; // {
\r
2612 // throw new NotImplementedException ();
\r
2615 // throw new NotImplementedException ();
\r
2619 public event EventHandler TabStopChanged; // {
\r
2621 // throw new NotImplementedException ();
\r
2624 // throw new NotImplementedException ();
\r
2628 //Compact Framework
\r
2629 public event EventHandler TextChanged; // {
\r
2631 // throw new NotImplementedException ();
\r
2634 // throw new NotImplementedException ();
\r
2638 public event EventHandler Validated; // {
\r
2640 // throw new NotImplementedException ();
\r
2643 // throw new NotImplementedException ();
\r
2648 // CancelEventHandler not yet defined
\r
2649 //public event CancelEventHandler Validating {
\r
2651 // throw new NotImplementedException ();
\r
2654 // throw new NotImplementedException ();
\r
2658 public event EventHandler VisibleChanged; // {
\r
2660 // throw new NotImplementedException ();
\r
2663 // throw new NotImplementedException ();
\r
2667 /// --- IWin32Window properties
\r
2668 public IntPtr Handle {
\r
2670 if (window != null)
\r
2671 return window.Handle;
\r
2672 return (IntPtr) 0;
\r
2676 /// --- ISynchronizeInvoke properties ---
\r
2678 public bool InvokeRequired {
\r
2679 get { throw new NotImplementedException (); }
\r
2682 /// --- ISynchronizeInvoke methods ---
\r
2684 public IAsyncResult BeginInvoke (Delegate method)
\r
2686 throw new NotImplementedException ();
\r
2690 public IAsyncResult BeginInvoke (Delegate method,
\r
2693 throw new NotImplementedException ();
\r
2697 public object EndInvoke (IAsyncResult asyncResult)
\r
2699 throw new NotImplementedException ();
\r
2702 //Compact Framework
\r
2704 public object Invoke (Delegate method)
\r
2706 throw new NotImplementedException ();
\r
2710 public object Invoke (Delegate method,object[] args)
\r
2712 throw new NotImplementedException ();
\r
2715 /// sub-class: Control.ControlAccessibleObject
\r
2717 /// Provides information about a control that can be used by an accessibility application.
\r
2719 public class ControlAccessibleObject /*: AccessibleObject*/ {
\r
2720 // AccessibleObject not ready to be base class
\r
2721 /// --- ControlAccessibleObject.constructor ---
\r
2723 public ControlAccessibleObject (Control ownerControl)
\r
2725 throw new NotImplementedException ();
\r
2729 /// --- ControlAccessibleObject Properties ---
\r
2731 // public override string DefaultAction {
\r
2732 // get { throw new NotImplementedException (); }
\r
2736 // public override string Description {
\r
2737 // get { throw new NotImplementedException (); }
\r
2741 public IntPtr Handle {
\r
2742 get { throw new NotImplementedException (); }
\r
2743 set { throw new NotImplementedException (); }
\r
2747 // public override string Help {
\r
2748 // get { throw new NotImplementedException (); }
\r
2752 // public override string KeyboardShortcut {
\r
2753 // get { throw new NotImplementedException (); }
\r
2757 // public override string Name {
\r
2758 // get { throw new NotImplementedException (); }
\r
2759 // set { throw new NotImplementedException (); }
\r
2763 public Control Owner {
\r
2764 get { throw new NotImplementedException (); }
\r
2768 // public override AccessibleRole Role {
\r
2769 // get { throw new NotImplementedException (); }
\r
2773 /// --- ControlAccessibleObject Methods ---
\r
2775 // public override int GetHelpTopic(out string fileName)
\r
2777 // throw new NotImplementedException ();
\r
2781 public void NotifyClients (AccessibleEvents accEvent)
\r
2783 throw new NotImplementedException ();
\r
2787 public void NotifyClients (AccessibleEvents accEvent,
\r
2790 throw new NotImplementedException ();
\r
2794 public override string ToString ()
\r
2796 throw new NotImplementedException ();
\r
2800 /// sub-class: Control.ControlCollection
\r
2802 /// Represents a collection of Control objects
\r
2804 public class ControlCollection : IList, ICollection, IEnumerable, ICloneable {
\r
2806 private ArrayList collection = new ArrayList ();
\r
2807 private Control owner;
\r
2809 /// --- ControlCollection.constructor ---
\r
2810 public ControlCollection (Control owner)
\r
2812 this.owner = owner;
\r
2815 /// --- ControlCollection Properties ---
\r
2816 public int Count {
\r
2817 get { return collection.Count; }
\r
2820 public bool IsReadOnly {
\r
2821 get { return collection.IsReadOnly; }
\r
2824 public virtual Control this [int index] {
\r
2825 get { return (Control) collection[index]; }
\r
2828 public virtual void Add (Control value)
\r
2830 collection.Add (value);
\r
2833 public virtual void AddRange (Control[] controls)
\r
2835 collection.AddRange (controls);
\r
2838 public virtual void Clear ()
\r
2840 collection.Clear ();
\r
2843 public bool Contains (Control control)
\r
2845 return collection.Contains (control);
\r
2848 public void CopyTo (Array dest,int index)
\r
2850 collection.CopyTo (dest, index);
\r
2854 public override bool Equals (object other)
\r
2856 throw new NotImplementedException ();
\r
2860 //public static bool Equals(object o1, object o2) {
\r
2861 // throw new NotImplementedException ();
\r
2865 public int GetChildIndex (Control child)
\r
2867 throw new NotImplementedException ();
\r
2870 public IEnumerator GetEnumerator ()
\r
2872 return collection.GetEnumerator ();
\r
2876 public override int GetHashCode ()
\r
2878 throw new NotImplementedException ();
\r
2881 public int IndexOf (Control control)
\r
2883 return collection.IndexOf (control);
\r
2886 public virtual void Remove (Control value)
\r
2888 collection.Remove (value);
\r
2891 public void RemoveAt (int index)
\r
2893 collection.RemoveAt (index);
\r
2897 public void SetChildIndex (Control child,int newIndex)
\r
2899 throw new NotImplementedException ();
\r
2902 /// --- ControlCollection.IClonable methods ---
\r
2904 object ICloneable.Clone ()
\r
2906 throw new NotImplementedException ();
\r
2909 /// --- ControlCollection.IList properties ---
\r
2910 bool IList.IsFixedSize {
\r
2911 get { return collection.IsFixedSize; }
\r
2914 object IList.this [int index] {
\r
2915 get { return collection[index]; }
\r
2916 set { collection[index] = value; }
\r
2919 object ICollection.SyncRoot {
\r
2920 get { return collection.SyncRoot; }
\r
2923 bool ICollection.IsSynchronized {
\r
2924 get { return collection.IsSynchronized; }
\r
2927 /// --- ControlCollection.IList methods ---
\r
2928 int IList.Add (object control)
\r
2930 return collection.Add (control);
\r
2933 bool IList.Contains (object control)
\r
2935 return collection.Contains (control);
\r
2938 int IList.IndexOf (object control)
\r
2940 return collection.IndexOf (control);
\r
2943 void IList.Insert (int index,object value)
\r
2945 collection.Insert (index, value);
\r
2948 void IList.Remove (object control)
\r
2950 collection.Remove (control);
\r
2952 } // --- end of Control.ControlCollection ---
\r