[Mono-dev] How to access XplatUI for custom controls?

Lionel Cuir lionel_email at aulofee.com
Fri Oct 22 12:08:52 EDT 2010


Hello,
 
So here is it. I called the assembly Mono.WinformsSupport.dll. Rename it as
you want + change the reference to the signing key to build it.
 
I've done something just a little more elaborate, as it can be used on Mono
but also with .NET. In a word, a GUI application can now use the same system
calls, independently of the runtime ( Mono / .NET) and of the OS (Windows,
Linux...). Technically, if a program (compiled with Mono.WinformsSupport)
runs on Mono, it will use XplatUI from the Mono's System.Windows.Forms dll.
But if it runs on .NET, then it will use the internal copy of XplatUIWin32
located in Mono.WinformsSupport. 
 
I didn't include any unit test as methods are either simple stubs (calling
XplatUI when on Mono) or a true copy of XplatUIWin32 (which is already
tested). Apply the diff on
mcs/class/Managed.Windows.Forms/Assembly/AssemblyInfo.cs also (add a
InternalsVisibleTo attribute to System.Windows.Forms.dll).
 
Hope it will encourage those creating GUI controls to make their controls
compatible with Mono.
 
Regards
Lionel
 
  _____  

De : miguel.novell at gmail.com [mailto:miguel.novell at gmail.com] De la part de
Miguel de Icaza
Envoyé : vendredi 15 octobre 2010 17:32
À : Lionel Cuir; mono-devel
Objet : Re: [Mono-dev] How to access XplatUI for custom controls?


Hello,



Right now, I'm using only a very limited subset:
GetFocus,
ResetMouseHover
ScrollWindow
 
So obviously, I could manage it manually. But I was thinking about porting
various opensource controls, available on Internet and which uses
GUI-related win32 calls (such as the ecellent DockPanel). As a lot of work
has been within XplatUI and its "drivers", I was looking at reusing them. My
first idea was to ask about making all/some XplatUI's methods public. But
maybe the easier way is to extract what's needed from these classes (easier
but not smarter way though).


I would support having an extra library "WinformsSupport.dll" that exposes
those methods for you.   Interested in cooking the patch?

It would probably be a matter of making the [InternalsVisisbleTo:] the new
assembly, and then exposing public methods for it.

Miguel.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20101022/45834dc6/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mono.WinformsSupport.zip
Type: application/octet-stream
Size: 36947 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20101022/45834dc6/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff AssemblyInfo
Type: application/octet-stream
Size: 934 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20101022/45834dc6/attachment-0003.obj 


More information about the Mono-devel-list mailing list