| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886 |
- //
- // System.Windows.Forms.Control.cs
- //
- // Author:
- // stubbed out by Jaak Simm ([email protected])
- // Dennis Hayes ([email protected])
- // WINELib implementation started by John Sohn ([email protected])
- //
- // (C) Ximian, Inc., 2002
- //
- using System.ComponentModel;
- using System.Drawing;
- using System.Collections;
- namespace System.Windows.Forms {
- /// <summary>
- /// Defines the base class for controls, which are components with
- /// visual representation.
- /// </summary>
-
- public class Control : Component , ISynchronizeInvoke, IWin32Window {
- // Helper NativeWindow class to dispatch messages back
- // to the Control class
- protected class ControlNativeWindow : NativeWindow {
- private Control control;
- public ControlNativeWindow (Control control) : base() {
- this.control = control;
- }
- protected override void WndProc (ref Message m) {
- base.WndProc (ref m);
- if (m.Msg == Win32.WM_CREATE)
- Console.WriteLine ("CNW WndProc WM_CREATE");
- control.WndProc (ref m);
- }
- }
-
- // FIXME: not sure if dervied classes should have access
- protected ControlNativeWindow window;
- private ControlCollection childControls;
- private Control parent;
- // private fields
- // it seems these are stored in case the window is not created,
- // corresponding properties (below) need to check if window
- // is created or not and react accordingly
- string accessibleDefaultActionDescription;
- string accessibleDescription;
- string accessibleName;
- AccessibleRole accessibleRole;
- bool allowDrop;
- AnchorStyles anchor;
- Color backColor;
- Image backgroundImage;
- //BindingContext bindingContext;
- Rectangle bounds;
- bool causesValidation;
- //ContextMenu contextMenu;
- DockStyle dock;
- bool enabled;
- Font font;
- Color foreColor;
- ImeMode imeMode;
- bool isAccessible;
- // Point location; // using bounds to store location
- string name;
- Region region;
- RightToLeft rightToLeft;
- bool tabStop;
- string text;
- bool visible;
- CreateParams createParams;
- // --- Constructors ---
- public Control ()
- {
- CreateControlsInstance ();
- accessibleDefaultActionDescription = null;
- accessibleDescription = null;
- accessibleName = null;
- accessibleRole = AccessibleRole.Default;
- allowDrop = false;
- anchor = AnchorStyles.Top | AnchorStyles.Left;
- //backColor = Control.DefaultBackColor;
- backgroundImage = null;
- bounds = new Rectangle();
- // bindingContext = null;
- causesValidation = true;
- // contextMenu = null;
- dock = DockStyle.None;
- enabled = true;
- // font = Control.DefaultFont;
- // foreColor = Control.DefaultForeColor;
- imeMode = ImeMode.Inherit;
- isAccessible = false;
- // location = new Point (0,0); should be from OS
- name = "";
- region = null;
- rightToLeft = RightToLeft.Inherit;
- tabStop = false;
- text = "";
- visible = true;
- parent = null;
- window = null;
- createParams = new CreateParams ();
- }
-
- // according to docs, the constructors do not create
- // the (HWND) window
- public Control (string text) : this()
- {
- Text = text;
- // Win32.SetWindowTextA (Handle, text);
- }
-
- public Control (Control parent, string text) : this (text)
- {
- Parent = parent;
- // Win32.SetParent (Handle, parent.Handle);
- }
-
- public Control (string text, int left, int top,
- int width, int height) : this(text)
- {
- Left = left;
- Top = top;
- Width = width;
- Height = height;
- //Win32.SetWindowPos (Handle, (IntPtr) 0, left, top,
- // width, height, 0);
- }
-
- public Control (Control parent,string text,int left, int top,
- int width,int height) : this (parent, text)
- {
- Left = left;
- Top = top;
- Width = width;
- Height = height;
- // Win32.SetWindowPos (Handle, (IntPtr) 0, left, top,
- // width, height, 0);
- }
- // for internal use only, create a control class
- // for an existing, created HWND
- private Control (IntPtr existingHandle)
- {
- window = (ControlNativeWindow) NativeWindow.FromHandle (
- existingHandle);
- }
- // --- Properties ---
- // Properties only supporting .NET framework, not stubbed out:
- // - protected bool RenderRightToLeft {get;}
- // - public IWindowTarget WindowTarget {get; set;}
- //[MonoTODO]
- //public AccessibleObject AccessibilityObject {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- public string AccessibleDefaultActionDescription {
- get {
- return accessibleDefaultActionDescription;
- }
- set {
- accessibleDefaultActionDescription = value;
- }
- }
-
- public string AccessibleDescription {
- get {
- return accessibleDescription;
- }
- set {
- accessibleDescription=value;
- }
- }
-
- public string AccessibleName {
- get {
- return accessibleName;
- }
- set {
- accessibleName=value;
- }
- }
-
- public AccessibleRole AccessibleRole {
- get {
- return accessibleRole;
- }
- set {
- accessibleRole=value;
- }
- }
-
- public virtual bool AllowDrop {
- get {
- return allowDrop;
- }
- set {
- allowDrop=value;
- }
- }
-
- public virtual AnchorStyles Anchor {
- get {
- return anchor;
- }
- set {
- anchor=value;
- }
- }
-
- public virtual Color BackColor {
- get {
- if (IsHandleCreated) {
- IntPtr dc = Win32.GetDC (Handle);
- uint bgColor = Win32.GetBkColor (dc);
- Win32.ReleaseDC (Handle, dc);
- int r = (int) (bgColor & 0xFF);
- int g = (int) ((bgColor >> 8) & 0xFF);
- int b = (int) ((bgColor >> 16) & 0xFF);
- return Color.FromArgb (r, g, b);
- } else return backColor;
- }
- set {
- backColor = value;
- if (IsHandleCreated) {
- IntPtr dc = Win32.GetDC (Handle);
- Win32.SetBkColor (dc, (uint) value.ToArgb());
- Win32.ReleaseDC (Handle, dc);
- }
- }
- }
-
- public virtual Image BackgroundImage {
- get {
- return backgroundImage;
- }
- set {
- backgroundImage = value;
- // FIXME: force redraw
- }
- }
- // waiting for BindingContext
- //public virtual BindingContext BindingContext {
- // get {
- // //return bindingContext;
- // throw new NotImplementedException ();
- // }
- // set {
- // //bindingContext=value;
- // throw new NotImplementedException ();
- // }
- //}
-
- public int Bottom {
- get {
- return Top + Height;
- }
- }
-
- public Rectangle Bounds {
- get {
- if (IsHandleCreated) {
- Win32.RECT rect = new Win32.RECT();
- Win32.GetWindowRect (Handle, ref rect);
- return new Rectangle ((int) rect.left,
- (int) rect.top,
- (int) rect.right,
- (int) rect.bottom);
- } else return bounds;
- }
- set {
- if (IsHandleCreated)
- Win32.SetWindowPos (
- Handle, (IntPtr) 0, value.X, value.Y,
- value.Width, value.Height, 0);
- else bounds = value;
- }
- }
-
- public bool CanFocus {
- get {
- if (IsHandleCreated && Visible && Enabled)
- return true;
- return false;
- }
- }
-
- [MonoTODO]
- public bool CanSelect {
- get {
- // if (ControlStyles.Selectable &&
- // isContainedInAnotherControl &&
- // parentIsVisiable && isVisialbe &&
- // parentIsEnabled && isEnabled) {
- // return true;
- // }
- // return false;
- throw new NotImplementedException ();
- }
- }
-
- public bool Capture {
- get {
- if (IsHandleCreated) {
- IntPtr captured = Win32.GetCapture ();
- if (Handle == captured)
- return true;
- }
- return false;
- }
- set {
- if (IsHandleCreated) {
- if (value)
- Win32.SetCapture (Handle);
- else {
- IntPtr captured = Win32.GetCapture ();
- // if this window is in capture state
- // release it
- if (Handle == captured)
- Win32.ReleaseCapture ();
- }
- }
- }
- }
-
- public bool CausesValidation {
- get {
- return causesValidation;
- }
- set {
- causesValidation=value;
- }
- }
-
- public Rectangle ClientRectangle {
- get {
- if (IsHandleCreated) {
- Win32.RECT rect = new Win32.RECT();
- Win32.GetClientRect (Handle, ref rect);
- return new Rectangle ((int) rect.left,
- (int) rect.top,
- (int) rect.right,
- (int) rect.bottom);
- }
- // FIXME: is the correct return value for
- // window who's handle is not created
- return new Rectangle (0, 0, 0, 0);
- }
- }
-
- [MonoTODO]
- public Size ClientSize {
- get {
- // FIXME: use GetSystemMetrics and/or
- // GetClientRect here?
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string CompanyName {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public bool ContainsFocus {
- get {
- if (IsHandleCreated) {
- IntPtr focusedWindow = Win32.GetFocus();
- if (focusedWindow == Handle)
- return true;
- }
- return false;
- }
- }
-
- //[MonoTODO]
- //public virtual ContextMenu ContextMenu {
- // get {
- // //return contextMenu;
- // throw new NotImplementedException ();
- // }
- // set {
- // //contextMenu=value;
- // throw new NotImplementedException ();
- // }
- //}
-
- public ControlCollection Controls {
- get { return childControls; }
- }
-
- public bool Created {
- get {
- if (Handle != (IntPtr) 0)
- return true;
- return false;
- }
- }
-
- protected virtual CreateParams CreateParams {
- get {
- return createParams;
- }
- }
-
- [MonoTODO]
- public virtual Cursor Cursor {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- //[MonoTODO]
- // waiting for BindingContext
- //public ControlBindingsCollection DataBindings {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- public static Color DefaultBackColor {
- get {
- // FIXME: use GetSystemMetrics?
- //return SystemColors.Control;
- throw new NotImplementedException ();
- }
- }
- //[MonoTODO]
- // FIXME: use GetSystemMetrics?
- //public static Font DefaultFont {
- // FIXME: get current system font from GenericSansSerif
- // call ArgumentException not called
- // get {
- // throw new NotImplementedException ();
- //return (FontFamily.GenericSansSerif);
- // }
- //}
-
- public static Color DefaultForeColor {
- get {
- // FIXME: use GetSystemMetrics?
- //return SystemColors.ControlText;
- throw new NotImplementedException ();
- }
- }
-
- protected virtual ImeMode DefaultImeMode {
- get {
- //return ImeMode.Inherit;
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- protected virtual Size DefaultSize {
- get {
- // FIXME: use GetSystemMetrics?
- throw new NotImplementedException ();
- }
- }
-
- public virtual Rectangle DisplayRectangle {
- get {
- return ClientRectangle;
- }
- }
-
- [MonoTODO]
- public bool Disposing {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual DockStyle Dock {
- get {
- return dock;
- }
- set {
- dock=value;
- }
- }
- public virtual bool Enabled {
- get {
- return Win32.IsWindowEnabled (Handle);
- }
- set {
- Win32.EnableWindow (Handle, value);
- }
- }
-
- public virtual bool Focused {
- get {
- return ContainsFocus;
- }
- }
-
- // [MonoTODO]
- //public virtual Font Font {
- // CHECKME:
- // get {
- //return font;
- // throw new NotImplementedException ();
- // }
- // set {
- //font=value;
- // throw new NotImplementedException ();
- // }
- //}
-
- [MonoTODO]
- protected int FontHeight {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- public virtual Color ForeColor {
- get {
- return foreColor;
- }
- set {
- foreColor = value;
- }
- }
-
- public bool HasChildren {
- get {
- if (childControls.Count >0)
- return true;
- return false;
- }
- }
-
- public int Height {
- get {
- if (IsHandleCreated) {
- // FIXME: GetWindowPos
- }
- return bounds.Height;
- }
- set {
- bounds.Height = value;
- if (IsHandleCreated) {
- // FIXME: SetWindowPos
- }
- }
- }
-
- public ImeMode ImeMode {
- // CHECKME:
- get {
- return imeMode;
- }
- set {
- imeMode=value;
- }
- }
-
- public bool IsAccessible {
- // CHECKME:
- get {
- return isAccessible;
- } // default is false
- set {
- isAccessible=value;
- }
- }
-
- public bool IsDisposed {
- get {
- if (Handle == (IntPtr) 0)
- return true;
- return false;
- }
- }
-
- public bool IsHandleCreated {
- get {
- if (Handle != (IntPtr) 0)
- return true;
- return false;
- }
- }
-
- public int Left {
- get {
- if (IsHandleCreated) {
- // FIXME: GetWindowPos
- }
- return Bounds.X;
- }
- set {
- if (IsHandleCreated) {
- // FIXME: SetWindowPos
- }
- Bounds.X = value;
- }
- }
-
- public Point Location {
- // CHECKME:
- get {
- return new Point (Top, Left);
- }
- set {
- bounds.X = value.X;
- bounds.Y = value.Y;
- if (IsHandleCreated) {
- // FIXME: SetWindowPos
- }
- }
- }
-
- [MonoTODO]
- public static Keys ModifierKeys {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public static MouseButtons MouseButtons {
- get {
- // FIXME: use GetAsycKeyState?
- throw new NotImplementedException ();
- }
- }
-
- public static Point MousePosition {
- get {
- Win32.POINT point = new Win32.POINT();
- Win32.GetCursorPos (ref point);
- return new Point ( (int) point.x, (int) point.y);
- }
- }
-
- public string Name {
- // CHECKME:
- get {
- return name;
- }
- set {
- name=value;
- }
- }
-
- public Control Parent {
- get {
- return parent;
- //IntPtr parent = Win32.GetParent (Handle);
- //return FromHandle (parent);
- }
- set {
- Console.WriteLine ("setting parent");
- parent = value;
- Console.WriteLine ("add ourself to the parents control");
- // add ourself to the parents control
- parent.Controls.Add (this);
- Console.WriteLine ("SetParent");
- if (IsHandleCreated) {
- Console.WriteLine ("Handle created");
- Win32.SetParent (Handle, value.Handle);
- }
- }
- }
-
- [MonoTODO]
- public string ProductName {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string ProductVersion {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public bool RecreatingHandle {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public Region Region {
- // CHECKME:
- get {
- return region;
- }
- set {
- region=value;
- }
- }
-
- [MonoTODO]
- protected bool ResizeRedraw {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- public int Right {
- get {
- return Left + Width;
- }
- }
-
- [MonoTODO]
- public virtual RightToLeft RightToLeft {
- // CHECKME:
- get {
- return rightToLeft;
- }
- set {
- rightToLeft=value;
- }
- }
-
- [MonoTODO]
- protected virtual bool ShowFocusCues {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- protected bool ShowKeyboardCues {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public override ISite Site {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public Size Size {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public int TabIndex {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- public bool TabStop {
- // CHECKME:
- get {
- return tabStop;
- }
- set {
- tabStop = value;
- }
- }
-
- [MonoTODO]
- public object Tag {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- public virtual string Text {
- get {
- if (IsHandleCreated) {
- String text = "";
- int length = Win32.GetWindowTextLengthA (Handle);
- Win32.GetWindowTextA (Handle, ref text, length);
- return text;
- } else return text;
- }
- set {
- text = value;
- if (IsHandleCreated)
- Win32.SetWindowTextA (Handle, value);
- }
- }
-
- public int Top {
- get {
- if (IsHandleCreated) {
- // FIXME: GetWindowPos
- return 0;
- } else return bounds.Top;
- }
- set {
- bounds.X = value;
- if (IsHandleCreated) {
- // FIXME: SetWindowPos
- }
- }
- }
-
- [MonoTODO]
- public Control TopLevelControl {
- get {
- throw new NotImplementedException ();
- }
- }
- public bool Visible {
- get {
- throw new NotImplementedException ();
- }
- set {
- if (value)
- Win32.ShowWindow (
- Handle, Win32.SW_SHOW);
- else
- Win32.ShowWindow (
- Handle, Win32.SW_HIDE);
- }
- }
-
- public int Width {
- get {
- if (IsHandleCreated) {
- // FIXME: GetWindowPos
- }
- return bounds.Width;
- }
- set {
- bounds.Width = value;
- if (IsHandleCreated) {
- // FIXME: SetWindowPos
- }
- }
- }
-
- /// --- methods ---
- /// internal .NET framework supporting methods, not stubbed out:
- /// - protected virtual void NotifyInvalidate(Rectangle invalidatedArea)
- /// - protected void RaiseDragEvent(object key,DragEventArgs e);
- /// - protected void RaiseKeyEvent(object key,KeyEventArgs e);
- /// - protected void RaiseMouseEvent(object key,MouseEventArgs e);
- /// - protected void RaisePaintEvent(object key,PaintEventArgs e);
- /// - protected void ResetMouseEventArgs();
-
- [MonoTODO]
- protected void AccessibilityNotifyClients (
- AccessibleEvents accEvent,int childID)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void BringToFront ()
- {
- throw new NotImplementedException ();
- }
-
- public bool Contains (Control ctl)
- {
- return childControls.Contains (ctl);
- }
-
- public void CreateControl ()
- {
- CreateHandle ();
- }
- //[MonoTODO]
- //AccessibleObject not ready
- //protected virtual AccessibleObject CreateAccessibilityInstance() {
- // throw new NotImplementedException ();
- //}
-
- protected virtual ControlCollection CreateControlsInstance ()
- {
- childControls = new ControlCollection (this);
- return childControls;
- }
-
- [MonoTODO]
- public Graphics CreateGraphics ()
- {
- throw new NotImplementedException ();
- }
-
- protected virtual void CreateHandle ()
- {
- window = new ControlNativeWindow (this);
-
- createParams.Caption = Text;
- createParams.ClassName = "mono_native_window";
- createParams.X = Top;
- createParams.Y = Left;
- createParams.Width = Width;
- createParams.Height = Height;
- createParams.ClassStyle = 0;
- createParams.ExStyle = 0;
- createParams.Param = 0;
- if (parent != null)
- createParams.Parent = parent.Handle;
- else
- createParams.Parent = (IntPtr) 0;
- createParams.Style = (int) Win32.WS_OVERLAPPEDWINDOW;
- window.CreateHandle (createParams);
- }
-
- protected virtual void DefWndProc (ref Message m)
- {
- window.DefWndProc(ref m);
- }
-
- protected virtual void DestroyHandle ()
- {
- window.DestroyHandle ();
- }
-
- [MonoTODO]
- protected override void Dispose (bool disposing)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public DragDropEffects DoDragDrop (
- object data, DragDropEffects allowedEffects)
- {
- throw new NotImplementedException ();
- }
-
- //public object EndInvoke(IAsyncResult asyncResult):
- //look under ISynchronizeInvoke methods
-
- [MonoTODO]
- public Form FindForm ()
- {
- throw new NotImplementedException ();
- }
-
- public bool Focus ()
- {
- if (Win32.SetFocus (Handle) != (IntPtr) 0)
- return true;
- return false;
- }
-
- [MonoTODO]
- public static Control FromChildHandle (IntPtr handle)
- {
- throw new NotImplementedException ();
- }
-
- public static Control FromHandle (IntPtr handle)
- {
- Control control = new Control (handle);
- return control;
- }
-
- [MonoTODO]
- public Control GetChildAtPoint (Point pt)
- {
- throw new NotImplementedException ();
- }
-
- // [MonoTODO]
- //public IContainerControl GetContainerControl ()
- //{
- // throw new NotImplementedException ();
- //}
-
- [MonoTODO]
- public Control GetNextControl (Control ctl, bool forward)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected bool GetStyle (ControlStyles flag)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected bool GetTopLevel ()
- {
- throw new NotImplementedException ();
- }
-
- public void Hide ()
- {
- if (IsHandleCreated)
- Win32.ShowWindow (Handle, Win32.SW_HIDE);
- }
-
- [MonoTODO]
- protected virtual void InitLayout ()
- {
- throw new NotImplementedException ();
- }
-
- public void Invalidate ()
- {
- if (IsHandleCreated) {
- Win32.RECT rect = (Win32.RECT) null;
- Win32.InvalidateRect (Handle, ref rect, true);
- }
- }
-
- [MonoTODO]
- public void Invalidate (bool invalidateChildren)
- {
- throw new NotImplementedException ();
- }
-
- public void Invalidate (Rectangle rc)
- {
- if (IsHandleCreated) {
- Win32.RECT rect = new Win32.RECT();
- rect.left = rc.Left;
- rect.top = rc.Top;
- rect.right = rc.Right;
- rect.bottom = rc.Bottom;
- Win32.InvalidateRect (Handle, ref rect, true);
- }
- }
-
- //[MonoTODO]
- public void Invalidate(Region region)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Invalidate (Rectangle rc, bool invalidateChildren)
- {
- throw new NotImplementedException ();
- }
-
- //[MonoTODO]
- public void Invalidate(Region region,bool invalidateChildren)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void InvokeGotFocus (Control toInvoke, EventArgs e)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void InvokeLostFocus (Control toInvoke, EventArgs e)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void InvokeOnClick (Control toInvoke, EventArgs e)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void InvokePaint (Control c, PaintEventArgs e)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void InvokePaintBackground (
- Control c,PaintEventArgs e)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual bool IsInputChar (char charCode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual bool IsInputKey (Keys keyData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static bool IsMnemonic (char charCode,string text)
- {
- throw new NotImplementedException ();
- }
-
- // methods used with events:
- protected virtual void OnBackColorChanged (EventArgs e)
- {
- if (BackColorChanged != null)
- BackColorChanged (this, e);
- }
-
- protected virtual void OnBackgroundImageChanged (EventArgs e)
- {
- if (BackgroundImageChanged != null)
- BackgroundImageChanged (this, e);
- }
-
- protected virtual void OnBindingContextChanged (EventArgs e)
- {
- if (BindingContextChanged != null)
- BindingContextChanged (this, e);
- }
-
- protected virtual void OnCausesValidationChanged (EventArgs e)
- {
- if (CausesValidationChanged != null)
- CausesValidationChanged (this, e);
- }
-
- protected virtual void OnChangeUICues(UICuesEventArgs e)
- {
- if (ChangeUICues != null)
- ChangeUICues (this, e);
- }
-
- protected virtual void OnClick (EventArgs e)
- {
- if (Click != null)
- Click (this, e);
- }
-
- protected virtual void OnContextMenuChanged (EventArgs e)
- {
- if (ContextMenuChanged != null)
- ContextMenuChanged (this, e);
- }
-
- protected virtual void OnControlAdded (ControlEventArgs e)
- {
- if (ControlAdded != null)
- ControlAdded (this, e);
- }
-
- protected virtual void OnControlRemoved (ControlEventArgs e)
- {
- if (ControlRemoved != null)
- ControlRemoved (this, e);
- }
-
- protected virtual void OnCreateControl ()
- {
-
- }
-
- protected virtual void OnCursorChanged (EventArgs e)
- {
- if (CursorChanged != null)
- CursorChanged (this, e);
- }
-
- protected virtual void OnDockChanged (EventArgs e)
- {
- if (DockChanged != null)
- DockChanged (this, e);
- }
-
- protected virtual void OnDoubleClick (EventArgs e)
- {
- if (DoubleClick != null)
- DoubleClick (this, e);
- }
-
- protected virtual void OnDragDrop (DragEventArgs e)
- {
- if (DragDrop != null)
- DragDrop (this, e);
- }
-
- protected virtual void OnDragEnter (DragEventArgs e)
- {
- if (DragEnter != null)
- DragEnter (this, e);
- }
-
- protected virtual void OnDragLeave (EventArgs e)
- {
- if (DragLeave != null)
- DragLeave (this, e);
- }
-
- protected virtual void OnDragOver (DragEventArgs e)
- {
- if (DragOver != null)
- DragOver (this, e);
- }
-
- protected virtual void OnEnabledChanged (EventArgs e)
- {
- if (EnabledChanged != null)
- EnabledChanged (this, e);
- }
-
- protected virtual void OnEnter (EventArgs e)
- {
- if (Enter != null)
- Enter (this, e);
- }
-
- protected virtual void OnFontChanged (EventArgs e)
- {
- if (FontChanged != null)
- FontChanged (this, e);
- }
-
- protected virtual void OnForeColorChanged (EventArgs e)
- {
- if (ForeColorChanged != null)
- ForeColorChanged (this, e);
- }
-
- protected virtual void OnGiveFeedback (GiveFeedbackEventArgs e)
- {
- if (GiveFeedback != null)
- GiveFeedback (this, e);
- }
-
- protected virtual void OnGotFocus (EventArgs e)
- {
- if (GotFocus != null)
- GotFocus (this, e);
- }
-
- protected virtual void OnHandleCreated (EventArgs e)
- {
- Console.WriteLine ("OnHandleCreated");
- if (HandleCreated != null)
- HandleCreated (this, e);
- // create all child windows
- IEnumerator cw = childControls.GetEnumerator();
- while (cw.MoveNext()) {
- Console.WriteLine ("Adding Control");
- Control control = (Control) cw.Current;
- control.CreateControl ();
- control.Show ();
- }
- }
-
- protected virtual void OnHandleDestroyed (EventArgs e)
- {
- if (HandleDestroyed != null)
- HandleDestroyed (this, e);
- }
-
- protected virtual void OnHelpRequested (HelpEventArgs e)
- {
- if (HelpRequested != null)
- HelpRequested (this, e);
- }
-
- protected virtual void OnImeModeChanged (EventArgs e)
- {
- if (ImeModeChanged != null)
- ImeModeChanged (this, e);
- }
-
- protected virtual void OnInvalidated (InvalidateEventArgs e)
- {
- if (Invalidated != null)
- Invalidated (this, e);
- }
-
- protected virtual void OnKeyDown (KeyEventArgs e)
- {
- if (KeyDown != null)
- KeyDown (this, e);
- }
-
- protected virtual void OnKeyPress (KeyPressEventArgs e)
- {
- if (KeyPress != null)
- KeyPress (this, e);
- }
-
- protected virtual void OnKeyUp (KeyEventArgs e)
- {
- if (KeyUp != null)
- KeyUp (this, e);
- }
-
- protected virtual void OnLayout (LayoutEventArgs e)
- {
- if (Layout != null)
- Layout (this, e);
- }
-
- protected virtual void OnLeave (EventArgs e)
- {
- if (Leave != null)
- Leave (this, e);
- }
-
- protected virtual void OnLocationChanged (EventArgs e)
- {
- if (LocationChanged != null)
- LocationChanged (this, e);
- }
-
- protected virtual void OnLostFocus (EventArgs e)
- {
- if (LostFocus != null)
- LostFocus (this, e);
- }
-
- protected virtual void OnMouseDown (MouseEventArgs e)
- {
- if (MouseDown != null)
- MouseDown (this, e);
- }
-
- protected virtual void OnMouseEnter (EventArgs e)
- {
- if (MouseEnter != null)
- MouseEnter (this, e);
- }
- protected virtual void OnMouseHover (EventArgs e)
- {
- if (MouseHover != null)
- MouseHover (this, e);
- }
-
- protected virtual void OnMouseLeave (EventArgs e)
- {
- if (MouseLeave != null)
- MouseLeave (this, e);
- }
-
- protected virtual void OnMouseMove (MouseEventArgs e)
- {
- if (MouseMove != null)
- MouseMove (this, e);
- }
-
- protected virtual void OnMouseUp (MouseEventArgs e)
- {
- if (MouseUp != null)
- MouseUp (this, e);
- }
-
- protected virtual void OnMouseWheel (MouseEventArgs e)
- {
- if (MouseWheel != null)
- MouseWheel (this, e);
- }
-
- protected virtual void OnMove (EventArgs e)
- {
- if (Move != null)
- Move (this, e);
- }
-
- protected virtual void OnNotifyMessage (Message m)
- {
- }
-
- protected virtual void OnPaint (PaintEventArgs e)
- {
- if (Paint != null)
- Paint (this, e);
- }
-
- protected virtual void OnPaintBackground (PaintEventArgs e)
- {
- }
-
- protected virtual void OnParentBackColorChanged (EventArgs e)
- {
- if (BackColorChanged != null)
- BackColorChanged (this, e);
- }
-
- protected virtual void OnParentBackgroundImageChanged (
- EventArgs e)
- {
- if (BackgroundImageChanged != null)
- BackgroundImageChanged (this, e);
- }
-
- protected virtual void OnParentBindingContextChanged (
- EventArgs e)
- {
- if (BindingContextChanged != null)
- BindingContextChanged (this, e);
- }
-
- protected virtual void OnParentChanged (EventArgs e)
- {
- if (ParentChanged != null)
- ParentChanged (this, e);
- }
-
- protected virtual void OnParentEnabledChanged (EventArgs e)
- {
- if (EnabledChanged != null)
- EnabledChanged (this, e);
- }
-
- protected virtual void OnParentFontChanged (EventArgs e)
- {
- if (FontChanged != null)
- FontChanged (this, e);
- }
-
- protected virtual void OnParentForeColorChanged (EventArgs e)
- {
- if (ForeColorChanged != null)
- ForeColorChanged (this, e);
- }
-
- protected virtual void OnParentRightToLeftChanged (
- EventArgs e)
- {
- if (RightToLeftChanged != null)
- RightToLeftChanged (this, e);
- }
-
- protected virtual void OnParentVisibleChanged (EventArgs e)
- {
- if (VisibleChanged != null)
- VisibleChanged (this, e);
- }
-
- protected virtual void OnQueryContinueDrag (
- QueryContinueDragEventArgs e)
- {
- if (QueryContinueDrag != null)
- QueryContinueDrag (this, e);
- }
-
- protected virtual void OnResize (EventArgs e)
- {
- if (Resize != null)
- Resize (this, e);
- }
-
- protected virtual void OnRightToLeftChanged (EventArgs e)
- {
- if (RightToLeftChanged != null)
- RightToLeftChanged (this, e);
- }
-
- protected virtual void OnSizeChanged (EventArgs e)
- {
- if (SizeChanged != null)
- SizeChanged (this, e);
- }
-
- protected virtual void OnStyleChanged (EventArgs e)
- {
- if (StyleChanged != null)
- StyleChanged (this, e);
- }
-
- protected virtual void OnSystemColorsChanged (EventArgs e)
- {
- if (SystemColorsChanged != null)
- SystemColorsChanged (this, e);
- }
-
- protected virtual void OnTabIndexChanged (EventArgs e)
- {
- if (TabIndexChanged != null)
- TabIndexChanged (this, e);
- }
-
- protected virtual void OnTabStopChanged (EventArgs e)
- {
- if (TabStopChanged != null)
- TabStopChanged (this, e);
- }
-
- protected virtual void OnTextChanged (EventArgs e)
- {
- if (TextChanged != null)
- TextChanged (this, e);
- }
- [MonoTODO] // this doesn't seem to be documented
- // protected virtual void OnTextAlignChanged (EventArgs e) {
- // TextAlignChanged (this, e);
- // }
-
- protected virtual void OnValidated (EventArgs e)
- {
- if (Validated != null)
- Validated (this, e);
- }
-
- [MonoTODO]
- // CancelEventArgs not ready
- //protected virtual void OnValidating(CancelEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
-
- [MonoTODO]
- protected virtual void OnVisibleChanged (EventArgs e)
- {
- if (VisibleChanged != null)
- VisibleChanged (this, e);
- }
- // --- end of methods for events ---
-
-
- [MonoTODO]
- public void PerformLayout ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void PerformLayout (Control affectedControl,
- string affectedProperty)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Point PointToClient (Point p)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Point PointToScreen (Point p)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual bool PreProcessMessage (ref Message msg)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual bool ProcessCmdKey (ref Message msg,
- Keys keyData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual bool ProcessDialogChar (char charCode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual bool ProcessDialogKey (Keys keyData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual bool ProcessKeyEventArgs (ref Message m)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected internal virtual bool ProcessKeyMessage (
- ref Message m)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual bool ProcessKeyPreview (ref Message m)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual bool ProcessMnemonic (char charCode)
- {
- throw new NotImplementedException ();
- }
-
- // used when properties/values of Control
- // are big enough to warrant recreating the HWND
- protected void RecreateHandle()
- {
- CreateHandle ();
- }
-
- [MonoTODO]
- public Rectangle RectangleToClient (Rectangle r)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Rectangle RectangleToScreen (Rectangle r)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected static bool ReflectMessage (IntPtr hWnd,
- ref Message m)
- {
- throw new NotImplementedException ();
- }
-
- public virtual void Refresh ()
- {
- Win32.RECT rect = (Win32.RECT) null;
- Win32.InvalidateRect (Handle, ref rect, true);
- Win32.UpdateWindow (Handle);
- }
-
- [MonoTODO]
- public virtual void ResetBackColor ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void ResetBindings ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void ResetFont ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void ResetForeColor ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void ResetImeMode ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void ResetRightToLeft ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void ResetText ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void ResumeLayout ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void ResumeLayout (bool performLayout)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected ContentAlignment RtlTranslateAlignment (
- ContentAlignment align)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected HorizontalAlignment RtlTranslateAlignment (
- HorizontalAlignment align)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected LeftRightAlignment RtlTranslateAlignment (
- LeftRightAlignment align)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected ContentAlignment RtlTranslateContent (
- ContentAlignment align)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected HorizontalAlignment RtlTranslateHorizontal (
- HorizontalAlignment align)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected LeftRightAlignment RtlTranslateLeftRight (
- LeftRightAlignment align)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Scale (float ratio)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Scale (float dx,float dy)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual void ScaleCore (float dx, float dy)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Select ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual void Select (bool directed,bool forward)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool SelectNextControl (Control ctl, bool forward,
- bool tabStopOnly,
- bool nested, bool wrap)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void SendToBack ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void SetBounds (int x, int y, int width, int height)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void SetBounds (int x, int y, int width, int height,
- BoundsSpecified specified)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual void SetBoundsCore (
- int x, int y, int width, int height,
- BoundsSpecified specified)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual void SetClientSizeCore (int x, int y)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void SetStyle (ControlStyles flag, bool value)
- {
- throw new NotImplementedException ();
- }
-
- protected void SetTopLevel (bool value)
- {
- if (value)
- // FIXME: verify on whether this is supposed
- // to activate/deactive the window
- Win32.SetWindowPos (Handle,
- (IntPtr) Win32.HWND_NOTOPMOST,
- 0, 0, 0, 0, 0);
- else
- // FIXME: this does not make sense but
- // the docs say the window is hidden
- Win32.ShowWindow (Handle, Win32.SW_HIDE);
- }
-
- [MonoTODO]
- protected virtual void SetVisibleCore (bool value)
- {
- throw new NotImplementedException ();
- }
-
- public void Show ()
- {
- Win32.ShowWindow (Handle, Win32.SW_SHOW);
- }
-
- [MonoTODO]
- public void SuspendLayout ()
- {
- throw new NotImplementedException ();
- }
-
- public void Update ()
- {
- Win32.UpdateWindow (Handle);
- }
-
- [MonoTODO]
- protected void UpdateBounds ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void UpdateBounds (int x, int y, int width, int height)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void UpdateBounds (
- int x, int y, int width, int height, int clientWidth,
- int clientHeight)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void UpdateStyles ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void UpdateZOrder ()
- {
- throw new NotImplementedException ();
- }
-
- // WndProc - calls appriate On... function for the give
- // message
- //
- // These On... functions do not appear to be called by
- // WndProc:
- //
- // background color/image handled by WinForms
- // OnBackColorChanged
- // OnBackgroundImageChanged
- // OnForeColorChanged
- // OnPaintBackground
- //
- // controls are added/removed by WinForms
- // OnControlAdded
- // OnControlRemoved
- // OnCreateControl
- //
- // OnBindingContextChanged
- // OnCausesValidationChanged
- // OnChangeUICues
- // OnContextMenuChanged
- // OnRightToLeftChanged
- // OnGiveFeedback
- // OnLayout
- // OnDockChanged
- // OnCursorChanged
- // OnTextAlignChanged
- // OnValidated
- // OnValidating
- // OnTabIndexChanged
- // OnTabStopChanged
- // OnLocationChanged
- //
- // FIXME: may be one of the WM_IME_ messages
- // OnImeModeChanged
- //
- // InvalidateRect is called by no Invalidate message exists
- // OnInvalidated
- //
- // these messages ARE not called by WNDPROC according to docs
- // OnParentBackColorChanged
- // OnParentBackgroundImageChanged
- // OnParentBindingContextChanged
- // OnParentChanged
- // OnParentEnabledChanged
- // OnParentFontChanged
- // OnParentForeColorChanged
- // OnParentRightToLeftChanged
- // OnParentVisibleChanged
- //
- protected virtual void WndProc(ref Message m)
- {
- EventArgs eventArgs = new EventArgs ();
- // FIXME: paintEventArgs is not being created properly
- PaintEventArgs paintEventArgs = new PaintEventArgs (
- new Graphics(), new Rectangle());
- switch (m.Msg) {
- case Win32.WM_CREATE:
- Console.WriteLine ("WM_CREATE");
- OnHandleCreated (eventArgs);
- break;
- case Win32.WM_LBUTTONDBLCLK:
- OnDoubleClick (eventArgs);
- break;
- // OnDragDrop
- // OnDragEnter
- // OnDragLeave
- // OnDragOver
- // OnQueryContinueDrag
- case Win32.WM_ENABLE:
- OnEnabledChanged (eventArgs);
- break;
- case Win32.WM_SETFOCUS:
- OnEnter (eventArgs);
- OnGotFocus (eventArgs);
- break;
- case Win32.WM_FONTCHANGE:
- OnFontChanged (eventArgs);
- break;
- case Win32.WM_DESTROY:
- OnHandleDestroyed (eventArgs);
- break;
- case Win32.WM_HELP:
- // FIXME:
- //OnHelpRequested (eventArgs);
- break;
- case Win32.WM_KEYDOWN:
- // FIXME:
- // OnKeyDown (eventArgs);
- break;
- case Win32.WM_CHAR:
- // FIXME:
- // OnKeyPress (eventArgs);
- break;
- case Win32.WM_KEYUP:
- // FIXME:
- // OnKeyUp (eventArgs);
- break;
- case Win32.WM_KILLFOCUS:
- OnLeave (eventArgs);
- OnLostFocus (eventArgs);
- break;
- case Win32.WM_LBUTTONDOWN:
- // FIXME:
- // OnMouseDown (eventArgs);
- break;
- case Win32.WM_MOUSEACTIVATE:
- OnMouseEnter (eventArgs);
- break;
- case Win32.WM_MOUSEHOVER: // called by TrackMouseEvent
- OnMouseHover (eventArgs);
- break;
- case Win32.WM_MOUSELEAVE: // called by TrackMouseEvent
- OnMouseLeave (eventArgs);
- break;
- case Win32.WM_MOUSEMOVE:
- // FIXME:
- // OnMouseMove (eventArgs);
- break;
- case Win32.WM_LBUTTONUP:
- // FIXME:
- // OnMouseUp (eventArgs);
- break;
- case Win32.WM_MOUSEWHEEL:
- // FIXME:
- // OnMouseWheel (eventArgs);
- break;
- case Win32.WM_MOVE:
- OnMove (eventArgs);
- break;
- case Win32.WM_NOTIFY:
- // FIXME: get NM_CLICKED msg from pnmh
- // OnClick (eventArgs);
- // OnNotifyMessage (eventArgs);
- case Win32.WM_PAINT:
- OnPaint (paintEventArgs);
- break;
- case Win32.WM_SIZE:
- OnResize (eventArgs);
- OnSizeChanged (eventArgs);
- break;
- case Win32.WM_STYLECHANGED:
- OnStyleChanged (eventArgs);
- break;
- case Win32.WM_SYSCOLORCHANGE:
- OnSystemColorsChanged (eventArgs);
- break;
- case Win32.WM_SETTEXT:
- OnTextChanged (eventArgs);
- break;
- case Win32.WM_SHOWWINDOW:
- OnVisibleChanged (eventArgs);
- break;
- // default:
- // DefWndProc (ref m);
- // break;
- }
- }
- /// --- Control: events ---
- public event EventHandler BackColorChanged;// {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler BackgroundImageChanged; //{
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler BindingContextChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler CausesValidationChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event UICuesEventHandler ChangeUICues; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler Click; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler ContextMenuChanged;
-
- public event ControlEventHandler ControlAdded; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event ControlEventHandler ControlRemoved; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler CursorChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler DockChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler DoubleClick; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event DragEventHandler DragDrop; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event DragEventHandler DragEnter; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler DragLeave; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event DragEventHandler DragOver; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler EnabledChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler Enter; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler FontChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler ForeColorChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event GiveFeedbackEventHandler GiveFeedback; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler GotFocus; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler HandleCreated; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler HandleDestroyed; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event HelpEventHandler HelpRequested; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler ImeModeChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event InvalidateEventHandler Invalidated; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event KeyEventHandler KeyDown; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event KeyPressEventHandler KeyPress; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event KeyEventHandler KeyUp; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event LayoutEventHandler Layout; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler Leave; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler LocationChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler LostFocus; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event MouseEventHandler MouseDown; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler MouseEnter; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler MouseHover; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler MouseLeave; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event MouseEventHandler MouseMove; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event MouseEventHandler MouseUp; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event MouseEventHandler MouseWheel; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler Move; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event PaintEventHandler Paint; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler ParentChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event QueryContinueDragEventHandler QueryContinueDrag; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler Resize; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler RightToLeftChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler SizeChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler StyleChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler SystemColorsChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler TabIndexChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler TabStopChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler TextChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- public event EventHandler Validated; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- [MonoTODO]
- // CancelEventHandler not yet defined
- //public event CancelEventHandler Validating {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- public event EventHandler VisibleChanged; // {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- // }
-
- /// --- IWin32Window properties
- public IntPtr Handle {
- get {
- if (window != null)
- return window.Handle;
- return (IntPtr) 0;
- }
- }
-
- /// --- ISynchronizeInvoke properties ---
- [MonoTODO]
- public bool InvokeRequired {
- get { throw new NotImplementedException (); }
- }
-
- /// --- ISynchronizeInvoke methods ---
- [MonoTODO]
- public IAsyncResult BeginInvoke (Delegate method)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public IAsyncResult BeginInvoke (Delegate method,
- object[] args)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public object EndInvoke (IAsyncResult asyncResult)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public object Invoke (Delegate method)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public object Invoke (Delegate method,object[] args)
- {
- throw new NotImplementedException ();
- }
-
- /// sub-class: Control.ControlAccessibleObject
- /// <summary>
- /// Provides information about a control that can be used by an accessibility application.
- /// </summary>
- public class ControlAccessibleObject /*: AccessibleObject*/ {
- // AccessibleObject not ready to be base class
- /// --- ControlAccessibleObject.constructor ---
- [MonoTODO]
- public ControlAccessibleObject (Control ownerControl)
- {
- throw new NotImplementedException ();
- }
-
-
- /// --- ControlAccessibleObject Properties ---
- [MonoTODO]
- // public override string DefaultAction {
- // get { throw new NotImplementedException (); }
- // }
-
- [MonoTODO]
- // public override string Description {
- // get { throw new NotImplementedException (); }
- // }
-
- [MonoTODO]
- public IntPtr Handle {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- // public override string Help {
- // get { throw new NotImplementedException (); }
- // }
-
- [MonoTODO]
- // public override string KeyboardShortcut {
- // get { throw new NotImplementedException (); }
- // }
-
- [MonoTODO]
- // public override string Name {
- // get { throw new NotImplementedException (); }
- // set { throw new NotImplementedException (); }
- // }
-
- [MonoTODO]
- public Control Owner {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- // public override AccessibleRole Role {
- // get { throw new NotImplementedException (); }
- // }
-
-
- /// --- ControlAccessibleObject Methods ---
- [MonoTODO]
- // public override int GetHelpTopic(out string fileName)
- // {
- // throw new NotImplementedException ();
- // }
-
- [MonoTODO]
- public void NotifyClients (AccessibleEvents accEvent)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void NotifyClients (AccessibleEvents accEvent,
- int childID)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string ToString ()
- {
- throw new NotImplementedException ();
- }
- }
-
- /// sub-class: Control.ControlCollection
- /// <summary>
- /// Represents a collection of Control objects
- /// </summary>
- public class ControlCollection : IList, ICollection, IEnumerable, ICloneable {
- private ArrayList collection = new ArrayList ();
- private Control owner;
- /// --- ControlCollection.constructor ---
- public ControlCollection (Control owner)
- {
- this.owner = owner;
- }
-
- /// --- ControlCollection Properties ---
- public int Count {
- get { return collection.Count; }
- }
-
- public bool IsReadOnly {
- get { return collection.IsReadOnly; }
- }
-
- public virtual Control this [int index] {
- get { return (Control) collection[index]; }
- }
-
- public virtual void Add (Control value)
- {
- collection.Add (value);
- }
-
- public virtual void AddRange (Control[] controls)
- {
- collection.AddRange (controls);
- }
-
- public virtual void Clear ()
- {
- collection.Clear ();
- }
-
- public bool Contains (Control control)
- {
- return collection.Contains (control);
- }
-
- public void CopyTo (Array dest,int index)
- {
- collection.CopyTo (dest, index);
- }
-
- [MonoTODO]
- public override bool Equals (object other)
- {
- throw new NotImplementedException ();
- }
-
- //inherited
- //public static bool Equals(object o1, object o2) {
- // throw new NotImplementedException ();
- //}
- [MonoTODO]
- public int GetChildIndex (Control child)
- {
- throw new NotImplementedException ();
- }
-
- public IEnumerator GetEnumerator ()
- {
- return collection.GetEnumerator ();
- }
-
- [MonoTODO]
- public override int GetHashCode ()
- {
- throw new NotImplementedException ();
- }
-
- public int IndexOf (Control control)
- {
- return collection.IndexOf (control);
- }
-
- public virtual void Remove (Control value)
- {
- collection.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- collection.RemoveAt (index);
- }
-
- [MonoTODO]
- public void SetChildIndex (Control child,int newIndex)
- {
- throw new NotImplementedException ();
- }
-
- /// --- ControlCollection.IClonable methods ---
- [MonoTODO]
- object ICloneable.Clone ()
- {
- throw new NotImplementedException ();
- }
-
- /// --- ControlCollection.IList properties ---
- bool IList.IsFixedSize {
- get { return collection.IsFixedSize; }
- }
- object IList.this [int index] {
- get { return collection[index]; }
- set { collection[index] = value; }
- }
- object ICollection.SyncRoot {
- get { return collection.SyncRoot; }
- }
-
- bool ICollection.IsSynchronized {
- get { return collection.IsSynchronized; }
- }
-
- /// --- ControlCollection.IList methods ---
- int IList.Add (object control)
- {
- return collection.Add (control);
- }
-
- bool IList.Contains (object control)
- {
- return collection.Contains (control);
- }
-
- int IList.IndexOf (object control)
- {
- return collection.IndexOf (control);
- }
-
- void IList.Insert (int index,object value)
- {
- collection.Insert (index, value);
- }
-
- void IList.Remove (object control)
- {
- collection.Remove (control);
- }
- } // --- end of Control.ControlCollection ---
- }
- }
|