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
26 // Helper NativeWindow class to dispatch messages back
\r
27 // to the Control class
\r
28 protected class ControlNativeWindow : NativeWindow {
\r
30 private Control control;
\r
32 public ControlNativeWindow (Control control) : base() {
\r
33 this.control = control;
\r
36 protected override void WndProc (ref Message m) {
\r
37 base.WndProc (ref m);
\r
39 control.WndProc (ref m);
\r
43 // FIXME: not sure if dervied classes should have access
\r
44 protected ControlNativeWindow window;
\r
45 private ControlCollection childControls;
\r
46 private Control parent;
\r
49 // it seems these are stored in case the window is not created,
\r
50 // corresponding properties (below) need to check if window
\r
51 // is created or not and react accordingly
\r
52 string accessibleDefaultActionDescription;
\r
53 string accessibleDescription;
\r
54 string accessibleName;
\r
55 AccessibleRole accessibleRole;
\r
57 AnchorStyles anchor;
\r
59 Image backgroundImage;
\r
60 //BindingContext bindingContext;
\r
62 bool causesValidation;
\r
63 //ContextMenu contextMenu;
\r
70 // Point location; // using bounds to store location
\r
73 RightToLeft rightToLeft;
\r
78 // --- Constructors ---
\r
80 //Compact Framework //only Control()
\r
83 CreateControlsInstance ();
\r
85 accessibleDefaultActionDescription = null;
\r
86 accessibleDescription = null;
\r
87 accessibleName = null;
\r
88 accessibleRole = AccessibleRole.Default;
\r
90 anchor = AnchorStyles.Top | AnchorStyles.Left;
\r
91 //backColor = Control.DefaultBackColor;
\r
92 backgroundImage = null;
\r
93 bounds = new Rectangle();
\r
94 // bindingContext = null;
\r
95 causesValidation = true;
\r
96 // contextMenu = null;
\r
97 dock = DockStyle.None;
\r
99 // font = Control.DefaultFont;
\r
100 // foreColor = Control.DefaultForeColor;
\r
101 imeMode = ImeMode.Inherit;
\r
102 isAccessible = false;
\r
103 // location = new Point (0,0); should be from OS
\r
106 rightToLeft = RightToLeft.Inherit;
\r
111 CreateHandle();//sets window handle. FIXME: No it does not
\r
114 // according to docs, the constructors do not create
\r
115 // the (HWND) window
\r
116 public Control (string text) : this()
\r
119 // SetWindowTextA (Handle, text);
\r
122 public Control (Control parent, string text) : this (text)
\r
125 // SetParent (Handle, parent.Handle);
\r
128 public Control (string text, int left, int top,
\r
129 int width, int height) : this(text)
\r
135 //SetWindowPos (Handle, (IntPtr) 0, left, top,
\r
136 // width, height, 0);
\r
139 public Control (Control parent,string text,int left, int top,
\r
140 int width,int height) : this (parent, text)
\r
146 // SetWindowPos (Handle, (IntPtr) 0, left, top,
\r
147 // width, height, 0);
\r
150 // for internal use only, create a control class
\r
151 // for an existing, created HWND
\r
152 private Control (IntPtr existingHandle)
\r
154 window = (ControlNativeWindow) NativeWindow.FromHandle (
\r
158 // --- Properties ---
\r
159 // Properties only supporting .NET framework, not stubbed out:
\r
160 // - protected bool RenderRightToLeft {get;}
\r
161 // - public IWindowTarget WindowTarget {get; set;}
\r
163 //public AccessibleObject AccessibilityObject {
\r
165 // throw new NotImplementedException ();
\r
169 public string AccessibleDefaultActionDescription {
\r
171 return accessibleDefaultActionDescription;
\r
174 accessibleDefaultActionDescription = value;
\r
178 public string AccessibleDescription {
\r
180 return accessibleDescription;
\r
183 accessibleDescription=value;
\r
187 public string AccessibleName {
\r
189 return accessibleName;
\r
192 accessibleName=value;
\r
196 public AccessibleRole AccessibleRole {
\r
198 return accessibleRole;
\r
201 accessibleRole=value;
\r
205 public virtual bool AllowDrop {
\r
214 public virtual AnchorStyles Anchor {
\r
223 //Compact Framework
\r
224 public virtual Color BackColor {
\r
226 if (IsHandleCreated) {
\r
227 IntPtr dc = Win32.GetDC (Handle);
\r
228 uint bgColor = Win32.GetBkColor (dc);
\r
229 Win32.ReleaseDC (Handle, dc);
\r
230 int r = (int) (bgColor & 0xFF);
\r
231 int g = (int) ((bgColor >> 8) & 0xFF);
\r
232 int b = (int) ((bgColor >> 16) & 0xFF);
\r
233 return Color.FromArgb (r, g, b);
\r
234 } else return backColor;
\r
238 if (IsHandleCreated) {
\r
239 IntPtr dc = Win32.GetDC (Handle);
\r
240 Win32.SetBkColor (dc, (uint) value.ToArgb());
\r
241 Win32.ReleaseDC (Handle, dc);
\r
246 public virtual Image BackgroundImage {
\r
248 return backgroundImage;
\r
251 backgroundImage = value;
\r
252 // FIXME: force redraw
\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 RECT rect = new 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 Handle, SetWindowPosZOrder.HWND_TOPMOST, value.X, value.Y,
\r
291 value.Width, value.Height, 0);
\r
292 else bounds = value;
\r
296 public bool CanFocus {
\r
298 if (IsHandleCreated && Visible && Enabled)
\r
305 public bool CanSelect {
\r
307 // if (ControlStyles.Selectable &&
\r
308 // isContainedInAnotherControl &&
\r
309 // parentIsVisiable && isVisialbe &&
\r
310 // parentIsEnabled && isEnabled) {
\r
315 throw new NotImplementedException ();
\r
319 //Compact Framework
\r
320 public bool Capture {
\r
322 if (IsHandleCreated) {
\r
323 IntPtr captured = Win32.GetCapture ();
\r
324 if (Handle == captured)
\r
330 if (IsHandleCreated) {
\r
332 Win32.SetCapture (Handle);
\r
334 IntPtr captured = Win32.GetCapture ();
\r
336 // if this window is in capture state
\r
338 if (Handle == captured)
\r
339 Win32.ReleaseCapture ();
\r
345 public bool CausesValidation {
\r
347 return causesValidation;
\r
350 causesValidation=value;
\r
354 //Compact Framework
\r
355 public Rectangle ClientRectangle {
\r
357 if (IsHandleCreated) {
\r
358 RECT rect = new RECT();
\r
359 Win32.GetClientRect (Handle, ref rect);
\r
360 return new Rectangle ((int) rect.left,
\r
363 (int) rect.bottom);
\r
366 // FIXME: is the correct return value for
\r
367 // window who's handle is not created
\r
368 return new Rectangle (0, 0, 0, 0);
\r
372 //Compact Framework
\r
374 public Size ClientSize {
\r
376 if (IsHandleCreated) {
\r
377 RECT rect = new RECT();
\r
378 Win32.GetClientRect (Handle, ref rect);
\r
381 (int) rect.bottom);
\r
383 // FIXME: is the correct return value for
\r
384 // window who's handle is not created
\r
385 return new Size (0, 0);
\r
388 // FIXME: Is this good default style ?
389 SetClientSize(value, (int)(WindowStyles.WS_CHILD | WindowStyles.WS_BORDER), false);
394 public string CompanyName {
\r
396 //Better than throwing an execption
\r
397 return "Company Name";
\r
401 internal void SetClientSize(Size value, int styleIfNoWindow, bool menuIfNoWindow) {
402 RECT rc = new RECT();
403 rc.left = rc.top = 0;
404 rc.right = value.Width;
405 rc.bottom = value.Height;
407 if( Handle != IntPtr.Zero){
408 int style = Win32.GetWindowLong( Handle, GetWindowLongFlag.GWL_STYLE).ToInt32();
410 if( (style & (int)WindowStyles.WS_CHILD) != 0 ){
411 menuExists = Win32.GetMenu(Handle) != IntPtr.Zero ? 1 : 0;
413 Win32.AdjustWindowRect( ref rc, style, menuExists);
414 Win32.SetWindowPos( Handle, SetWindowPosZOrder.HWND_TOP, 0, 0, 400 /*rc.right - rc.left */, rc.bottom - rc.top,
415 SetWindowPosFlags.SWP_NOMOVE | SetWindowPosFlags.SWP_NOZORDER);
418 Win32.AdjustWindowRect( ref rc, styleIfNoWindow, menuIfNoWindow ? 1 : 0);
419 Width = rc.right - rc.left;
420 Height = rc.bottom - rc.top;
424 public bool ContainsFocus {
\r
426 if (IsHandleCreated) {
\r
427 IntPtr focusedWindow = Win32.GetFocus();
\r
428 if (focusedWindow == Handle)
\r
435 //Compact Framework
\r
437 public virtual ContextMenu ContextMenu {
\r
439 //return contextMenu;
\r
440 throw new NotImplementedException ();
\r
443 //contextMenu=value;
\r
444 throw new NotImplementedException ();
\r
448 public ControlCollection Controls {
\r
449 get { return childControls; }
\r
452 public bool Created {
\r
454 if (Handle != (IntPtr) 0)
\r
460 protected virtual CreateParams CreateParams {
\r
462 CreateParams createParams = new CreateParams ();
\r
463 createParams.Caption = Text;
\r
464 createParams.ClassName = "CONTROL";
\r
465 createParams.X = Left;
\r
466 createParams.Y = Top;
\r
467 createParams.Width = Width;
\r
468 createParams.Height = Height;
\r
469 createParams.ClassStyle = 0;
\r
470 createParams.ExStyle = 0;
\r
471 createParams.Param = 0;
\r
473 if (parent != null)
\r
474 createParams.Parent = parent.Handle;
\r
476 createParams.Parent = (IntPtr) 0;
\r
478 createParams.Style = (int) WindowStyles.WS_OVERLAPPEDWINDOW;
\r
480 return createParams;
\r
485 public virtual Cursor Cursor {
\r
487 throw new NotImplementedException ();
\r
490 throw new NotImplementedException ();
\r
494 //Compact Framework
\r
496 // waiting for BindingContext; should be stubbed now
\r
497 public ControlBindingsCollection DataBindings {
\r
499 throw new NotImplementedException ();
\r
503 public static Color DefaultBackColor {
\r
505 // FIXME: use GetSystemMetrics?
\r
506 //return SystemColors.Control;
\r
507 throw new NotImplementedException ();
\r
512 // FIXME: use GetSystemMetrics?
\r
513 //public static Font DefaultFont {
\r
514 // FIXME: get current system font from GenericSansSerif
\r
515 // call ArgumentException not called
\r
517 // throw new NotImplementedException ();
\r
518 //return (FontFamily.GenericSansSerif);
\r
522 public static Color DefaultForeColor {
\r
524 return SystemColors.ControlText;
\r
528 protected virtual ImeMode DefaultImeMode {
\r
530 return ImeMode.Inherit;
\r
534 protected virtual Size DefaultSize {
\r
536 //Default label size, this should be correct.
\r
537 return new Size(100,23);
\r
541 public virtual Rectangle DisplayRectangle {
\r
543 return ClientRectangle;
\r
548 public bool Disposing {
\r
550 throw new NotImplementedException ();
\r
554 public virtual DockStyle Dock {
\r
563 //Compact Framework
\r
564 public virtual bool Enabled {
\r
566 return Win32.IsWindowEnabled (Handle);
\r
569 Win32.EnableWindow (Handle, value);
\r
573 //Compact Framework
\r
574 public virtual bool Focused {
\r
576 return ContainsFocus;
\r
580 //Compact Framework
\r
581 public virtual Font Font {
\r
583 throw new NotImplementedException ();
\r
584 //uint ReturnValue = SendMessage(Handle, WM_GETFONT, IntPtr.Zero, IntPtr.Zero);
\r
585 //if(ReturnValue != 0)throw new Exception("Could not get Font",null);
\r
589 throw new NotImplementedException ();
\r
590 //uint ReturnValue = SendMessage(Handle, WM_SETFONT, value, (IntPtr)1 );
\r
591 //if(ReturnValue != 0)throw new Exception("Could not set Font",null);
\r
596 protected int FontHeight {
\r
598 throw new NotImplementedException ();
\r
601 throw new NotImplementedException ();
\r
605 //Compact Framework
\r
606 public virtual Color ForeColor {
\r
615 public bool HasChildren {
\r
617 if (childControls.Count >0)
\r
623 //Compact Framework
\r
624 public int Height {
\r
626 if (IsHandleCreated) {
\r
627 // FIXME: GetWindowPos
\r
629 return bounds.Height;
\r
632 bounds.Height = value;
\r
633 if (IsHandleCreated) {
\r
634 // FIXME: SetWindowPos
\r
639 public ImeMode ImeMode {
\r
649 public bool IsAccessible {
\r
652 return isAccessible;
\r
653 } // default is false
\r
655 isAccessible=value;
\r
659 public bool IsDisposed {
\r
661 if (Handle == (IntPtr) 0)
\r
667 public bool IsHandleCreated {
\r
669 if (Handle != (IntPtr) 0)
\r
675 //Compact Framework
\r
678 if (IsHandleCreated) {
\r
679 // FIXME: GetWindowPos
\r
681 } else return bounds.X;
\r
686 if (IsHandleCreated) {
\r
687 // FIXME: SetWindowPos
\r
692 //Compact Framework
\r
693 public Point Location {
\r
696 return new Point (Top, Left);
\r
699 bounds.X = value.X;
\r
700 bounds.Y = value.Y;
\r
702 if (IsHandleCreated) {
\r
703 // FIXME: SetWindowPos
\r
710 public static Keys ModifierKeys {
\r
712 throw new NotImplementedException ();
\r
716 //Compact Framework
\r
718 public static MouseButtons MouseButtons {
\r
720 // FIXME: use GetAsycKeyState?
\r
721 throw new NotImplementedException ();
\r
725 //Compact Framework
\r
726 public static Point MousePosition {
\r
728 POINT point = new POINT();
\r
729 Win32.GetCursorPos (ref point);
\r
730 return new Point ( (int) point.x, (int) point.y);
\r
734 public string Name {
\r
744 //Compact Framework
\r
745 public Control Parent {
\r
748 //IntPtr parent = GetParent (Handle);
\r
749 //return FromHandle (parent);
\r
752 Console.WriteLine ("setting parent");
\r
755 Console.WriteLine ("add ourself to the parents control");
\r
756 // add ourself to the parents control
\r
757 parent.Controls.Add (this);
\r
759 Console.WriteLine ("SetParent");
\r
760 if (IsHandleCreated) {
\r
761 Console.WriteLine ("Handle created");
\r
762 Win32.SetParent (Handle, value.Handle);
\r
768 public string ProductName {
\r
771 return "Product Name";
\r
776 public string ProductVersion {
\r
779 return "Product Version";
\r
784 public bool RecreatingHandle {
\r
786 throw new NotImplementedException ();
\r
790 public Region Region {
\r
801 protected bool ResizeRedraw {
\r
803 throw new NotImplementedException ();
\r
806 throw new NotImplementedException ();
\r
810 //Compact Framework
\r
813 return Left + Width;
\r
818 public virtual RightToLeft RightToLeft {
\r
821 return rightToLeft;
\r
829 protected virtual bool ShowFocusCues {
\r
831 throw new NotImplementedException ();
\r
836 protected bool ShowKeyboardCues {
\r
838 throw new NotImplementedException ();
\r
843 public override ISite Site {
\r
845 throw new NotImplementedException ();
\r
848 throw new NotImplementedException ();
\r
852 //Compact Framework
\r
854 //FIXME: should we return client size or someother size???
\r
856 RECT WindowRectangle;
\r
857 WindowRectangle = new RECT();
\r
858 if(!Win32.GetWindowRect(Handle,ref WindowRectangle)){
\r
859 //throw new Exception("couild not retreve Control Size");
\r
861 return new Size(WindowRectangle.right - WindowRectangle.left,
\r
862 WindowRectangle.bottom - WindowRectangle.top);
\r
865 Win32.SetWindowPos(Handle, SetWindowPosZOrder.HWND_TOP, 0, 0, this.Size.Width, this.Size.Height,
\r
866 SetWindowPosFlags.SWP_NOMOVE | SetWindowPosFlags.SWP_NOMOVE |
\r
867 SetWindowPosFlags.SWP_NOZORDER);// Activating might be a good idea?? | SetWindowPosFlags.SWP_NOACTIVATE);
\r
870 internal int tabindex;//for debug/test only. remove
\r
872 public int TabIndex {
\r
881 public bool TabStop {
\r
892 public object Tag {
\r
901 //Compact Framework
\r
902 public virtual string Text {
\r
904 if (IsHandleCreated) {
\r
906 int length = Win32.GetWindowTextLengthA (Handle);
\r
907 Win32.GetWindowTextA (Handle, ref text, length);
\r
917 if (IsHandleCreated)
\r
918 Win32.SetWindowTextA (Handle, value);
\r
922 //Compact Framework
\r
925 if (IsHandleCreated) {
\r
926 // FIXME: GetWindowPos
\r
928 } else return bounds.Top;
\r
933 if (IsHandleCreated) {
\r
934 // FIXME: SetWindowPos
\r
940 public Control TopLevelControl {
\r
942 throw new NotImplementedException ();
\r
946 //Compact Framework
\r
947 public bool Visible {
\r
949 throw new NotImplementedException ();
\r
954 Handle, ShowWindowStyles.SW_SHOW);
\r
957 Handle, ShowWindowStyles.SW_HIDE);
\r
961 //Compact Framework
\r
964 if (IsHandleCreated) {
\r
965 // FIXME: GetWindowPos
\r
967 return bounds.Width;
\r
970 bounds.Width = value;
\r
971 if (IsHandleCreated) {
\r
972 // FIXME: SetWindowPos
\r
977 /// --- methods ---
\r
978 /// internal .NET framework supporting methods, not stubbed out:
\r
979 /// - protected virtual void NotifyInvalidate(Rectangle invalidatedArea)
\r
980 /// - protected void RaiseDragEvent(object key,DragEventArgs e);
\r
981 /// - protected void RaiseKeyEvent(object key,KeyEventArgs e);
\r
982 /// - protected void RaiseMouseEvent(object key,MouseEventArgs e);
\r
983 /// - protected void RaisePaintEvent(object key,PaintEventArgs e);
\r
984 /// - protected void ResetMouseEventArgs();
\r
987 protected void AccessibilityNotifyClients (
\r
988 AccessibleEvents accEvent,int childID)
\r
990 throw new NotImplementedException ();
\r
993 //Compact Framework
\r
995 public void BringToFront ()
\r
1000 public bool Contains (Control ctl)
\r
1002 return childControls.Contains (ctl);
\r
1005 public void CreateControl ()
\r
1011 protected virtual AccessibleObject CreateAccessibilityInstance() {
\r
1012 throw new NotImplementedException ();
\r
1015 protected virtual ControlCollection CreateControlsInstance ()
\r
1017 childControls = new ControlCollection (this);
\r
1018 return childControls;
\r
1021 //Compact Framework
\r
1023 public Graphics CreateGraphics ()
\r
1025 throw new NotImplementedException ();
\r
1028 protected virtual void CreateHandle ()
\r
1030 window = new ControlNativeWindow (this);
\r
1032 window.CreateHandle (CreateParams);
\r
1035 protected virtual void DefWndProc (ref Message m)
\r
1037 window.DefWndProc(ref m);
\r
1040 protected virtual void DestroyHandle ()
\r
1042 window.DestroyHandle ();
\r
1045 protected override void Dispose (bool disposing)
\r
1048 base.Dispose(disposing);
\r
1052 public DragDropEffects DoDragDrop (
\r
1053 object data, DragDropEffects allowedEffects)
\r
1055 throw new NotImplementedException ();
\r
1058 //public object EndInvoke(IAsyncResult asyncResult):
\r
1059 //look under ISynchronizeInvoke methods
\r
1062 public Form FindForm ()
\r
1064 throw new NotImplementedException ();
\r
1067 //Compact Framework
\r
1068 public bool Focus ()
\r
1070 if (Win32.SetFocus (Handle) != (IntPtr) 0)
\r
1076 public static Control FromChildHandle (IntPtr handle)
\r
1078 throw new NotImplementedException ();
\r
1081 public static Control FromHandle (IntPtr handle)
\r
1083 Control control = new Control (handle);
\r
1088 public Control GetChildAtPoint (Point pt)
\r
1090 throw new NotImplementedException ();
\r
1094 //public IContainerControl GetContainerControl ()
\r
1096 // throw new NotImplementedException ();
\r
1100 public Control GetNextControl (Control ctl, bool forward)
\r
1102 throw new NotImplementedException ();
\r
1106 protected bool GetStyle (ControlStyles flag)
\r
1108 throw new NotImplementedException ();
\r
1112 protected bool GetTopLevel ()
\r
1114 throw new NotImplementedException ();
\r
1117 //Compact Framework
\r
1118 public void Hide ()
\r
1120 if (IsHandleCreated)
\r
1121 Win32.ShowWindow (Handle, ShowWindowStyles.SW_HIDE);
\r
1125 protected virtual void InitLayout ()
\r
1130 //Compact Framework
\r
1131 public void Invalidate ()
\r
1133 if (IsHandleCreated) {
\r
1135 //RECT rect = (RECT) null;
\r
1136 //InvalidateRect (Handle, ref rect, true);
\r
1141 public void Invalidate (bool invalidateChildren)
\r
1146 //Compact Framework
\r
1147 public void Invalidate (Rectangle rc)
\r
1149 if (IsHandleCreated) {
\r
1150 RECT rect = new RECT();
\r
1151 rect.left = rc.Left;
\r
1152 rect.top = rc.Top;
\r
1153 rect.right = rc.Right;
\r
1154 rect.bottom = rc.Bottom;
\r
1155 Win32.InvalidateRect (Handle, ref rect, true);
\r
1160 public void Invalidate(Region region)
\r
1166 public void Invalidate (Rectangle rc, bool invalidateChildren)
\r
1172 public void Invalidate(Region region,bool invalidateChildren)
\r
1178 protected void InvokeGotFocus (Control toInvoke, EventArgs e)
\r
1184 protected void InvokeLostFocus (Control toInvoke, EventArgs e)
\r
1190 protected void InvokeOnClick (Control toInvoke, EventArgs e)
\r
1196 protected void InvokePaint (Control c, PaintEventArgs e)
\r
1202 protected void InvokePaintBackground (
\r
1203 Control c,PaintEventArgs e)
\r
1209 protected virtual bool IsInputChar (char charCode)
\r
1211 throw new NotImplementedException ();
\r
1215 protected virtual bool IsInputKey (Keys keyData)
\r
1217 throw new NotImplementedException ();
\r
1221 public static bool IsMnemonic (char charCode,string text)
\r
1223 throw new NotImplementedException ();
\r
1226 // methods used with events:
\r
1227 protected virtual void OnBackColorChanged (EventArgs e)
\r
1229 if (BackColorChanged != null)
\r
1230 BackColorChanged (this, e);
\r
1233 protected virtual void OnBackgroundImageChanged (EventArgs e)
\r
1235 if (BackgroundImageChanged != null)
\r
1236 BackgroundImageChanged (this, e);
\r
1239 protected virtual void OnBindingContextChanged (EventArgs e)
\r
1241 if (BindingContextChanged != null)
\r
1242 BindingContextChanged (this, e);
\r
1245 protected virtual void OnCausesValidationChanged (EventArgs e)
\r
1247 if (CausesValidationChanged != null)
\r
1248 CausesValidationChanged (this, e);
\r
1251 protected virtual void OnChangeUICues(UICuesEventArgs e)
\r
1253 if (ChangeUICues != null)
\r
1254 ChangeUICues (this, e);
\r
1257 //Compact Framework
\r
1258 protected virtual void OnClick (EventArgs e)
\r
1260 if (Click != null)
\r
1265 protected virtual void OnContextMenuChanged (EventArgs e)
\r
1267 if (ContextMenuChanged != null)
\r
1268 ContextMenuChanged (this, e);
\r
1271 protected virtual void OnControlAdded (ControlEventArgs e)
\r
1273 if (ControlAdded != null)
\r
1274 ControlAdded (this, e);
\r
1277 protected virtual void OnControlRemoved (ControlEventArgs e)
\r
1279 if (ControlRemoved != null)
\r
1280 ControlRemoved (this, e);
\r
1283 protected virtual void OnCreateControl ()
\r
1288 protected virtual void OnCursorChanged (EventArgs e)
\r
1290 if (CursorChanged != null)
\r
1291 CursorChanged (this, e);
\r
1294 protected virtual void OnDockChanged (EventArgs e)
\r
1296 if (DockChanged != null)
\r
1297 DockChanged (this, e);
\r
1300 protected virtual void OnDoubleClick (EventArgs e)
\r
1302 if (DoubleClick != null)
\r
1303 DoubleClick (this, e);
\r
1306 protected virtual void OnDragDrop (DragEventArgs e)
\r
1308 if (DragDrop != null)
\r
1309 DragDrop (this, e);
\r
1312 protected virtual void OnDragEnter (DragEventArgs e)
\r
1314 if (DragEnter != null)
\r
1315 DragEnter (this, e);
\r
1318 protected virtual void OnDragLeave (EventArgs e)
\r
1320 if (DragLeave != null)
\r
1321 DragLeave (this, e);
\r
1324 protected virtual void OnDragOver (DragEventArgs e)
\r
1326 if (DragOver != null)
\r
1327 DragOver (this, e);
\r
1330 //Compact Framework
\r
1331 protected virtual void OnEnabledChanged (EventArgs e)
\r
1333 if (EnabledChanged != null)
\r
1334 EnabledChanged (this, e);
\r
1337 protected virtual void OnEnter (EventArgs e)
\r
1339 if (Enter != null)
\r
1343 protected virtual void OnFontChanged (EventArgs e)
\r
1345 if (FontChanged != null)
\r
1346 FontChanged (this, e);
\r
1349 protected virtual void OnForeColorChanged (EventArgs e)
\r
1351 if (ForeColorChanged != null)
\r
1352 ForeColorChanged (this, e);
\r
1355 protected virtual void OnGiveFeedback (GiveFeedbackEventArgs e)
\r
1357 if (GiveFeedback != null)
\r
1358 GiveFeedback (this, e);
\r
1361 //Compact Framework
\r
1362 protected virtual void OnGotFocus (EventArgs e)
\r
1364 if (GotFocus != null)
\r
1365 GotFocus (this, e);
\r
1368 protected virtual void OnHandleCreated (EventArgs e)
\r
1370 Console.WriteLine ("OnHandleCreated");
\r
1372 if (HandleCreated != null)
\r
1373 HandleCreated (this, e);
\r
1375 // create all child windows
\r
1376 IEnumerator cw = childControls.GetEnumerator();
\r
1378 while (cw.MoveNext()) {
\r
1379 Console.WriteLine ("Adding Control");
\r
1380 Control control = (Control) cw.Current;
\r
1381 control.CreateControl ();
\r
1386 protected virtual void OnHandleDestroyed (EventArgs e)
\r
1388 if (HandleDestroyed != null)
\r
1389 HandleDestroyed (this, e);
\r
1392 protected virtual void OnHelpRequested (HelpEventArgs e)
\r
1394 if (HelpRequested != null)
\r
1395 HelpRequested (this, e);
\r
1398 protected virtual void OnImeModeChanged (EventArgs e)
\r
1400 if (ImeModeChanged != null)
\r
1401 ImeModeChanged (this, e);
\r
1404 protected virtual void OnInvalidated (InvalidateEventArgs e)
\r
1406 if (Invalidated != null)
\r
1407 Invalidated (this, e);
\r
1410 //Compact Framework
\r
1411 protected virtual void OnKeyDown (KeyEventArgs e)
\r
1413 if (KeyDown != null)
\r
1414 KeyDown (this, e);
\r
1417 //Compact Framework
\r
1418 protected virtual void OnKeyPress (KeyPressEventArgs e)
\r
1420 if (KeyPress != null)
\r
1421 KeyPress (this, e);
\r
1424 //Compact Framework
\r
1425 protected virtual void OnKeyUp (KeyEventArgs e)
\r
1427 if (KeyUp != null)
\r
1432 protected virtual void OnLayout (LayoutEventArgs e)
\r
1434 if (Layout != null)
\r
1438 protected virtual void OnLeave (EventArgs e)
\r
1440 if (Leave != null)
\r
1444 protected virtual void OnLocationChanged (EventArgs e)
\r
1446 if (LocationChanged != null)
\r
1447 LocationChanged (this, e);
\r
1450 //Compact Framework
\r
1451 protected virtual void OnLostFocus (EventArgs e)
\r
1453 if (LostFocus != null)
\r
1454 LostFocus (this, e);
\r
1457 //Compact Framework
\r
1458 protected virtual void OnMouseDown (MouseEventArgs e)
\r
1460 if (MouseDown != null)
\r
1461 MouseDown (this, e);
\r
1464 protected virtual void OnMouseEnter (EventArgs e)
\r
1466 if (MouseEnter != null)
\r
1467 MouseEnter (this, e);
\r
1470 protected virtual void OnMouseHover (EventArgs e)
\r
1472 if (MouseHover != null)
\r
1473 MouseHover (this, e);
\r
1476 protected virtual void OnMouseLeave (EventArgs e)
\r
1478 if (MouseLeave != null)
\r
1479 MouseLeave (this, e);
\r
1482 //Compact Framework
\r
1483 protected virtual void OnMouseMove (MouseEventArgs e)
\r
1485 if (MouseMove != null)
\r
1486 MouseMove (this, e);
\r
1489 //Compact Framework
\r
1490 protected virtual void OnMouseUp (MouseEventArgs e)
\r
1492 if (MouseUp != null)
\r
1493 MouseUp (this, e);
\r
1496 protected virtual void OnMouseWheel (MouseEventArgs e)
\r
1498 if (MouseWheel != null)
\r
1499 MouseWheel (this, e);
\r
1502 protected virtual void OnMove (EventArgs e)
\r
1508 protected virtual void OnNotifyMessage (Message m)
\r
1513 //Compact Framework
\r
1514 protected virtual void OnPaint (PaintEventArgs e)
\r
1516 if (Paint != null)
\r
1520 //Compact Framework
\r
1521 protected virtual void OnPaintBackground (PaintEventArgs e)
\r
1526 protected virtual void OnParentBackColorChanged (EventArgs e)
\r
1528 if (BackColorChanged != null)
\r
1529 BackColorChanged (this, e);
\r
1532 protected virtual void OnParentBackgroundImageChanged (
\r
1535 if (BackgroundImageChanged != null)
\r
1536 BackgroundImageChanged (this, e);
\r
1539 protected virtual void OnParentBindingContextChanged (
\r
1542 if (BindingContextChanged != null)
\r
1543 BindingContextChanged (this, e);
\r
1546 //Compact Framework
\r
1547 protected virtual void OnParentChanged (EventArgs e)
\r
1549 if (ParentChanged != null)
\r
1550 ParentChanged (this, e);
\r
1553 protected virtual void OnParentEnabledChanged (EventArgs e)
\r
1555 if (EnabledChanged != null)
\r
1556 EnabledChanged (this, e);
\r
1559 protected virtual void OnParentFontChanged (EventArgs e)
\r
1561 if (FontChanged != null)
\r
1562 FontChanged (this, e);
\r
1565 protected virtual void OnParentForeColorChanged (EventArgs e)
\r
1567 if (ForeColorChanged != null)
\r
1568 ForeColorChanged (this, e);
\r
1571 protected virtual void OnParentRightToLeftChanged (
\r
1574 if (RightToLeftChanged != null)
\r
1575 RightToLeftChanged (this, e);
\r
1578 protected virtual void OnParentVisibleChanged (EventArgs e)
\r
1580 if (VisibleChanged != null)
\r
1581 VisibleChanged (this, e);
\r
1584 protected virtual void OnQueryContinueDrag (
\r
1585 QueryContinueDragEventArgs e)
\r
1587 if (QueryContinueDrag != null)
\r
1588 QueryContinueDrag (this, e);
\r
1591 //Compact Framework
\r
1592 protected virtual void OnResize (EventArgs e)
\r
1594 if (Resize != null)
\r
1598 protected virtual void OnRightToLeftChanged (EventArgs e)
\r
1600 if (RightToLeftChanged != null)
\r
1601 RightToLeftChanged (this, e);
\r
1604 protected virtual void OnSizeChanged (EventArgs e)
\r
1606 if (SizeChanged != null)
\r
1607 SizeChanged (this, e);
\r
1610 protected virtual void OnStyleChanged (EventArgs e)
\r
1612 if (StyleChanged != null)
\r
1613 StyleChanged (this, e);
\r
1616 protected virtual void OnSystemColorsChanged (EventArgs e)
\r
1618 if (SystemColorsChanged != null)
\r
1619 SystemColorsChanged (this, e);
\r
1622 protected virtual void OnTabIndexChanged (EventArgs e)
\r
1624 if (TabIndexChanged != null)
\r
1625 TabIndexChanged (this, e);
\r
1628 protected virtual void OnTabStopChanged (EventArgs e)
\r
1630 if (TabStopChanged != null)
\r
1631 TabStopChanged (this, e);
\r
1634 //Compact Framework
\r
1635 protected virtual void OnTextChanged (EventArgs e)
\r
1637 if (TextChanged != null)
\r
1638 TextChanged (this, e);
\r
1641 //[MonoTODO] // this doesn't seem to be documented
\r
1642 // protected virtual void OnTextAlignChanged (EventArgs e) {
\r
1643 // TextAlignChanged (this, e);
\r
1646 protected virtual void OnValidated (EventArgs e)
\r
1648 if (Validated != null)
\r
1649 Validated (this, e);
\r
1653 // CancelEventArgs not ready
\r
1654 //protected virtual void OnValidating(CancelEventArgs e)
\r
1656 // throw new NotImplementedException ();
\r
1660 protected virtual void OnVisibleChanged (EventArgs e)
\r
1662 if (VisibleChanged != null)
\r
1663 VisibleChanged (this, e);
\r
1665 // --- end of methods for events ---
\r
1669 public void PerformLayout ()
\r
1675 public void PerformLayout (Control affectedControl,
\r
1676 string affectedProperty)
\r
1681 //Compact Framework
\r
1683 public Point PointToClient (Point p)
\r
1685 throw new NotImplementedException ();
\r
1688 //Compact Framework
\r
1690 public Point PointToScreen (Point p)
\r
1692 throw new NotImplementedException ();
\r
1696 public virtual bool PreProcessMessage (ref Message msg)
\r
1698 throw new NotImplementedException ();
\r
1702 protected virtual bool ProcessCmdKey (ref Message msg,
\r
1705 throw new NotImplementedException ();
\r
1709 protected virtual bool ProcessDialogChar (char charCode)
\r
1711 throw new NotImplementedException ();
\r
1715 protected virtual bool ProcessDialogKey (Keys keyData)
\r
1717 throw new NotImplementedException ();
\r
1721 protected virtual bool ProcessKeyEventArgs (ref Message m)
\r
1723 throw new NotImplementedException ();
\r
1727 protected internal virtual bool ProcessKeyMessage (
\r
1730 throw new NotImplementedException ();
\r
1734 protected virtual bool ProcessKeyPreview (ref Message m)
\r
1736 throw new NotImplementedException ();
\r
1740 protected virtual bool ProcessMnemonic (char charCode)
\r
1742 throw new NotImplementedException ();
\r
1745 // used when properties/values of Control
\r
1746 // are big enough to warrant recreating the HWND
\r
1747 protected void RecreateHandle()
\r
1753 //Compact Framework
\r
1755 public Rectangle RectangleToClient (Rectangle r)
\r
1757 throw new NotImplementedException ();
\r
1760 //Compact Framework
\r
1762 public Rectangle RectangleToScreen (Rectangle r)
\r
1764 throw new NotImplementedException ();
\r
1768 protected static bool ReflectMessage (IntPtr hWnd,
\r
1771 throw new NotImplementedException ();
\r
1774 //Compact Framework
\r
1775 public virtual void Refresh ()
\r
1777 //RECT rect = (RECT) null;
\r
1778 //InvalidateRect (Handle, ref rect, true);
\r
1779 Win32.UpdateWindow (Handle);
\r
1783 public virtual void ResetBackColor ()
\r
1789 public void ResetBindings ()
\r
1795 public virtual void ResetFont ()
\r
1801 public virtual void ResetForeColor ()
\r
1807 public void ResetImeMode ()
\r
1813 public virtual void ResetRightToLeft ()
\r
1819 public virtual void ResetText ()
\r
1825 public void ResumeLayout ()
\r
1831 public void ResumeLayout (bool performLayout)
\r
1837 protected ContentAlignment RtlTranslateAlignment (
\r
1838 ContentAlignment align)
\r
1840 throw new NotImplementedException ();
\r
1844 protected HorizontalAlignment RtlTranslateAlignment (
\r
1845 HorizontalAlignment align)
\r
1847 throw new NotImplementedException ();
\r
1851 protected LeftRightAlignment RtlTranslateAlignment (
\r
1852 LeftRightAlignment align)
\r
1854 throw new NotImplementedException ();
\r
1858 protected ContentAlignment RtlTranslateContent (
\r
1859 ContentAlignment align)
\r
1861 throw new NotImplementedException ();
\r
1865 protected HorizontalAlignment RtlTranslateHorizontal (
\r
1866 HorizontalAlignment align)
\r
1868 throw new NotImplementedException ();
\r
1872 protected LeftRightAlignment RtlTranslateLeftRight (
\r
1873 LeftRightAlignment align)
\r
1875 throw new NotImplementedException ();
\r
1879 public void Scale (float ratio)
\r
1885 public void Scale (float dx,float dy)
\r
1891 protected virtual void ScaleCore (float dx, float dy)
\r
1897 public void Select ()
\r
1903 protected virtual void Select (bool directed,bool forward)
\r
1909 public bool SelectNextControl (Control ctl, bool forward,
\r
1910 bool tabStopOnly,
\r
1911 bool nested, bool wrap)
\r
1913 throw new NotImplementedException ();
\r
1916 //Compact Framework
\r
1918 public void SendToBack ()
\r
1924 public void SetBounds (int x, int y, int width, int height)
\r
1930 public void SetBounds (int x, int y, int width, int height,
\r
1931 BoundsSpecified specified)
\r
1937 protected virtual void SetBoundsCore (
\r
1938 int x, int y, int width, int height,
\r
1939 BoundsSpecified specified)
\r
1945 protected virtual void SetClientSizeCore (int x, int y)
\r
1951 protected void SetStyle (ControlStyles flag, bool value)
\r
1956 protected void SetTopLevel (bool value)
\r
1959 // FIXME: verify on whether this is supposed
\r
1960 // to activate/deactive the window
\r
1961 Win32.SetWindowPos (Handle,
\r
1962 SetWindowPosZOrder.HWND_NOTOPMOST,
\r
1965 // FIXME: this does not make sense but
\r
1966 // the docs say the window is hidden
\r
1967 Win32.ShowWindow (Handle, ShowWindowStyles.SW_HIDE);
\r
1971 protected virtual void SetVisibleCore (bool value)
\r
1976 //Compact Framework
\r
1977 public void Show ()
\r
1979 Win32.ShowWindow (Handle, ShowWindowStyles.SW_SHOW);
\r
1983 public void SuspendLayout ()
\r
1988 //Compact Framework
\r
1989 public void Update ()
\r
1991 Win32.UpdateWindow (Handle);
\r
1995 protected void UpdateBounds ()
\r
2001 protected void UpdateBounds (int x, int y, int width, int height)
\r
2007 protected void UpdateBounds (
\r
2008 int x, int y, int width, int height, int clientWidth,
\r
2015 protected void UpdateStyles ()
\r
2021 protected void UpdateZOrder ()
\r
2026 // WndProc - calls appriate On... function for the give
\r
2029 // These On... functions do not appear to be called by
\r
2032 // background color/image handled by WinForms
\r
2033 // OnBackColorChanged
\r
2034 // OnBackgroundImageChanged
\r
2035 // OnForeColorChanged
\r
2036 // OnPaintBackground
\r
2038 // controls are added/removed by WinForms
\r
2040 // OnControlRemoved
\r
2041 // OnCreateControl
\r
2043 // OnBindingContextChanged
\r
2044 // OnCausesValidationChanged
\r
2046 // OnContextMenuChanged
\r
2047 // OnRightToLeftChanged
\r
2051 // OnCursorChanged
\r
2052 // OnTextAlignChanged
\r
2055 // OnTabIndexChanged
\r
2056 // OnTabStopChanged
\r
2057 // OnLocationChanged
\r
2059 // FIXME: may be one of the WM_IME_ messages
\r
2060 // OnImeModeChanged
\r
2062 // InvalidateRect is called by no Invalidate message exists
\r
2065 // these messages ARE not called by WNDPROC according to docs
\r
2066 // OnParentBackColorChanged
\r
2067 // OnParentBackgroundImageChanged
\r
2068 // OnParentBindingContextChanged
\r
2069 // OnParentChanged
\r
2070 // OnParentEnabledChanged
\r
2071 // OnParentFontChanged
\r
2072 // OnParentForeColorChanged
\r
2073 // OnParentRightToLeftChanged
\r
2074 // OnParentVisibleChanged
\r
2076 protected virtual void WndProc(ref Message m)
\r
2078 EventArgs eventArgs = new EventArgs ();
\r
2079 // FIXME: paintEventArgs is not being created properly
\r
2080 // FIXME: Graphics does not have a public constructor, you must get one from .NET
\r
2081 //PaintEventArgs paintEventArgs = new PaintEventArgs (
\r
2082 // new Graphics(), new Rectangle());
\r
2086 case Msg.WM_CREATE:
\r
2087 Console.WriteLine ("WM_CREATE");
\r
2088 OnHandleCreated (eventArgs);
\r
2090 case Msg.WM_LBUTTONDBLCLK:
\r
2091 OnDoubleClick (eventArgs);
\r
2097 // OnQueryContinueDrag
\r
2098 case Msg.WM_ENABLE:
\r
2099 OnEnabledChanged (eventArgs);
\r
2101 case Msg.WM_SETFOCUS:
\r
2102 OnEnter (eventArgs);
\r
2103 OnGotFocus (eventArgs);
\r
2105 case Msg.WM_FONTCHANGE:
\r
2106 OnFontChanged (eventArgs);
\r
2108 case Msg.WM_DESTROY:
\r
2109 OnHandleDestroyed (eventArgs);
\r
2113 //OnHelpRequested (eventArgs);
\r
2115 case Msg.WM_KEYDOWN:
\r
2117 // OnKeyDown (eventArgs);
\r
2121 // OnKeyPress (eventArgs);
\r
2123 case Msg.WM_KEYUP:
\r
2125 // OnKeyUp (eventArgs);
\r
2127 case Msg.WM_KILLFOCUS:
\r
2128 OnLeave (eventArgs);
\r
2129 OnLostFocus (eventArgs);
\r
2131 case Msg.WM_LBUTTONDOWN:
\r
2133 // OnMouseDown (eventArgs);
\r
2135 case Msg.WM_MOUSEACTIVATE:
\r
2136 OnMouseEnter (eventArgs);
\r
2138 case Msg.WM_MOUSEHOVER: // called by TrackMouseEvent
\r
2139 OnMouseHover (eventArgs);
\r
2141 case Msg.WM_MOUSELEAVE: // called by TrackMouseEvent
\r
2142 OnMouseLeave (eventArgs);
\r
2144 case Msg.WM_MOUSEMOVE:
\r
2146 // OnMouseMove (eventArgs);
\r
2148 case Msg.WM_LBUTTONUP:
\r
2150 // OnMouseUp (eventArgs);
\r
2152 case Msg.WM_MOUSEWHEEL:
\r
2154 // OnMouseWheel (eventArgs);
\r
2157 OnMove (eventArgs);
\r
2159 case Msg.WM_NOTIFY:
\r
2160 // FIXME: get NM_CLICKED msg from pnmh
\r
2161 // OnClick (eventArgs);
\r
2162 // OnNotifyMessage (eventArgs);
\r
2163 case Msg.WM_PAINT:
\r
2164 //OnPaint (paintEventArgs);
\r
2167 OnResize (eventArgs);
\r
2168 OnSizeChanged (eventArgs);
\r
2170 case Msg.WM_STYLECHANGED:
\r
2171 OnStyleChanged (eventArgs);
\r
2173 case Msg.WM_SYSCOLORCHANGE:
\r
2174 OnSystemColorsChanged (eventArgs);
\r
2176 case Msg.WM_SETTEXT:
\r
2177 OnTextChanged (eventArgs);
\r
2179 case Msg.WM_SHOWWINDOW:
\r
2180 OnVisibleChanged (eventArgs);
\r
2183 // DefWndProc (ref m);
\r
2188 /// --- Control: events ---
\r
2189 public event EventHandler BackColorChanged;
\r
2190 public event EventHandler BackgroundImageChanged;
\r
2191 public event EventHandler BindingContextChanged;
\r
2192 public event EventHandler CausesValidationChanged;
\r
2193 public event UICuesEventHandler ChangeUICues;
\r
2195 //Compact Framework
\r
2196 public event EventHandler Click;
\r
2198 public event EventHandler ContextMenuChanged;
\r
2199 public event ControlEventHandler ControlAdded;
\r
2200 public event ControlEventHandler ControlRemoved;
\r
2201 public event EventHandler CursorChanged;
\r
2202 public event EventHandler DockChanged;
\r
2203 public event EventHandler DoubleClick;
\r
2204 public event DragEventHandler DragDrop;
\r
2205 public event DragEventHandler DragEnter;
\r
2206 public event EventHandler DragLeave;
\r
2207 public event DragEventHandler DragOver;
\r
2209 //Compact Framework
\r
2210 public event EventHandler EnabledChanged;
\r
2212 public event EventHandler Enter;
\r
2213 public event EventHandler FontChanged;
\r
2214 public event EventHandler ForeColorChanged;
\r
2215 public event GiveFeedbackEventHandler GiveFeedback;
\r
2217 //Compact Framework
\r
2218 public event EventHandler GotFocus;
\r
2220 public event EventHandler HandleCreated;
\r
2221 public event EventHandler HandleDestroyed;
\r
2222 public event HelpEventHandler HelpRequested;
\r
2223 public event EventHandler ImeModeChanged;
\r
2224 public event InvalidateEventHandler Invalidated;
\r
2226 //Compact Framework
\r
2227 public event KeyEventHandler KeyDown;
\r
2229 //Compact Framework
\r
2230 public event KeyPressEventHandler KeyPress;
\r
2232 //Compact Framework
\r
2233 public event KeyEventHandler KeyUp;
\r
2235 public event LayoutEventHandler Layout;
\r
2236 public event EventHandler Leave;
\r
2237 public event EventHandler LocationChanged;
\r
2239 //Compact Framework
\r
2240 public event EventHandler LostFocus;
\r
2242 //Compact Framework
\r
2243 public event MouseEventHandler MouseDown;
\r
2245 public event EventHandler MouseEnter;
\r
2246 public event EventHandler MouseHover;
\r
2247 public event EventHandler MouseLeave;
\r
2249 //Compact Framework
\r
2250 public event MouseEventHandler MouseMove;
\r
2252 //Compact Framework
\r
2253 public event MouseEventHandler MouseUp;
\r
2255 public event MouseEventHandler MouseWheel;
\r
2256 public event EventHandler Move;
\r
2258 //Compact Framework
\r
2259 public event PaintEventHandler Paint;
\r
2261 //Compact Framework
\r
2262 public event EventHandler ParentChanged;
\r
2264 public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp;
\r
2265 public event QueryContinueDragEventHandler QueryContinueDrag;
\r
2267 //Compact Framework
\r
2268 public event EventHandler Resize;
\r
2270 public event EventHandler RightToLeftChanged;
\r
2271 public event EventHandler SizeChanged;
\r
2272 public event EventHandler StyleChanged;
\r
2273 public event EventHandler SystemColorsChanged;
\r
2274 public event EventHandler TabIndexChanged;
\r
2275 public event EventHandler TabStopChanged;
\r
2277 //Compact Framework
\r
2278 public event EventHandler TextChanged;
\r
2280 public event EventHandler Validated;
\r
2282 // CancelEventHandler not yet defined
\r
2283 //public event CancelEventHandler Validating {
\r
2285 public event EventHandler VisibleChanged;
\r
2287 /// --- IWin32Window properties
\r
2288 public IntPtr Handle {
\r
2290 if (window != null)
\r
2291 return window.Handle;
\r
2292 return (IntPtr) 0;
\r
2296 /// --- ISynchronizeInvoke properties ---
\r
2298 public bool InvokeRequired {
\r
2299 get { throw new NotImplementedException (); }
\r
2302 /// --- ISynchronizeInvoke methods ---
\r
2304 public IAsyncResult BeginInvoke (Delegate method)
\r
2306 throw new NotImplementedException ();
\r
2310 public IAsyncResult BeginInvoke (Delegate method,
\r
2313 throw new NotImplementedException ();
\r
2317 public object EndInvoke (IAsyncResult asyncResult)
\r
2319 throw new NotImplementedException ();
\r
2322 //Compact Framework
\r
2324 public object Invoke (Delegate method)
\r
2326 throw new NotImplementedException ();
\r
2330 public object Invoke (Delegate method, object[] args)
\r
2332 throw new NotImplementedException ();
\r
2335 /// sub-class: Control.ControlAccessibleObject
\r
2337 /// Provides information about a control that can be used by an accessibility application.
\r
2339 public class ControlAccessibleObject : AccessibleObject {
\r
2340 // AccessibleObject not ready to be base class
\r
2341 /// --- ControlAccessibleObject.constructor ---
\r
2343 public ControlAccessibleObject (Control ownerControl)
\r
2345 throw new NotImplementedException ();
\r
2349 /// --- ControlAccessibleObject Properties ---
\r
2351 public override string DefaultAction {
\r
2354 return base.DefaultAction;
\r
2359 public override string Description {
\r
2362 return base.Description;
\r
2367 public IntPtr Handle {
\r
2369 throw new NotImplementedException ();
\r
2377 public override string Help {
\r
2385 public override string KeyboardShortcut {
\r
2388 return base.KeyboardShortcut;
\r
2393 public override string Name {
\r
2400 base.Name = value;
\r
2405 public Control Owner {
\r
2407 throw new NotImplementedException ();
\r
2412 public override AccessibleRole Role {
\r
2419 /// --- ControlAccessibleObject Methods ---
\r
2421 public override int GetHelpTopic(out string fileName)
\r
2424 return base.GetHelpTopic(out fileName);
\r
2428 public void NotifyClients (AccessibleEvents accEvent)
\r
2434 public void NotifyClients (AccessibleEvents accEvent,
\r
2441 public override string ToString ()
\r
2444 return base.ToString();
\r
2448 /// sub-class: Control.ControlCollection
\r
2450 /// Represents a collection of Control objects
\r
2452 public class ControlCollection : IList, ICollection, IEnumerable, ICloneable {
\r
2454 private ArrayList collection = new ArrayList ();
\r
2455 private Control owner;
\r
2457 /// --- ControlCollection.constructor ---
\r
2458 public ControlCollection (Control owner)
\r
2460 this.owner = owner;
\r
2463 /// --- ControlCollection Properties ---
\r
2464 public int Count {
\r
2466 return collection.Count;
\r
2470 public bool IsReadOnly {
\r
2472 return collection.IsReadOnly;
\r
2476 public virtual Control this [int index] {
\r
2478 return (Control) collection[index];
\r
2482 public virtual void Add (Control value)
\r
2484 collection.Add (value);
\r
2487 public virtual void AddRange (Control[] controls)
\r
2489 collection.AddRange (controls);
\r
2492 public virtual void Clear ()
\r
2494 collection.Clear ();
\r
2497 public bool Contains (Control control)
\r
2499 return collection.Contains (control);
\r
2502 public void CopyTo (Array dest,int index)
\r
2504 collection.CopyTo (dest, index);
\r
2508 public override bool Equals (object obj)
\r
2511 return base.Equals(obj);
\r
2515 public int GetChildIndex (Control child)
\r
2517 throw new NotImplementedException ();
\r
2520 public IEnumerator GetEnumerator ()
\r
2522 return collection.GetEnumerator ();
\r
2526 public override int GetHashCode ()
\r
2529 return base.GetHashCode();
\r
2532 public int IndexOf (Control control)
\r
2534 return collection.IndexOf (control);
\r
2537 public virtual void Remove (Control value)
\r
2539 collection.Remove (value);
\r
2542 public void RemoveAt (int index)
\r
2544 collection.RemoveAt (index);
\r
2548 public void SetChildIndex (Control child,int newIndex)
\r
2553 /// --- ControlCollection.IClonable methods ---
\r
2555 object ICloneable.Clone ()
\r
2557 throw new NotImplementedException ();
\r
2560 /// --- ControlCollection.IList properties ---
\r
2561 bool IList.IsFixedSize {
\r
2563 return collection.IsFixedSize;
\r
2567 object IList.this [int index] {
\r
2569 return collection[index];
\r
2572 collection[index] = value;
\r
2576 object ICollection.SyncRoot {
\r
2578 return collection.SyncRoot;
\r
2582 bool ICollection.IsSynchronized {
\r
2584 return collection.IsSynchronized;
\r
2588 /// --- ControlCollection.IList methods ---
\r
2589 int IList.Add (object control)
\r
2591 return collection.Add (control);
\r
2594 bool IList.Contains (object control)
\r
2596 return collection.Contains (control);
\r
2599 int IList.IndexOf (object control)
\r
2601 return collection.IndexOf (control);
\r
2604 void IList.Insert (int index,object value)
\r
2606 collection.Insert (index, value);
\r
2609 void IList.Remove (object control)
\r
2611 collection.Remove (control);
\r
2613 } // --- end of Control.ControlCollection ---
\r