From pigolkine@gmx.de Fri Aug 1 00:50:10 2003 From: pigolkine@gmx.de (Alexandre Pigolkine) Date: Fri, 1 Aug 2003 01:50:10 +0200 (MEST) Subject: [Mono-winforms-list] Mono SWF Samples References: <1059602284.7733.11.camel@localhost.localdomain> Message-ID: <1858.1059695410@www65.gmx.net> Hello Timothy, The Button sample looks a bit better now : http://www.geocities.com/pigolkine/swf-buttons-linux.png (the buttons at the bottom). The code is in the CVS. I hope that behaviour is also correct. May we can also create one test for Layout/Dock styles ? Alex From tpsoftware@users.sourceforge.net Fri Aug 1 09:25:05 2003 From: tpsoftware@users.sourceforge.net (Timothy Parez) Date: 01 Aug 2003 10:25:05 +0200 Subject: [Mono-winforms-list] Mono SWF Samples In-Reply-To: <1858.1059695410@www65.gmx.net> References: <1059602284.7733.11.camel@localhost.localdomain> <1858.1059695410@www65.gmx.net> Message-ID: <1059726305.5956.0.camel@localhost.localdomain> --=-K0+2/axrUrLHN9Gvt0G0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Thnx, I have uploaded the new picture to the same server as the others. The layout/dock styles test is a good idea Timothy. Op vr 01-08-2003, om 01:50 schreef Alexandre Pigolkine: > Hello Timothy, > > The Button sample looks a bit better now : > http://www.geocities.com/pigolkine/swf-buttons-linux.png > (the buttons at the bottom). The code is in the CVS. > I hope that behaviour is also correct. > May we can also create one test for Layout/Dock styles ? > > Alex > > --=-K0+2/axrUrLHN9Gvt0G0 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Thnx,

I have uploaded the new picture to the same server as the others.
The layout/dock styles test is  a good idea

Timothy.
Op vr 01-08-2003, om 01:50 schreef Alexandre Pigolkine:
Hello Timothy,

The Button sample looks a bit better now : 
http://www.geocities.com/pigolkine/swf-buttons-linux.png
(the buttons at the bottom).  The code is in the CVS.
I hope that behaviour is also correct.
May we can also create one test for Layout/Dock styles ?

Alex

--=-K0+2/axrUrLHN9Gvt0G0-- From tpsoftware@users.sourceforge.net Fri Aug 1 21:07:34 2003 From: tpsoftware@users.sourceforge.net (Timothy Parez) Date: Fri, 1 Aug 2003 22:07:34 +0200 Subject: [Mono-winforms-list] Re: C# Layout Examples References: <20030801155856.A19555@rac2.wam.umd.edu> Message-ID: <000d01c35868$8c8315f0$0500000a@alfred> Thnx, I'll add this to the page ASAP. Regards Timothy. ----- Original Message ----- From: "David W. Bettis" To: Sent: Friday, August 01, 2003 9:58 PM Subject: C# Layout Examples > Hey Tim, > > I heard a request on the mailing list for some layout > examples... ask and ye shall receive. > > Same drill as before... apart from text wrapping on the > buttons (which isn't really a layout issue), it looks pretty > solid. > > > http://enthalpy.net/swf/swf-anchors.tar.bz2 > http://enthalpy.net/swf/swf-dock.tar.bz2 > > Cheers, > --Dave > > -- > David W. Bettis (dwb@umd.edu), http://www.wam.umd.edu/~dwb/ --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 14/07/2003 From pigolkine@gmx.de Sun Aug 3 23:57:18 2003 From: pigolkine@gmx.de (Alexandre Pigolkine) Date: Mon, 4 Aug 2003 00:57:18 +0200 Subject: [Mono-winforms-list] Mono SWF Samples References: <001301c35605$ca5b4470$0100000a@pclindsey> <004d01c356e1$ae0465e0$46d6fea9@alexhome> <1059602284.7733.11.camel@localhost.localdomain> Message-ID: <001a01c35a12$97b63dc0$46d6fea9@alexhome> Hello Timothy, I made screenshots of sample apps without XP style engine: http://www.geocities.com/pigolkine/MonoWin.zip Also other samples run better on Linux now: http://www.geocities.com/pigolkine/MonoLinux.zip I updated GroupBox picture because of control with AnchorAll style. CheckBox and RadioButton do not look perfect yet :(, hope to fix this soon Alex From james@linuxaus.com Mon Aug 4 08:10:08 2003 From: james@linuxaus.com (James Gregory) Date: 04 Aug 2003 17:10:08 +1000 Subject: [Mono-winforms-list] more gtk look stuff Message-ID: <1059981007.7482.35.camel@localhost.localdomain> Hi all, I posted ages ago about wanting to work on the wine GTK look part of the mono project. It's been a while, but I have actually made some progress. I have code now which will set wine's colours to match the GTK theme (well some of the colours, the rest of them is just a case of me having time and patience to finish it). The other achievement was to get a GdkWindow from the XID that Wine uses to display stuff and map a Gtk Button to it. Alas the button is not as yet displaying, which is why I'm writing. The problem as I see it is simply that the gtk main loop isn't running, so whatever it is that actually draws the button inside the expose event in a normal gtk app just isn't running. The patch is a bit of a mess, but if there's interest I'd love to get some feedback from someone who knows the internals of gtk/gdk a bit better. I'm sure that after I'm over this hurdle, the rest will be far faster and simpler to implement. Thanks, James. From thunderbird2k@gmx.net Mon Aug 4 08:58:21 2003 From: thunderbird2k@gmx.net (Roderick Colenbrander) Date: Mon, 4 Aug 2003 09:58:21 +0200 Subject: [Mono-winforms-list] more gtk look stuff In-Reply-To: <1059981007.7482.35.camel@localhost.localdomain> References: <1059981007.7482.35.camel@localhost.localdomain> Message-ID: <200308040958.21736.thunderbird2k@gmx.net> Hi James, Some time ago I emailed with you about this too, congratulations so far. Perhaps it is time now to start a full wine theming thread. Perhaps on wine-devel too. The Wine guys love to have some way of theming too. The simple color changing stuff is the first step. Just hacking Wine to make it look like GTK is not the correct solution and will about sure never make it back in real Wine. It won't work for all controls and it is really a hack. The real solution is to do what WindowsXP is doing. XP is using a special theme library called "uxtheme.dll". It can be accessed directly from an app but most apps don't use it directly. WindowsXP's control related dlls use it too. XP uses two sets of comctl32 and friends. One "old" one and one with theming. The comctl32 and other dlls then contain some options to enable theming and contain some area in which you can draw. I looked into it a bit in the past. Not sure how it fully works but this is the real way to go. So in short on XP the core dlls are patched to use uxtheme.dll for theming. Lets hope this triggers a full thread :) Thanks, Roderick Colenbrander Op maandag 4 augustus 2003 09:10, schreef James Gregory: > Hi all, > > I posted ages ago about wanting to work on the wine GTK look part of the > mono project. It's been a while, but I have actually made some progress. > I have code now which will set wine's colours to match the GTK theme > (well some of the colours, the rest of them is just a case of me having > time and patience to finish it). The other achievement was to get a > GdkWindow from the XID that Wine uses to display stuff and map a Gtk > Button to it. Alas the button is not as yet displaying, which is why I'm > writing. The problem as I see it is simply that the gtk main loop isn't > running, so whatever it is that actually draws the button inside the > expose event in a normal gtk app just isn't running. The patch is a bit > of a mess, but if there's interest I'd love to get some feedback from > someone who knows the internals of gtk/gdk a bit better. I'm sure that > after I'm over this hurdle, the rest will be far faster and simpler to > implement. > > Thanks, > > James. > > > _______________________________________________ > Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/mono-winforms-list From james@linuxaus.com Mon Aug 4 09:11:55 2003 From: james@linuxaus.com (James Gregory) Date: 04 Aug 2003 18:11:55 +1000 Subject: [Mono-winforms-list] more gtk look stuff In-Reply-To: <200308040958.21736.thunderbird2k@gmx.net> References: <1059981007.7482.35.camel@localhost.localdomain> <200308040958.21736.thunderbird2k@gmx.net> Message-ID: <1059984715.7731.49.camel@localhost.localdomain> On Mon, 2003-08-04 at 17:58, Roderick Colenbrander wrote: > Hi James, > > Some time ago I emailed with you about this too, congratulations so far. > Perhaps it is time now to start a full wine theming thread. Perhaps on > wine-devel too. > > The Wine guys love to have some way of theming too. The simple color changing > stuff is the first step. Just hacking Wine to make it look like GTK is not > the correct solution and will about sure never make it back in real Wine. It > won't work for all controls and it is really a hack. An increasingly common hack it seems. I chose it because I figured it would be the fastest to see results on, but agreed it isn't the best solution. > > The real solution is to do what WindowsXP is doing. XP is using a special > theme library called "uxtheme.dll". It can be accessed directly from an app > but most apps don't use it directly. WindowsXP's control related dlls use it > too. XP uses two sets of comctl32 and friends. One "old" one and one with > theming. The comctl32 and other dlls then contain some options to enable > theming and contain some area in which you can draw. I looked into it a bit > in the past. Not sure how it fully works but this is the real way to go. I've heard this. Unfortunately I don't have a copy of windows XP to play with, but that's what the wine guys said when I raised this. So you're suggesting that the uxtheme.dll be written to render stuff with GTK? Does that mean replacing x11drv with a gdkdrv so that there are GdkDrawables to draw on? If so we're not really departing that far from the hacky solution -- it's just a bit more compartmentalised. James. > > So in short on XP the core dlls are patched to use uxtheme.dll for theming. > > Lets hope this triggers a full thread :) > > Thanks, > Roderick Colenbrander > > Op maandag 4 augustus 2003 09:10, schreef James Gregory: > > Hi all, > > > > I posted ages ago about wanting to work on the wine GTK look part of the > > mono project. It's been a while, but I have actually made some progress. > > I have code now which will set wine's colours to match the GTK theme > > (well some of the colours, the rest of them is just a case of me having > > time and patience to finish it). The other achievement was to get a > > GdkWindow from the XID that Wine uses to display stuff and map a Gtk > > Button to it. Alas the button is not as yet displaying, which is why I'm > > writing. The problem as I see it is simply that the gtk main loop isn't > > running, so whatever it is that actually draws the button inside the > > expose event in a normal gtk app just isn't running. The patch is a bit > > of a mess, but if there's interest I'd love to get some feedback from > > someone who knows the internals of gtk/gdk a bit better. I'm sure that > > after I'm over this hurdle, the rest will be far faster and simpler to > > implement. > > > > Thanks, > > > > James. > > > > > > _______________________________________________ > > Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com > > http://lists.ximian.com/mailman/listinfo/mono-winforms-list > From thunderbird2k@gmx.net Mon Aug 4 10:04:35 2003 From: thunderbird2k@gmx.net (Roderick Colenbrander) Date: Mon, 4 Aug 2003 11:04:35 +0200 Subject: [Mono-winforms-list] more gtk look stuff In-Reply-To: <1059984715.7731.49.camel@localhost.localdomain> References: <1059981007.7482.35.camel@localhost.localdomain> <200308040958.21736.thunderbird2k@gmx.net> <1059984715.7731.49.camel@localhost.localdomain> Message-ID: <200308041104.35536.thunderbird2k@gmx.net> The dll uxtheme takes care of all theming. "Real" xp apps use new versions of comctl32 and friends in which uxtheme.dll is used as a plugin. Other apps use it directly. The dll takes care of all theme loading and stuff related to that. I'm about sure this dll can be implemented using gtk calls and even other api's. The opposite of this is already happening with gtk on winxp. Using uxtheme.dll to theme GTK ;) Check out gtk-winp.sf.net Note that uxtheme will need a thread on wine-devel, since it needs some changes in a few other dlls. Since the uxtheme dll itself doesn't do that much. Here is some more information of the working of it all: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/userex/themes.asp Roderick Op maandag 4 augustus 2003 10:11, schreef u: > On Mon, 2003-08-04 at 17:58, Roderick Colenbrander wrote: > > Hi James, > > > > Some time ago I emailed with you about this too, congratulations so far. > > Perhaps it is time now to start a full wine theming thread. Perhaps on > > wine-devel too. > > > > The Wine guys love to have some way of theming too. The simple color > > changing stuff is the first step. Just hacking Wine to make it look like > > GTK is not the correct solution and will about sure never make it back in > > real Wine. It won't work for all controls and it is really a hack. > > An increasingly common hack it seems. I chose it because I figured it > would be the fastest to see results on, but agreed it isn't the best > solution. > > > The real solution is to do what WindowsXP is doing. XP is using a special > > theme library called "uxtheme.dll". It can be accessed directly from an > > app but most apps don't use it directly. WindowsXP's control related dlls > > use it too. XP uses two sets of comctl32 and friends. One "old" one and > > one with theming. The comctl32 and other dlls then contain some options > > to enable theming and contain some area in which you can draw. I looked > > into it a bit in the past. Not sure how it fully works but this is the > > real way to go. > > I've heard this. Unfortunately I don't have a copy of windows XP to play > with, but that's what the wine guys said when I raised this. > > So you're suggesting that the uxtheme.dll be written to render stuff > with GTK? Does that mean replacing x11drv with a gdkdrv so that there > are GdkDrawables to draw on? If so we're not really departing that far > from the hacky solution -- it's just a bit more compartmentalised. > > James. > > > So in short on XP the core dlls are patched to use uxtheme.dll for > > theming. > > > > Lets hope this triggers a full thread :) > > > > Thanks, > > Roderick Colenbrander > > > > Op maandag 4 augustus 2003 09:10, schreef James Gregory: > > > Hi all, > > > > > > I posted ages ago about wanting to work on the wine GTK look part of > > > the mono project. It's been a while, but I have actually made some > > > progress. I have code now which will set wine's colours to match the > > > GTK theme (well some of the colours, the rest of them is just a case of > > > me having time and patience to finish it). The other achievement was to > > > get a GdkWindow from the XID that Wine uses to display stuff and map a > > > Gtk Button to it. Alas the button is not as yet displaying, which is > > > why I'm writing. The problem as I see it is simply that the gtk main > > > loop isn't running, so whatever it is that actually draws the button > > > inside the expose event in a normal gtk app just isn't running. The > > > patch is a bit of a mess, but if there's interest I'd love to get some > > > feedback from someone who knows the internals of gtk/gdk a bit better. > > > I'm sure that after I'm over this hurdle, the rest will be far faster > > > and simpler to implement. > > > > > > Thanks, > > > > > > James. > > > > > > > > > _______________________________________________ > > > Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com > > > http://lists.ximian.com/mailman/listinfo/mono-winforms-list From duncan@ximian.com Thu Aug 7 01:29:38 2003 From: duncan@ximian.com (Duncan Mak) Date: Wed, 06 Aug 2003 20:29:38 -0400 Subject: [Mono-winforms-list] Winform samples in CVS Message-ID: <1060216178.24101.3.camel@diphthong> Hey guys, I've imported all the winforms samples into the samples module in Mono CVS. You can find all of them in sample/winforms. Duncan. From timothyparez@linux.be Thu Aug 7 08:12:19 2003 From: timothyparez@linux.be (Timothy Parez) Date: 07 Aug 2003 09:12:19 +0200 Subject: [Mono-winforms-list] Winform samples in CVS In-Reply-To: <1060216178.24101.3.camel@diphthong> References: <1060216178.24101.3.camel@diphthong> Message-ID: <1060240338.5946.0.camel@localhost.localdomain> --=-Y0iyCO0gZOi/2yQ+Vmbt Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, Can I commit to that repository ? Timothy. Op do 07-08-2003, om 02:29 schreef Duncan Mak: > Hey guys, > > I've imported all the winforms samples into the samples module in Mono > CVS. You can find all of them in sample/winforms. > > Duncan. > _______________________________________________ > Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/mono-winforms-list --=-Y0iyCO0gZOi/2yQ+Vmbt Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Hi,

Can I commit to that repository ?

Timothy.

Op do 07-08-2003, om 02:29 schreef Duncan Mak:
Hey guys,

I've imported all the winforms samples into the samples module in Mono
CVS. You can find all of them in sample/winforms.

Duncan.
_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list
--=-Y0iyCO0gZOi/2yQ+Vmbt-- From tpsoftware@users.sourceforge.net Fri Aug 8 19:43:10 2003 From: tpsoftware@users.sourceforge.net (Timothy Parez) Date: 08 Aug 2003 20:43:10 +0200 Subject: [Mono-winforms-list] SWF-ComboBox Sample Message-ID: <1060368189.10767.1.camel@localhost.localdomain> --=-/rC6hMpYGrNxvFXGHtpO Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, I just uploaded the ComboBox sample and comitted it to CVS URL: http://www.nullenvoid.com/mono/wiki/index.php/The%20ComboBox%20Control. CVS Module: winforms Running the sample with Mono 0.25 resulted in something weird (check the screenshot) Perhaps someone can test it with the latest CVS and send me a better screenshot then. No compilation errors for this sample. Timothy. --=-/rC6hMpYGrNxvFXGHtpO Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Hi,

I just uploaded the ComboBox sample and comitted it to CVS
URL: http://www.nullenvoid.com/mono/wiki/index.php/The%20ComboBox%20Control.
CVS Module: winforms

Running the sample with Mono 0.25 resulted in something weird (check the screenshot)
Perhaps someone can test it with the latest CVS and send me a better screenshot then.

No compilation errors for this sample.

Timothy. --=-/rC6hMpYGrNxvFXGHtpO-- From denisraytek@yahoo.com Sun Aug 10 06:37:15 2003 From: denisraytek@yahoo.com (Dennis Hayes) Date: Sat, 9 Aug 2003 22:37:15 -0700 (PDT) Subject: [Mono-winforms-list] Control.cs Message-ID: <20030810053715.15191.qmail@web80503.mail.yahoo.com> --0-1364252259-1060493835=:13662 Content-Type: text/plain; charset=us-ascii I just made changes to control.cs and monthcalendar.cs. Just signiture changes. Out of 23735 items 3603 were missing, 2292 were added, and 134 were breaking. The numbers are now 2992 1637 95 Dennis --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software --0-1364252259-1060493835=:13662 Content-Type: text/html; charset=us-ascii
I just made changes to control.cs and monthcalendar.cs.
Just signiture changes.
Out of 23735 items 3603 were missing, 2292 were added, and 134 were breaking.
The numbers are now
2992 1637 95
 
Dennis
 


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software --0-1364252259-1060493835=:13662-- From denisraytek@yahoo.com Sun Aug 10 06:45:54 2003 From: denisraytek@yahoo.com (Dennis Hayes) Date: Sat, 9 Aug 2003 22:45:54 -0700 (PDT) Subject: [Mono-winforms-list] button implmentation Message-ID: <20030810054554.21112.qmail@web80509.mail.yahoo.com> --0-2047449786-1060494354=:20236 Content-Type: text/plain; charset=us-ascii Button.cs implments OnPaint. The spec says this should be in ButtonBase.cs. ButtonBase is just base.OnPaint (pevent) There is a lot of implmentation in button.cs * It looks like just replacing the ButtonBase OnPaint with the Button OnPaint, and removing the OnPaint from Button.cs would be the correct option. * Can someone do this and verify that is does not break any of the test? Thanks, Dennis --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software --0-2047449786-1060494354=:20236 Content-Type: text/html; charset=us-ascii
Button.cs implments OnPaint.
The spec says this should be in ButtonBase.cs.
ButtonBase is just
base.OnPaint (pevent)
There is a lot of implmentation in button.cs
 
*
It looks like just replacing the ButtonBase OnPaint with the Button OnPaint, and removing the OnPaint from Button.cs would be the correct option.
*
Can someone do this and verify that is does not break any of the test?
Thanks,
Dennis
 


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software --0-2047449786-1060494354=:20236-- From mpollack@speakeasy.net Mon Aug 11 06:38:57 2003 From: mpollack@speakeasy.net (mpollack@speakeasy.net) Date: Mon, 11 Aug 2003 05:38:57 +0000 Subject: [Mono-winforms-list] erratic behavior in running winforms - redhat 7.2 Message-ID: Hi, I have redhat 7.2 and have some erratic behavior running the examples, sometimes they work, sometimes I get a stack trace. The procedure for installing was the following 1. Download wine from http://primates.ximian.com/~duncan/mono-wine/sources/ and install according to http://www.nullenvoid.com/mono/wiki/index.php/MonoWinePackages I also need to make the changes (NB There is a source code error after patching in line 695 where a variable HMODULE module is declared after other statements which is not allowed in C. I swapped lines 694 and 695 to cure.) 2. downloaded mono from http://go-mono.com/daily/ version mono-0.25.99.2.20030810 and did ./configure --prefix=/usr/local, make, make install 3. compiled and ran a simple program, got the whole font generation stuff. Then my winform showed up, with a message from wine, "I think you have a buggy version of libXrender.so. 4. I ran across the post on http://kt.zork.net/wine/wn20020509_122.html#6 . I was using XFree86 4.1, I downloaded the 4.2 version of Xlib.tgz and put in the newer version of libXrender.so.1.1 5. Built some samples from http://primates.ximian.com/~duncan/mono-wine/samples/sources/ and ran them. Now sometimes I can run the label program and get mono swf-label.exe MonoWin32: Initializing WineLib Warning: Language 'en_US' was not found, retrying without country name... Warning: Language 'en' was not recognized, defaulting to English err:menu:MENU_GetSysMenu failed to load system menu! and i see the program run fine. If I try to run the buttons example i get mono swf-buttons.exe MonoWin32: Initializing WineLib Warning: Language 'en_US' was not found, retrying without country name... Warning: Language 'en' was not recognized, defaulting to English Unhandled Exception: System.NullReferenceException: A null value was found where an object instance was required in (unmanaged) 06 System.Windows.Forms.Win32:CreateWindowEx (uint,string,string,uint,int,int,int,int,intptr,intptr,intptr,intptr) in <0x00004> 06 System.Windows.Forms.Win32:CreateWindowEx (uint,string,string,uint,int,int,int,int,intptr,intptr,intptr,intptr) in <0x004ac> 00 System.Windows.Forms.NativeWindow:CreateHandle (System.Windows.Forms.CreateParams) in <0x000c5> 00 System.Windows.Forms.Control:get_ParkingWindowHandle () in <0x00177> 00 System.Windows.Forms.Control:get_CreateParams () in <0x0000d> 00 System.Windows.Forms.ButtonBase:get_CreateParams () in <0x0001c> 00 System.Windows.Forms.Button:get_CreateParams () in <0x00048> 00 System.Windows.Forms.Control:UpdateBounds (int,int,int,int) in <0x000a3> 08 System.Windows.Forms.Control:UpdateBounds (int,int,int,int) in <0x000fb> 00 System.Windows.Forms.Control:SetBoundsCore (int,int,int,int,System.Windows.Forms.BoundsSpecified) in <0x0001d> 00 System.Windows.Forms.Control:SetBounds (int,int,int,int,System.Windows.Forms.BoundsSpecified) in <0x000b5> 08 System.Windows.Forms.Control:SetBounds (int,int,int,int,System.Windows.Forms.BoundsSpecified) in <0x0007e> 00 System.Windows.Forms.Control:set_Location (System.Drawing.Point) in <0x0009b> 08 System.Windows.Forms.Control:set_Location (System.Drawing.Point) in <0x00582> 00 MyFormProject.MainForm:InitializeComponent () in <0x00054> 08 MyFormProject.MainForm:InitializeComponent () in <0x00019> 00 MyFormProject.MainForm:.ctor () in <0x00054> 08 MyFormProject.MainForm:.ctor () in <0x0001e> 00 MyFormProject.MainForm:Main (string[]) What is also interesting is if I try to run the label example like this mono ./swf-label.exe I also get the same exception. Any ideas what is going on? Cheers and keep up the good work! - Mark From denisraytek@yahoo.com Sun Aug 10 06:15:41 2003 From: denisraytek@yahoo.com (Dennis Hayes) Date: Sat, 9 Aug 2003 22:15:41 -0700 (PDT) Subject: [Mono-winforms-list] control.cs In-Reply-To: <1060368189.10767.1.camel@localhost.localdomain> Message-ID: <20030810051541.99745.qmail@web80507.mail.yahoo.com> --0-393905900-1060492541=:98676 Content-Type: text/plain; charset=us-ascii I just updated Controls.cs with some signiture fixes. Month control also. Dennis --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software --0-393905900-1060492541=:98676 Content-Type: text/html; charset=us-ascii
 
I just updated Controls.cs with some signiture fixes.
Month control also.
Dennis


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software --0-393905900-1060492541=:98676-- From tpsoftware@users.sourceforge.net Mon Aug 11 12:07:22 2003 From: tpsoftware@users.sourceforge.net (Timothy Parez) Date: 11 Aug 2003 13:07:22 +0200 Subject: [Mono-winforms-list] SWF Example 11 - The MainMenu Control Message-ID: <1060600041.6143.2.camel@localhost.localdomain> --=-eSWUgtrbd8PRqK7Z2AU2 Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, Lawrence E. Smithmier just sent me the MainMenu control example. I've commited it to CVS and updated the Wiki http://www.nullenvoid.com/mono/wiki/index.php/The%20MainMenu%20Control. We need Mono Linux and Mono Windows Screenshots. But as you can see from the screenshot on the Wiki only a single menu can be shown at a time. Therefore we need the screenshots from the second menu (as seen in the dotnet windows screenshot) Other screenshots may be included in a compressed archive. Timothy. --=-eSWUgtrbd8PRqK7Z2AU2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Hi,

Lawrence E. Smithmier just sent me the MainMenu control example.
I've commited it to CVS and updated the Wiki

http://www.nullenvoid.com/mono/wiki/index.php/The%20MainMenu%20Control.

We need Mono Linux and Mono Windows Screenshots.
But as you can see from the screenshot on the Wiki only a single menu can be shown at a time.
Therefore we need the screenshots from the second menu (as seen in the dotnet windows screenshot)
Other screenshots may be included in a compressed archive.

Timothy. --=-eSWUgtrbd8PRqK7Z2AU2-- From ryabchuk@yahoo.com Mon Aug 11 15:11:20 2003 From: ryabchuk@yahoo.com (Aleksey Ryabchuk) Date: Mon, 11 Aug 2003 07:11:20 -0700 (PDT) Subject: [Mono-winforms-list] button implmentation In-Reply-To: <20030810054554.21112.qmail@web80509.mail.yahoo.com> Message-ID: <20030811141120.35098.qmail@web10909.mail.yahoo.com> Hello, May be from technical point of view there is no difference where this code is located . But it can be wrong logically, because this code is not common for all button controls. Aleksey --- Dennis Hayes wrote: > Button.cs implments OnPaint. > The spec says this should be in ButtonBase.cs. > ButtonBase is just > base.OnPaint (pevent) > There is a lot of implmentation in button.cs > > * > It looks like just replacing the ButtonBase OnPaint > with the Button OnPaint, and removing the OnPaint > from Button.cs would be the correct option. > * > Can someone do this and verify that is does not > break any of the test? > Thanks, > Dennis __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From DENNISH@Raytek.com Mon Aug 11 19:09:38 2003 From: DENNISH@Raytek.com (Dennis Hayes) Date: Mon, 11 Aug 2003 11:09:38 -0700 Subject: [Mono-winforms-list] button implmentation Message-ID: <6A5462649507D7119DE00090271EC70B8D31DD@RHQPDC0> OK let's leave it where it is for the time being. Actually I am wrong twice; the spec says OnPaint for Button is inherited from control. How can control handle OnPaint for Button? Am I missing something here? Anyway, there are several thousand signature errors for me to fix before I come back to this one. Dennis -----Original Message----- From: Aleksey Ryabchuk [mailto:ryabchuk@yahoo.com] Sent: Monday, August 11, 2003 7:11 AM To: mono-winforms-list@lists.ximian.com Subject: Re: [Mono-winforms-list] button implmentation Hello, May be from technical point of view there is no difference where this code is located . But it can be wrong logically, because this code is not common for all button controls. Aleksey --- Dennis Hayes wrote: > Button.cs implments OnPaint. > The spec says this should be in ButtonBase.cs. > ButtonBase is just > base.OnPaint (pevent) > There is a lot of implmentation in button.cs > > * > It looks like just replacing the ButtonBase OnPaint > with the Button OnPaint, and removing the OnPaint > from Button.cs would be the correct option. > * > Can someone do this and verify that is does not > break any of the test? > Thanks, > Dennis __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com _______________________________________________ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list From 2a5gjx302@sneakemail.com Tue Aug 12 10:40:52 2003 From: 2a5gjx302@sneakemail.com (Jonathan Gilbert) Date: Tue, 12 Aug 2003 09:40:52 Subject: [Mono-winforms-list] button implmentation In-Reply-To: <6A5462649507D7119DE00090271EC70B8D31DD@RHQPDC0> Message-ID: <27402-70134@sneakemail.com> Just thought I'd poke my head in on this and point out that the Windows implementations usually don't actually draw themselves. They simply wrap up a win32 HWND and allow the system to draw the control. The other thing to point out is that Microsoft codes in this pattern: public event PaintEventHandler Paint; protected void OnPaint(PaintEventArgs e) { if (Paint != null) Paint(this, e); } Therefore, it is likely that a subclass would hook the 'Paint' event instead of overriding the 'OnPaint' method. Jonathan At 11:09 AM 11/08/2003 -0700, you wrote: >OK let's leave it where it is for the time being. >Actually I am wrong twice; the spec says OnPaint for Button is inherited >from control. >How can control handle OnPaint for Button? >Am I missing something here? >Anyway, there are several thousand signature errors for me to fix before I >come back to this one. >Dennis > >-----Original Message----- >From: Aleksey Ryabchuk [mailto:ryabchuk@yahoo.com] >Sent: Monday, August 11, 2003 7:11 AM >To: mono-winforms-list@lists.ximian.com >Subject: Re: [Mono-winforms-list] button implmentation > >Hello, > >May be from technical point of view there is no >difference where this code is located . But it can be >wrong logically, because this code is not common for >all button controls. > >Aleksey > >--- Dennis Hayes wrote: >> Button.cs implments OnPaint. >> The spec says this should be in ButtonBase.cs. >> ButtonBase is just >> base.OnPaint (pevent) >> There is a lot of implmentation in button.cs >> >> * >> It looks like just replacing the ButtonBase OnPaint >> with the Button OnPaint, and removing the OnPaint >> from Button.cs would be the correct option. >> * >> Can someone do this and verify that is does not >> break any of the test? >> Thanks, >> Dennis > > >__________________________________ >Do you Yahoo!? >The New Yahoo! Search - Faster. Easier. Bingo. >http://search.yahoo.com >_______________________________________________ >Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com >http://lists.ximian.com/mailman/listinfo/mono-winforms-list >_______________________________________________ >Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com >http://lists.ximian.com/mailman/listinfo/mono-winforms-list > From DENNISH@Raytek.com Tue Aug 12 01:46:48 2003 From: DENNISH@Raytek.com (Dennis Hayes) Date: Mon, 11 Aug 2003 17:46:48 -0700 Subject: [Mono-winforms-list] button implmentation Message-ID: <6A5462649507D7119DE00090271EC70B8D31EB@RHQPDC0> Just thought I'd poke my head in on this and point out that the Windows implementations usually don't actually draw themselves. They simply wrap up a win32 HWND and allow the system to draw the control. This is what we should do as well. That is why we use Wine. Dennis -----Original Message----- From: Jonathan Gilbert [mailto:2a5gjx302@sneakemail.com] Sent: Tuesday, August 12, 2003 2:41 AM To: mono-winforms-list@lists.ximian.com Subject: RE: [Mono-winforms-list] button implmentation Just thought I'd poke my head in on this and point out that the Windows implementations usually don't actually draw themselves. They simply wrap up a win32 HWND and allow the system to draw the control. The other thing to point out is that Microsoft codes in this pattern: public event PaintEventHandler Paint; protected void OnPaint(PaintEventArgs e) { if (Paint != null) Paint(this, e); } Therefore, it is likely that a subclass would hook the 'Paint' event instead of overriding the 'OnPaint' method. Jonathan At 11:09 AM 11/08/2003 -0700, you wrote: >OK let's leave it where it is for the time being. >Actually I am wrong twice; the spec says OnPaint for Button is inherited >from control. >How can control handle OnPaint for Button? >Am I missing something here? >Anyway, there are several thousand signature errors for me to fix before I >come back to this one. >Dennis > >-----Original Message----- >From: Aleksey Ryabchuk [mailto:ryabchuk@yahoo.com] >Sent: Monday, August 11, 2003 7:11 AM >To: mono-winforms-list@lists.ximian.com >Subject: Re: [Mono-winforms-list] button implmentation > >Hello, > >May be from technical point of view there is no >difference where this code is located . But it can be >wrong logically, because this code is not common for >all button controls. > >Aleksey > >--- Dennis Hayes wrote: >> Button.cs implments OnPaint. >> The spec says this should be in ButtonBase.cs. >> ButtonBase is just >> base.OnPaint (pevent) >> There is a lot of implmentation in button.cs >> >> * >> It looks like just replacing the ButtonBase OnPaint >> with the Button OnPaint, and removing the OnPaint >> from Button.cs would be the correct option. >> * >> Can someone do this and verify that is does not >> break any of the test? >> Thanks, >> Dennis > > >__________________________________ >Do you Yahoo!? >The New Yahoo! Search - Faster. Easier. Bingo. >http://search.yahoo.com >_______________________________________________ >Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com >http://lists.ximian.com/mailman/listinfo/mono-winforms-list >_______________________________________________ >Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com >http://lists.ximian.com/mailman/listinfo/mono-winforms-list > _______________________________________________ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list From ryabchuk@yahoo.com Tue Aug 12 09:26:07 2003 From: ryabchuk@yahoo.com (Aleksey Ryabchuk) Date: Tue, 12 Aug 2003 01:26:07 -0700 (PDT) Subject: [Mono-winforms-list] button implmentation In-Reply-To: <6A5462649507D7119DE00090271EC70B8D31EB@RHQPDC0> Message-ID: <20030812082607.9880.qmail@web10901.mail.yahoo.com> Hello, I agree that we should delegate as much work as possible to Wine. But all button controls ( Button, CheckBox, RadioButton) in SWF have to be ownerdrawn, because they implement a number of properties not supported by Win API. For example, TextAlignment can only be left, center or right in WinAPI, while in SWF it can be TopLeft or RightBottom etc. The same is for Label control. Another problem is that the patched version of Wine is not able to draw some controls at all. CheckBox, RadioButton and ComboBox are among them. Regards Aleksey --- Dennis Hayes wrote: > > Just thought I'd poke my head in on this and point > out that the Windows > implementations usually don't actually draw > themselves. They simply wrap up > a win32 HWND and allow the system to draw the > control. > > This is what we should do as well. That is why we > use Wine. > Dennis > > > > > -----Original Message----- > From: Jonathan Gilbert > [mailto:2a5gjx302@sneakemail.com] > Sent: Tuesday, August 12, 2003 2:41 AM > To: mono-winforms-list@lists.ximian.com > Subject: RE: [Mono-winforms-list] button > implmentation > > Just thought I'd poke my head in on this and point > out that the Windows > implementations usually don't actually draw > themselves. They simply wrap up > a win32 HWND and allow the system to draw the > control. > > The other thing to point out is that Microsoft codes > in this pattern: > > public event PaintEventHandler Paint; > > protected void OnPaint(PaintEventArgs e) > { > if (Paint != null) > Paint(this, e); > } > > Therefore, it is likely that a subclass would hook > the 'Paint' event > instead of overriding the 'OnPaint' method. > > Jonathan > > At 11:09 AM 11/08/2003 -0700, you wrote: > >OK let's leave it where it is for the time being. > >Actually I am wrong twice; the spec says OnPaint > for Button is inherited > >from control. > >How can control handle OnPaint for Button? > >Am I missing something here? > >Anyway, there are several thousand signature errors > for me to fix before I > >come back to this one. > >Dennis > > > >-----Original Message----- > >From: Aleksey Ryabchuk [mailto:ryabchuk@yahoo.com] > >Sent: Monday, August 11, 2003 7:11 AM > >To: mono-winforms-list@lists.ximian.com > >Subject: Re: [Mono-winforms-list] button > implmentation > > > >Hello, > > > >May be from technical point of view there is no > >difference where this code is located . But it can > be > >wrong logically, because this code is not common > for > >all button controls. > > > >Aleksey > > > >--- Dennis Hayes wrote: > >> Button.cs implments OnPaint. > >> The spec says this should be in ButtonBase.cs. > >> ButtonBase is just > >> base.OnPaint (pevent) > >> There is a lot of implmentation in button.cs > >> > >> * > >> It looks like just replacing the ButtonBase > OnPaint > >> with the Button OnPaint, and removing the OnPaint > >> from Button.cs would be the correct option. > >> * > >> Can someone do this and verify that is does not > >> break any of the test? > >> Thanks, > >> Dennis __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com From mark@dawebber.com Tue Aug 12 18:19:28 2003 From: mark@dawebber.com (Mark Gimelfarb) Date: Tue, 12 Aug 2003 13:19:28 -0400 Subject: [Mono-winforms-list] button implmentation In-Reply-To: <20030812082607.9880.qmail@web10901.mail.yahoo.com> References: <20030812082607.9880.qmail@web10901.mail.yahoo.com> Message-ID: <1060708768.3f3921a0e893a@www.configtech.com> Hello, all! I would like to play devil's advocate here (no pun intended), so I looked at MS's recommendation in MSDN on drawing owner-drawn controls. We'll have to assume that Button is in fact an owner-drawn control, rather than an inherited control, based on its placement in the inheritance hierarchy. Control->ButtonBase->Button. According to this: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/h tml/cpconrenderingwindowsformscontrol.asp "A control must provide rendering logic by overriding the OnPaint method that it inherits from Control. OnPaint gets access to a graphics object and a rectangle to draw in through the Graphics and the ClipRectangle properties of the PaintEventArgs instance passed to it. protected virtual void OnPaint(PaintEventArgs pe); The OnPaint method of the base Control class does not implement any drawing functionality but merely invokes the event delegates that are registered with the Paint event. When you override OnPaint, you should typically invoke the OnPaint method of the base class so that registered delegates receive the Paint event. However, controls that paint their entire surface should not invoke the base class's OnPaint, as this introduces flicker. " So, it seems that MS tells us not to use their own Win32 API to create owner- drawn controls (even though I can't prove or state that MS necessarily follows their own preachings), but to use GDI+ facilities to do the drawing of the control. Maybe it will be easier to implement our own control drawing routines, in order to be: a) compatible with MS b) more platform (and P/Invoke) independent. Just some thoughts on the topic. Regards, Mark. -----Original Message----- From: mono-winforms-list-admin@lists.ximian.com [mailto:mono-winforms-list-admin@lists.ximian.com] On Behalf Of Aleksey Ryabchuk Sent: Tuesday, August 12, 2003 3:26 AM To: mono-winforms-list@lists.ximian.com Subject: RE: [Mono-winforms-list] button implmentation Hello, I agree that we should delegate as much work as possible to Wine. But all button controls ( Button, CheckBox, RadioButton) in SWF have to be ownerdrawn, because they implement a number of properties not supported by Win API. For example, TextAlignment can only be left, center or right in WinAPI, while in SWF it can be TopLeft or RightBottom etc. The same is for Label control. Another problem is that the patched version of Wine is not able to draw some controls at all. CheckBox, RadioButton and ComboBox are among them. Regards Aleksey --- Dennis Hayes wrote: > > Just thought I'd poke my head in on this and point > out that the Windows > implementations usually don't actually draw > themselves. They simply wrap up > a win32 HWND and allow the system to draw the > control. > > This is what we should do as well. That is why we > use Wine. > Dennis > > > > > -----Original Message----- > From: Jonathan Gilbert > [mailto:2a5gjx302@sneakemail.com] > Sent: Tuesday, August 12, 2003 2:41 AM > To: mono-winforms-list@lists.ximian.com > Subject: RE: [Mono-winforms-list] button > implmentation > > Just thought I'd poke my head in on this and point > out that the Windows > implementations usually don't actually draw > themselves. They simply wrap up > a win32 HWND and allow the system to draw the > control. > > The other thing to point out is that Microsoft codes > in this pattern: > > public event PaintEventHandler Paint; > > protected void OnPaint(PaintEventArgs e) > { > if (Paint != null) > Paint(this, e); > } > > Therefore, it is likely that a subclass would hook > the 'Paint' event > instead of overriding the 'OnPaint' method. > > Jonathan > > At 11:09 AM 11/08/2003 -0700, you wrote: > >OK let's leave it where it is for the time being. > >Actually I am wrong twice; the spec says OnPaint > for Button is inherited > >from control. > >How can control handle OnPaint for Button? > >Am I missing something here? > >Anyway, there are several thousand signature errors > for me to fix before I > >come back to this one. > >Dennis > > > >-----Original Message----- > >From: Aleksey Ryabchuk [mailto:ryabchuk@yahoo.com] > >Sent: Monday, August 11, 2003 7:11 AM > >To: mono-winforms-list@lists.ximian.com > >Subject: Re: [Mono-winforms-list] button > implmentation > > > >Hello, > > > >May be from technical point of view there is no > >difference where this code is located . But it can > be > >wrong logically, because this code is not common > for > >all button controls. > > > >Aleksey > > > >--- Dennis Hayes wrote: > >> Button.cs implments OnPaint. > >> The spec says this should be in ButtonBase.cs. > >> ButtonBase is just > >> base.OnPaint (pevent) > >> There is a lot of implmentation in button.cs > >> > >> * > >> It looks like just replacing the ButtonBase > OnPaint > >> with the Button OnPaint, and removing the OnPaint > >> from Button.cs would be the correct option. > >> * > >> Can someone do this and verify that is does not > >> break any of the test? > >> Thanks, > >> Dennis From DENNISH@Raytek.com Tue Aug 12 19:22:54 2003 From: DENNISH@Raytek.com (Dennis Hayes) Date: Tue, 12 Aug 2003 11:22:54 -0700 Subject: [Mono-winforms-list] button implmentation Message-ID: <6A5462649507D7119DE00090271EC70B8D31FA@RHQPDC0> The .NET spec says that Button inherits the OnPaint from Control. Winchurn, a .dll compare routine, verifies that the binary matches the spec. Maybe Button registers an "internal" method with the control onPaint? Can Button have an "new internal OnPaint" that hides the Control OnPaint, but that is not visible outside the .dll? No, that will not work, because Button must expose the OnPaint from Control. * To be 100% compatible with MS, Button must expose only the OnPaint inherited from Control. * How? I do not know. Important? Not very. I would rather have Button work and expose its own OnPaint than have it use OnPaint from Control and not work. I am going to work on some of the other 3,000 signature errors that are easy to fix. Also in control, OnWmCommand should be marked as internal, not protected, unless it needs to be accessed outside of the SWF dll. This is true of any method/property that is not part of the spec. Dennis -----Original Message----- From: Mark Gimelfarb [mailto:mark@dawebber.com] Sent: Tuesday, August 12, 2003 10:19 AM To: mono-winforms-list@lists.ximian.com Subject: RE: [Mono-winforms-list] button implmentation Hello, all! I would like to play devil's advocate here (no pun intended), so I looked at MS's recommendation in MSDN on drawing owner-drawn controls. We'll have to assume that Button is in fact an owner-drawn control, rather than an inherited control, based on its placement in the inheritance hierarchy. Control->ButtonBase->Button. According to this: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/h tml/cpconrenderingwindowsformscontrol.asp "A control must provide rendering logic by overriding the OnPaint method that it inherits from Control. OnPaint gets access to a graphics object and a rectangle to draw in through the Graphics and the ClipRectangle properties of the PaintEventArgs instance passed to it. protected virtual void OnPaint(PaintEventArgs pe); The OnPaint method of the base Control class does not implement any drawing functionality but merely invokes the event delegates that are registered with the Paint event. When you override OnPaint, you should typically invoke the OnPaint method of the base class so that registered delegates receive the Paint event. However, controls that paint their entire surface should not invoke the base class's OnPaint, as this introduces flicker. " So, it seems that MS tells us not to use their own Win32 API to create owner- drawn controls (even though I can't prove or state that MS necessarily follows their own preachings), but to use GDI+ facilities to do the drawing of the control. Maybe it will be easier to implement our own control drawing routines, in order to be: a) compatible with MS b) more platform (and P/Invoke) independent. Just some thoughts on the topic. Regards, Mark. -----Original Message----- From: mono-winforms-list-admin@lists.ximian.com [mailto:mono-winforms-list-admin@lists.ximian.com] On Behalf Of Aleksey Ryabchuk Sent: Tuesday, August 12, 2003 3:26 AM To: mono-winforms-list@lists.ximian.com Subject: RE: [Mono-winforms-list] button implmentation Hello, I agree that we should delegate as much work as possible to Wine. But all button controls ( Button, CheckBox, RadioButton) in SWF have to be ownerdrawn, because they implement a number of properties not supported by Win API. For example, TextAlignment can only be left, center or right in WinAPI, while in SWF it can be TopLeft or RightBottom etc. The same is for Label control. Another problem is that the patched version of Wine is not able to draw some controls at all. CheckBox, RadioButton and ComboBox are among them. Regards Aleksey --- Dennis Hayes wrote: > > Just thought I'd poke my head in on this and point > out that the Windows > implementations usually don't actually draw > themselves. They simply wrap up > a win32 HWND and allow the system to draw the > control. > > This is what we should do as well. That is why we > use Wine. > Dennis > > > > > -----Original Message----- > From: Jonathan Gilbert > [mailto:2a5gjx302@sneakemail.com] > Sent: Tuesday, August 12, 2003 2:41 AM > To: mono-winforms-list@lists.ximian.com > Subject: RE: [Mono-winforms-list] button > implmentation > > Just thought I'd poke my head in on this and point > out that the Windows > implementations usually don't actually draw > themselves. They simply wrap up > a win32 HWND and allow the system to draw the > control. > > The other thing to point out is that Microsoft codes > in this pattern: > > public event PaintEventHandler Paint; > > protected void OnPaint(PaintEventArgs e) > { > if (Paint != null) > Paint(this, e); > } > > Therefore, it is likely that a subclass would hook > the 'Paint' event > instead of overriding the 'OnPaint' method. > > Jonathan > > At 11:09 AM 11/08/2003 -0700, you wrote: > >OK let's leave it where it is for the time being. > >Actually I am wrong twice; the spec says OnPaint > for Button is inherited > >from control. > >How can control handle OnPaint for Button? > >Am I missing something here? > >Anyway, there are several thousand signature errors > for me to fix before I > >come back to this one. > >Dennis > > > >-----Original Message----- > >From: Aleksey Ryabchuk [mailto:ryabchuk@yahoo.com] > >Sent: Monday, August 11, 2003 7:11 AM > >To: mono-winforms-list@lists.ximian.com > >Subject: Re: [Mono-winforms-list] button > implmentation > > > >Hello, > > > >May be from technical point of view there is no > >difference where this code is located . But it can > be > >wrong logically, because this code is not common > for > >all button controls. > > > >Aleksey > > > >--- Dennis Hayes wrote: > >> Button.cs implments OnPaint. > >> The spec says this should be in ButtonBase.cs. > >> ButtonBase is just > >> base.OnPaint (pevent) > >> There is a lot of implmentation in button.cs > >> > >> * > >> It looks like just replacing the ButtonBase > OnPaint > >> with the Button OnPaint, and removing the OnPaint > >> from Button.cs would be the correct option. > >> * > >> Can someone do this and verify that is does not > >> break any of the test? > >> Thanks, > >> Dennis _______________________________________________ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list From sford@RJKTECH.com Wed Aug 13 12:41:33 2003 From: sford@RJKTECH.com (Scott Ford) Date: Wed, 13 Aug 2003 07:41:33 -0400 Subject: [Mono-winforms-list] button implmentation Message-ID: Since Button, Checkbox, and RadioButton do not declare OnPaint and ButtonBase does and based on what I have been able to gleam from the methods that are declared, my guess is that ButtonBase provides methods for how a generic button has to be drawn and CheckBox and RadioButton just override the functions that are necessary to obtain the look that they need. This would make sense if there was a lot of potential duplicated code among the three classes. -Scott -----Original Message----- From: Mark Gimelfarb [mailto:mark@dawebber.com]=20 Sent: Tuesday, August 12, 2003 1:19 PM To: Aleksey Ryabchuk Subject: RE: [Mono-winforms-list] button implmentation Hello, all! I would like to play devil's advocate here (no pun intended), so I looked at MS's recommendation in MSDN on drawing owner-drawn controls. We'll have to assume that Button is in fact an owner-drawn control, rather than an inherited control, based on its placement in the inheritance hierarchy. Control->ButtonBase->Button. According to this: http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/cpguid= e /h tml/cpconrenderingwindowsformscontrol.asp "A control must provide rendering logic by overriding the OnPaint method that it inherits from Control. OnPaint gets access to a graphics object and a rectangle to draw in through the Graphics and the ClipRectangle properties of the PaintEventArgs instance passed to it. protected virtual void OnPaint(PaintEventArgs pe); The OnPaint method of the base Control class does not implement any drawing functionality but merely invokes the event delegates that are registered with the Paint event. When you override OnPaint, you should typically invoke the OnPaint method of the base class so that registered delegates receive the Paint event. However, controls that paint their entire surface should not invoke the base class's OnPaint, as this introduces flicker. " So, it seems that MS tells us not to use their own Win32 API to create owner- drawn controls (even though I can't prove or state that MS necessarily follows their own preachings), but to use GDI+ facilities to do the drawing of the=20 control.=20 Maybe it will be easier to implement our own control drawing routines, in order=20 to be: a) compatible with MS b) more platform (and P/Invoke) independent. Just some thoughts on the topic. Regards, Mark. -----Original Message----- From: mono-winforms-list-admin@lists.ximian.com [mailto:mono-winforms-list-admin@lists.ximian.com] On Behalf Of Aleksey Ryabchuk Sent: Tuesday, August 12, 2003 3:26 AM To: mono-winforms-list@lists.ximian.com Subject: RE: [Mono-winforms-list] button implmentation Hello, I agree that we should delegate as much work as possible to Wine. But all button controls ( Button, CheckBox, RadioButton) in SWF have to be ownerdrawn, because they implement a number of properties not supported by Win API. For example, TextAlignment can only be left, center or right in WinAPI, while in SWF it can be TopLeft or RightBottom etc. The same is for Label control. Another problem is that the patched version of Wine is not able to draw some controls at all. CheckBox, RadioButton and ComboBox are among them.=20 Regards Aleksey --- Dennis Hayes wrote: >=20 > Just thought I'd poke my head in on this and point > out that the Windows > implementations usually don't actually draw > themselves. They simply wrap up > a win32 HWND and allow the system to draw the > control. >=20 > This is what we should do as well. That is why we > use Wine. > Dennis >=20 >=20 >=20 >=20 > -----Original Message----- > From: Jonathan Gilbert > [mailto:2a5gjx302@sneakemail.com]=20 > Sent: Tuesday, August 12, 2003 2:41 AM > To: mono-winforms-list@lists.ximian.com > Subject: RE: [Mono-winforms-list] button > implmentation >=20 > Just thought I'd poke my head in on this and point > out that the Windows > implementations usually don't actually draw > themselves. They simply wrap up > a win32 HWND and allow the system to draw the > control. >=20 > The other thing to point out is that Microsoft codes > in this pattern: >=20 > public event PaintEventHandler Paint; >=20 > protected void OnPaint(PaintEventArgs e) > { > if (Paint !=3D null) > Paint(this, e); > } >=20 > Therefore, it is likely that a subclass would hook > the 'Paint' event > instead of overriding the 'OnPaint' method. >=20 > Jonathan >=20 > At 11:09 AM 11/08/2003 -0700, you wrote: > >OK let's leave it where it is for the time being. > >Actually I am wrong twice; the spec says OnPaint > for Button is inherited > >from control. > >How can control handle OnPaint for Button? > >Am I missing something here? > >Anyway, there are several thousand signature errors > for me to fix before I > >come back to this one. > >Dennis > > > >-----Original Message----- > >From: Aleksey Ryabchuk [mailto:ryabchuk@yahoo.com]=20 > >Sent: Monday, August 11, 2003 7:11 AM > >To: mono-winforms-list@lists.ximian.com > >Subject: Re: [Mono-winforms-list] button > implmentation > > > >Hello, > > > >May be from technical point of view there is no > >difference where this code is located . But it can > be > >wrong logically, because this code is not common > for > >all button controls. > > > >Aleksey > > > >--- Dennis Hayes wrote: > >> Button.cs implments OnPaint. > >> The spec says this should be in ButtonBase.cs. > >> ButtonBase is just > >> base.OnPaint (pevent) > >> There is a lot of implmentation in button.cs > >> =20 > >> * > >> It looks like just replacing the ButtonBase > OnPaint > >> with the Button OnPaint, and removing the OnPaint > >> from Button.cs would be the correct option. > >> * > >> Can someone do this and verify that is does not > >> break any of the test? > >> Thanks, > >> Dennis _______________________________________________ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list From akhilesh_agarwal@msn.com Wed Aug 13 16:25:51 2003 From: akhilesh_agarwal@msn.com (Akhilesh Agarwal) Date: Wed, 13 Aug 2003 20:55:51 +0530 Subject: [Mono-winforms-list] button implmentation Message-ID: <04972E71C5A3BB4CB66DB700853A404001DFC6@server.nd.adityainternational.com> Hello, >> So, it seems that MS tells us not to use their own Win32 API to create >> owner-drawn controls (even though I can't prove or state that MS >> necessarily follows their own preachings), but to use GDI+ facilities to >> do the drawing of the control.=20 >From what I know, there is a property called Flatstyle on Button and some other controls.=20 System: Use the operating system to draw the control (I believe this means use of P/Invoke because on Windows XP themes are enabled only by using this setting). Standard (which is the default setting): .NET draws the control on its own. XP themes are also not enabled in this case. Akhilesh Agarwal From brian.takita@runbox.com Fri Aug 15 22:11:46 2003 From: brian.takita@runbox.com (Brian Takita) Date: Fri, 15 Aug 2003 14:11:46 -0700 Subject: [Mono-winforms-list] DataSource Property for Windows.Forms.ListControl Message-ID: <3F3D4C92.2030502@runbox.com> Hello, I'm creating a custom control that uses the DataSource property. I'm interested in contributing it to the Mono project for the Windows.Forms.ListControl Where do I go from here? Thank You, Brian Takita From brian.takita@runbox.com Mon Aug 18 21:19:05 2003 From: brian.takita@runbox.com (Brian Takita) Date: Mon, 18 Aug 2003 13:19:05 -0700 Subject: [Mono-winforms-list] DataSource Property for Windows.Forms.Li stControl In-Reply-To: <6A5462649507D7119DE00090271EC70B8D324B@RHQPDC0> References: <6A5462649507D7119DE00090271EC70B8D324B@RHQPDC0> Message-ID: <3F4134B9.5000003@runbox.com> Dennis, Thank you for the intro to develop for Mono. I asked the microsoft.public.dotnet.framework.csharp newsgroup about how to implement it in the thread "How come nobody responds to Implementing DataSource Request??". The list of tasks I got are: - DataSources should implement the IList interface. - If a DataView is passed in, then use that. - In the case of a DataTable, you should use the DefaultView property of that table to get the view. - Once you have your source, you can iterate through the list of items and display them, using reflection to get the value of the property to display. If the item returned in the list implements the ICustomTypeDescriptor interface, use that. They seem reasonable to me. I would have to add support for a DataSet as the DataSource property and the DataMember property to point to the correct DataTable. I think this covers most of the functionality of the DataSource property. Unfortunately, its a sizeable black box, so some reverse engineering is probably needed. What do you think? Brian Takita Dennis Hayes wrote: >Great! >If you have not done so already, install a tarball (the version 0.26 just >released, or a nightly snapshot) these include binaries to kick start >development. When you get that to compile, do an anonymous checkout from cvs >and get that to compile. >After that, start adding you new code. >Post changes to the email list and get them oked. Make sure someone checks >them in to cvs. After a few checkins, we can get you a real cvs account. >No one is working on ListControl right now. > >Do you have a plan on how to implement the DataSource function? >Dennis > > >-----Original Message----- >From: Brian Takita [mailto:brian.takita@runbox.com] >Sent: Friday, August 15, 2003 2:12 PM >To: mono-winforms-list@lists.ximian.com >Subject: [Mono-winforms-list] DataSource Property for >Windows.Forms.ListControl > >Hello, > >I'm creating a custom control that uses the DataSource property. > >I'm interested in contributing it to the Mono project for the >Windows.Forms.ListControl > >Where do I go from here? > >Thank You, >Brian Takita > >_______________________________________________ >Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com >http://lists.ximian.com/mailman/listinfo/mono-winforms-list > > > > From brian.takita@runbox.com Thu Aug 21 09:12:14 2003 From: brian.takita@runbox.com (Brian Takita) Date: Thu, 21 Aug 2003 01:12:14 -0700 Subject: [Mono-winforms-list] DataSource Property for Windows.Forms.Li stControl In-Reply-To: <20030819001401.37005.qmail@web80511.mail.yahoo.com> References: <20030819001401.37005.qmail@web80511.mail.yahoo.com> Message-ID: <3F447EDE.9080507@runbox.com> This is a multi-part message in MIME format. --------------090500060703000705050205 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, I added the code for the DataSource property. I have done some reverse engineering work on the ComboBox and have a good idea of how the DataSource works with it. I don't know where to add it in ComboBox.cs however. Can you give me an overview on how the control works? For ListBox, do I add the fill code in OnCreateControl? Brian Dennis Hayes wrote: > Sounds like you know what you are doing. > Go for it. > Many controls use this functionality. > You might check (ask on the list) to see if there is anything in the > other classes that you can use. > If not, you might want to do the implmentation for some of the other > classes as well. > > Welcome aboard. > When you have code to checkin, post to the list and send me a copy. > If I have time to lookit over and check it in, I will. Otherwise > someone from the list can do it. > Dennis > > > */Brian Takita /* wrote: > > Dennis, > > Thank you for the intro to develop for Mono. > > I asked the microsoft.public.dotnet.framework.csharp newsgroup > about how > to implement it in the thread > "How come nobody responds to Implementing DataSource Request??". > > The list of tasks I got are: > > - DataSources should implement the IList interface. > - If a DataView is passed in, then use that. > - In the case of a DataTable, you should use the DefaultView > property of > that table to get the view. > - Once you have your source, you can iterate through the list of > items and > display them, using reflection to get the value of the property to > display. > If the item returned in the list implements the ICustomTypeDescriptor > interface, use that. > > They seem reasonable to me. I would have to add support for a > DataSet as > the DataSource property and the DataMember property to point to the > correct DataTable. > > I think this covers most of the functionality of the DataSource > property. Unfortunately, its a sizeable black box, so some reverse > engineering is probably needed. > What do you think? > > Brian Takita > > Dennis Hayes wrote: > > >Great! > >If you have not done so already, install a tarball (the version > 0.26 just > >released, or a nightly snapshot) these include binaries to kick start > >development. When you get that to compile, do an anonymous > checkout from cvs > >and get that to compile. > >After that, start adding you new code. > >Post changes to the email list and get them oked. Make sure > someone checks > >them in to cvs. After a few checkins, we can get you a real cvs > account. > >No one is working on ListControl right now. > > > >Do you have a plan on how to implement the DataSource function? > >Dennis > > > > > >-----Original Message----- > >From: Brian Takita [mailto:brian.takita@runbox.com] > >Sent: Friday, August 15, 2003 2:12 PM > >To: mono-winforms-list@lists.ximian.com > >Subject: [Mono-winforms-list] DataSource Property for > >Windows.Forms.ListControl > > > >Hello, > > > >I'm creating a custom control that uses the DataSource property. > > > >I'm interested in contributing it to the Mono project for the > >Windows.Forms.ListControl > > > >Where do I go from here? > > > >Thank You, > >Brian Takita > > > >_______________________________________________ > >Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com > >http://lists.ximian.com/mailman/listinfo/mono-winforms-list > > > > > > > > > > ------------------------------------------------------------------------ > Do you Yahoo!? > Yahoo! SiteBuilder > - > Free, easy-to-use web site design software --------------090500060703000705050205 Content-Type: text/plain; name="ListControl.cs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ListControl.cs" // // System.Windows.Forms.ListControl.cs // // Author: // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu) // Dennis Hayes (dennish@raytek.com) // (C) 2002/3 Ximian, Inc // using System; using System.Drawing; using System.Collections; using System.Reflection; namespace System.Windows.Forms { // // // public abstract class ListControl : Control { protected string DisplayMember_ = String.Empty; private object _dataSource; //ControlStyles controlStyles; // // --- Public Properties // [MonoTODO] public object DataSource { get { return _dataSource; } set { if(_dataSource != value) { if((value is IList) || (value is IListSource)) { _dataSource = value; OnDataSourceChanged(new EventArgs()); } else { throw new Exception("Complex DataBinding accepts as a data source either an IList or an IListSource"); } } } } [MonoTODO] public string DisplayMember { get { return DisplayMember_; } set { if( DisplayMember_ != value) { DisplayMember_ = value; OnDisplayMemberChanged(new EventArgs()); } } } internal string getDisplayMemberOfObj( object obj) { string objectString = String.Empty; Type t = obj.GetType(); if( DisplayMember != String.Empty) { if( t != null) { PropertyInfo prop = t.GetProperty(DisplayMember); if( prop != null) { objectString = prop.GetValue(obj, null).ToString(); } } } if( objectString == String.Empty) { objectString = obj.ToString(); } return objectString; } internal class ListControlComparer : IComparer { private ListControl owner_ = null; public ListControlComparer(ListControl owner) { owner_ = owner; } public int Compare(object x, object y) { return owner_.getDisplayMemberOfObj(x).CompareTo(owner_.getDisplayMemberOfObj(y)); } } [MonoTODO] public abstract int SelectedIndex {get;set;} [MonoTODO] public object SelectedValue { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public string ValueMember { get { throw new NotImplementedException (); } set { //FIXME: } } // // --- Public Methods // [MonoTODO] public string GetItemText(object item) { throw new NotImplementedException (); } // // --- Public Events // [MonoTODO] public event EventHandler DataSourceChanged; [MonoTODO] public event EventHandler DisplayMemberChanged; // // --- Protected Constructor // [MonoTODO] protected ListControl() { } // // --- Protected Properties // [MonoTODO] protected CurrencyManager DataManager { get { throw new NotImplementedException (); } } // // --- Protected Methods // [MonoTODO] protected override bool IsInputKey(Keys keyData) { //FIXME: return base.IsInputKey(keyData); } [MonoTODO] protected virtual void OnDataSourceChanged(EventArgs e) { //FIXME: } [MonoTODO] protected virtual void OnDisplayMemberChanged(EventArgs e) { //FIXME: } [MonoTODO] protected virtual void OnSelectedIndexChanged(EventArgs e) { //FIXME: } [MonoTODO] protected virtual void OnSelectedValueChanged(EventArgs e){ //FIXME: } public event EventHandler SelectedValueChanged; public event EventHandler ValueMemberChanged; [MonoTODO] protected override void OnBindingContextChanged(EventArgs e) { //FIXME: base.OnBindingContextChanged(e); } [MonoTODO] protected abstract void RefreshItem(int index); } } --------------090500060703000705050205-- From brian.takita@runbox.com Thu Aug 21 21:15:31 2003 From: brian.takita@runbox.com (Brian Takita) Date: Thu, 21 Aug 2003 13:15:31 -0700 Subject: [Mono-winforms-list] Moving Items property into ListControl In-Reply-To: <20030819001401.37005.qmail@web80511.mail.yahoo.com> References: <20030819001401.37005.qmail@web80511.mail.yahoo.com> Message-ID: <3F452863.5020803@runbox.com> This is a multi-part message in MIME format. --------------050009000608010902000000 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Dennis, I made a revision to the ListControl. I made the DataSource virtual so the ComboBox and ListBox can override the DataSource. When a DataSource is added, we can fill the Items_ ObjectCollection and set an internal flag to not accept any inputs from Items.Add(). When DataSource is set to null, the internal flag will be set to accept inputs from Items.Add(). How does this sound? Brian --------------050009000608010902000000 Content-Type: text/plain; name="ListControl.cs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ListControl.cs" // // System.Windows.Forms.ListControl.cs // // Author: // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu) // Dennis Hayes (dennish@raytek.com) // Brian Takita (brian.takita@runbox.com) // (C) 2002/3 Ximian, Inc // using System; using System.Drawing; using System.Collections; using System.Reflection; namespace System.Windows.Forms { // // // public abstract class ListControl : Control { protected string DisplayMember_ = String.Empty; protected object DataSource_; //ControlStyles controlStyles; // // --- Public Properties // [MonoTODO] public virtual object DataSource { get { return DataSource_; } set { if(DataSource_ != value) { if((value is IList) || (value is IListSource)) { DataSource_ = value; OnDataSourceChanged(new EventArgs()); } else { throw new Exception("Complex DataBinding accepts as a data source either an IList or an IListSource"); } } } } [MonoTODO] public string DisplayMember { get { return DisplayMember_; } set { if( DisplayMember_ != value) { DisplayMember_ = value; OnDisplayMemberChanged(new EventArgs()); } } } internal string getDisplayMemberOfObj( object obj) { string objectString = String.Empty; Type t = obj.GetType(); if( DisplayMember != String.Empty) { if( t != null) { PropertyInfo prop = t.GetProperty(DisplayMember); if( prop != null) { objectString = prop.GetValue(obj, null).ToString(); } } } if( objectString == String.Empty) { objectString = obj.ToString(); } return objectString; } internal class ListControlComparer : IComparer { private ListControl owner_ = null; public ListControlComparer(ListControl owner) { owner_ = owner; } public int Compare(object x, object y) { return owner_.getDisplayMemberOfObj(x).CompareTo(owner_.getDisplayMemberOfObj(y)); } } [MonoTODO] public abstract int SelectedIndex {get;set;} [MonoTODO] public object SelectedValue { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public string ValueMember { get { throw new NotImplementedException (); } set { //FIXME: } } // // --- Public Methods // [MonoTODO] public string GetItemText(object item) { throw new NotImplementedException (); } // // --- Public Events // [MonoTODO] public event EventHandler DataSourceChanged; [MonoTODO] public event EventHandler DisplayMemberChanged; // // --- Protected Constructor // [MonoTODO] protected ListControl() { } // // --- Protected Properties // [MonoTODO] protected CurrencyManager DataManager { get { throw new NotImplementedException (); } } // // --- Protected Methods // [MonoTODO] protected override bool IsInputKey(Keys keyData) { //FIXME: return base.IsInputKey(keyData); } [MonoTODO] protected virtual void OnDataSourceChanged(EventArgs e) { //FIXME: } [MonoTODO] protected virtual void OnDisplayMemberChanged(EventArgs e) { //FIXME: } [MonoTODO] protected virtual void OnSelectedIndexChanged(EventArgs e) { //FIXME: } [MonoTODO] protected virtual void OnSelectedValueChanged(EventArgs e){ //FIXME: } public event EventHandler SelectedValueChanged; public event EventHandler ValueMemberChanged; [MonoTODO] protected override void OnBindingContextChanged(EventArgs e) { //FIXME: base.OnBindingContextChanged(e); } [MonoTODO] protected abstract void RefreshItem(int index); } } --------------050009000608010902000000-- From DENNISH@Raytek.com Thu Aug 21 22:25:16 2003 From: DENNISH@Raytek.com (Dennis Hayes) Date: Thu, 21 Aug 2003 14:25:16 -0700 Subject: [Mono-winforms-list] Moving Items property into ListControl Message-ID: <6A5462649507D7119DE00090271EC70B8D3338@RHQPDC0> I do not know enough about this to say, except: 1) Yes, mark the flag as internal, since it is implementation, not part of the spec. 2) Instead of using a flag, could you just check to see if the datasouce is null? Dennis -----Original Message----- From: Brian Takita [mailto:brian.takita@runbox.com] Sent: Thursday, August 21, 2003 1:16 PM To: Dennis Hayes Cc: mono-winforms-list@lists.ximian.com Subject: [Mono-winforms-list] Moving Items property into ListControl Dennis, I made a revision to the ListControl. I made the DataSource virtual so the ComboBox and ListBox can override the DataSource. When a DataSource is added, we can fill the Items_ ObjectCollection and set an internal flag to not accept any inputs from Items.Add(). When DataSource is set to null, the internal flag will be set to accept inputs from Items.Add(). How does this sound? Brian From brian.takita@runbox.com Thu Aug 21 23:12:18 2003 From: brian.takita@runbox.com (Brian Takita) Date: Thu, 21 Aug 2003 15:12:18 -0700 Subject: [Mono-winforms-list] Building Errors Using Visual Studio Message-ID: <3F4543C2.1000904@runbox.com> Hello, I tried building Windows.Forms using Visual Studio. However I got a bunch of errors. Most of them are about Properties, Methods, etc. requiring the new keyword. Is this something that is already fixed? If not, should I try to fix this to get it to compile? Should I posts the changes? Sincerely, Brian Takita From duncan@ximian.com Fri Aug 22 05:45:07 2003 From: duncan@ximian.com (Duncan Mak) Date: Fri, 22 Aug 2003 00:45:07 -0400 Subject: [Mono-winforms-list] Moving Items property into ListControl In-Reply-To: <3F452863.5020803@runbox.com> References: <20030819001401.37005.qmail@web80511.mail.yahoo.com> <3F452863.5020803@runbox.com> Message-ID: <1061527507.4961.15.camel@diphthong> Hello Brian! On Thu, 2003-08-21 at 16:15, Brian Takita wrote: > Dennis, > > I made a revision to the ListControl. > I have just committed this patch to CVS. Some questions: > public abstract class ListControl : Control { > > protected object DataSource_; > [MonoTODO] > public virtual object DataSource { The 1.1 SDK docs list this property without the virtual keyword. Was that an MS documentation bug? > set { > if(DataSource_ != value) { > if((value is IList) || (value is IListSource)) { > DataSource_ = value; > OnDataSourceChanged(new EventArgs()); > } > else { > throw new Exception("Complex DataBinding accepts as a data source either an IList or an IListSource"); > } > } > } I made indenting changes here to make the code better conform to the Mono coding style. Also, the 1.1 SDK docs does not say the property will throw any Exceptions at all. Is that also a documentation bug? Thanks for the patch! Duncan. From brian.takita@runbox.com Fri Aug 22 09:34:59 2003 From: brian.takita@runbox.com (Brian Takita) Date: Fri, 22 Aug 2003 01:34:59 -0700 Subject: [Mono-winforms-list] Moving Items property into ListControl In-Reply-To: <1061527507.4961.15.camel@diphthong> References: <20030819001401.37005.qmail@web80511.mail.yahoo.com> <3F452863.5020803@runbox.com> <1061527507.4961.15.camel@diphthong> Message-ID: <3F45D5B3.7060008@runbox.com> This is a multi-part message in MIME format. --------------040309000602080703000000 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello Duncan, Here is the revised ListControl class. I took a better look at the ListControl, and found the following... >> public abstract class ListControl : Control { >> >> protected object DataSource_; >> [MonoTODO] >> public virtual object DataSource { >> >> DataSource_ and DisplayMember_ should be private. >The 1.1 SDK docs list this property without the virtual keyword. Was >that an MS documentation bug? > > DataSource is not virtual in ListControl. > > >>set { >> if(DataSource_ != value) { >> if((value is IList) || (value is IListSource)) { >> DataSource_ = value; >> OnDataSourceChanged(new EventArgs()); >> } >> else { >> throw new Exception("Complex DataBinding accepts as a data source either an IList or an IListSource"); >> } >> } >>} >> >> > >I made indenting changes here to make the code better conform to the >Mono coding style. Also, the 1.1 SDK docs does not say the property will >throw any Exceptions at all. Is that also a documentation bug? > > This is a documentation bug. I got an exception when DataSource was not set to an IList or an IListSource object. The exception message was taken verbatim from MS's exception. Should I rewrite a new exception message to avoid plagerism? Also, where are the docs on coding standards? >Thanks for the patch! > >Duncan. > Glad to help. I'm learning alot about .NET already. Thanks for the feedback!! Brian >_______________________________________________ >Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com >http://lists.ximian.com/mailman/listinfo/mono-winforms-list > > > > --------------040309000602080703000000 Content-Type: text/plain; name="ListControl.cs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ListControl.cs" // // System.Windows.Forms.ListControl.cs // // Author: // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu) // Dennis Hayes (dennish@raytek.com) // Brian Takita (brian.takita@runbox.com) // (C) 2002/3 Ximian, Inc // using System; using System.Drawing; using System.Collections; using System.Reflection; namespace System.Windows.Forms { // // // public abstract class ListControl : Control { private string DisplayMember_ = String.Empty; private object DataSource_; //ControlStyles controlStyles; // // --- Public Properties // [MonoTODO] public object DataSource { get { return DataSource_; } set { if(DataSource_ != value) { if((value is IList) || (value is IListSource)) { DataSource_ = value; OnDataSourceChanged(new EventArgs()); } else { throw new Exception("Complex DataBinding accepts as a data source either an IList or an IListSource"); } } } } [MonoTODO] public string DisplayMember { get { return DisplayMember_; } set { if( DisplayMember_ != value) { DisplayMember_ = value; OnDisplayMemberChanged(new EventArgs()); } } } internal string getDisplayMemberOfObj( object obj) { string objectString = String.Empty; Type t = obj.GetType(); if( DisplayMember != String.Empty) { if( t != null) { PropertyInfo prop = t.GetProperty(DisplayMember); if( prop != null) { objectString = prop.GetValue(obj, null).ToString(); } } } if( objectString == String.Empty) { objectString = obj.ToString(); } return objectString; } internal class ListControlComparer : IComparer { private ListControl owner_ = null; public ListControlComparer(ListControl owner) { owner_ = owner; } public int Compare(object x, object y) { return owner_.getDisplayMemberOfObj(x).CompareTo(owner_.getDisplayMemberOfObj(y)); } } [MonoTODO] public abstract int SelectedIndex {get;set;} [MonoTODO] public object SelectedValue { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public string ValueMember { get { throw new NotImplementedException (); } set { //FIXME: } } // // --- Public Methods // [MonoTODO] public string GetItemText(object item) { throw new NotImplementedException (); } // // --- Public Events // [MonoTODO] public event EventHandler DataSourceChanged; [MonoTODO] public event EventHandler DisplayMemberChanged; // // --- Protected Constructor // [MonoTODO] protected ListControl() { } // // --- Protected Properties // [MonoTODO] protected CurrencyManager DataManager { get { throw new NotImplementedException (); } } // // --- Protected Methods // [MonoTODO] protected override bool IsInputKey(Keys keyData) { //FIXME: return base.IsInputKey(keyData); } [MonoTODO] protected virtual void OnDataSourceChanged(EventArgs e) { //FIXME: } [MonoTODO] protected virtual void OnDisplayMemberChanged(EventArgs e) { //FIXME: } [MonoTODO] protected virtual void OnSelectedIndexChanged(EventArgs e) { //FIXME: } [MonoTODO] protected virtual void OnSelectedValueChanged(EventArgs e) { //FIXME: } public event EventHandler SelectedValueChanged; public event EventHandler ValueMemberChanged; [MonoTODO] protected override void OnBindingContextChanged(EventArgs e) { //FIXME: base.OnBindingContextChanged(e); } [MonoTODO] protected abstract void RefreshItem(int index); } } --------------040309000602080703000000-- From brian.takita@runbox.com Fri Aug 22 09:46:54 2003 From: brian.takita@runbox.com (Brian Takita) Date: Fri, 22 Aug 2003 01:46:54 -0700 Subject: [Mono-winforms-list] Getting System.Windows.Forms to compile Message-ID: <3F45D87E.4080804@runbox.com> This is a multi-part message in MIME format. --------------050004090601090805090303 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, I'm trying to compile the library, but am getting a bunch of build errors. I'll go through and make changes to the errors. Starting with AxHost, I commented out public event CancelEventHandler Validating; and AccessibleObject AccessibilityObject { get { throw new NotImplementedException (); } } Brian --------------050004090601090805090303 Content-Type: text/plain; name="AxHost.cs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="AxHost.cs" // // System.Windows.Forms.AxHost // // Author: // stubbed out by Jaak Simm (jaaksimm@firm.ee) // Dennis hayes (dennish@raytek.com) // // (C) Ximian, Inc., 2002/3 // // using System; using System.ComponentModel; using System.Drawing; using System.Runtime.Serialization; namespace System.Windows.Forms { /// /// Wraps ActiveX controls and exposes them as fully featured Windows Forms controls. /// [MonoTODO] public abstract class AxHost : Control, ISupportInitialize, ICustomTypeDescriptor { /// --- Constructors --- /// Class AxHost does not have a constructor for non-internal purposes. /// Thus, no constructor is stubbed out. /// Here are the two AxHost constructors for supporting .NET Framework infrastructure: protected AxHost(string clsid){ } protected AxHost(string clsid,int flags){ } /// --- public Properties --- /// Properties supporting .NET framework, only. Not stubbed out: public bool EditMode { get { throw new NotImplementedException (); } } [MonoTODO] public override Color BackColor { get { //FIXME: return base.BackColor; } set { //FIXME: base.BackColor = value; } } [MonoTODO] public override Image BackgroundImage { get { //FIXME: return base.BackgroundImage; } set { //FIXME: base.BackgroundImage = value; } } [MonoTODO] public ContainerControl ContainingControl { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public override ContextMenu ContextMenu { get { //FIXME: return base.ContextMenu; } set { //FIXME: base.ContextMenu = value; } } [MonoTODO] protected override CreateParams CreateParams { get { //FIXME: return base.CreateParams; } } [MonoTODO] public override Cursor Cursor { get { //FIXME: return base.Cursor; } set { //FIXME: base.Cursor = value; } } [MonoTODO] protected override Size DefaultSize { get { //FIXME: return base.DefaultSize; } } [MonoTODO] public new virtual bool Enabled { get { //FIXME: throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public override Font Font { get { //FIXME: return base.Font; } set { //FIXME: base.Font = value; } } [MonoTODO] public override Color ForeColor { get { //FIXME: return base.ForeColor; } set { //FIXME: base.ForeColor = value; } } [MonoTODO] public bool HasAboutBox { get { throw new NotImplementedException (); } } [MonoTODO] public AxHost.State OcxState { get { //FIXME: throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] //FIXME public new virtual bool RightToLeft { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public override ISite Site { set { //FIXME: } } [MonoTODO] public override string Text { get { //FIXME: return base.Text; } set { //FIXME: base.Text = value; } } /// --- methods --- /// internal .NET framework supporting methods, not stubbed out: /// [MonoTODO] protected virtual void CreateSink(){ } [MonoTODO] protected virtual void DetachSink(){ } [MonoTODO] public void DoVerb(int verb){ } [MonoTODO] protected static Color GetColorFromOleColor(uint color){ throw new NotImplementedException (); } [MonoTODO] protected static Font GetFontFromIFont(object font){ throw new NotImplementedException (); } [MonoTODO] protected static Font GetFontFromIFontDisp(object font){ throw new NotImplementedException (); } [MonoTODO] protected static object GetIFontDispFromFont(Font font){ throw new NotImplementedException (); } [MonoTODO] protected static object GetIFontFromFont(Font font){ throw new NotImplementedException (); } [MonoTODO] protected static object GetIPictureDispFromPicture(Image image){ throw new NotImplementedException (); } [MonoTODO] protected static object GetIPictureFromCursor(Cursor cursor){ throw new NotImplementedException (); } [MonoTODO] protected static object GetIPictureFromPicture(Image image){ throw new NotImplementedException (); } [MonoTODO] protected static double GetOADateFromTime(DateTime time){ throw new NotImplementedException (); } [MonoTODO] protected static uint GetOleColorFromColor(Color color){ throw new NotImplementedException (); } [MonoTODO] protected static Image GetPictureFromIPicture(object picture){ throw new NotImplementedException (); } [MonoTODO] protected static Image GetPictureFromIPictureDisp(object picture){ throw new NotImplementedException (); } [MonoTODO] protected static DateTime GetTimeFromOADate(double date){ throw new NotImplementedException (); } [MonoTODO] public void InvokeEditMode(){ } [MonoTODO] public void MakeDirty(){ } protected bool PropsValid(){ throw new NotImplementedException (); } protected void RaiseOnMouseDown(short button,short shift,int x,int y){ } protected void RaiseOnMouseDown(short button,short shift,float x,float y){ } protected void RaiseOnMouseDown(object o1,object o2,object o3,object o4){ } protected void RaiseOnMouseMove(short button,short shift,int x,int y){ } protected void RaiseOnMouseMove(short button,short shift,float x,float y){ } protected void RaiseOnMouseMove(object o1,object o2,object o3,object o4){ } protected void RaiseOnMouseUp(short button,short shift,int x,int y){ } protected void RaiseOnMouseUp(short button,short shift,float x,float y){ } protected void RaiseOnMouseUp(object o1,object o2,object o3,object o4){ } [MonoTODO] protected virtual void AttachInterfaces() { //FIXME: } [MonoTODO] public void BeginInit() { //FIXME: } [MonoTODO] protected override void CreateHandle() { //FIXME: base.CreateHandle(); } [MonoTODO] protected override void DestroyHandle() { //FIXME: base.DestroyHandle(); } [MonoTODO] protected override void Dispose(bool disposing) { //FIXME: base.Dispose(disposing); } [MonoTODO] public virtual void EndInit() { //FIXME: } [MonoTODO] public object GetOcx() { throw new NotImplementedException (); } [MonoTODO] public bool HasPropertyPages() { throw new NotImplementedException (); } [MonoTODO] protected override bool IsInputChar(char charCode) { //FIXME: return base.IsInputChar(charCode); } /// --- methods used with events --- [MonoTODO] protected override void OnBackColorChanged(EventArgs e) { //FIXME: base.OnBackColorChanged(e); } [MonoTODO] protected override void OnFontChanged(EventArgs e) { //FIXME: base.OnFontChanged(e); } [MonoTODO] protected override void OnForeColorChanged(EventArgs e) { //FIXME: base.OnForeColorChanged(e); } [MonoTODO] protected override void OnHandleCreated(EventArgs e) { //FIXME: base.OnHandleCreated(e); } [MonoTODO] protected override void OnLostFocus(EventArgs e) { //FIXME: base.OnLostFocus(e); } /// --- END OF: methods used with events --- [MonoTODO] public override bool PreProcessMessage(ref Message msg) { //FIXME: return base.PreProcessMessage(ref msg); } [MonoTODO] protected override bool ProcessMnemonic(char charCode) { //FIXME: return base.ProcessMnemonic(charCode); } [MonoTODO] protected override bool ProcessDialogKey(Keys keyData) { // .NET V1.1 Beta //FIXME: return base.ProcessDialogKey(keyData); } [MonoTODO] protected void SetAboutBoxDelegate(AxHost.AboutBoxDelegate d) { //FIXME: } [MonoTODO] protected override void SetBoundsCore(int x,int y,int width,int height,BoundsSpecified specified) { //FIXME: base.SetBoundsCore(x,y,width,height,specified); } [MonoTODO] protected override void SetVisibleCore(bool value) { //FIXME: base.SetVisibleCore(value); } [MonoTODO] public void ShowAboutBox() { //FIXME: } [MonoTODO] public void ShowPropertyPages() { //FIXME: } [MonoTODO] public void ShowPropertyPages(Control control) { //FIXME: } [MonoTODO] protected override void WndProc(ref Message m) { //FIXME: base.WndProc(ref m); } /// --- events --- //[MonoToDo] //public event EventHandler BackColorChanged; //public new event EventHandler BackgroundImageChanged; //public new event EventHandler BindingContextChanged; //public new event UICuesEventHandler ChangeUICues; //public new event EventHandler Click; //public new event EventHandler ContextMenuChanged; //public new event EventHandler CursorChanged; //public new event EventHandler DoubleClick; //public new event DragEventHandler DragDrop; //public new event DragEventHandler DragEnter; //public new event EventHandler DragLeave; //public new event DragEventHandler DragOver; //public new event EventHandler EnabledChanged; //public new event EventHandler FontChanged; //public new event EventHandler ForeColorChanged; //public new event GiveFeedbackEventHandler GiveFeedback; //public new event HelpEventHandler HelpRequested; //public new event EventHandler ImeModeChanged; //public new event KeyEventHandler KeyDown; //public new event KeyPressEventHandler KeyPress; //public new event KeyEventHandler KeyUp; //public new event LayoutEventHandler Layout; //public new event MouseEventHandler MouseDown; //public new event EventHandler MouseEnter; //public new event EventHandler MouseHover; //public new event EventHandler MouseLeave; //public new event MouseEventHandler MouseMove; //public new event MouseEventHandler MouseUp; //public new event MouseEventHandler MouseWheel; //public new event PaintEventHandler Paint; //public new event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp; //public new event QueryContinueDragEventHandler QueryContinueDrag; //public new event EventHandler RightToLeftChanged; //public new event EventHandler StyleChanged; //public new event EventHandler TabIndexChanged; //public new event EventHandler TabStopChanged; //public new event EventHandler TextChanged; //public event CancelEventHandler Validating; /// --- public delegates --- //[Serializable] protected delegate void AboutBoxDelegate(); /// --- ICustomTypeDescriptor methods --- /// Note: all of them are supporting .NET framework, but have to be stubbed out for the interface [MonoTODO] AttributeCollection ICustomTypeDescriptor.GetAttributes() { throw new NotImplementedException (); } [MonoTODO] string ICustomTypeDescriptor.GetClassName() { //FIXME: return ""; } [MonoTODO] string ICustomTypeDescriptor.GetComponentName() { //FIXME: return ""; } [MonoTODO] TypeConverter ICustomTypeDescriptor.GetConverter() { throw new NotImplementedException (); } [MonoTODO] EventDescriptor ICustomTypeDescriptor.GetDefaultEvent() { throw new NotImplementedException (); } [MonoTODO] PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty() { throw new NotImplementedException (); } [MonoTODO] object ICustomTypeDescriptor.GetEditor(Type editorBaseType) { throw new NotImplementedException (); } [MonoTODO] EventDescriptorCollection ICustomTypeDescriptor.GetEvents() { throw new NotImplementedException (); } [MonoTODO] EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes) { throw new NotImplementedException (); } [MonoTODO] PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties() { throw new NotImplementedException (); } [MonoTODO] PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes) { throw new NotImplementedException (); } [MonoTODO] object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd) { throw new NotImplementedException (); } /// sub-class: AxHost.InvalidActiveXStateException /// /// The exception that is thrown when the ActiveX control is referenced while in an invalid state. /// [MonoTODO] public class InvalidActiveXStateException : Exception { } /// sub-class: AxHost.State /// /// Encapsulates the persisted state of an ActiveX control. /// /// Note: the class does not contain any documented methods, just only those supporting .NET framework /// [MonoTODO] [Serializable] public class State : ISerializable { /// The classes only constructor is supporting .NET framework, and thus not stubbed out: /// - [Serializable] public AxHost.State(Stream ms,int storageType,bool manualUpdate,string licKey); /// --- Methods --- //[Serializable] void ISerializable.GetObjectData(SerializationInfo si,StreamingContext context) { throw new NotImplementedException (); } } /* AccessibleObject AccessibilityObject { get { throw new NotImplementedException (); } } */ //protected bool RenderRightToLeft{ //} public enum ActiveXInvokeKind { MethodInvoke = 0, PropertyGet = 1, PropertySet = 2 } public class AxComponentEditor { } public class ConnectionPointCookie { } public class StateConverter : System.ComponentModel.TypeConverter { } [AttributeUsage(AttributeTargets.Class)] public sealed class ClsidAttribute : Attribute{ } [AttributeUsage(AttributeTargets.Assembly)] public sealed class TypeLibraryTimeStampAtribute : Attribute{ } } } --------------050004090601090805090303-- From brian.takita@runbox.com Fri Aug 22 09:51:35 2003 From: brian.takita@runbox.com (Brian Takita) Date: Fri, 22 Aug 2003 01:51:35 -0700 Subject: [Mono-winforms-list] CheckBox Message-ID: <3F45D997.1090807@runbox.com> This is a multi-part message in MIME format. --------------060106030607000004070203 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit OnPaintBackground should be inherited from Control. --------------060106030607000004070203 Content-Type: text/plain; name="CheckBox.cs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="CheckBox.cs" // // System.Windows.Forms.CheckBox.cs // // Author: // stubbed out by Jaak Simm (jaaksimm@firm.ee) // Dennis Hayes (dennish@Raytek.com) // // (C) Ximian, Inc., 2002 // using System.Drawing; namespace System.Windows.Forms { /// /// Represents a Windows check box. /// [MonoTODO] public class CheckBox : ButtonBase { // private fields Appearance appearance; bool autoCheck; ContentAlignment checkAlign; bool _checked; CheckState checkState; bool threeState; ContentAlignment textAlign; // --- Constructor --- public CheckBox() : base() { appearance = Appearance.Normal; autoCheck = true; checkAlign = ContentAlignment.MiddleLeft; _checked = false; checkState = CheckState.Unchecked; threeState = false; textAlign = ContentAlignment.MiddleCenter; SubClassWndProc_ = true; SetStyle (ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); callWinControlProcMask &= ~(CallWinControlProcMask.MOUSE_MESSAGES | CallWinControlProcMask.KEYBOARD_MESSAGES); } // --- CheckBox Properties --- public Appearance Appearance { get { return appearance; } set { appearance=value; } } public bool AutoCheck { get { return autoCheck; } set { autoCheck = value; } } public ContentAlignment CheckAlign { get { return checkAlign; } set { checkAlign=value; } } public bool Checked { get { return _checked; } set { if( _checked != value) { CheckState = (value) ? CheckState.Checked : CheckState.Unchecked; } } } public CheckState CheckState { get { return checkState; } set { if( checkState != value) { checkState = value; bool oldChecked = _checked; if( checkState == CheckState.Unchecked) { _checked = false; } else { _checked = true; } if( oldChecked != _checked) { OnCheckedChanged(new EventArgs()); } OnCheckStateChanged(new EventArgs()); } } } [MonoTODO] protected override CreateParams CreateParams { get { CreateParams createParams = base.CreateParams; createParams.ClassName = "BUTTON"; createParams.Style = (int) ( (int)WindowStyles.WS_CHILD | (int)WindowStyles.WS_VISIBLE | (int)ButtonStyles.BS_CHECKBOX | (int)WindowStyles.WS_CLIPSIBLINGS | (int)SS_Static_Control_Types.SS_LEFT ); if( autoCheck) { createParams.Style |= (int)ButtonStyles.BS_AUTOCHECKBOX; } //createParams.Style |= (int) ButtonStyles.BS_OWNERDRAW; return createParams; } } [MonoTODO] protected override Size DefaultSize { get { return new Size(100,20); } } [MonoTODO] public override ContentAlignment TextAlign { get { return textAlign; } set { textAlign = value; } } public bool ThreeState { get { return threeState; } set { threeState = value; } } // --- CheckBox methods --- // I do not think this is part of the spec //protected override AccessibleObject CreateAccessibilityInstance() //{ // throw new NotImplementedException (); //} // [event methods] [MonoTODO] protected virtual void OnAppearanceChanged(EventArgs e) { //FIXME: } [MonoTODO] protected virtual void OnCheckedChanged(EventArgs e) { //FIXME: if(CheckedChanged != null) { CheckedChanged( this, e); } } [MonoTODO] protected virtual void OnCheckStateChanged(EventArgs e) { //FIXME: if(CheckStateChanged != null) { CheckStateChanged( this, e); } } [MonoTODO] protected override void OnClick(EventArgs e) { CheckState = (CheckState)Win32.SendMessage(Handle, (int)ButtonMessages.BM_GETCHECK, 0, 0); base.OnClick(e); } [MonoTODO] protected override void OnHandleCreated(EventArgs e) { //FIXME: base.OnHandleCreated(e); Win32.SendMessage(Handle, (int)ButtonMessages.BM_SETCHECK, (int)checkState, 0); } protected override void OnMouseDown (MouseEventArgs e) { base.OnMouseDown (e); } [MonoTODO] protected override void OnMouseUp(MouseEventArgs e) { if (ThreeState) { switch (CheckState) { case CheckState.Unchecked: CheckState = CheckState.Checked; break; case CheckState.Indeterminate: CheckState = CheckState.Unchecked; break; case CheckState.Checked: CheckState = CheckState.Indeterminate; break; } } else { Checked = Checked ? false : true; } Invalidate (); base.OnMouseUp(e); } // end of [event methods] [MonoTODO] protected override bool ProcessMnemonic(char charCode) { //FIXME: return base.ProcessMnemonic(charCode); } [MonoTODO] //FIXME: do a better tostring public override string ToString() { if(Checked){ return "CheckBox" + " Checked"; } else{ return "CheckBox" + " Unchecked"; } } /* protected virtual void OnPaintBackground (PaintEventArgs e) { // just do nothing to avoid flickering } */ protected override void OnPaint (PaintEventArgs e) { Rectangle paintBounds = ClientRectangle; Bitmap bmp = new Bitmap( paintBounds.Width, paintBounds.Height,e.Graphics); Graphics paintOn = Graphics.FromImage(bmp); SolidBrush sb = new SolidBrush (BackColor); paintOn.FillRectangle (sb, paintBounds); sb.Dispose (); // FIXME: Width/Heigth of checkmark are not correct Rectangle checkRect = new Rectangle(paintBounds.Left,paintBounds.Top,12,12); Rectangle textRect = new Rectangle( checkRect.Right,paintBounds.Top,paintBounds.Width - checkRect.Width - 1,paintBounds.Height); paintOn.DrawString(Text, Font, SystemBrushes.ControlText, textRect.X, textRect.Y); ButtonState state = ButtonState.Normal; if (FlatStyle == FlatStyle.Flat) { state |= ButtonState.Flat; } if (Checked) { state |= ButtonState.Checked; } if (ThreeState && CheckState == CheckState.Indeterminate) { state |= ButtonState.Pushed; } ControlPaint.DrawCheckBox (paintOn, checkRect, state); if (Focused) { ControlPaint.DrawFocusRectangle (paintOn, textRect); } e.Graphics.DrawImage(bmp, 0, 0, paintBounds.Width, paintBounds.Height); paintOn.Dispose (); bmp.Dispose(); } protected override void WndProc (ref Message m) { switch (m.Msg) { case Msg.WM_DRAWITEM: { m.Result = (IntPtr)1; } break; default: base.WndProc (ref m); break; } } /// --- CheckBox events --- public event EventHandler AppearanceChanged; public event EventHandler CheckedChanged; public event EventHandler CheckStateChanged; /// --- public class CheckBox.CheckBoxAccessibleObject : ButtonBase.ButtonBaseAccessibleObject --- /// the class is not stubbed, cause it's only used for .NET framework } } --------------060106030607000004070203-- From brian.takita@runbox.com Fri Aug 22 09:55:53 2003 From: brian.takita@runbox.com (Brian Takita) Date: Fri, 22 Aug 2003 01:55:53 -0700 Subject: [Mono-winforms-list] CheckedListBox Message-ID: <3F45DA99.90200@runbox.com> This is a multi-part message in MIME format. --------------010001000809050905080402 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Items has a new keyword. CheckedListBox.ObjectCollection class has new keyword. --------------010001000809050905080402 Content-Type: text/plain; name="CheckedListBox.cs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="CheckedListBox.cs" // // System.Windows.Forms.CheckedListBox.cs // // Author: // stubbed out by Jaak Simm (jaaksimm@firm.ee) // Denis hayes (dennish@raytek.com) // Alexandre Pigolkine (pigolkine@gmx.de) // // (C) Ximian, Inc., 2002/3 // using System.Drawing; using System.Collections; namespace System.Windows.Forms { /// /// Displays a ListBox in which a check box is displayed to the left of each item. /// [MonoTODO] public class CheckedListBox : ListBox { // private fields private bool checkOnClick; private bool threeDCheckBoxes; private CheckedListBox.CheckedIndexCollection CheckedIndices_ = null; private CheckedListBox.CheckedItemCollection CheckedItems_ = null; // --- Constructor --- public CheckedListBox() : base() { checkOnClick = false; threeDCheckBoxes = true; DrawMode_ = DrawMode.Normal; } internal override void OnObjectCollectionChanged() { CheckedIndices_ = null; CheckedItems_ = null; base.OnObjectCollectionChanged(); } // --- CheckedListBox Properties --- [MonoTODO] public CheckedListBox.CheckedIndexCollection CheckedIndices { get { if( CheckedIndices_ == null) { CheckedIndices_ = new CheckedListBox.CheckedIndexCollection(this); } return CheckedIndices_; } } [MonoTODO] public CheckedListBox.CheckedItemCollection CheckedItems { get { if( CheckedItems_ == null) { CheckedItems_ = new CheckedListBox.CheckedItemCollection(this); } return CheckedItems_; } } public bool CheckOnClick { get { return checkOnClick; } set { checkOnClick = value; } } [MonoTODO] protected override CreateParams CreateParams { get { CreateParams createParams = base.CreateParams; // set ownerDraw flag to be able to paint check-boxes createParams.Style |= (int)ListBoxStyles.LBS_OWNERDRAWFIXED; return createParams; } } [MonoTODO] public override DrawMode DrawMode { get { return DrawMode.Normal; } set { // always DrawMode.Normal } } [MonoTODO] public override int ItemHeight { get { //FIXME return base.ItemHeight; } set { //FIXME base.ItemHeight = value; } } [MonoTODO] public new CheckedListBox.ObjectCollection Items { get { return (CheckedListBox.ObjectCollection)base.Items; } } [MonoTODO] public new object DataSource { // .NET V1.1 Beta. needs implmented get { return base.DataSource; } set { base.DataSource = value; } } [MonoTODO] public new string DisplayMember { // .NET V1.1 Beta. needs implmented get { return base.DisplayMember; } set { base.DisplayMember = value; } } [MonoTODO] public new string ValueMember { // .NET V1.1 Beta. needs implmented get { return base.DisplayMember; } set { base.DisplayMember = value; } } public override SelectionMode SelectionMode { set { if (value!=SelectionMode.One && value!=SelectionMode.None) throw new ArgumentException(); base.SelectionMode=value; } } public bool ThreeDCheckBoxes { get { return threeDCheckBoxes; } set { if( threeDCheckBoxes != value) { threeDCheckBoxes = value; Invalidate(); } } } // --- CheckedListBox methods --- // following methods were not stubbed out, because they only support .NET framework: // - protected virtual void OnItemCheck(ItemCheckEventArgs ice) // - protected override void WmReflectCommand(ref Message m) // I do not think this is part of the spec. //protected override AccessibleObject CreateAccessibilityInstance() //{ // throw new NotImplementedException (); //} [MonoTODO] protected override ListBox.ObjectCollection CreateItemCollection() { return (ListBox.ObjectCollection)(new CheckedListBox.ObjectCollection( this)); } [MonoTODO] public bool GetItemChecked(int index) { return CheckedIndices.Contains(index); } [MonoTODO] public CheckState GetItemCheckState(int index) { return CheckedIndices.Contains(index) ? CheckState.Checked : CheckState.Unchecked; } // [event methods] [MonoTODO] protected override void OnBackColorChanged(EventArgs e) { //FIXME base.OnBackColorChanged(e); } [MonoTODO] protected override void OnClick(EventArgs e) { //FIXME base.OnClick(e); } [MonoTODO] protected override void OnDrawItem(DrawItemEventArgs e) { Rectangle paintBounds = new Rectangle (0, 0, e.Bounds.Width, e.Bounds.Height); Bitmap bmp = new Bitmap( paintBounds.Width, paintBounds.Height,e.Graphics); Graphics paintOn = Graphics.FromImage(bmp); paintOn.FillRectangle(SystemBrushes.Window, paintBounds); Rectangle checkRect = new Rectangle( 0, 0, paintBounds.Height, paintBounds.Height); checkRect.Inflate(-1,-1); Rectangle textRect = new Rectangle( checkRect.Right, 0, paintBounds.Width - checkRect.Width - 1, paintBounds.Height); if( (e.State & DrawItemState.Selected) != 0) { paintOn.FillRectangle(SystemBrushes.Highlight, textRect); paintOn.DrawString(Items_[e.Index].ToString(), Font, SystemBrushes.HighlightText, textRect.X, textRect.Y); } else { paintOn.DrawString(Items_[e.Index].ToString(), Font, SystemBrushes.ControlText, textRect.X, textRect.Y); } ButtonState state = ButtonState.Normal; if( !threeDCheckBoxes) { state |= ButtonState.Flat; } if( CheckedIndices.Contains(e.Index)) { state |= ButtonState.Checked; } ControlPaint.DrawCheckBox (paintOn, checkRect, state); if( 0 != (DrawItemState.Focus & e.State)) { ControlPaint.DrawFocusRectangle (paintOn, textRect); } e.Graphics.DrawImage(bmp, e.Bounds.Left, e.Bounds.Top, e.Bounds.Width, e.Bounds.Height); paintOn.Dispose (); bmp.Dispose(); } [MonoTODO] protected override void OnFontChanged(EventArgs e) { //FIXME base.OnFontChanged(e); } [MonoTODO] protected override void OnHandleCreated(EventArgs e) { //FIXME base.OnHandleCreated(e); } // only supports .NET framework, thus is not stubbed out /* [MonoTODO] protected virtual void OnItemCheck(ItemCheckEventArgs ice) { throw new NotImplementedException (); } */ [MonoTODO] protected override void OnKeyPress(KeyPressEventArgs e) { //FIXME base.OnKeyPress(e); } [MonoTODO] protected override void OnMeasureItem(MeasureItemEventArgs e) { //FIXME base.OnMeasureItem(e); } [MonoTODO] protected override void OnSelectedIndexChanged(EventArgs e) { //FIXME base.OnSelectedIndexChanged(e); } // end of [event methods] [MonoTODO] public void SetItemChecked(int index,bool value) { SetItemCheckState(index, value ? CheckState.Checked : CheckState.Unchecked); } [MonoTODO] public void SetItemCheckState(int index, CheckState value) { if( index < 0 || index > Items.Count) { // FIXME: Set exception properties throw new ArgumentException(); } //bool invalidateControl = false; ListBox.ObjectCollection.ListBoxItem item = Items_.getItemAt(index); item.Checked_ = value == CheckState.Checked ? true : false; CheckedIndices_ = null; CheckedItems_ = null; // FIXME: Minimize repainting here, invalidate only part on the control ? Invalidate(); } internal void listboxSelChange() { int curSel = Win32.SendMessage(Handle, (int)ListBoxMessages.LB_GETCURSEL, 0, 0); //Console.WriteLine("ListBoxNotifications.LBN_SELCHANGE. {0} item is active", curSel); // CHECKME: the things work nice w/out call to control, but may be this will be needed. //CallControlWndProc(ref m); if(checkOnClick || prevSelectedIndex == curSel) { SelectedIndex = curSel; SetItemChecked(SelectedIndex, !CheckedIndices.Contains(SelectedIndex)); } prevSelectedIndex = curSel; } [MonoTODO] protected override void WndProc(ref Message m) { //FIXME switch (m.Msg) { case Msg.WM_COMMAND: switch(m.HiWordWParam) { case (uint)ListBoxNotifications.LBN_SELCHANGE: listboxSelChange(); m.Result = IntPtr.Zero; break; case (uint)ListBoxNotifications.LBN_DBLCLK: listboxSelChange(); m.Result = IntPtr.Zero; break; default: base.WndProc(ref m); break; } break; default: base.WndProc(ref m); break; } } /// --- CheckedListBox events --- /// following events are not stubbed out, because they only support .NET framework: /// - public new event EventHandler Click; /// - public new event DrawItemEventHandler DrawItem; /// - public new event MeasureItemEventHandler MeasureItem; public event ItemCheckEventHandler ItemCheck; /// sub-class: CheckedListBox.CheckedIndexCollection /// /// Encapsulates the collection of indexes of checked items (including items in an indeterminate state) in a CheckedListBox. /// [MonoTODO] public class CheckedIndexCollection : IList, ICollection, IEnumerable { CheckedListBox owner_; ArrayList collection_; internal CheckedIndexCollection(CheckedListBox owner) { owner_ = owner; collection_ = owner_.Items.CreateCheckedIndexList(); } /// --- CheckedIndexCollection Properties --- [MonoTODO] public int Count { get { return collection_.Count; } } [MonoTODO] public bool IsReadOnly { get { return true; } } [MonoTODO] public int this[int index] { get { return (int)collection_[index]; } } /// --- ICollection properties --- bool IList.IsFixedSize { [MonoTODO] get { throw new NotImplementedException(); } } object IList.this[int index] { [MonoTODO] get { throw new NotImplementedException(); } [MonoTODO] set { ; } } object ICollection.SyncRoot { [MonoTODO] get { throw new NotImplementedException(); } } bool ICollection.IsSynchronized { [MonoTODO] get { throw new NotImplementedException(); } } /// --- CheckedIndexCollection Methods --- /// Note: IList methods are stubbed out, otherwise does not IList interface cannot be implemented [MonoTODO] public bool Contains(int index) { return collection_.Contains(index); } [MonoTODO] public void CopyTo(Array dest,int index) { collection_.CopyTo(dest, index); } [MonoTODO] public IEnumerator GetEnumerator() { return collection_.GetEnumerator(); } [MonoTODO] public int IndexOf(int index) { return collection_.IndexOf(index); } /// --- CheckedIndexCollection.IList methods --- [MonoTODO] int IList.Add(object value) { throw new NotImplementedException (); } [MonoTODO] void IList.Clear() { throw new NotImplementedException (); } [MonoTODO] bool IList.Contains(object index) { throw new NotImplementedException (); } [MonoTODO] int IList.IndexOf(object index) { throw new NotImplementedException (); } [MonoTODO] void IList.Insert(int index,object value) { throw new NotImplementedException (); } [MonoTODO] void IList.Remove(object value) { throw new NotImplementedException (); } [MonoTODO] void IList.RemoveAt(int index) { throw new NotImplementedException (); } } // --- end of CheckedListBox.CheckedIndexCollection --- /// sub-class: CheckedListBox.CheckedItemCollection /// /// Encapsulates the collection of checked items (including items in an indeterminate state) in a CheckedListBox control. /// [MonoTODO] public class CheckedItemCollection : IList, ICollection, IEnumerable { CheckedListBox owner_; ArrayList collection_; internal CheckedItemCollection(CheckedListBox owner) { owner_ = owner; collection_ = owner_.Items.CreateCheckedItemList(); } /// --- CheckedItemCollection Properties --- [MonoTODO] public int Count { get { return collection_.Count; } } [MonoTODO] public bool IsReadOnly { get { return collection_.IsReadOnly; } } /// --- ICollection properties --- bool IList.IsFixedSize { [MonoTODO] get { throw new NotImplementedException (); } } object IList.this[int index] { [MonoTODO] get { throw new NotImplementedException (); } [MonoTODO] set { throw new NotImplementedException (); } } [MonoTODO] public object this[int index] { get { return collection_[index]; } set { throw new NotImplementedException (); } } object ICollection.SyncRoot { [MonoTODO] get { throw new NotImplementedException (); } } bool ICollection.IsSynchronized { [MonoTODO] get { throw new NotImplementedException (); } } /// --- CheckedItemCollection Methods --- /// Note: IList methods are stubbed out, otherwise IList interface cannot be implemented [MonoTODO] public bool Contains(object item) { return collection_.Contains(item); } [MonoTODO] public void CopyTo(Array dest,int index) { collection_.CopyTo(dest,index); } [MonoTODO] public IEnumerator GetEnumerator() { return collection_.GetEnumerator(); } [MonoTODO] public int IndexOf(object item) { return collection_.IndexOf(item); } /// --- CheckedItemCollection.IList methods --- [MonoTODO] int IList.Add(object value) { throw new NotImplementedException (); } [MonoTODO] void IList.Clear() { throw new NotImplementedException (); } [MonoTODO] bool IList.Contains(object index) { throw new NotImplementedException (); } [MonoTODO] int IList.IndexOf(object index) { throw new NotImplementedException (); } [MonoTODO] void IList.Insert(int index,object value) { throw new NotImplementedException (); } [MonoTODO] void IList.Remove(object value) { throw new NotImplementedException (); } [MonoTODO] void IList.RemoveAt(int index) { throw new NotImplementedException (); } } // --- end of CheckedListBox.CheckedItemCollection --- /// sub-class: CheckedListBox.ObjectCollection /// /// Represents the collection of items in a CheckedListBox. /// [MonoTODO] public new class ObjectCollection : ListBox.ObjectCollection { /// --- ObjectCollection.constructor --- [MonoTODO] public ObjectCollection(CheckedListBox owner) :base(owner) { } /// --- methods --- [MonoTODO] public int Add(object item,bool isChecked) { throw new NotImplementedException (); } [MonoTODO] public int Add(object item,CheckState check) { throw new NotImplementedException (); } } } } --------------010001000809050905080402-- From brian.takita@runbox.com Fri Aug 22 10:02:25 2003 From: brian.takita@runbox.com (Brian Takita) Date: Fri, 22 Aug 2003 02:02:25 -0700 Subject: [Mono-winforms-list] ComboBox Message-ID: <3F45DC21.30807@runbox.com> This is a multi-part message in MIME format. --------------060600020107060203030603 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit text private variable is changed to Text_ There was a conflict with text private variable in Control class. --------------060600020107060203030603 Content-Type: text/plain; name="ComboBox.cs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ComboBox.cs" // // System.Windows.Forms.ComboBox.cs // // Author: // stubbed out by Jaak Simm (jaaksimm@firm.ee) // Dennis Hayes (dennish@Raytek.com) // Alexandre Pigolkine (pigolkine@gmx.de) // // (C) Ximian, Inc., 2002/3 // using System.ComponentModel; using System.Collections; using System.Drawing; using System.Runtime.InteropServices; namespace System.Windows.Forms { /// /// Represents a Windows combo box control. /// [MonoTODO] public class ComboBox : ListControl { // private fields DrawMode drawMode; ComboBoxStyle dropDownStyle; bool droppedDown; bool integralHeight; bool sorted; Image backgroundImage; ControlStyles controlStyles; string Text_; int selectedLength; string selectedText; int selectedIndex; object selectedItem; int selecedStart; private ComboBox.ObjectCollection Items_ = null; int itemHeight_; int maxDropDownItems; bool updateing; // true when begin update has been called. do not paint when true; // --- Constructor --- public ComboBox() : base() { selectedLength = 0; selectedText = ""; selectedIndex = -1; selectedItem = null; selecedStart = 0; updateing = false; //controlStyles = null; drawMode = DrawMode.Normal; dropDownStyle = ComboBoxStyle.DropDownList; droppedDown = false; integralHeight = true; sorted = false; backgroundImage = null; Text_ = ""; Items_ = new ComboBox.ObjectCollection(this); itemHeight_ = 13; maxDropDownItems = 8; SubClassWndProc_ = true; Size = DefaultSize; } // --- Properties --- [MonoTODO] public override Color BackColor { get { return base.BackColor; } set { if(BackColor.A != 255){ if( (controlStyles & ControlStyles.SupportsTransparentBackColor) != ControlStyles.SupportsTransparentBackColor ){ throw new ArgumentOutOfRangeException("BackColor", BackColor, "Transparant background color not allowed."); } } base.BackColor = value; } } public override Image BackgroundImage { get { return backgroundImage; } set { backgroundImage = value; } } internal int getDropDownHeight() { // FIXME: use PreferredHeight instead of DefaultSize.Height ? // FIXME: those calculations probably wrong return DefaultSize.Height + (maxDropDownItems + 1) * itemHeight_ - (itemHeight_ / 2); } [MonoTODO] protected override CreateParams CreateParams { get { CreateParams createParams = base.CreateParams; createParams.ClassName = "ComboBox"; if( DropDownStyle == ComboBoxStyle.Simple) { createParams.Height = Height; } else { createParams.Height = getDropDownHeight(); } createParams.ExStyle = (int)( WindowExStyles.WS_EX_RIGHTSCROLLBAR | WindowExStyles.WS_EX_NOPARENTNOTIFY); createParams.Style = (int) ( (int)WindowStyles.WS_CHILD | (int)WindowStyles.WS_VISIBLE | (int)WindowStyles.WS_VSCROLL | (int)WindowStyles.WS_TABSTOP | (int)ComboBoxStyles.CBS_HASSTRINGS ); switch( DrawMode){ case DrawMode.OwnerDrawFixed: createParams.Style |= (int)ComboBoxStyles.CBS_OWNERDRAWFIXED; break; case DrawMode.OwnerDrawVariable: createParams.Style |= (int)ComboBoxStyles.CBS_OWNERDRAWVARIABLE; break; } switch(DropDownStyle) { case ComboBoxStyle.Simple: createParams.Style |= (int)ComboBoxStyles.CBS_SIMPLE; break; case ComboBoxStyle.DropDown: createParams.Style |= (int)ComboBoxStyles.CBS_DROPDOWN; break; case ComboBoxStyle.DropDownList: createParams.Style |= (int)ComboBoxStyles.CBS_DROPDOWNLIST; break; } if( !integralHeight) { createParams.Style |= (int)ComboBoxStyles.CBS_NOINTEGRALHEIGHT; } /* * Keep Control unsorted, but sort data in Items (ArrayList) if( sorted) { createParams.Style |= (int)ComboBoxStyles.CBS_SORT; } */ return createParams; } } protected override Size DefaultSize { get { return new Size(121,21);//correct size } } /* public new Size Size { //FIXME: should we return client size or someother size??? get { return base.Size; } set { if( dropDownStyle == ComboBoxStyle.Simple) { Size sz = value; sz.Height += maxDropDownItems * itemHeight_; base.Size = sz; } else { base.Size = value; } } } */ public DrawMode DrawMode { get { return drawMode; } set { if( drawMode != value) { drawMode = value; RecreateHandle(); } } } public ComboBoxStyle DropDownStyle { get { return dropDownStyle; } set { if( dropDownStyle != value) { dropDownStyle = value; RecreateHandle(); OnDropDownStyleChanged( new EventArgs()); } } } [MonoTODO] public int DropDownWidth { get { throw new NotImplementedException (); } set { //FIXME: } } public bool DroppedDown { get { return droppedDown; } set { droppedDown = value; } } [MonoTODO] public override bool Focused { get { if (IsHandleCreated) { IntPtr focusedWindow = Win32.GetFocus(); if (focusedWindow == Handle) return true; if( Win32.GetParent(focusedWindow) == Handle) return true; } return false; } } [MonoTODO] public override Color ForeColor { get { //FIXME: return base.ForeColor; } set { //FIXME: base.ForeColor = value; } } public bool IntegralHeight { get { return integralHeight; } set { if( integralHeight != value) { integralHeight = value; if( IsHandleCreated) { if( integralHeight) { Win32.UpdateWindowStyle(Handle, (int)ComboBoxStyles.CBS_NOINTEGRALHEIGHT, 0); } else { Win32.UpdateWindowStyle(Handle, 0, (int)ComboBoxStyles.CBS_NOINTEGRALHEIGHT); } } } } } [MonoTODO] public int ItemHeight { get { return itemHeight_; } set { itemHeight_ = value; if( IsHandleCreated) { if( DrawMode != DrawMode.OwnerDrawVariable) { Win32.SendMessage(Handle, (int)ComboBoxMessages.CB_SETITEMHEIGHT, 0, itemHeight_); } else { for( int i = 0; i < Items.Count; i++) { Win32.SendMessage(Handle, (int)ComboBoxMessages.CB_SETITEMHEIGHT, i, itemHeight_); } } Win32.SendMessage(Handle, (int)ComboBoxMessages.CB_SETITEMHEIGHT, -1, itemHeight_); } } } [MonoTODO] public ComboBox.ObjectCollection Items { get { return Items_; } } [MonoTODO] public int MaxDropDownItems { get { return maxDropDownItems; } set { if( maxDropDownItems != value) { maxDropDownItems = value; if( DropDownStyle != ComboBoxStyle.Simple) { Height = getDropDownHeight(); } } } } [MonoTODO] public int MaxLength { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public int PreferredHeight { get { return 20; //FIXME: this is the default, good as any? } } [MonoTODO] public override int SelectedIndex { get { if( IsHandleCreated) { return Win32.SendMessage(Handle, (int)ComboBoxMessages.CB_GETCURSEL, 0, 0); } else { return selectedIndex; } } set { if( selectedIndex != value) { //FIXME: set exception parameters if( value >= Items_.Count) { throw new ArgumentOutOfRangeException(); } selectedIndex = value; if( IsHandleCreated) { Win32.SendMessage(Handle, (int)ComboBoxMessages.CB_SETCURSEL, selectedIndex, 0); } OnSelectedIndexChanged(new EventArgs()); } } } [MonoTODO] public object SelectedItem { get { if( IsHandleCreated) { return Items_[Win32.SendMessage(Handle, (int)ComboBoxMessages.CB_GETCURSEL, 0, 0)]; } else { return Items_[selectedIndex]; } } set { //FIXME: } } [MonoTODO] public string SelectedText { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public int SelectionLength { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public int SelectionStart { get { throw new NotImplementedException (); } set { //FIXME: } } public bool Sorted { get { return sorted; } set { if( sorted != value) { sorted = value; if( IsHandleCreated) { if( sorted) { object[] items = new object[Items.Count]; Items.CopyTo(items, 0); Items.Clear(); Items.AddRange(items); } } selectedIndex = -1; } } } [MonoTODO] public override string Text { get { return Text_; } set { Text_ = value; } } /// --- Methods --- /// internal .NET framework supporting methods, not stubbed out: internal void populateControl( ICollection items) { if( IsHandleCreated && items != null) { foreach( object obj in items) { // CHECKME : shall we check for null here or in Add/Insert functions if( obj != null) { Win32.SendMessage(Handle, (int)ComboBoxMessages.CB_ADDSTRING, 0, getDisplayMemberOfObj(obj)); } } } } protected override void OnCreateControl () { } [MonoTODO] protected override void OnSelectedValueChanged(EventArgs e){ // .NET V1.1 Beta //FIXME: base.OnSelectedValueChanged(e); } /// - protected override void SetItemCore(int index,object value); [MonoTODO] protected virtual void AddItemsCore(object[] value) { //FIXME: } [MonoTODO] public void BeginUpdate() { updateing = true; } [MonoTODO] public void EndUpdate() { updateing = false; } [MonoTODO] public int FindString(string s) { throw new NotImplementedException (); } [MonoTODO] public int FindString(string s,int startIndex) { throw new NotImplementedException (); } [MonoTODO] public int FindStringExact(string s) { throw new NotImplementedException (); } [MonoTODO] public int FindStringExact(string s,int startIndex) { throw new NotImplementedException (); } [MonoTODO] public int GetItemHeight(int index) { throw new NotImplementedException (); } [MonoTODO] protected override bool IsInputKey(Keys keyData) { //FIXME: return base.IsInputKey(keyData); } /// [methods for events] [MonoTODO] protected override void OnBackColorChanged(EventArgs e) { //FIXME: base.OnBackColorChanged(e); } [MonoTODO] protected override void OnDataSourceChanged(EventArgs e) { //FIXME: base.OnDataSourceChanged(e); } [MonoTODO] protected override void OnDisplayMemberChanged(EventArgs e) { //FIXME: base.OnDisplayMemberChanged(e); } [MonoTODO] protected virtual void OnDrawItem(DrawItemEventArgs e) { if( DrawItem != null) { DrawItem(this, e); } } [MonoTODO] protected virtual void OnDropDown(EventArgs e) { //FIXME: } [MonoTODO] protected virtual void OnDropDownStyleChanged(EventArgs e) { if( DropDownStyleChanged != null) { DropDownStyleChanged(this, e); } } [MonoTODO] protected override void OnFontChanged(EventArgs e) { //FIXME: base.OnFontChanged(e); } [MonoTODO] protected override void OnForeColorChanged(EventArgs e) { //FIXME: base.OnForeColorChanged(e); } [MonoTODO] protected override void OnHandleCreated(EventArgs e) { //FIXME: base.OnHandleCreated(e); populateControl(Items_); Win32.SendMessage(Handle, (int)ComboBoxMessages.CB_SETCURSEL, selectedIndex, 0); } [MonoTODO] protected override void OnHandleDestroyed(EventArgs e) { //FIXME: base.OnHandleDestroyed(e); } [MonoTODO] protected override void OnKeyPress(KeyPressEventArgs e) { //FIXME: base.OnKeyPress(e); } [MonoTODO] protected virtual void OnMeasureItem(MeasureItemEventArgs e) { if(MeasureItem != null) { MeasureItem(this, e); } } [MonoTODO] protected override void OnParentBackColorChanged(EventArgs e) { //FIXME: base.OnParentBackColorChanged(e); } [MonoTODO] protected override void OnResize(EventArgs e) { //FIXME: base.OnResize(e); } [MonoTODO] protected override void OnSelectedIndexChanged(EventArgs e) { if( SelectedIndexChanged != null) { SelectedIndexChanged( this, e); } } [MonoTODO] protected virtual void OnSelectionChangeCommitted(EventArgs e) { //FIXME: } /// end of [methods for events] [MonoTODO] protected override void RefreshItem(int index) { //FIXME: base.Refresh(); } [MonoTODO] public void Select(int start,int length) { //FIXME: } [MonoTODO] public void SelectAll() { //FIXME: } [MonoTODO] protected override void SetBoundsCore(int x,int y,int width,int height,BoundsSpecified specified) { //FIXME: // If DropDownStyle == ComboBoxStyle.Simple, the heigth is a real window height - no control over it // else, // if Handle created - specify complete height, ComboBox-control will adjust window rectangle // else - set the height to Default. if(DropDownStyle != ComboBoxStyle.Simple) { if( IsHandleCreated) { height = getDropDownHeight(); } else { height = DefaultSize.Height; } } base.SetBoundsCore(x,y,width,height,specified); // FIXME: this is needed, otherwise painting is not correct if( dropDownStyle == ComboBoxStyle.Simple ) { Win32.InvalidateRect(Handle, IntPtr.Zero, 0); Win32.UpdateWindow(Handle); } } // for IList interface // FIXME not sure how to handle this //[MonoTODO] //protected override void SetItemsCore(IList value) //{ // throw new NotImplementedException (); //} [MonoTODO] public override string ToString() { //FIXME: return base.ToString(); } [MonoTODO] protected override void WndProc(ref Message m) { switch (m.Msg) { case Msg.WM_MEASUREITEM: { MEASUREITEMSTRUCT mis = new MEASUREITEMSTRUCT(); mis = (MEASUREITEMSTRUCT)Marshal.PtrToStructure(m.LParam, mis.GetType()); MeasureItemEventArgs args = new MeasureItemEventArgs(CreateGraphics(),mis.itemID); args.ItemHeight = mis.itemHeight; args.ItemWidth = mis.itemWidth; OnMeasureItem( args); mis.itemHeight = args.ItemHeight; mis.itemWidth = args.ItemWidth; Marshal.StructureToPtr(mis, m.LParam, false); m.Result = (IntPtr)1; } break; case Msg.WM_DRAWITEM: { DRAWITEMSTRUCT dis = new DRAWITEMSTRUCT(); dis = (DRAWITEMSTRUCT)Marshal.PtrToStructure(m.LParam, dis.GetType()); Rectangle rect = new Rectangle(dis.rcItem.left, dis.rcItem.top, dis.rcItem.right - dis.rcItem.left, dis.rcItem.bottom - dis.rcItem.top); DrawItemEventArgs args = new DrawItemEventArgs(Graphics.FromHdc(dis.hDC), Font, rect, dis.itemID, (DrawItemState)dis.itemState); OnDrawItem( args); //Marshal.StructureToPtr(dis, m.LParam, false); m.Result = (IntPtr)1; } break; /* case Msg.WM_COMPAREITEM: { int i = 10; } break; */ case Msg.WM_COMMAND: if( m.LParam != Handle) { base.WndProc(ref m); } else { switch(m.HiWordWParam) { case (uint)ComboBoxNotification.CBN_SELCHANGE: //OnSelectedIndexChanged(new EventArgs()); SelectedIndex = Win32.SendMessage(Handle, (int)ComboBoxMessages.CB_GETCURSEL, 0, 0); m.Result = IntPtr.Zero; //CallControlWndProc(ref m); break; default: Console.WriteLine("ComboBox enter default"); //CallControlWndProc(ref m); m.Result = IntPtr.Zero; Console.WriteLine("ComboBox exit default"); break; } } break; default: base.WndProc(ref m); break; } } /// --- Button events --- /// commented out, cause it only supports the .NET Framework infrastructure [MonoTODO] public event DrawItemEventHandler DrawItem; [MonoTODO] public event EventHandler DropDown; [MonoTODO] public event EventHandler DropDownStyleChanged; [MonoTODO] public event MeasureItemEventHandler MeasureItem; /* only supports .NET framework [MonoTODO] public new event PaintEventHandler Paint; */ [MonoTODO] public event EventHandler SelectedIndexChanged; [MonoTODO] public event EventHandler SelectionChangeCommitted; /// --- public class ComboBox.ChildAccessibleObject : AccessibleObject --- /// the class is not stubbed, cause it's only used for .NET framework /// sub-class: ComboBox.ObjectCollection /// /// Represents the collection of items in a ComboBox. /// [MonoTODO] public class ObjectCollection : IList, ICollection, IEnumerable { private ArrayList collection_ = new ArrayList (); private ComboBox owner_ = null; /// --- ObjectCollection.constructor --- [MonoTODO] public ObjectCollection (ComboBox owner) { owner_ = owner; } /// --- ObjectCollection Properties --- [MonoTODO] public int Count { get { return collection_.Count; } } [MonoTODO] public bool IsReadOnly { get { return collection_.IsReadOnly; } } object IList.this[int index] { get { return collection_[index]; } set { collection_[index] = value; } } [MonoTODO] public object this[int index] { get { return collection_[index]; } set { collection_[index] = value; } } /// --- ICollection properties --- bool IList.IsFixedSize { [MonoTODO] get { return collection_.IsFixedSize; } } object ICollection.SyncRoot { get { return collection_.SyncRoot; } } bool ICollection.IsSynchronized { [MonoTODO] get { return collection_.IsSynchronized; } } /// --- methods --- /// --- ObjectCollection Methods --- /// Note: IList methods are stubbed out, otherwise IList interface cannot be implemented [MonoTODO] public int Add(object item) { // FIXME: not optimal int idx = collection_.Add(item); if( owner_.Sorted) { ListControl.ListControlComparer cic = new ListControl.ListControlComparer(owner_); collection_.Sort(cic); idx = collection_.BinarySearch(item,cic); if( owner_.IsHandleCreated) { Win32.SendMessage(owner_.Handle, (int)ComboBoxMessages.CB_INSERTSTRING, idx, owner_.getDisplayMemberOfObj(item)); } } else { if( owner_.IsHandleCreated) { Win32.SendMessage(owner_.Handle, (int)ComboBoxMessages.CB_ADDSTRING, 0, owner_.getDisplayMemberOfObj(item)); } } return idx; } [MonoTODO] public void AddRange(object[] items) { // FIXME: not optimal foreach(object item in items) { Add(item); } // owner_.populateControl(items); // collection_.AddRange(items); } [MonoTODO] public void Clear() { collection_.Clear(); Win32.SendMessage(owner_.Handle, (int)ComboBoxMessages.CB_RESETCONTENT, 0, 0); } [MonoTODO] public bool Contains(object value) { return collection_.Contains(value); } [MonoTODO] public void CopyTo(object[] dest,int arrayIndex) { collection_.CopyTo(dest, arrayIndex); } /// for ICollection: [MonoTODO] void ICollection.CopyTo(Array dest,int index) { collection_.CopyTo(dest, index); } [MonoTODO] public IEnumerator GetEnumerator() { return collection_.GetEnumerator(); } [MonoTODO] public int IndexOf(object value) { return collection_.IndexOf(value); } [MonoTODO] public void Insert(int index,object item) { //FIXME: } [MonoTODO] public void Remove(object value) { //FIXME: } [MonoTODO] public void RemoveAt(int index) { //FIXME: } } // --- end of ComboBox.ObjectCollection --- } } --------------060600020107060203030603-- From brian.takita@runbox.com Fri Aug 22 10:05:21 2003 From: brian.takita@runbox.com (Brian Takita) Date: Fri, 22 Aug 2003 02:05:21 -0700 Subject: [Mono-winforms-list] GroupBox Message-ID: <3F45DCD1.1070709@runbox.com> This is a multi-part message in MIME format. --------------080709010609000000070400 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Commented out OnPaintBackground. --------------080709010609000000070400 Content-Type: text/plain; name="GroupBox.cs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="GroupBox.cs" // // System.Windows.Forms.GroupBox.cs // // Author: // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu) // Dennis Hayes (dennish@raytek.com) // Aleksey Ryabchuk (ryabchuk@yahoo.com) // // (C) 2002/3 Ximian, Inc // using System.Drawing; using System.ComponentModel; namespace System.Windows.Forms { // // Represents a Windows group box. // public class GroupBox : Control { FlatStyle flatStyle; [MonoTODO] public GroupBox() { SetStyle ( ControlStyles.UserPaint, true); SetStyle ( ControlStyles.Selectable, false ); TabStop = false; flatStyle = FlatStyle.Standard; } [EditorBrowsable (EditorBrowsableState.Never)] public override bool AllowDrop { get { return base.AllowDrop; } set { base.AllowDrop = value; } } [MonoTODO] public override Rectangle DisplayRectangle { get { //FIXME: return base.DisplayRectangle; } } [MonoTODO] public FlatStyle FlatStyle { get { return flatStyle; } set { if ( !Enum.IsDefined ( typeof(FlatStyle), value ) ) throw new InvalidEnumArgumentException( "FlatStyle", (int)value, typeof(FlatStyle)); flatStyle = value; } } public override string ToString() { return GetType ( ).FullName.ToString ( ) + ", Text: " + Text; } [MonoTODO] protected override CreateParams CreateParams { get { RegisterDefaultWindowClass ( ); CreateParams createParams = base.CreateParams; createParams.ClassName = Win32.DEFAULT_WINDOW_CLASS;; createParams.Style = (int) ( (int)WindowStyles.WS_CHILDWINDOW | (int)WindowStyles.WS_CLIPCHILDREN | (int)WindowStyles.WS_CLIPSIBLINGS | (int)WindowStyles.WS_OVERLAPPED | (int)WindowStyles.WS_VISIBLE ); return createParams; } } protected override Size DefaultSize { get { return new Size(200,100); } } [MonoTODO] protected override void OnFontChanged(EventArgs e) { base.OnFontChanged(e); Invalidate ( ); } /* protected virtual void OnPaintBackground (PaintEventArgs e) { } */ public override string Text { get { return base.Text; } set { base.Text = value; Invalidate ( ); } } [MonoTODO] protected override void OnPaint(PaintEventArgs e) { try { //FIXME: use TextMetrics to calculate coordinates in the method Rectangle bounds = DisplayRectangle; Bitmap bmp = new Bitmap(bounds.Width, bounds.Height, e.Graphics); Graphics paintOn = Graphics.FromImage(bmp); Brush br = new SolidBrush(BackColor); paintOn.FillRectangle(br, bounds); bounds.Y += 5; bounds.Height -= 5; /* bounds.Inflate(-4,-4); bounds.Y += 2; */ Color dark = ControlPaint.DarkDark ( BackColor ); Color light = ControlPaint.LightLight ( BackColor ); ControlPaint.DrawBorder(paintOn, bounds, dark, 1, ButtonBorderStyle.Solid, dark, 1, ButtonBorderStyle.Solid, light, 1, ButtonBorderStyle.Solid, light, 1, ButtonBorderStyle.Solid); bounds.Inflate(-1,-1); ControlPaint.DrawBorder(paintOn, bounds, light, 1, ButtonBorderStyle.Solid, light, 1, ButtonBorderStyle.Solid, dark, 1, ButtonBorderStyle.Solid, dark, 1, ButtonBorderStyle.Solid); SizeF sz = paintOn.MeasureString( Text, Font); sz.Width += 2.0F; paintOn.FillRectangle( br, new RectangleF(new PointF((float)bounds.Left + 3.0F, 0.0F), sz)); paintOn.DrawString(Text, Font, SystemBrushes.ControlText, (float)bounds.Left + 5, 0); e.Graphics.DrawImage(bmp, 0, 0, bmp.Width, bmp.Height); br.Dispose(); bmp.Dispose(); } catch(Exception ex) { } //base.OnPaint(e); } [MonoTODO] protected override bool ProcessMnemonic(char charCode) { //FIXME: return base.ProcessMnemonic(charCode); } [MonoTODO] protected override void WndProc(ref Message m) { switch (m.Msg) { case Msg.WM_ERASEBKGND: m.Result = (IntPtr)1; break; default: base.WndProc (ref m); break; } } } } --------------080709010609000000070400-- From brian.takita@runbox.com Fri Aug 22 10:27:23 2003 From: brian.takita@runbox.com (Brian Takita) Date: Fri, 22 Aug 2003 02:27:23 -0700 Subject: [Mono-winforms-list] MonthCalendar Message-ID: <3F45E1FB.2090908@runbox.com> This is a multi-part message in MIME format. --------------030107050706040902050801 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Should match Specs better. --------------030107050706040902050801 Content-Type: text/plain; name="MonthCalendar.cs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="MonthCalendar.cs" // // System.Windows.Forms.MonthCalendar.cs // // Author: // stubbed out by Paul Osman (paul.osman@sympatico.ca) // Dennis Hayes (dennish@raytek.com) // // (C) 2002/3 Ximian, Inc // using System.Drawing; using System.ComponentModel; using System.Runtime.Remoting; namespace System.Windows.Forms { // // public class MonthCalendar : Control { // // --- Constructor // [MonoTODO] public MonthCalendar() { } // // --- Public Methods // [MonoTODO] public void AddAnnuallyBoldedDate(DateTime date) { //FIXME: } [MonoTODO] public void AddBoldedDate(DateTime date) { //FIXME: } [MonoTODO] public void AddMonthlyBoldedDate(DateTime date) { //FIXME: } [MonoTODO] public void RemoveAllAnnuallyBoldedDates() { //FIXME: } //[MonoTODO] //public void BringToFront() { // throw new NotImplementedException (); //} //[MonoTODO] //public void CreateControl() { // throw new NotImplementedException (); //} //[MonoTODO] //public void Hide() { // throw new NotImplementedException (); //} //[MonoTODO] //public void Invalidate() { // throw new NotImplementedException (); //} //[MonoTODO] //public void Invalidate(bool b) { // throw new NotImplementedException (); //} //[MonoTODO] //public void Invalidate(Rectangle r) { // throw new NotImplementedException (); //} //[MonoTODO] //public void Invalidate(Region rg) { // throw new NotImplementedException (); //} //[MonoTODO] //public void Invalidate(Rectangle r, bool b) { // throw new NotImplementedException (); //} //[MonoTODO] //public void Invalidate(Region rg, bool b) { // throw new NotImplementedException (); //} //[MonoTODO] //public void PerformLayout() { // throw new NotImplementedException (); //} //[MonoTODO] //public void PerformLayout(Control ctl, string s) { // throw new NotImplementedException (); //} [MonoTODO] public void RemoveAllBoldedDates() { //FIXME: } [MonoTODO] public void RemoveAllMonthlyBoldedDates() { //FIXME: } [MonoTODO] public void RemoveAnnuallyBoldedDate(DateTime date) { //FIXME: } [MonoTODO] public void RemoveBoldedDate(DateTime date) { //FIXME: } [MonoTODO] public void RemoveMonthlyBoldedDate(DateTime date) { //FIXME: } //[MonoTODO] //public void ResetBindings() { // throw new NotImplementedException (); //} //[MonoTODO] //public void ResetImeMode() { // throw new NotImplementedException (); //} //[MonoTODO] //public void ResumeLayout() { // throw new NotImplementedException (); //} //[MonoTODO] //public void ResumeLayout(bool b) { // throw new NotImplementedException (); //} //[MonoTODO] //public void Scale(float ft) { // throw new NotImplementedException (); //} //[MonoTODO] //public void Scale(float ft, float ft1) { // throw new NotImplementedException (); //} //[MonoTODO] //public void Select() { // throw new NotImplementedException (); //} //[MonoTODO] //public void SendToBack() { // throw new NotImplementedException (); //} //[MonoTODO] //public void SetBounds(int i, int i1, int i2, int i3) { // throw new NotImplementedException (); //} [MonoTODO] public void SetCalendarDimensions(int x, int y) { //FIXME: } [MonoTODO] public void SetDate(DateTime date) { //FIXME: } [MonoTODO] public void SetSelectionRange(DateTime date1, DateTime date2) { //FIXME: } //[MonoTODO] //public void Show() { // throw new NotImplementedException (); //} //[MonoTODO] //public void SuspendLayout() { // throw new NotImplementedException (); //} //[MonoTODO] //public void Update() { // throw new NotImplementedException (); //} [MonoTODO] public void UpdateBoldedDates() { //FIXME: } //[MonoTODO] //public IAsyncResult BeginInvoke(Delegate dels) { // throw new NotImplementedException (); //} //[MonoTODO] //public IAsyncResult BeginInvoke(Delegate dels, object[] objs) { // throw new NotImplementedException (); //} //[MonoTODO] //public bool Contains(Control ctl) { // throw new NotImplementedException (); //} //[MonoTODO] //public Graphics CreateGraphics() { // throw new NotImplementedException (); //} //[MonoTODO] //public DragDropEffects DoDragDrop(object o, DragDropEffects dde) { // throw new NotImplementedException (); //} [MonoTODO] public object EndEnvoke(IAsyncResult asyncResult) { throw new NotImplementedException (); } //[MonoTODO] //public static bool Equals(object o, object o1) { // throw new NotImplementedException (); //} //[MonoTODO] //public Form FindForm() { // throw new NotImplementedException (); //} //[MonoTODO] //public bool Focus() { // throw new NotImplementedException (); //} //[MonoTODO] //public Control GetChildAtPoint(Point pt) { // throw new NotImplementedException (); //} //[MonoTODO] //public IContainerControl GetContainerControl() { // throw new NotImplementedException (); //} [MonoTODO] public SelectionRange GetDisplayRange(bool visible) { throw new NotImplementedException (); } //[MonoTODO] //public virtual int GetHashCode() { // throw new NotImplementedException (); //} //[MonoTODO] //public object GetLifetimeService() { // throw new NotImplementedException (); //} //[MonoTODO] //public Control GetNextControl(Control ctl, bool b) { // throw new NotImplementedException (); //} //[MonoTODO] //public Type GetType() { // throw new NotImplementedException (); //} [MonoTODO] public HitTestInfo HitTest(Point point) { throw new NotImplementedException (); } [MonoTODO] public HitTestInfo HitTest(int x, int y) { throw new NotImplementedException (); } //[MonoTODO] //public virtual object InitializeLifetimeService() { // throw new NotImplementedException (); //} //[MonoTODO] //public object Invoke(Delegate d) { // throw new NotImplementedException (); //} //[MonoTODO] //public object Invoke(Delegate d, object[] obj) { // throw new NotImplementedException (); //} //[MonoTODO] //public Point PointToClient(Point pt) { // throw new NotImplementedException (); //} //[MonoTODO] //public Point PointToScreen(Point pt) { // throw new NotImplementedException (); //} //[MonoTODO] //public Rectangle RectangleToClient(Rectangle r) { // throw new NotImplementedException (); //} //[MonoTODO] //public Rectangle RectangleToScreen(Rectangle r) { // throw new NotImplementedException (); //} //[MonoTODO] //public bool SelectNextControl(Control ctl, bool b, bool b1, bool b2, bool b3) { // throw new NotImplementedException (); //} [MonoTODO] public override string ToString() { //FIXME: return base.ToString(); } //[MonoTODO] //public virtual ObjRef CreateObjRef(Type reqType) { // throw new NotImplementedException (); //} //[MonoTODO] //public virtual bool Equals(object o) { // throw new NotImplementedException (); //} //[MonoTODO] //public virtual bool PreProcessMessage(ref Message msg) { // throw new NotImplementedException (); //} //[MonoTODO] //public virtual void Refresh() { // throw new NotImplementedException (); //} //[MonoTODO] //public virtual void ResetBackColor() { // throw new NotImplementedException (); //} //[MonoTODO] //public virtual void ResetCursor() { // throw new NotImplementedException (); //} //[MonoTODO] //public virtual void ResetFont() { // throw new NotImplementedException (); //} //[MonoTODO] //public virtual void ResetForeColor() { // throw new NotImplementedException (); //} //[MonoTODO] //public virtual void ResetRightToLeft() { // throw new NotImplementedException (); //} //[MonoTODO] //public virtual void ResetText() { // throw new NotImplementedException (); //} //[MonoTODO] //public virtual void Select(bool b, bool b1) { // throw new NotImplementedException (); //} // // --- Public Properties // /* [MonoTODO] public AccessibleObject AccessibilityObject { get { throw new NotImplementedException (); } } */ /* [MonoTODO] public string AccessibleDefaultActionDescription { get { throw new NotImplementedException (); } set { } } */ /* [MonoTODO] public string AccessibleDescription { get { throw new NotImplementedException (); } set { //FIXME: } } */ //[MonoTODO] //public string AccessibleName { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } //} /* [MonoTODO] public AccessibleRole AccessibleRole { get { throw new NotImplementedException (); } set { //FIXME: } } */ [MonoTODO] public override bool AllowDrop { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public override AnchorStyles Anchor { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public DateTime[] AnnuallyBoldedDates { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public override Color BackColor { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public override Image BackgroundImage { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public override BindingContext BindingContext { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public DateTime[] BoldedDates { get { throw new NotImplementedException (); } set { //FIXME: } } /* [MonoTODO] public int Bottom { get { throw new NotImplementedException (); } } */ /* [MonoTODO] public Rectangle Bounds { get { throw new NotImplementedException (); } set { //FIXME: } } */ [MonoTODO] public Size CalendarDimensions { get { throw new NotImplementedException (); } set { //FIXME: } } /* [MonoTODO] public bool CanFocus { get { throw new NotImplementedException (); } } */ /* [MonoTODO] public bool CanSelect { get { throw new NotImplementedException (); } } */ /* [MonoTODO] public bool Capture { get { throw new NotImplementedException (); } set { //FIXME: } } */ /* [MonoTODO] public bool CausesValidation { get { throw new NotImplementedException (); } set { //FIXME: } } */ /* [MonoTODO] public Rectangle ClientRectangle { get { throw new NotImplementedException (); } } */ /* [MonoTODO] public Size ClientSize { get { throw new NotImplementedException (); } set { //FIXME: } } */ /* [MonoTODO] public string CompanyName { get { throw new NotImplementedException (); } } */ /* [MonoTODO] public IContainer Container { get { throw new NotImplementedException (); } } */ /* [MonoTODO] public bool ContainsFocus { get { throw new NotImplementedException (); } } */ /* [MonoTODO] public override ContextMenu ContextMenu { get { throw new NotImplementedException (); } set { //FIXME: } } */ /* [MonoTODO] public Control.ControlCollection Controls { get { throw new NotImplementedException (); } } */ /* [MonoTODO] public bool Created { get { throw new NotImplementedException (); } } */ /* [MonoTODO] public override Cursor Cursor { get { throw new NotImplementedException (); } set { //FIXME: } } */ /* [MonoTODO] public ControlBindingsCollection DataBindings { get { throw new NotImplementedException (); } } */ /* [MonoTODO] public override Rectangle DisplayRectangle { get { throw new NotImplementedException (); } } */ /* [MonoTODO] public bool Disposing { get { throw new NotImplementedException (); } } */ // [MonoTODO] // public override DockStyle Dock { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } [MonoTODO] public Day FirstDayOfWeek { get { throw new NotImplementedException (); } set { //FIXME: } } // [MonoTODO] // public override bool Focused { // get { // throw new NotImplementedException (); // } // } // [MonoTODO] // public override Font Font { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } [MonoTODO] public override Color ForeColor { get { throw new NotImplementedException (); } set { //FIXME: } } // [MonoTODO] // public bool HasChildren { // get { // throw new NotImplementedException (); // } // } // [MonoTODO] // public int Height { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } // [MonoTODO] // public bool IsAccessible { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } // [MonoTODO] // public bool IsDisposed { // get { // throw new NotImplementedException (); // } // } // [MonoTODO] // public bool IsHandleCreated { // get { // throw new NotImplementedException (); // } // } // [MonoTODO] // public int Left { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } // [MonoTODO] // public Point Location { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } [MonoTODO] public DateTime MaxDate { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public int MaxSelectionCount { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public DateTime MinDate { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public DateTime[] MonthlyBoldedDates { get { throw new NotImplementedException (); } set { //FIXME: } } // [MonoTODO] // public string Name { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } // [MonoTODO] // public Control Parent { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } // [MonoTODO] // public string ProductName { // get { // throw new NotImplementedException (); // } // } // [MonoTODO] // public string ProductVersion { // get { // throw new NotImplementedException (); // } // } // [MonoTODO] // public bool RecreatingHandle { // get { // throw new NotImplementedException (); // } // } // [MonoTODO] // public Region Region { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } // [MonoTODO] // public int Right { // get { // throw new NotImplementedException (); // } // } // [MonoTODO] // public override RightToLeft RightToLeft { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } [MonoTODO] public int ScrollChange { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public DateTime SelectionEnd { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public SelectionRange SelectionRange { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public DateTime SelectionStart { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public bool ShowToday { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public bool ShowTodayCircle { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public bool ShowWeekNumbers { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } } [MonoTODO] public Size SingleMonthSize { get { throw new NotImplementedException (); } } // [MonoTODO] // public override ISite Site { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } // [MonoTODO] // public Size Size { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } // [MonoTODO] // public int TabIndex { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } // [MonoTODO] // public bool TabStop { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } // [MonoTODO] // public object Tag { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } [MonoTODO] public override string Text { get { //FIXME: return base.Text; } set { //FIXME: base.Text = value; } } [MonoTODO] public Color TitleBackColor { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public Color TitleForeColor { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public DateTime TodayDate { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public bool TodayDateSet { get { throw new NotImplementedException (); } } // [MonoTODO] // public int Top { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } // [MonoTODO] // public Control TopLevelControl { // get { // throw new NotImplementedException (); // } // } [MonoTODO] public Color TrailingForeColor { get { throw new NotImplementedException (); } set { //FIXME: } } // [MonoTODO] // public bool Visible { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } // [MonoTODO] // public int Width { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } // // --- Protected Methods // [MonoTODO] protected override void CreateHandle() { //FIXME: base.CreateHandle(); } //[MonoTODO] //protected bool GetStyle(ControlStyles flag) { // throw new NotImplementedException (); //} //[MonoTODO] //protected bool GetTopLevel() { // throw new NotImplementedException (); //} [MonoTODO] protected override bool IsInputKey(Keys keyData) { throw new NotImplementedException (); } //[MonoTODO] //protected object MemberwiseClone() { // throw new NotImplementedException (); //} [MonoTODO] protected override void OnBackColorChanged(EventArgs e) { //FIXME: } [MonoTODO] protected override void OnHandleCreated(EventArgs e) { //FIXME: } // [MonoTODO] // protected internal virtual bool ProcessKeyMessage(ref Message m) { // 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] protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) { //FIXME: } [MonoTODO] protected override void WndProc(ref Message m) { //FIXME: } protected override void Dispose(bool disposing) { //FIXME: } //[MonoTODO] //protected virtual void InitLayout() { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnBackgroundImageChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnBindingContextChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnCausesValidationChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnChangeUICues(UICuesEventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnClick(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnContextMenuChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnControlAdded(ControlEventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnControlRemoved(ControlEventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnCreateControl() { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnCursorChanged(EventArgs e) { // throw new NotImplementedException (); //} [MonoTODO] protected virtual void OnDateChanged(DateRangeEventArgs drevent) { //FIXME: } [MonoTODO] protected virtual void OnDateSelected(DateRangeEventArgs drevent) { //FIXME: } //[MonoTODO] //protected virtual void OnDockChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnDoubleClick(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnDragDrop(DragEventArgs drgevent) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnDragEnter(DragEventArgs drgevent) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnDragLeave(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnDragOver(DragEventArgs drgevent) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnEnabledChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnEnter(EventArgs e) { // throw new NotImplementedException (); //} [MonoTODO] protected override void OnFontChanged(EventArgs e) { //FIXME: } [MonoTODO] protected override void OnForeColorChanged(EventArgs e) { //FIXME: } //[MonoTODO] //protected virtual void OnGiveFeedback(GiveFeedbackEventArgs gfbevent) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnGotFocus(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnHandleDestroyed(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnHelpRequested(HelpEventArgs hevent) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnImeModeChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnInvalidated(InvalidateEventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnKeyDown(KeyEventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnKeyPress(KeyPressEventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnKeyUp(KeyEventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnLayout(LayoutEventArgs levent) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnLeave(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnLocationChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnLostFocus(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnMouseDown(MouseEventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnMouseEnter(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnMouseHover(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnMouseLeave(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnMouseMove(MouseEventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnMouseUp(MouseEventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnMouseWheel(MouseEventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnMove(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnNotifyMessage(Message m) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnPaint(PaintEventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnPaintBackground(PaintEventArgs pevent) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnParentBackColorChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnParentBackgroundImageChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnParentBindingContextChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnParentChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnParentEnabledChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnParentFontChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnParentForeColorChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnParentRightToLeftChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnParentVisibleChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnResize(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnRightToLeftChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnSizeChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnStyleChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnSystemColorsChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnTabIndexChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnTabStopChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnTextChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnValidated(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnValidating(CancelEventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void OnVisibleChanged(EventArgs e) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void ScaleCore(float dx,float dy) { // throw new NotImplementedException (); //} // [MonoTODO] // protected virtual void Select(bool b, bool b1) // { // throw new NotImplementedException (); // } //[MonoTODO] //protected virtual void SetClientSizeCore(int x, int y) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void SetVisibleCore(bool value) { // throw new NotImplementedException (); //} //[MonoTODO] //protected void AccessibilityNotifyClients(AccessibleEvents accEvent, int i) { // 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 void RecreateHandle() { // throw new NotImplementedException (); //} //[MonoTODO] //protected void SetStyle(ControlStyles flag, bool value) { // throw new NotImplementedException (); //} //[MonoTODO] //protected void SetTopLevel(bool value) { // throw new NotImplementedException (); //} //[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, intclientHeigth); // { // throw new NotImplementedException (); // } //[MonoTODO] //protected void UpdateStyles() { // throw new NotImplementedException (); //} //[MonoTODO] //protected void UpdateZOrder() { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual AccessibleObject CreateAccessibilityInstance() { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual ControlCollection CreateControlsInstance() { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void DefWndProc(ref Message m) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual void DestroyHandle() { // throw new NotImplementedException (); //} // [MonoTODO] // protected virtual object GetService(Type service) { // throw new NotImplementedException (); // } //[MonoTODO] //protected virtual bool IsInputChar(char charCode) { // 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 virtual bool ProcessKeyPreview(ref Message m) { // throw new NotImplementedException (); //} //[MonoTODO] //protected virtual bool ProcessMnemonic(char charCode) { // throw new NotImplementedException (); //} // // --- Protected Properties // [MonoTODO] protected override CreateParams CreateParams { get { //FIXME: return base.CreateParams; } } [MonoTODO] protected override ImeMode DefaultImeMode { get { throw new NotImplementedException (); } } [MonoTODO] protected override Size DefaultSize { get { return new Size (100, 100); } } // [MonoTODO] // protected bool DesignMode { // get { // throw new NotImplementedException (); // } // } // [MonoTODO] // protected bool ResizeRedraw { // get { // throw new NotImplementedException (); // } // set { // throw new NotImplementedException (); // } // } // [MonoTODO] // protected EventHandlerList Events { // get { // throw new NotImplementedException (); // } // } // [MonoTODO] // protected bool ShowKeyboardCues { // get { // throw new NotImplementedException (); // } // } // [MonoTODO] // protected int FontHeight { // get { // throw new NotImplementedException (); // } // set { // //FIXME: // } // } // [MonoTODO] // protected override bool ShowFocusCues { // get { // throw new NotImplementedException (); // } // } public enum HitArea { Nowhere = 0, TitleBackground = 1, TitleMonth = 2, TitleYear = 3, NextMonthButton = 4, PrevMonthButton = 5, CalendarBackground = 6, Date = 7, NextMonthDate = 8, PrevMonthDate = 9, DayOfWeek = 10, WeekNumbers = 11, TodayLink = 12 } // // --- Public Events // // public event EventHandler BackColorChanged; // public event EventHandler BackgroundImageChanged; // public event EventHandler BindingContextChanged; // public event EventHandler CausesValidationChanged; // public event UICuesEventHandler ChangeUICues; // public event EventHandler ContextMenuChanged; // public event ControlEventHandler ControlAdded; // public event ControlEventHandler ControlRemoved; // public event EventHandler CursorChanged; public event DateRangeEventHandler DateChanged; public event DateRangeEventHandler DateSelected; // public event EventHandler DockChanged; // public event DragEventHandler DragDrop; // public event DragEventHandler DragEnter; // public event EventHandler DragLeave; // public event DragEventHandler DragOver; // public event EventHandler EnabledChanged; // public event EventHandler Enter; // public event EventHandler FontChanged; // public event EventHandler ForeColorChanged; // public event GiveFeedbackEventHandler GiveFeedback; // public event EventHandler GotFocus; // public event EventHandler HandleCreated; // public event EventHandler HandleDestroyed; // public event HelpEventHandler HelpRequested; // public event EventHandler ImeModeChanged; // public event InvalidateEventHandler Invalidated; // public event KeyEventHandler KeyDown; // public event KeyPressEventHandler KeyPress; // public event KeyEventHandler KeyUp; // public event LayoutEventHandler Layout; // public event EventHandler Leave; // public event EventHandler LocationChanged; // public event EventHandler LostFocus; // public event MouseEventHandler MouseDown; // public event EventHandler MouseEnter; // public event EventHandler MouseHover; // public event EventHandler MouseLeave; // public event MouseEventHandler MouseMove; // public event MouseEventHandler MouseUp; // public event MouseEventHandler MouseWheel; // public event EventHandler Move; // public event EventHandler ParentChanged; // public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp; // public event QueryContinueDragEventHandler QueryContinueDrag; // public event EventHandler Resize; // public event EventHandler RightToLeftChanged; // public event EventHandler SizeChanged; // public event EventHandler StyleChanged; // public event EventHandler SystemColorsChanged; // public event EventHandler TabIndexChanged; // public event EventHandler TabStopChanged; // public event EventHandler TextChanged; // public event EventHandler Validated; // public event CancelEventHandler Validating; // public event EventHandler VisibleChanged; // // System.Windows.Forms.MonthCalendar.HitTestInfo.cs // // Author: // stubbed out by Paul Osman (paul.osman@sympatico.ca) // // (C) 2002 Ximian, Inc // // // public sealed class HitTestInfo { // // --- Public Properties // // [MonoTODO] // public MonthCalendar.HitArea HitArea { // get { // throw new NotImplementedException (); // } // } [MonoTODO] public Point Point { get { throw new NotImplementedException (); } } [MonoTODO] public DateTime Time { get { throw new NotImplementedException (); } } } } } --------------030107050706040902050801-- From brian.takita@runbox.com Fri Aug 22 10:32:04 2003 From: brian.takita@runbox.com (Brian Takita) Date: Fri, 22 Aug 2003 02:32:04 -0700 Subject: [Mono-winforms-list] ListControl update Message-ID: <3F45E314.2070408@runbox.com> This is a multi-part message in MIME format. --------------000201020605050803070707 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit This one compiles correctly. --------------000201020605050803070707 Content-Type: text/plain; name="ListControl.cs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ListControl.cs" // // System.Windows.Forms.ListControl.cs // // Author: // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu) // Dennis Hayes (dennish@raytek.com) // Brian Takita (brian.takita@runbox.com) // (C) 2002/3 Ximian, Inc // using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Reflection; namespace System.Windows.Forms { // // // public abstract class ListControl : Control { private string DisplayMember_ = String.Empty; private object DataSource_; //ControlStyles controlStyles; // // --- Public Properties // [MonoTODO] public object DataSource { get { return DataSource_; } set { if(DataSource_ != value) { if((value is IList) || (value is IListSource)) { DataSource_ = value; OnDataSourceChanged(new EventArgs()); } else { throw new Exception("Complex DataBinding accepts as a data source either an IList or an IListSource"); } } } } [MonoTODO] public string DisplayMember { get { return DisplayMember_; } set { if( DisplayMember_ != value) { DisplayMember_ = value; OnDisplayMemberChanged(new EventArgs()); } } } internal string getDisplayMemberOfObj( object obj) { string objectString = String.Empty; Type t = obj.GetType(); if( DisplayMember != String.Empty) { if( t != null) { PropertyInfo prop = t.GetProperty(DisplayMember); if( prop != null) { objectString = prop.GetValue(obj, null).ToString(); } } } if( objectString == String.Empty) { objectString = obj.ToString(); } return objectString; } internal class ListControlComparer : IComparer { private ListControl owner_ = null; public ListControlComparer(ListControl owner) { owner_ = owner; } public int Compare(object x, object y) { return owner_.getDisplayMemberOfObj(x).CompareTo(owner_.getDisplayMemberOfObj(y)); } } [MonoTODO] public abstract int SelectedIndex {get;set;} [MonoTODO] public object SelectedValue { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public string ValueMember { get { throw new NotImplementedException (); } set { //FIXME: } } // // --- Public Methods // [MonoTODO] public string GetItemText(object item) { throw new NotImplementedException (); } // // --- Public Events // [MonoTODO] public event EventHandler DataSourceChanged; [MonoTODO] public event EventHandler DisplayMemberChanged; // // --- Protected Constructor // [MonoTODO] protected ListControl() { } // // --- Protected Properties // [MonoTODO] protected CurrencyManager DataManager { get { throw new NotImplementedException (); } } // // --- Protected Methods // [MonoTODO] protected override bool IsInputKey(Keys keyData) { //FIXME: return base.IsInputKey(keyData); } [MonoTODO] protected virtual void OnDataSourceChanged(EventArgs e) { //FIXME: } [MonoTODO] protected virtual void OnDisplayMemberChanged(EventArgs e) { //FIXME: } [MonoTODO] protected virtual void OnSelectedIndexChanged(EventArgs e) { //FIXME: } [MonoTODO] protected virtual void OnSelectedValueChanged(EventArgs e) { //FIXME: } public event EventHandler SelectedValueChanged; public event EventHandler ValueMemberChanged; [MonoTODO] protected override void OnBindingContextChanged(EventArgs e) { //FIXME: base.OnBindingContextChanged(e); } [MonoTODO] protected abstract void RefreshItem(int index); } } --------------000201020605050803070707-- From pigolkine@gmx.de Fri Aug 22 10:35:38 2003 From: pigolkine@gmx.de (Alexandre Pigolkine) Date: 22 Aug 2003 11:35:38 +0200 Subject: [Mono-winforms-list] SWF-ComboBox Sample Message-ID: <1061544937.4602.20.camel@alexhome> --=-OphozsslkJPGCvZCb6HC Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello! I updated the code for ComboBox, so the sample runs better now. I made small change to the controls/combo.c file from WineLib. Patch file is attached, it should be applied to the Wine-20030318 after the mono-wine.patch. A Linux screenshot is here : http://www.geocities.com/pigolkine/swf-combobox-linux.png Alexandre --=-OphozsslkJPGCvZCb6HC Content-Disposition: attachment; filename=mono-wine.patch.1 Content-Type: text/x-patch; name=mono-wine.patch.1; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -Nru -x '*~' -x '*.o' -x '*.orig' -x '*.rej' -x '*.0' -x 'request*' -x '*.log' -x '*.status' wine-20030318.orig.patched/controls/combo.c wine-20030318.my/controls/combo.c --- wine-20030318.orig.patched/controls/combo.c 2003-01-08 22:09:28.000000000 +0100 +++ wine-20030318.my/controls/combo.c 2003-08-22 10:09:33.000000000 +0200 @@ -97,7 +97,7 @@ static BOOL COMBO_Init() { HDC hDC; - +#ifndef MONO if( hComboBmp ) return TRUE; if( (hDC = CreateCompatibleDC(0)) ) { @@ -124,6 +124,9 @@ return bRet; } return FALSE; +#else + return TRUE; +#endif } --=-OphozsslkJPGCvZCb6HC-- From pigolkine@gmx.de Fri Aug 22 10:38:57 2003 From: pigolkine@gmx.de (Alexandre Pigolkine) Date: 22 Aug 2003 11:38:57 +0200 Subject: [Mono-winforms-list] ComboBox In-Reply-To: <3F45DC21.30807@runbox.com> References: <3F45DC21.30807@runbox.com> Message-ID: <1061545137.4602.24.camel@alexhome> Hello, I already committed modified version of the file. The text private variable was removed. Thanks, Alexandre On Fri, 2003-08-22 at 11:02, Brian Takita wrote: > text private variable is changed to Text_ > There was a conflict with text private variable in Control class. > > ______________________________________________________________________ > From brian.takita@runbox.com Fri Aug 22 10:45:39 2003 From: brian.takita@runbox.com (Brian Takita) Date: Fri, 22 Aug 2003 02:45:39 -0700 Subject: [Mono-winforms-list] ComboBox In-Reply-To: <1061545137.4602.24.camel@alexhome> References: <3F45DC21.30807@runbox.com> <1061545137.4602.24.camel@alexhome> Message-ID: <3F45E643.1000301@runbox.com> I'm sorry. I need to be more careful with what I edit. Brian Alexandre Pigolkine wrote: >Hello, > >I already committed modified version of the file. >The text private variable was removed. > >Thanks, > >Alexandre > > >On Fri, 2003-08-22 at 11:02, Brian Takita wrote: > > >>text private variable is changed to Text_ >>There was a conflict with text private variable in Control class. >> >>______________________________________________________________________ >> >> >> > > >_______________________________________________ >Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com >http://lists.ximian.com/mailman/listinfo/mono-winforms-list > > > > From brian.takita@runbox.com Fri Aug 22 10:03:55 2003 From: brian.takita@runbox.com (Brian Takita) Date: Fri, 22 Aug 2003 02:03:55 -0700 Subject: [Mono-winforms-list] Control Message-ID: <3F45DC7B.4050503@runbox.com> This is a multi-part message in MIME format. --------------040702060704050202050007 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Unreachable code detected. line 2845. Commented out break keyword. --------------040702060704050202050007 Content-Type: text/plain; name="Control.cs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Control.cs" // // System.Windows.Forms.Control.cs // // Author: // stubbed out by Jaak Simm (jaaksimm@firm.ee) // Dennis Hayes (dennish@rayetk.com) // WINELib implementation started by John Sohn (jsohn@columbus.rr.com) // Alexandre Pigolkine (pigolkine@gmx.de) // Aleksey Ryabchuk (ryabchuk@yahoo.com) // // (C) Ximian, Inc., 2002 // using System.ComponentModel; using System.Drawing; using System.Collections; using System.Threading; using System.Text; using System.Runtime.InteropServices; using System.Collections.Specialized; namespace System.Windows.Forms { 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) { //Console.WriteLine ("Control WndProc Message HWnd {0}, Msg {1}", m.HWnd, m.Msg); // Do not call default WndProc here // let the control decide what to do // base.WndProc (ref m); //Console.WriteLine ("Control WndProc {0}", control.GetType().ToString()); #if FilterDrawItem if (m.Msg == Msg.WM_DRAWITEM) { m.Result = (IntPtr)1; } else control.WndProc (ref m); #endif control.WndProc (ref m); } } // FIXME: not sure if dervied classes should have access protected ControlNativeWindow window; private ControlCollection childControls; private Control parent; static private Hashtable controlsCollection = new Hashtable (); static private NativeWindow parkingWindow = null; private static bool classRegistered = false; // // 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; internal Color backColor; Image backgroundImage; //BindingContext bindingContext; Rectangle bounds; Rectangle oldBounds; bool causesValidation; ContextMenu contextMenu; DockStyle dock; bool enabled; Font font; internal Color foreColor; ImeMode imeMode; bool isAccessible; // Point location; // using bounds to store location string name; Region region; RightToLeft rightToLeft; bool tabStop; internal string text; internal bool visible; internal ControlStyles controlStyles_; Cursor cursor; int clientWidth; int clientHeight; BitVector32 statuses; private static readonly int LAYOUT_SUSPENDED = BitVector32.CreateMask (); private static readonly int LAYOUT_PENDING = BitVector32.CreateMask (LAYOUT_SUSPENDED); private static readonly int DISPOSED = BitVector32.CreateMask (LAYOUT_PENDING); private static readonly int RECREATING_HANDLE= BitVector32.CreateMask (DISPOSED); private static readonly int CREATED = BitVector32.CreateMask (RECREATING_HANDLE); private static readonly int DISPOSING = BitVector32.CreateMask (CREATED); private static readonly int TOPLEVEL = BitVector32.CreateMask (DISPOSING); internal enum CallWinControlProcMask : uint { MOUSE_MESSAGES = 0x0001, KEYBOARD_MESSAGES = 0x0002 } internal CallWinControlProcMask callWinControlProcMask; object tag; internal bool mouseIsInside_; // BeginInvoke () etc. helpers static int InvokeMessage = Win32.RegisterWindowMessage ("mono_control_invoke_helper"); // CHECKME: This variable is used to determine whether current thread // was used to create Control Handle. It take some space but saves a call // to unmanaged code in ISynchronizeInvoke.IsInvokeRequired. private int CreatorThreadId_ = 0; private Queue InvokeQueue_ = new Queue (); internal class ControlInvokeHelper : IAsyncResult { private Delegate Method_ = null; private object[] MethodArgs_ = null; private object MethodResult_ = null; private ManualResetEvent AsyncWaitHandle_ = new ManualResetEvent (false); private bool CompletedSynchronously_ = false; private bool IsCompleted_ = false; public ControlInvokeHelper (Delegate method, object[] args) { Method_ = method; MethodArgs_ = args; } // IAsyncResult interface object IAsyncResult.AsyncState { get { if (MethodArgs_ != null && MethodArgs_.Length != 0) return MethodArgs_[MethodArgs_.Length - 1]; return null; } } WaitHandle IAsyncResult.AsyncWaitHandle { get { return AsyncWaitHandle_; } } bool IAsyncResult.CompletedSynchronously { get { return CompletedSynchronously_; } } bool IAsyncResult.IsCompleted { get { return IsCompleted_; } } internal bool CompletedSynchronously { set { CompletedSynchronously_ = value; } } internal object MethodResult { get { return MethodResult_; } } internal void ExecuteMethod () { object result = Method_.DynamicInvoke (MethodArgs_); lock (this) { MethodResult_ = result; IsCompleted_ = true; } AsyncWaitHandle_.Set (); } } // --- Constructors --- //Compact Framework //only Control () public Control () { childControls = CreateControlsInstance (); statuses = new BitVector32 (); callWinControlProcMask = CallWinControlProcMask.MOUSE_MESSAGES | CallWinControlProcMask.KEYBOARD_MESSAGES; accessibleDefaultActionDescription = null; accessibleDescription = null; accessibleName = null; accessibleRole = AccessibleRole.Default; allowDrop = false; anchor = AnchorStyles.Top | AnchorStyles.Left; backColor = Control.DefaultBackColor; backgroundImage = null; bounds = new Rectangle (); oldBounds = 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 = true; text = ""; visible = true; parent = null; cursor = null; oldBounds.Width = bounds.Width = DefaultSize.Width; oldBounds.Height = bounds.Height= DefaultSize.Height; clientWidth = DefaultSize.Width; clientHeight = DefaultSize.Height; mouseIsInside_ = false; controlStyles_ = ControlStyles.Selectable | ControlStyles.StandardClick | ControlStyles.StandardDoubleClick; // Do not create Handle here, only in CreateHandle // CreateHandle ();//sets window handle. FIXME: No it does not } // according to docs, the constructors do not create // the (HWND) window public Control (string text) : this () { Text = text; // SetWindowTextA (Handle, text); } public Control (Control parent, string text) : this (text) { Parent = parent; // 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; //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; // 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{ throw new NotImplementedException (); } } public IWindowTarget WindowTarget { get { throw new NotImplementedException (); } 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 { if (anchor != value){ anchor = value; if (anchor != (AnchorStyles.Left | AnchorStyles.Top)) Dock = DockStyle.None; } } } //Compact Framework public virtual Color BackColor { get { return backColor; } set { if (backColor != value) { backColor = value; OnBackColorChanged (new EventArgs ()); } } } public virtual Image BackgroundImage { get { return backgroundImage; } set { backgroundImage = value; // FIXME: force redraw Invalidate (); } } public virtual BindingContext BindingContext { get { //return bindingContext; throw new NotImplementedException (); } set { //bindingContext=value; throw new NotImplementedException (); } } //Compact Framework public int Bottom { get { return Top + Height; } } //Compact Framework public Rectangle Bounds { get { return bounds; } set { SetBounds (value.Left, value.Top, value.Width, value.Height); } } public bool CanFocus { get { if (IsHandleCreated && Visible && Enabled) return true; return false; } } [MonoTODO] public bool CanSelect { get { if (!GetStyle (ControlStyles.Selectable)) return false; if (Parent == null) return false; Control parent = Parent; while (parent != null){ if (!parent.Visible || !parent.Enabled) return false; parent = parent.Parent; } return true; } } //Compact Framework 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; } } //Compact Framework public Rectangle ClientRectangle { get { return new Rectangle (0, 0, ClientSize.Width, ClientSize.Height); } } //Compact Framework [MonoTODO] public Size ClientSize { get { return new Size (clientWidth, clientHeight); } set { SetClientSizeCore (value.Width, value.Height); } } [MonoTODO] public string CompanyName { get { //Better than throwing an execption return "Company Name"; } } public bool ContainsFocus { get { if (IsHandleCreated) { if (Focused) return true; foreach (Control ctr in Controls) { if (ctr.ContainsFocus) return true; } } return false; } } //Compact Framework [MonoTODO] public virtual ContextMenu ContextMenu { get { return contextMenu; } set { if (contextMenu != value){ contextMenu = value; OnContextMenuChanged (EventArgs.Empty); } } } public ControlCollection Controls { get { return childControls; } } public bool Created { get { return statuses[ CREATED ]; } } protected virtual CreateParams CreateParams { get { CreateParams createParams = new CreateParams (); createParams.Caption = Text; createParams.X = Left; createParams.Y = Top; 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 = ParkingWindowHandle; createParams.Style = (int) WindowStyles.WS_OVERLAPPED; if (visible) { createParams.Style |= (int) WindowStyles.WS_VISIBLE; } return createParams; } } internal protected IntPtr ControlRealWndProc = IntPtr.Zero; internal protected bool SubClassWndProc_ = false; // This function lets Windows or/and default Windows control process message // Classes have to call it if they do not handle message in WndProc or // default handling is needed. protected void CallControlWndProc (ref Message msg) { if (ControlRealWndProc != IntPtr.Zero) { bool callControlProc = true; if ((callWinControlProcMask & CallWinControlProcMask.MOUSE_MESSAGES) == 0 && msg.IsMouseMessage) { callControlProc = false; } if ((callWinControlProcMask & CallWinControlProcMask.KEYBOARD_MESSAGES) == 0 && msg.IsKeyboardMessage) { callControlProc = false; } if (callControlProc) { //Console.WriteLine ("CallControl {0}", msg.Msg); msg.Result = (IntPtr)Win32.CallWindowProc (ControlRealWndProc, msg.HWnd, (int)msg.Msg, msg.WParam.ToInt32 (), msg.LParam.ToInt32 ()); } } else { DefWndProc (ref msg); } } // Subclass only native Windows controls. Those classes have to set SubClassWndProc_ to true in contructor private void SubclassWindow () { if (IsHandleCreated && SubClassWndProc_) { ControlRealWndProc = Win32.SetWindowLong (Handle, GetWindowLongFlag.GWL_WNDPROC, NativeWindow.GetWindowProc ()); } } private void UnsubclassWindow () { if (IsHandleCreated) { Win32.SetWindowLong (Handle, GetWindowLongFlag.GWL_WNDPROC, ControlRealWndProc.ToInt32 ()); } } protected virtual void OnWmCommand (ref Message m) { if (m.LParam.ToInt32 () != 0) { if (m.LParam != Handle) { // Control notification System.Console.WriteLine ("Control notification Code {0} Id = Hwnd {1}", m.HiWordWParam, m.LParam.ToInt32 ()); Control.ReflectMessage (m.LParam, ref m); } else { // Unhandled Control reflection // Derived class didn't handle WM_COMMAND or called base.WndProc in WM_COMMAND handler // CHECKME: Shall we notify user in debug build, throw an exception or just ignore this case ? } } } [MonoTODO] public virtual Cursor Cursor { get { if (cursor == null) return Cursors.Default; return cursor; } set { cursor = value;} } //Compact Framework [MonoTODO] // waiting for BindingContext; should be stubbed now 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); return Font.FromHfont (Win32.GetStockObject (GSO_.DEFAULT_GUI_FONT)); } } public static Color DefaultForeColor { get { return SystemColors.ControlText; } } protected virtual ImeMode DefaultImeMode { get { return ImeMode.Inherit; } } protected virtual Size DefaultSize { get { //Default label size, this should be correct. return new Size (100,23); } } public virtual Rectangle DisplayRectangle { get { return ClientRectangle; } } public bool Disposing { get { return statuses [ DISPOSING ]; } } public virtual DockStyle Dock { get { return dock; } set { if (dock != value){ dock = value; if (dock != DockStyle.None) Anchor = (AnchorStyles.Left | AnchorStyles.Top); OnDockChanged (EventArgs.Empty); } } } //Compact Framework //public virtual bool Enabled { public bool Enabled { get { return enabled; //return Win32.IsWindowEnabled (Handle); } set { if (enabled != value) { Win32.EnableWindow (Handle, value); enabled = value; // FIXME: Disable/enable all children here Invalidate (); } } } //Compact Framework public virtual bool Focused { get { if (IsHandleCreated) { IntPtr focusedWindow = Win32.GetFocus (); if (focusedWindow == Handle) return true; } return false; } } //Compact Framework public virtual Font Font { get { Font result = font; if (result == null) { if (Parent != null) { result = Parent.Font; } if (result == null) { result = Control.DefaultFont; } } return result; } set { font = value; if (IsHandleCreated) { Win32.SendMessage (Handle, Msg.WM_SETFONT, Font.ToHfont ().ToInt32 (), 1); } } } [MonoTODO] protected int FontHeight { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } } //Compact Framework public virtual Color ForeColor { get { return foreColor; } set { foreColor = value; } } public bool HasChildren { get { if (childControls.Count >0) return true; return false; } } //Compact Framework public int Height { get { return bounds.Height; } set { SetBounds (bounds.X, bounds.Y, bounds.Width, value, BoundsSpecified.Height); } } 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 { return statuses [ DISPOSED ]; } } public bool IsHandleCreated { get { return window != null && window.Handle != IntPtr.Zero; } } //Compact Framework public int Left { get { return bounds.X; } set { SetBounds (value, bounds.Y, bounds.Width, bounds.Height, BoundsSpecified.X); } } //Compact Framework public Point Location { // CHECKME: get { return new Point (Top, Left); } set { SetBounds (value.X, value.Y, bounds.Width, bounds.Height, BoundsSpecified.Location); } } public static Keys ModifierKeys { get { Keys keys = Keys.None; if ( (Win32.GetKeyState ( (int) VirtualKeys.VK_SHIFT)& 0x8000)== 0x8000) keys |= Keys.Shift; if ( (Win32.GetKeyState ( (int) VirtualKeys.VK_MENU)& 0x8000) == 0x8000) keys |= Keys.Alt; if ( (Win32.GetKeyState ( (int) VirtualKeys.VK_CONTROL) & 0x8000) == 0x8000) keys |= Keys.Control; return keys; } } //Compact Framework public static MouseButtons MouseButtons { get { MouseButtons buttons = MouseButtons.None; if ( (Win32.GetAsyncKeyState ( (int) VirtualKeys.VK_LBUTTON ) & 0x8000)== 0x8000) buttons |= SystemInformation.MouseButtonsSwapped ? MouseButtons.Right : MouseButtons.Left; if ( (Win32.GetAsyncKeyState ( (int) VirtualKeys.VK_RBUTTON ) & 0x8000)== 0x8000) buttons |= SystemInformation.MouseButtonsSwapped ? MouseButtons.Left : MouseButtons.Right; if ( (Win32.GetAsyncKeyState ( (int) VirtualKeys.VK_MBUTTON ) & 0x8000)== 0x8000) buttons |= MouseButtons.Middle; if ( (Win32.GetAsyncKeyState ( (int) VirtualKeys.VK_XBUTTON1) & 0x8000)== 0x8000) buttons |= MouseButtons.XButton1; if ( (Win32.GetAsyncKeyState ( (int) VirtualKeys.VK_XBUTTON2) & 0x8000)== 0x8000) buttons |= MouseButtons.XButton2; return buttons; } } //Compact Framework public static Point MousePosition { get { POINT point = new POINT (); Win32.GetCursorPos (ref point); return new Point ( (int) point.x, (int) point.y); } } public string Name { // CHECKME: get { return name; } set { name = value; } } //Compact Framework public Control Parent { get { return parent; //IntPtr parent = GetParent (Handle); //return FromHandle (parent); } set { if (parent != value) { parent = value; // add ourself to the parents control if (!parent.Controls.Contains (this)) parent.Controls.Add (this); // FIXME: Is this logic correct ? if (BackColor == DefaultBackColor) { if (parent.BackColor != BackColor) OnParentBackColorChanged (new EventArgs ()); } if (IsHandleCreated) { Win32.SetParent (Handle, value.Handle); } /* else if (parent.IsHandleCreated){ // CHECKME: Now control is responsible for creating his window // when added to Form, may be things must be reversed. CreateControl (); } */ } } } protected static IntPtr ParkingWindowHandle { get { if (parkingWindow == null) parkingWindow = new NativeWindow (); if (parkingWindow.Handle == IntPtr.Zero){ CreateParams pars = new CreateParams (); pars.ClassName = "mono_native_window"; pars.Style = (int) WindowStyles.WS_OVERLAPPED; parkingWindow.CreateHandle (pars); } return parkingWindow.Handle; } } protected static void RegisterDefaultWindowClass () { if (!classRegistered){ WNDCLASS wndClass = new WNDCLASS (); wndClass.style = (int) (CS_.CS_OWNDC); wndClass.lpfnWndProc = NativeWindow.GetWindowProc (); wndClass.cbClsExtra = 0; wndClass.cbWndExtra = 0; wndClass.hInstance = (IntPtr)0; wndClass.hIcon = (IntPtr)0; wndClass.hCursor = Win32.LoadCursor ( (IntPtr)0, LC_.IDC_ARROW); wndClass.hbrBackground = (IntPtr) ( (int)GetSysColorIndex.COLOR_BTNFACE + 1); wndClass.lpszMenuName = ""; wndClass.lpszClassName = Win32.DEFAULT_WINDOW_CLASS; if (Win32.RegisterClass (ref wndClass) != 0) classRegistered = true; } } [MonoTODO] public string ProductName { get { //FIXME: return "Product Name"; } } [MonoTODO] public string ProductVersion { get { //FIXME: return "Product Version"; } } [MonoTODO] public bool RecreatingHandle { get { return statuses [ RECREATING_HANDLE ] ; } } public Region Region { // CHECKME: get { return region; } set { region = value; } } protected bool ResizeRedraw { get { return GetStyle (ControlStyles.ResizeRedraw); } set { SetStyle (ControlStyles.ResizeRedraw, value); } } //Compact Framework 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 (); } } //Compact Framework public Size Size { get { return new Size (Width, Height); } set { SetBounds (bounds.X, bounds.Y, value.Width, value.Height, BoundsSpecified.Size); } } internal int tabindex;//for debug/test only. remove [MonoTODO] public int TabIndex { get { return tabindex; } set { tabindex = value; } } public bool TabStop { // CHECKME: get { return tabStop; } set { tabStop = value; } } [MonoTODO] public object Tag { get { return tag; } set { tag = value; } } //Compact Framework public virtual string Text { get { // CHECKME: if we really need to provide back current text of real window // or just our copy in text member. if (IsHandleCreated){ int len = Win32.GetWindowTextLengthA (Handle); // FIXME: len is doubled due to some strange behaviour. (of GetWindowText function ?) // instead of 10 characters we can get only 9, even if sb.Capacity is 10. StringBuilder sb = new StringBuilder (len * 2 /*Win32.GetWindowTextLengthA (Handle)*/); Win32.GetWindowText (Handle, sb, sb.Capacity); text = sb.ToString (); } return text; } set { if (text != value){ text = value; if (IsHandleCreated) Win32.SetWindowTextA (Handle, value); OnTextChanged (EventArgs.Empty); } } } //Compact Framework public int Top { get { return bounds.Top; } set { SetBounds (bounds.X, value, bounds.Width, bounds.Height, BoundsSpecified.Y); } } [MonoTODO] public Control TopLevelControl { get { throw new NotImplementedException (); } } public bool Visible { get { return visible; } set { SetVisibleCore (value); } } //Compact Framework public int Width { get { return bounds.Width; } set { SetBounds (bounds.X, bounds.Y, value, bounds.Height, BoundsSpecified.Width); } } /// --- 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 () { if (IsHandleCreated) Win32.SetWindowPos (Handle, SetWindowPosZOrder.HWND_TOP, 0, 0, 0, 0, SetWindowPosFlags.SWP_NOMOVE | SetWindowPosFlags.SWP_NOSIZE); } public bool Contains (Control ctl) { return childControls.Contains (ctl); } public void CreateControl () { if (!Created) { CreateHandle (); OnCreateControl (); statuses [ CREATED ] = true; } } [MonoTODO] protected virtual AccessibleObject CreateAccessibilityInstance () { throw new NotImplementedException (); } protected virtual ControlCollection CreateControlsInstance () { return new ControlCollection (this); } //Compact Framework [MonoTODO] public Graphics CreateGraphics () { return Graphics.FromHwnd (Handle); } protected virtual void CreateHandle () { if (IsDisposed) throw new ObjectDisposedException (Name); if (IsHandleCreated) return; if (window == null) window = new ControlNativeWindow (this); CreateParams createParams = CreateParams; if (!Enabled) { createParams.Style |= (int)WindowStyles.WS_DISABLED; } window.CreateHandle (createParams); if (window.Handle != IntPtr.Zero) { if (!controlsCollection.Contains (window.Handle)) controlsCollection.Add (window.Handle, this); SubclassWindow (); CreatorThreadId_ = Win32.GetCurrentThreadId (); OnHandleCreated (EventArgs.Empty); } } protected virtual void DefWndProc (ref Message m) { window.DefWndProc (ref m); } protected virtual void DestroyHandle () { if (IsHandleCreated){ if (Handle != IntPtr.Zero) { controlsCollection.Remove (Handle); } if (window != null) { window.DestroyHandle (); } } } protected override void Dispose (bool disposing) { lock (this){ statuses [ DISPOSING ] = true; try { if (disposing){ DestroyHandle (); } // close/free unmanaged resources } finally { base.Dispose (disposing); } statuses [ DISPOSED ] = true; } } [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 (); } //Compact Framework public bool Focus () { if (Win32.SetFocus (Handle) != (IntPtr) 0) return true; return false; } [MonoTODO] public static Control FromChildHandle (IntPtr handle) { Control control = null; IntPtr controlHwnd = handle; while (controlHwnd != IntPtr.Zero) { control = controlsCollection[controlHwnd] as Control; if (control != null) break; controlHwnd = Win32.GetParent (controlHwnd); } return control; } public static Control FromHandle (IntPtr handle) { // FIXME: Here we have to check, whether control already exists //Control control = new Control (handle); Control control = controlsCollection[handle] as Control; return control; } [MonoTODO] public Control GetChildAtPoint (Point pt) { throw new NotImplementedException (); } [MonoTODO] public IContainerControl GetContainerControl () { throw new NotImplementedException (); } internal Control getNextFocusedControlCore (Control parent, Control ctl, bool forward) { while (parent.Parent != null) parent = parent.Parent; Control next = parent.GetNextControl (ctl, forward); while (next != null){ if (next.TabStop && next.CanFocus) return next; next = parent.GetNextControl (next, forward); } return null; } internal Control getNextFocusedControl (Control parent, bool forward) { Control next = getNextFocusedControlCore (parent, FocusedControl, forward); if (next == null) next = getNextFocusedControlCore (parent, null, forward); return next; } [MonoTODO] public Control GetNextControl (Control ctl, bool forward) { Control next = null; if (ctl == null) next = Controls.GetFirstControl (forward); else { if (forward) next = getNextControlForward (ctl); else next = getNextControlBackward (ctl); } return next; } private Control getNextControlForward (Control ctl) { if (ctl.Controls.Count != 0) return ctl.Controls.GetFirstControl (true); Control parent = ctl.Parent; if (parent != null){ while (parent != null){ Control next = parent.Controls.GetNextControl (ctl, true); if (next != null) return next; ctl = parent; parent = parent.Parent; } return null; } else return Controls.GetFirstControl (true); } private Control getNextControlBackward (Control ctl) { Control parent = ctl.Parent; if (parent != null){ Control next = parent.Controls.GetNextControl (ctl, false); if (next != null){ if (next.Controls.Count > 0) return next.Controls.GetFirstControl (false); else return next; } return parent; } else return Controls.GetFirstControl (false); } [MonoTODO] protected bool GetStyle (ControlStyles flag) { return (controlStyles_ & flag) != 0; } [MonoTODO] protected bool GetTopLevel () { return statuses [ TOPLEVEL ]; } public void Hide () { Visible = false; } [MonoTODO] protected virtual void InitLayout () { //FIXME: } //Compact Framework public void Invalidate () { if (IsHandleCreated) { Win32.InvalidateRect (Handle, IntPtr.Zero, 1); } } public void Invalidate (bool invalidateChildren) { Invalidate () ; if (invalidateChildren){ foreach (Control child in Controls) child.Invalidate (invalidateChildren); } } // tries to find appropriate owner for modal form internal static Control getOwnerWindow (Control skip) { // temporary solution IEnumerator cw = controlsCollection.GetEnumerator (); while (cw.MoveNext ()){ Control c = ( (DictionaryEntry) cw.Current).Value as Control; if (c != null && c != skip){ IntPtr parent = Win32.GetParent (c.Handle); IntPtr owner = Win32.GetWindow (c.Handle, (uint) GetWindowConstants.GW_OWNER); if (parent == IntPtr.Zero && owner == IntPtr.Zero) return c; } } return null; } //Compact Framework public void Invalidate (Rectangle rc) { if (IsHandleCreated) { RECT rect = new 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) { //FIXME: } [MonoTODO] public void Invalidate (Rectangle rc, bool invalidateChildren) { //FIXME: } [MonoTODO] public void Invalidate (Region region,bool invalidateChildren) { //FIXME: } [MonoTODO] protected void InvokeGotFocus (Control toInvoke, EventArgs e) { //FIXME: } [MonoTODO] protected void InvokeLostFocus (Control toInvoke, EventArgs e) { //FIXME: } [MonoTODO] protected void InvokeOnClick (Control toInvoke, EventArgs e) { //FIXME: } [MonoTODO] protected void InvokePaint (Control c, PaintEventArgs e) { //FIXME: } [MonoTODO] protected void InvokePaintBackground ( Control c,PaintEventArgs e) { //FIXME: } [MonoTODO] protected virtual bool IsInputChar (char charCode) { return true; } [MonoTODO] protected virtual bool IsInputKey (Keys keyData) { return false; } public static bool IsMnemonic (char charCode, string text) { if (text == null) return false; return text.IndexOf ("&" + charCode)> 0; } // methods used with events: protected virtual void OnBackColorChanged (EventArgs e) { if (BackColorChanged != null) BackColorChanged (this, e); foreach (Control ctl in Controls) { ctl.OnParentBackColorChanged (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); } //Compact Framework 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 (Created){ e.Control.CreateControl (); } e.Control.Visible = Visible; if (ControlAdded != null) ControlAdded (this, e); } protected virtual void OnControlRemoved (ControlEventArgs e) { if (ControlRemoved != null) ControlRemoved (this, e); } protected virtual void OnCreateControl () { //FIXME: // create all child windows IEnumerator cw = childControls.GetEnumerator (); while (cw.MoveNext ()) { Control control = (Control) cw.Current; control.CreateControl (); control.Show (); } } protected virtual void OnCursorChanged (EventArgs e) { if (CursorChanged != null) CursorChanged (this, e); } protected virtual void OnDockChanged (EventArgs e) { // changing this property does not affect the control directly // so have its parent to calculate new layout if (Parent != null) Parent.PerformLayout (this, "Dock"); if (DockChanged != null) DockChanged (this, e); } protected virtual void OnDoubleClick (EventArgs e) { if (DoubleClick != null) DoubleClick (this, e); } protected virtual void OnDragDrop (DragEventArgs drgevent) { if (DragDrop != null) DragDrop (this, drgevent); } protected virtual void OnDragEnter (DragEventArgs drgevent) { if (DragEnter != null) DragEnter (this, drgevent); } protected virtual void OnDragLeave (EventArgs e) { if (DragLeave != null) DragLeave (this, e); } protected virtual void OnDragOver (DragEventArgs drgevent) { if (DragOver != null) DragOver (this, drgevent); } //Compact Framework 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 gfbevent) { if (GiveFeedback != null) GiveFeedback (this, gfbevent); } //Compact Framework protected virtual void OnGotFocus (EventArgs e) { if (GotFocus != null) GotFocus (this, e); } protected virtual void OnHandleCreated (EventArgs e) { //if (font != null) { // Win32.SendMessage (Handle, Msg.WM_SETFONT, font.ToHfont ().ToInt32 (), 0); //} Win32.SendMessage (Handle, Msg.WM_SETFONT, Font.ToHfont ().ToInt32 (), 0); Win32.SetWindowText (Handle, text); if (HandleCreated != null) HandleCreated (this, e); } protected virtual void OnHandleDestroyed (EventArgs e) { if (Handle != IntPtr.Zero) { controlsCollection.Remove (Handle); } if (HandleDestroyed != null) { HandleDestroyed (this, e); } } protected virtual void OnHelpRequested (HelpEventArgs hevent) { if (HelpRequested != null) HelpRequested (this, hevent); } protected virtual void OnImeModeChanged (EventArgs e) { if (ImeModeChanged != null) ImeModeChanged (this, e); } protected virtual void OnInvalidated (InvalidateEventArgs e) { if (Invalidated != null) Invalidated (this, e); } //Compact Framework protected virtual void OnKeyDown (KeyEventArgs e) { if (KeyDown != null) KeyDown (this, e); } //Compact Framework protected virtual void OnKeyPress (KeyPressEventArgs e) { if (KeyPress != null) KeyPress (this, e); } //Compact Framework protected virtual void OnKeyUp (KeyEventArgs e) { if (KeyUp != null) KeyUp (this, e); } protected virtual void OnLayout (LayoutEventArgs levent) { DoDockAndAnchorLayout (levent); if (Layout != null) Layout (this, levent); } protected virtual void OnLeave (EventArgs e) { if (Leave != null) Leave (this, e); } protected virtual void OnLocationChanged (EventArgs e) { if (LocationChanged != null) LocationChanged (this, e); } //Compact Framework protected virtual void OnLostFocus (EventArgs e) { if (LostFocus != null) LostFocus (this, e); } //Compact Framework protected virtual void OnMouseDown (MouseEventArgs e) { if (MouseDown != null) MouseDown (this, e); } protected virtual void OnMouseEnter (EventArgs e) { //System.Console.WriteLine ("OnMouseEnter"); if (MouseEnter != null) MouseEnter (this, e); } protected virtual void OnMouseHover (EventArgs e) { if (MouseHover != null) MouseHover (this, e); } protected virtual void OnMouseLeave (EventArgs e) { //System.Console.WriteLine ("OnMouseLeave"); mouseIsInside_ = false; if (MouseLeave != null) MouseLeave (this, e); } //Compact Framework protected virtual void OnMouseMove (MouseEventArgs e) { // If enter and mouse pressed - do not process if ( ( (e.Button & MouseButtons.Left) != 0) && !mouseIsInside_) return; if (!mouseIsInside_) { TRACKMOUSEEVENT tme = new TRACKMOUSEEVENT (); tme.cbSize = 16; tme.hWnd = Handle; tme.dwFlags = (int)TrackerEventFlags.TME_LEAVE; tme.dwHoverTime = 0; bool result = Win32.TrackMouseEvent (ref tme); if (!result) { System.Console.WriteLine ("{0}",Win32.FormatMessage (Win32.GetLastError ())); } } POINT pt = new POINT (); pt.x = e.X; pt.y = e.Y; Win32.ClientToScreen (Handle, ref pt); IntPtr wndUnderMouse = Win32.WindowFromPoint (pt); if (wndUnderMouse != Handle) { // we are outside of the window if (mouseIsInside_) { OnMouseLeave (new EventArgs ()); mouseIsInside_ = false; } } else { if (!mouseIsInside_) { mouseIsInside_ = true; OnMouseEnter (new EventArgs ()); } } if (MouseMove != null) MouseMove (this, e); } //Compact Framework 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) { //FIXME: } //Compact Framework protected virtual void OnPaint (PaintEventArgs e) { if (Paint != null) Paint (this, e); } //Compact Framework protected virtual void OnPaintBackground (PaintEventArgs pevent) { if (GetStyle (ControlStyles.UserPaint)) { Brush br = new SolidBrush (BackColor); pevent.Graphics.FillRectangle (br, pevent.ClipRectangle); br.Dispose (); } } protected virtual void OnParentBackColorChanged (EventArgs e) { BackColor = Parent.BackColor; // FIXME: setting BackColor fires the BackColorChanged event, // so we do not need to call this here /* 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); } //Compact Framework 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 qcdevent) { if (QueryContinueDrag != null) QueryContinueDrag (this, qcdevent); } //Compact Framework protected virtual void OnResize (EventArgs e) { if (Resize != null) Resize (this, e); PerformLayout (this, "Bounds"); } protected virtual void OnRightToLeftChanged (EventArgs e) { if (RightToLeftChanged != null) RightToLeftChanged (this, e); } protected virtual void OnSizeChanged (EventArgs e) { OnResize (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); } //Compact Framework 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); PerformLayout (); } // --- end of methods for events --- [MonoTODO] public void PerformLayout () { PerformLayout (null, null); } [MonoTODO] public void PerformLayout (Control affectedControl, string affectedProperty) { if (!statuses [ LAYOUT_SUSPENDED ]) OnLayout (new LayoutEventArgs (affectedControl, affectedProperty)); else statuses [ LAYOUT_PENDING ] = true; } //Compact Framework public Point PointToClient ( Point p ) { POINT pt = new POINT(); pt.x = p.X; pt.y = p.Y; Win32.ScreenToClient( Handle, ref pt); return new Point ( pt.x, pt.y ); } //Compact Framework public Point PointToScreen ( Point p ) { POINT pt = new POINT(); pt.x = p.X; pt.y = p.Y; Win32.ClientToScreen ( Handle, ref pt); return new Point ( pt.x, pt.y ); } [MonoTODO] public virtual bool PreProcessMessage (ref Message msg) { if (msg.Msg == Msg.WM_KEYDOWN){ Keys keyData = (Keys)msg.WParam.ToInt32 (); if (!ProcessCmdKey (ref msg, keyData)) { if (IsInputKey (keyData)) return false; return ProcessDialogKey (keyData); } return true; } else if (msg.Msg == Msg.WM_CHAR){ if (IsInputChar ( (char) msg.WParam)) return false; return ProcessDialogChar ( (char) msg.WParam); } return false; } [MonoTODO] protected virtual bool ProcessCmdKey (ref Message msg, Keys keyData) { // do something with context menu if (Parent != null) return Parent.ProcessCmdKey (ref msg, keyData); return false; } [MonoTODO] protected virtual bool ProcessDialogChar (char charCode) { if (Parent != null) return Parent.ProcessDialogChar (charCode); return false; } [MonoTODO] protected virtual bool ProcessDialogKey (Keys keyData) { if (Parent != null) return Parent.ProcessDialogKey (keyData); return false; } [MonoTODO] protected virtual bool ProcessKeyEventArgs (ref Message m) { bool handled = false; switch (m.Msg){ case Msg.WM_KEYDOWN: KeyEventArgs args_down = new KeyEventArgs ( (Keys)m.WParam.ToInt32 ()); OnKeyDown (args_down); handled = args_down.Handled; break; case Msg.WM_CHAR: KeyPressEventArgs args_press = new KeyPressEventArgs ( (char) m.WParam); OnKeyPress (args_press); handled = args_press.Handled; break; case Msg.WM_KEYUP: KeyEventArgs args_up = new KeyEventArgs ( (Keys)m.WParam.ToInt32 ()); OnKeyUp (args_up); handled = args_up.Handled; break; } return handled; } [MonoTODO] protected internal virtual bool ProcessKeyMessage (ref Message m) { if (Parent != null){ if (!Parent.ProcessKeyPreview (ref m)) return ProcessKeyEventArgs (ref m); } return false; } [MonoTODO] protected virtual bool ProcessKeyPreview (ref Message m) { if (Parent != null) return Parent.ProcessKeyPreview (ref m); return false; } // This default implementation of the ProcessMnemonic method simply // returns false to indicate that the control has no mnemonic. protected virtual bool ProcessMnemonic (char charCode) { return false; } // used when properties/values of Control // are big enough to warrant recreating the HWND protected void RecreateHandle () { statuses [RECREATING_HANDLE] = true; if (IsHandleCreated) { DestroyHandle (); CreateHandle (); UpdateZOrder (); IEnumerator cw = childControls.GetEnumerator (); while (cw.MoveNext ()) ( (Control)cw.Current).RecreateHandle (); } statuses [ RECREATING_HANDLE ] = false; } //Compact Framework public Rectangle RectangleToClient (Rectangle r) { RECT rect = new RECT (); rect.left = r.Left; rect.top = r.Top; rect.right = r.Right; rect.bottom = r.Bottom; Win32.ScreenToClient (Handle,ref rect); return new Rectangle (rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); } //Compact Framework public Rectangle RectangleToScreen (Rectangle r) { RECT rect = new RECT (); rect.left = r.Left; rect.top = r.Top; rect.right = r.Right; rect.bottom = r.Bottom; Win32.ClientToScreen (Handle,ref rect); return new Rectangle (rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); } [MonoTODO] protected static bool ReflectMessage (IntPtr hWnd, ref Message m) { bool result = false; Control cntrl = Control.FromHandle (hWnd); if (cntrl != null) { cntrl.WndProc (ref m); result = true; } return result; } public virtual void Refresh () { Win32.UpdateWindow (Handle); } [MonoTODO] public virtual void ResetBackColor () { //FIXME: } [MonoTODO] public void ResetBindings () { //FIXME: } [MonoTODO] public virtual void ResetFont () { //FIXME: } [MonoTODO] public virtual void ResetForeColor () { //FIXME: } [MonoTODO] public void ResetImeMode () { //FIXME: } public virtual void ResetCursor(){ } [MonoTODO] public virtual void ResetRightToLeft () { //FIXME: } [MonoTODO] public virtual void ResetText () { //FIXME: } [MonoTODO] public void ResumeLayout () { statuses [ LAYOUT_SUSPENDED ] = false; if (statuses [ LAYOUT_PENDING ]){ PerformLayout (); statuses [ LAYOUT_PENDING ] = false; } } [MonoTODO] public void ResumeLayout (bool performLayout) { statuses [ LAYOUT_SUSPENDED ] = false; if (performLayout && statuses [ LAYOUT_PENDING ]){ PerformLayout (); statuses [ LAYOUT_PENDING ] = false; } } [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 (); } public void Scale (float ratio) { Scale (ratio, ratio); } [MonoTODO] public void Scale (float dx,float dy) { SuspendLayout (); ScaleCore (dx, dy); IEnumerator cw = childControls.GetEnumerator (); while (cw.MoveNext ()){ Control control = (Control) cw.Current; control.Scale (dx, dy); } ResumeLayout (); } [MonoTODO] protected virtual void ScaleCore (float dx, float dy) { Location = new Point ( (int) (Left * dx), (int) (Top * dy)); ClientSize = new Size ( (int) (ClientSize.Width * dx), (int) (ClientSize.Height * dy)); } [MonoTODO] public void Select () { //FIXME: } [MonoTODO] protected virtual void Select (bool directed,bool forward) { //FIXME: } [MonoTODO] public bool SelectNextControl (Control ctl, bool forward, bool tabStopOnly, bool nested, bool wrap) { throw new NotImplementedException (); } //Compact Framework [MonoTODO] public void SendToBack () { //FIXME: } [MonoTODO] public void SetBounds (int x, int y, int width, int height) { SetBounds (x, y, width, height, BoundsSpecified.All); } [MonoTODO] public void SetBounds (int x, int y, int width, int height, BoundsSpecified specified) { SetBoundsCore (x, y, width, height, specified); } [MonoTODO] protected virtual void SetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified) { if ( (specified & BoundsSpecified.X) == 0) x = Left; if ( (specified & BoundsSpecified.Y) == 0) y = Top; if ( (specified & BoundsSpecified.Width) == 0) width = Width; if ( (specified & BoundsSpecified.Height) == 0) height = Height; if (IsHandleCreated){ SetWindowPosFlags flags = SetWindowPosFlags.SWP_NOZORDER | SetWindowPosFlags.SWP_FRAMECHANGED | SetWindowPosFlags.SWP_DRAWFRAME; Win32.SetWindowPos (Handle, SetWindowPosZOrder.HWND_NOTOPMOST, x, y, width, height, flags); } UpdateBounds (x, y, width, height); } protected virtual bool MenuPresent { get { return false; } } [MonoTODO] protected virtual void SetClientSizeCore (int x, int y) { RECT rc = new RECT (); rc.right = x; rc.bottom = y; CreateParams pars = CreateParams; Win32.AdjustWindowRectEx (ref rc, pars.Style, MenuPresent ? 1 : 0, pars.ExStyle); Size = new Size (rc.right - rc.left, rc.bottom - rc.top); } [MonoTODO] protected void SetStyle (ControlStyles flag, bool value) { if (value) { controlStyles_ |= flag; } else { controlStyles_ &= ~flag; } } protected void SetTopLevel (bool value) {/* if (value) // FIXME: verify on whether this is supposed // to activate/deactive the window Win32.SetWindowPos (Handle, SetWindowPosZOrder.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, ShowWindowStyles.SW_HIDE); */ if (GetTopLevel () != value && Parent != null) throw new ArgumentException (); statuses [ TOPLEVEL ] = value; } [MonoTODO] protected virtual void SetVisibleCore (bool value) { bool visibleChanged = (visible != value); visible = value; if (visibleChanged) OnVisibleChanged (EventArgs.Empty); if (IsHandleCreated){ SetWindowPosFlags flags = value ? SetWindowPosFlags.SWP_SHOWWINDOW : SetWindowPosFlags.SWP_HIDEWINDOW; flags |= SetWindowPosFlags.SWP_NOZORDER | SetWindowPosFlags.SWP_NOMOVE | SetWindowPosFlags.SWP_NOSIZE; Win32.SetWindowPos (Handle, 0, 0, 0, 0, 0, flags); } foreach (Control c in Controls) c.Visible = value ; } public void Show () { Visible = true; } public void SuspendLayout () { statuses [ LAYOUT_SUSPENDED ] = true; } //Compact Framework public void Update () { Win32.UpdateWindow (Handle); } [MonoTODO] protected void UpdateBounds () { // update control bounds with current size and position // currently, this function is called in responce to // window events, so I assume that all window handles // are created RECT rect = new RECT (); Win32.GetWindowRect (Handle, ref rect); IntPtr parent = Win32.GetParent (Handle); if (parent != IntPtr.Zero){ Win32.ScreenToClient (parent, ref rect); } UpdateBounds (rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); } [MonoTODO] protected void UpdateBounds (int x, int y, int width, int height) { int clWidth = width; int clHeight = height; CreateParams pars = CreateParams; RECT rc = new RECT (); rc.right = width; rc.bottom = height; Win32.AdjustWindowRectEx (ref rc, pars.Style, MenuPresent ? 1 : 0, pars.ExStyle); clWidth -= ( (rc.right - rc.left)- clWidth); clHeight -= ( (rc.bottom - rc.top)- clHeight); UpdateBounds (x , y, width, height, clWidth, clHeight); } [MonoTODO] protected void UpdateBounds ( int x, int y, int width, int height, int clientWidth, int clientHeight) { oldBounds.X = bounds.X; oldBounds.Y = bounds.Y; oldBounds.Width = bounds.Width; oldBounds.Height = bounds.Height; bool bLocationChanged = (bounds.X != x)|| (bounds.Y != y); bounds.X = x; bounds.Y = y; bool bSizeChanged = (bounds.Width != width)|| (bounds.Height != height); bounds.Width = width; bounds.Height = height; this.clientWidth = clientWidth; this.clientHeight = clientHeight; // FIXME: not sure whether this is correct if (statuses [ LAYOUT_SUSPENDED ]) { oldBounds.X = bounds.X; oldBounds.Y = bounds.Y; oldBounds.Width = bounds.Width; oldBounds.Height = bounds.Height; } if (bLocationChanged) OnLocationChanged (EventArgs.Empty); if (bSizeChanged) OnSizeChanged (EventArgs.Empty); } [MonoTODO] protected void UpdateStyles () { //FIXME: } [MonoTODO] protected void UpdateZOrder () { if (!IsHandleCreated || Parent == null) return; int position = Parent.Controls.GetChildIndex (this , false); switch (position){ case 0: BringToFront (); break; // not in collection for some reason case -1: break; default: Control prev = Parent.Controls [ position - 1 ]; if (prev.IsHandleCreated) Win32.SetWindowPos (Handle, prev.Handle, 0, 0, 0, 0, SetWindowPosFlags.SWP_NOMOVE | SetWindowPosFlags.SWP_NOSIZE); break; } } internal MouseEventArgs Msg2MouseEventArgs (ref Message msg) { MouseButtons mb = MouseButtons.None; KeyStatusFlags keyIndicator = (KeyStatusFlags)msg.WParam.ToInt32 (); if ( (keyIndicator & KeyStatusFlags.MK_LBUTTON) != 0) { mb |= MouseButtons.Left; } if ( (keyIndicator & KeyStatusFlags.MK_RBUTTON) != 0) { mb |= MouseButtons.Right; } if ( (keyIndicator & KeyStatusFlags.MK_MBUTTON) != 0) { mb |= MouseButtons.Middle; } if ( (keyIndicator & KeyStatusFlags.MK_XBUTTON1) != 0) { mb |= MouseButtons.XButton1; } if ( (keyIndicator & KeyStatusFlags.MK_XBUTTON2) != 0) { mb |= MouseButtons.XButton2; } return new MouseEventArgs (mb, (mb != MouseButtons.None) ? 1: 0, msg.LoWordLParam, msg.HiWordLParam, 0); } // 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 // FIXME: Graphics does not have a public constructor, you must get one from .NET //PaintEventArgs paintEventArgs = new PaintEventArgs ( // new Graphics (), new Rectangle ()); if ( (uint)m.Msg == Control.InvokeMessage) { ControlInvokeHelper helper = null; lock (InvokeQueue_.SyncRoot) { if (InvokeQueue_.Count > 0) { helper = (ControlInvokeHelper)InvokeQueue_.Dequeue (); } } if (helper != null) { helper.ExecuteMethod (); } return; } else if (m.Msg == Msg.WM_COMMAND) { // Notification m.Result = (IntPtr)1; OnWmCommand (ref m); if (m.Result != IntPtr.Zero) { CallControlWndProc (ref m); } return; } switch (m.Msg) { case Msg.WM_CREATE: Console.WriteLine ("WM_CREATE"); OnHandleCreated (eventArgs); break; case Msg.WM_LBUTTONDBLCLK: OnDoubleClick (eventArgs); CallControlWndProc (ref m); break; // OnDragDrop // OnDragEnter // OnDragLeave // OnDragOver // OnQueryContinueDrag case Msg.WM_ENABLE: OnEnabledChanged (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_SETFOCUS: OnEnter (eventArgs); OnGotFocus (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_FONTCHANGE: OnFontChanged (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_DESTROY: OnHandleDestroyed (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_HELP: // FIXME: //OnHelpRequested (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_KEYDOWN: if (!ProcessKeyMessage (ref m)) CallControlWndProc (ref m); break; case Msg.WM_CHAR: if (!ProcessKeyMessage (ref m)) CallControlWndProc (ref m); break; case Msg.WM_KEYUP: if (!ProcessKeyMessage (ref m)) CallControlWndProc (ref m); break; case Msg.WM_KILLFOCUS: OnLeave (eventArgs); OnLostFocus (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_MOUSEACTIVATE: //OnMouseEnter (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_MOUSEHOVER: // called by TrackMouseEvent OnMouseHover (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_MOUSELEAVE: // called by TrackMouseEvent OnMouseLeave (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_MOUSEMOVE: // FIXME: OnMouseMove (Msg2MouseEventArgs (ref m)); CallControlWndProc (ref m); break; case Msg.WM_LBUTTONDOWN: // FIXME: OnMouseDown (Msg2MouseEventArgs(ref m)); CallControlWndProc (ref m); break; case Msg.WM_LBUTTONUP: // FIXME: OnMouseUp (Msg2MouseEventArgs(ref m)); CallControlWndProc (ref m); break; case Msg.WM_MOUSEWHEEL: // FIXME: //OnMouseWheel (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_MOVE: OnMove (eventArgs); UpdateBounds (); CallControlWndProc (ref m); break; case Msg.WM_CTLCOLOREDIT : if ( !Control.ReflectMessage ( m.LParam, ref m ) ) CallControlWndProc ( ref m ); break; //case Msg.WM_CTLCOLORSTATIC: // if ( !Control.ReflectMessage ( m.LParam, ref m ) ) // CallControlWndProc ( ref m ); //break; case Msg.WM_NOTIFY: NMHDR nmhdr = (NMHDR)Marshal.PtrToStructure (m.LParam, typeof (NMHDR)); if (!Control.ReflectMessage (nmhdr.hwndFrom, ref m)) CallControlWndProc (ref m); // FIXME: get NM_CLICKED msg from pnmh // OnClick (eventArgs); //OnNotifyMessage (eventArgs); break; case Msg.WM_ERASEBKGND: if (GetStyle (ControlStyles.UserPaint)){ if (!GetStyle (ControlStyles.AllPaintingInWmPaint)) { PaintEventArgs eraseEventArgs = new PaintEventArgs (Graphics.FromHdc (m.WParam), new Rectangle (new Point (0,0),Size)); OnPaintBackground (eraseEventArgs); eraseEventArgs.Dispose (); } m.Result = (IntPtr)1; } else { CallControlWndProc (ref m); } break; case Msg.WM_PAINT: if (!GetStyle (ControlStyles.UserPaint)) { CallControlWndProc (ref m); } else { PAINTSTRUCT ps = new PAINTSTRUCT (); IntPtr hdc = Win32.BeginPaint (Handle, ref ps); Rectangle rc = new Rectangle (); rc.X = ps.rcPaint.left; rc.Y = ps.rcPaint.top; rc.Width = ps.rcPaint.right - ps.rcPaint.left; rc.Height = ps.rcPaint.bottom - ps.rcPaint.top; PaintEventArgs paintEventArgs = new PaintEventArgs (Graphics.FromHdc (hdc), rc); if (GetStyle (ControlStyles.AllPaintingInWmPaint)) { OnPaintBackground (paintEventArgs); } OnPaint (paintEventArgs); paintEventArgs.Dispose (); Win32.EndPaint (Handle, ref ps); } break; case Msg.WM_SIZE: if (GetStyle (ControlStyles.ResizeRedraw)) { Invalidate (); } CallControlWndProc (ref m); break; case Msg.WM_WINDOWPOSCHANGED: UpdateBounds (); CallControlWndProc (ref m); break; case Msg.WM_STYLECHANGED: OnStyleChanged (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_SYSCOLORCHANGE: OnSystemColorsChanged (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_SETTEXT: //OnTextChanged (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_SETFONT: //OnTextChanged (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_SHOWWINDOW: OnVisibleChanged (eventArgs); CallControlWndProc (ref m); break; case Msg.WM_CTLCOLORLISTBOX: Win32.SetTextColor (m.WParam, Win32.RGB (ForeColor)); //Win32.SetBkColor (m.WParam, 0x00FF00); //m.Result = Win32.GetStockObject (GSO_.LTGRAY_BRUSH); break; case Msg.WM_MEASUREITEM: ReflectMessage (m.WParam, ref m); break; case Msg.WM_DRAWITEM: Control.ReflectMessage (m.WParam, ref m); break; case Msg.WM_HSCROLL: case Msg.WM_VSCROLL: if (!Control.ReflectMessage (m.LParam, ref m)) { CallControlWndProc (ref m); } break; case Msg.WM_SETCURSOR: if (cursor != null && cursor.Handle != IntPtr.Zero){ Win32.SetCursor (cursor.Handle); m.Result = (IntPtr)1; } else CallControlWndProc (ref m); break; case Msg.WM_RBUTTONDOWN: if (contextMenu != null){ contextMenu.Show (this, new Point (Win32.HIGH_ORDER (m.LParam.ToInt32 ()), Win32.LOW_ORDER (m.LParam.ToInt32 ()))); } OnMouseDown ( Msg2MouseEventArgs( ref m ) ); CallControlWndProc (ref m); break; default: CallControlWndProc (ref m); /* if (ControlRealWndProc != IntPtr.Zero) { CallControlWndProc (ref m); } else { DefWndProc (ref m); } */ break; } } private void DoAnchor (Control ctrl) { // the default, no actions are needed if (ctrl.Anchor == (AnchorStyles.Left | AnchorStyles.Top)) return; int deltaWidth = Bounds.Width - oldBounds.Width; int deltaHeight = Bounds.Height - oldBounds.Height; double x_change = 0; double y_change = 0; double halfDeltaWidth = (double)deltaWidth / 2.0; double halfDeltaHeight = (double)deltaHeight / 2.0; Rectangle controlBounds = ctrl.Bounds; if ( (ctrl.Anchor & AnchorStyles.Left) == 0) { x_change += halfDeltaWidth; } if ( (ctrl.Anchor & AnchorStyles.Top) == 0) { y_change += halfDeltaHeight; } if ( (ctrl.Anchor & AnchorStyles.Right) == AnchorStyles.Right) { if ( (ctrl.Anchor & AnchorStyles.Left) == AnchorStyles.Left) { if ( !ctrl.GetStyle ( ControlStyles.FixedWidth ) ) controlBounds.Width += deltaWidth; } else { x_change += halfDeltaWidth; } } if ( (ctrl.Anchor & AnchorStyles.Bottom) == AnchorStyles.Bottom) { if ( (ctrl.Anchor & AnchorStyles.Top) == AnchorStyles.Top) { if ( !ctrl.GetStyle ( ControlStyles.FixedHeight ) ) controlBounds.Height += deltaHeight; } else { y_change += halfDeltaHeight; } } controlBounds.X += (int) Math.Round( x_change ); controlBounds.Y += (int) Math.Round( y_change ); ctrl.Bounds = controlBounds; } private void DoDockAndAnchorLayout (LayoutEventArgs e) { Rectangle area = DisplayRectangle; for (int i = childControls.Count - 1; i >= 0; i--){ Control control = childControls[i]; switch (control.Dock){ case DockStyle.Bottom: control.SetBounds (area.Left, area.Bottom - control.Height, area.Width, control.Height); area.Height -= control.Height; break; case DockStyle.Top: control.SetBounds (area.Left, area.Y, area.Width, control.Height); area.Y += control.Height; area.Height -= control.Height; break; case DockStyle.Right: control.SetBounds (area.Right - control.Width, area.Top, control.Width, area.Height); area.Width -= control.Width; break; case DockStyle.Left: control.SetBounds (area.Left, area.Y, control.Width, area.Height); area.X += control.Width; area.Width -= control.Width; break; case DockStyle.None: DoAnchor (control); break; } } for (int i = childControls.Count - 1; i >= 0; i--){ Control control = childControls[i]; if (control.Dock == DockStyle.Fill){ control.SetBounds (area.X, area.Y, area.Width, area.Height); } } } internal static Control FocusedControl { get { IEnumerator cw = controlsCollection.GetEnumerator (); while (cw.MoveNext ()){ Control c = ( (DictionaryEntry) cw.Current).Value as Control; if (c.Focused)return c; } return null; } } internal Control getParentForm () { Control parent = this.Parent; while (parent != null){ if (parent is Form) return parent; parent = parent.Parent; } return null; } /// --- Control: events --- public event EventHandler BackColorChanged; public event EventHandler BackgroundImageChanged; public event EventHandler BindingContextChanged; public event EventHandler CausesValidationChanged; public event UICuesEventHandler ChangeUICues; //Compact Framework public event EventHandler Click; public event EventHandler ContextMenuChanged; public event ControlEventHandler ControlAdded; public event ControlEventHandler ControlRemoved; public event EventHandler CursorChanged; public event EventHandler DockChanged; public event EventHandler DoubleClick; public event DragEventHandler DragDrop; public event DragEventHandler DragEnter; public event EventHandler DragLeave; public event DragEventHandler DragOver; //Compact Framework public event EventHandler EnabledChanged; public event EventHandler Enter; public event EventHandler FontChanged; public event EventHandler ForeColorChanged; public event GiveFeedbackEventHandler GiveFeedback; //Compact Framework public event EventHandler GotFocus; public event EventHandler HandleCreated; public event EventHandler HandleDestroyed; public event HelpEventHandler HelpRequested; public event EventHandler ImeModeChanged; public event InvalidateEventHandler Invalidated; //Compact Framework public event KeyEventHandler KeyDown; //Compact Framework public event KeyPressEventHandler KeyPress; //Compact Framework public event KeyEventHandler KeyUp; public event LayoutEventHandler Layout; public event EventHandler Leave; public event EventHandler LocationChanged; //Compact Framework public event EventHandler LostFocus; //Compact Framework public event MouseEventHandler MouseDown; public event EventHandler MouseEnter; public event EventHandler MouseHover; public event EventHandler MouseLeave; //Compact Framework public event MouseEventHandler MouseMove; //Compact Framework public event MouseEventHandler MouseUp; public event MouseEventHandler MouseWheel; public event EventHandler Move; //Compact Framework public event PaintEventHandler Paint; //Compact Framework public event EventHandler ParentChanged; public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp; public event QueryContinueDragEventHandler QueryContinueDrag; //Compact Framework public event EventHandler Resize; public event EventHandler RightToLeftChanged; public event EventHandler SizeChanged; public event EventHandler StyleChanged; public event EventHandler SystemColorsChanged; public event EventHandler TabIndexChanged; public event EventHandler TabStopChanged; //Compact Framework public event EventHandler TextChanged; public event EventHandler Validated; //[MonoTODO] // CancelEventHandler not yet defined public event CancelEventHandler Validating; public event EventHandler VisibleChanged; /// --- IWin32Window properties public IntPtr Handle { get { // If the handle has not yet been created, // referencing this property will force the // handle to be created. (MSDN) if (!IsHandleCreated) CreateHandle (); return window.Handle; } } /// --- ISynchronizeInvoke properties --- [MonoTODO] public bool InvokeRequired { get { return CreatorThreadId_ != Win32.GetCurrentThreadId (); } } private IAsyncResult DoInvoke (Delegate method, object[] args) { IAsyncResult result = null; ControlInvokeHelper helper = new ControlInvokeHelper (method, args); if (InvokeRequired) { lock (this) { lock (InvokeQueue_.SyncRoot) { InvokeQueue_.Enqueue (helper); } Win32.PostMessage (Handle, Control.InvokeMessage, 0, 0); result = helper; } } else { helper.CompletedSynchronously = true; helper.ExecuteMethod (); result = helper; } return result; } /// --- ISynchronizeInvoke methods --- [MonoTODO] public IAsyncResult BeginInvoke (Delegate method) { return DoInvoke (method, null); } [MonoTODO] public IAsyncResult BeginInvoke (Delegate method, object[] args) { return DoInvoke (method, args); } [MonoTODO] public object EndInvoke (IAsyncResult asyncResult) { object result = null; ControlInvokeHelper helper = asyncResult as ControlInvokeHelper; if (helper != null) { if (!asyncResult.CompletedSynchronously) { asyncResult.AsyncWaitHandle.WaitOne (); } result = helper.MethodResult; } return result; } //Compact Framework [MonoTODO] public object Invoke (Delegate method) { return Invoke (method, null); } //[MonoTODO] public object Invoke (Delegate method, object[] args) { IAsyncResult result = BeginInvoke (method, args); return EndInvoke (result); } /// sub-class: Control.ControlAccessibleObject /// /// Provides information about a control that can be used by an accessibility application. /// 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 { //FIXME: return base.DefaultAction; } } [MonoTODO] public override string Description { get { //FIXME: return base.Description; } } [MonoTODO] public IntPtr Handle { get { throw new NotImplementedException (); } set { //FIXME: } } [MonoTODO] public override string Help { get { //FIXME: return base.Help; } } [MonoTODO] public override string KeyboardShortcut { get { //FIXME: return base.KeyboardShortcut; } } [MonoTODO] public override string Name { get { //FIXME: return base.Name; } set { //FIXME: base.Name = value; } } [MonoTODO] public Control Owner { get { throw new NotImplementedException (); } } [MonoTODO] public override AccessibleRole Role { get { //FIXME: return base.Role; } } /// --- ControlAccessibleObject Methods --- [MonoTODO] public override int GetHelpTopic (out string fileName) { //FIXME: return base.GetHelpTopic (out fileName); } [MonoTODO] public void NotifyClients (AccessibleEvents accEvent) { //FIXME: } [MonoTODO] public void NotifyClients (AccessibleEvents accEvent, int childID) { //FIXME: } [MonoTODO] public override string ToString () { //FIXME: return base.ToString (); } } /// sub-class: Control.ControlCollection /// /// Represents a collection of Control objects /// public class ControlCollection : IList, ICollection, IEnumerable, ICloneable { class ControlComparer : IComparer { int IComparer.Compare (object x, object y) { int tx = ( (Control)x).TabIndex; int ty = ( (Control)y).TabIndex; if (tx > ty) return 1; else if (tx < ty) return -1; else return 0; } } private ArrayList collection = new ArrayList (); protected 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) { if (!Contains (value)) { collection.Add (value); value.Parent = owner; owner.OnControlAdded (new ControlEventArgs (value)); } } public virtual void AddRange (Control[] controls) { for (int i = 0; i < controls.Length; i++) { Add (controls[i]); } } 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 obj) { //FIXME: return base.Equals (obj); } public int GetChildIndex (Control child) { return GetChildIndex (child, true); } public int GetChildIndex (Control child, bool throwException) { int index = collection.IndexOf (child); if (index == -1 && throwException) throw new ArgumentException ("'child' is not a child control of this parent."); return index; } public IEnumerator GetEnumerator () { return collection.GetEnumerator (); } [MonoTODO] public override int GetHashCode () { //FIXME: return base.GetHashCode (); } public int IndexOf (Control control) { return collection.IndexOf (control); } public virtual void Remove (Control value) { collection.Remove (value); } public void RemoveAt (int index) { Remove (this [ index ]); // have to give a chance to handle this situation in derived class //collection.RemoveAt (index); } public void SetChildIndex (Control child, int newIndex) { int oldIndex = collection.IndexOf (child); if (oldIndex == -1) throw new ArgumentException ("'child' is not a child control of this parent."); if (oldIndex != newIndex){ collection.Remove (child); if (newIndex >= collection.Count) collection.Add (child); else collection.Insert (newIndex, child); } } internal Control GetFirstControl (bool direction) { if (collection.Count == 0) return null; ArrayList copy = collection.Clone () as ArrayList; copy.Sort (new ControlComparer ()); if (direction) return copy [0] as Control; else { Control last = copy[ collection.Count - 1 ] as Control; if (last.Controls.Count == 0) return last; else return last.Controls.GetFirstControl (false); } } internal Control GetNextControl (Control ctl, bool forward) { if (collection.Count == 0) return null; ArrayList copy = collection.Clone () as ArrayList; copy.Sort (new ControlComparer ()); int index = copy.IndexOf (ctl)+ (forward ? 1 : -1); if ( (forward && index < copy.Count)|| (!forward && index >= 0)) return copy[index] as Control; return null; } /// --- 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 --- } } --------------040702060704050202050007-- From Larry@Smithmier.com Fri Aug 22 14:07:35 2003 From: Larry@Smithmier.com (Lawrence E. Smithmier, Jr.) Date: Fri, 22 Aug 2003 09:07:35 -0400 Subject: [Mono-winforms-list] SWF-ComboBox Sample Message-ID: <1061557655.3f461597168ec@mail.cbtree.org> Thank you Alexandre! I will update the http://www.nullenvoid.com/mono/wiki/index.php/The%20ComboBox%20Control. page with updated images as soon as I get a chance. I will also be updating all of the images for the 0.26 release today as well. Lawrence E. Smithmier, Jr. MCP, MCAD (919) 522-9738 Larry@Smithmier.com Quoting Alexandre Pigolkine : > Hello! > > I updated the code for ComboBox, so the sample runs better now. > > I made small change to the controls/combo.c file from WineLib. > Patch file is attached, it should be applied to the Wine-20030318 > after the mono-wine.patch. > > A Linux screenshot is here : > http://www.geocities.com/pigolkine/swf-combobox-linux.png > > > Alexandre > From miguel@ximian.com Fri Aug 22 15:55:44 2003 From: miguel@ximian.com (Miguel de Icaza) Date: 22 Aug 2003 10:55:44 -0400 Subject: [Mono-winforms-list] Control In-Reply-To: <3F45DC7B.4050503@runbox.com> References: <3F45DC7B.4050503@runbox.com> Message-ID: <1061564144.3822.54.camel@erandi.boston.ximian.com> Hello Brian, > Unreachable code detected. > line 2845. > Commented out break keyword. You might want to consider keeping the pristine original file around, and then using the diff command to generate a patch file. Like this: diff -u Control.cs.original Control.cs > patch And mailing us patch ;-) Miguel From pigolkine@gmx.de Fri Aug 22 17:25:46 2003 From: pigolkine@gmx.de (Alexandre Pigolkine) Date: Fri, 22 Aug 2003 18:25:46 +0200 Subject: [Mono-winforms-list] button implmentation References: <20030810054554.21112.qmail@web80509.mail.yahoo.com> Message-ID: <007f01c368ca$0b7ab720$46d6fea9@alexhome> This is a multi-part message in MIME format. ------=_NextPart_000_007C_01C368DA.CE460380 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I modified ButtonBase and derived classes and committed the code to the = CVS. Looks like the changes don't break the tests. Hopefully, the classes are more spec-conformant now. Shall I send a compiled version of SWF dll to check that my changes are = OK ? Alexandre ----- Original Message -----=20 From: Dennis Hayes=20 To: mono-winforms-list@lists.ximian.com=20 Sent: Sunday, August 10, 2003 7:45 AM Subject: [Mono-winforms-list] button implmentation Button.cs implments OnPaint. The spec says this should be in ButtonBase.cs. ButtonBase is just base.OnPaint (pevent) There is a lot of implmentation in button.cs * It looks like just replacing the ButtonBase OnPaint with the Button = OnPaint, and removing the OnPaint from Button.cs would be the correct = option. * Can someone do this and verify that is does not break any of the test? Thanks, Dennis -------------------------------------------------------------------------= ----- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software ------=_NextPart_000_007C_01C368DA.CE460380 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,
 
I modified ButtonBase and derived = classes and=20 committed the code to the CVS.
Looks like the changes don't break the=20 tests.
 
Hopefully, the classes are more=20 spec-conformant now.
Shall I send a compiled version of SWF = dll to=20 check that my changes are OK ?
 
Alexandre
 
 
 
----- Original Message -----
From:=20 Dennis=20 Hayes
To: mono-winforms-list@li= sts.ximian.com=20
Sent: Sunday, August 10, 2003 = 7:45=20 AM
Subject: [Mono-winforms-list] = button=20 implmentation

Button.cs implments OnPaint.
The spec says this should be in ButtonBase.cs.
ButtonBase is just
base.OnPaint = (pevent)
There is a lot of implmentation in = button.cs
 
*
It looks like just replacing the ButtonBase = OnPaint with the=20 Button OnPaint, and removing the OnPaint from Button.cs would be the = correct=20 option.
*
Can someone do this and verify that is does not = break any of=20 the test?
Thanks,
Dennis
 


Do you Yahoo!?
Yahoo!=20 SiteBuilder - Free, easy-to-use web site design=20 software ------=_NextPart_000_007C_01C368DA.CE460380-- From pigolkine@gmx.de Fri Aug 22 17:26:38 2003 From: pigolkine@gmx.de (Alexandre Pigolkine) Date: Fri, 22 Aug 2003 18:26:38 +0200 Subject: [Mono-winforms-list] Control References: <3F45DC7B.4050503@runbox.com> Message-ID: <008c01c368ca$29fb3f80$46d6fea9@alexhome> Hello, File committed. Thanks, Alexandre ----- Original Message ----- From: "Brian Takita" To: Sent: Friday, August 22, 2003 11:03 AM Subject: [Mono-winforms-list] Control > Unreachable code detected. > line 2845. > Commented out break keyword. > From brian.takita@runbox.com Fri Aug 22 18:10:19 2003 From: brian.takita@runbox.com (Brian Takita) Date: Fri, 22 Aug 2003 10:10:19 -0700 Subject: [Mono-winforms-list] Control In-Reply-To: <1061564144.3822.54.camel@erandi.boston.ximian.com> References: <3F45DC7B.4050503@runbox.com> <1061564144.3822.54.camel@erandi.boston.ximian.com> Message-ID: <3F464E7B.8060603@runbox.com> Miquel, That makes sense. Thanks for the tip. :) Brian Miguel de Icaza wrote: >Hello Brian, > > > >>Unreachable code detected. >>line 2845. >>Commented out break keyword. >> >> > >You might want to consider keeping the pristine original file around, >and then using the diff command to generate a patch file. Like this: > >diff -u Control.cs.original Control.cs > patch > >And mailing us patch ;-) > >Miguel > > > > From DENNISH@Raytek.com Fri Aug 22 20:03:35 2003 From: DENNISH@Raytek.com (Dennis Hayes) Date: Fri, 22 Aug 2003 12:03:35 -0700 Subject: [Mono-winforms-list] Moving Items property into ListControl Message-ID: <6A5462649507D7119DE00090271EC70B8D3352@RHQPDC0> DataSource_ and DisplayMember_ should be private. They probably should be internal. Dennis -----Original Message----- From: Brian Takita [mailto:brian.takita@runbox.com] Sent: Friday, August 22, 2003 1:35 AM To: Duncan Mak Cc: mono-winforms-list@lists.ximian.com Subject: Re: [Mono-winforms-list] Moving Items property into ListControl Hello Duncan, Here is the revised ListControl class. I took a better look at the ListControl, and found the following... >> public abstract class ListControl : Control { >> >> protected object DataSource_; >> [MonoTODO] >> public virtual object DataSource { >> >> DataSource_ and DisplayMember_ should be private. >The 1.1 SDK docs list this property without the virtual keyword. Was >that an MS documentation bug? > > DataSource is not virtual in ListControl. > > >>set { >> if(DataSource_ != value) { >> if((value is IList) || (value is IListSource)) { >> DataSource_ = value; >> OnDataSourceChanged(new EventArgs()); >> } >> else { >> throw new Exception("Complex DataBinding accepts as a data source either an IList or an IListSource"); >> } >> } >>} >> >> > >I made indenting changes here to make the code better conform to the >Mono coding style. Also, the 1.1 SDK docs does not say the property will >throw any Exceptions at all. Is that also a documentation bug? > > This is a documentation bug. I got an exception when DataSource was not set to an IList or an IListSource object. The exception message was taken verbatim from MS's exception. Should I rewrite a new exception message to avoid plagerism? Also, where are the docs on coding standards? >Thanks for the patch! > >Duncan. > Glad to help. I'm learning alot about .NET already. Thanks for the feedback!! Brian >_______________________________________________ >Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com >http://lists.ximian.com/mailman/listinfo/mono-winforms-list > > > > From brian.takita@runbox.com Fri Aug 22 20:08:35 2003 From: brian.takita@runbox.com (Brian Takita) Date: Fri, 22 Aug 2003 12:08:35 -0700 Subject: [Mono-winforms-list] WinForms behavior Message-ID: <3F466A33.9000406@runbox.com> Hello, Are we trying to copy Windows.Forms exactly as MS as implemented them even when the behavior is a little strange? Thanks, Brian From pigolkine@gmx.de Sat Aug 23 00:27:42 2003 From: pigolkine@gmx.de (Alexandre Pigolkine) Date: Sat, 23 Aug 2003 01:27:42 +0200 Subject: [Mono-winforms-list] CheckedListBox References: <3F45DA99.90200@runbox.com> Message-ID: <018401c36904$fccd3b40$46d6fea9@alexhome> Patch applied. Thanks. Alex ----- Original Message ----- From: "Brian Takita" To: Sent: Friday, August 22, 2003 10:55 AM Subject: [Mono-winforms-list] CheckedListBox > Items has a new keyword. > CheckedListBox.ObjectCollection class has new keyword. > From nissuacfeneyrol@free.fr Sun Aug 24 02:55:15 2003 From: nissuacfeneyrol@free.fr (nissuacfeneyrol@free.fr) Date: Sun, 24 Aug 2003 03:55:15 +0200 Subject: [Mono-winforms-list] I ask to be no more on your list! Tks! Message-ID: <1061690115.3f481b035da42@impt2-1.free.fr> I ask to be no more on your list! Tks! From duncan@ximian.com Sun Aug 24 09:01:14 2003 From: duncan@ximian.com (Duncan Mak) Date: Sun, 24 Aug 2003 04:01:14 -0400 Subject: [Mono-winforms-list] Re: Ok...Three's a charm...Use this patch instead of the other two In-Reply-To: <3F46A56F.5080604@runbox.com> References: <3F46A56F.5080604@runbox.com> Message-ID: <1061712074.29472.2.camel@diphthong> Hello Brian, On Fri, 2003-08-22 at 19:21, Brian Takita wrote: > Duncan, > > This should be the last one. > I didn't make any changes to Control.cs after all. > This patch has just been committed. You asked for the Mono coding style guide on IRC, you can find them in mcs/class/README. Duncan. From duncan@ximian.com Sun Aug 24 17:42:53 2003 From: duncan@ximian.com (Duncan Mak) Date: Sun, 24 Aug 2003 12:42:53 -0400 Subject: [Mono-winforms-list] New mono-wine packages available with combobox fixes Message-ID: <1061743373.6250.17.camel@diphthong> Hello Winforms hackers of the world! A new mono-wine package has been made to include Alexandre Pigolkine's fixes to the ComboBox widget. I've bumped the packages revision number, but there might be some versioning confusion -- I don't remember if I ever built a rev 2 package on RH8. Either way, the packages were just pushed to Red Carpet and you can download them directly from the following addresses: (RH9) http://go-mono.com/archive/mono-wine-20030318-1.ximian.6.2.i386.rpm http://go-mono.com/archive/mono-wine-debuginfo-20030318-1.ximian.6.2.i386.rpm (RH8) http://go-mono.com/archive/mono-wine-20030318-1.ximian.5.2.i386.rpm Duncan. From miguel@ximian.com Mon Aug 25 18:36:46 2003 From: miguel@ximian.com (Miguel de Icaza) Date: 25 Aug 2003 13:36:46 -0400 Subject: [Mono-winforms-list] Winforms progress and goals. Message-ID: <1061833006.9409.810.camel@erandi.boston.ximian.com> Hey guys, Thanks to the Winforms team, we have been able to make a lot of progress on Windows.Forms. The availability of WineLib packages improved the situation vastly, and things like the effort lead by Timothy's sample code with screenshots to identify the bugs was a key to the development of it: http://www.nullenvoid.com/mono/wiki/index.php/WineSamples Windows.Forms today is still far from being able to run most of the production applications written in .NET, but we want to fix that. We want to push for a particular milestone: running WebMatrix out of the box on Linux and MacOS with Mono. This is a fairly large Winforms application that excercises plenty of areas in Winforms and the runtime. If you want to help this happen, please join us on the mono-winforms-list@ximian. Make sure you check frequently our Wiki page on Windows.Forms progress: http://www.nullenvoid.com/mono/wiki/index.php/WindowsForms Miguel -- Miguel de Icaza From Larry@Smithmier.com Tue Aug 26 02:56:50 2003 From: Larry@Smithmier.com (Lawrence E. Smithmier, Jr.) Date: Mon, 25 Aug 2003 21:56:50 -0400 Subject: [Mono-winforms-list] New mono-wine packages available with combobox fixes Message-ID: <1061863010.3f4abe625896c@mail.cbtree.org> Hi all, The Linux images on http://www.nullenvoid.com/mono/wiki/index.php/WineSamples have been updated to show the state of SWF as of 0.26-2. Lawrence E. Smithmier, Jr. MCP, MCAD (919) 522-9738 Larry@Smithmier.com Quoting Duncan Mak : > Hello Winforms hackers of the world! > > A new mono-wine package has been made to include Alexandre Pigolkine's > fixes to the ComboBox widget. I've bumped the packages revision number, > but there might be some versioning confusion -- I don't remember if I > ever built a rev 2 package on RH8. > > Either way, the packages were just pushed to Red Carpet and you can > download them directly from the following addresses: > > (RH9) > http://go-mono.com/archive/mono-wine-20030318-1.ximian.6.2.i386.rpm > http://go-mono.com/archive/mono-wine-debuginfo-20030318-1.ximian.6.2.i386.rpm > > (RH8) > http://go-mono.com/archive/mono-wine-20030318-1.ximian.5.2.i386.rpm > > Duncan. > _______________________________________________ > Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/mono-winforms-list > From sergio-blanco@iespana.es Mon Aug 25 19:14:09 2003 From: sergio-blanco@iespana.es (Sergio Blanco Cuaresma) Date: 25 Aug 2003 20:14:09 +0200 Subject: [Mono-winforms-list] Re: [Mono-list] Winforms progress and goals. In-Reply-To: <1061833006.9409.810.camel@erandi.boston.ximian.com> References: <1061833006.9409.810.camel@erandi.boston.ximian.com> Message-ID: <1061835249.4565.22.camel@saturno.marblestation.homeip.net> --=-pLf9GBjzVAXFrOjnrPgm Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable El lun, 25-08-2003 a las 19:36, Miguel de Icaza escribi=F3: > We want to push for a particular milestone: running WebMatrix out of > the box on Linux and MacOS with Mono. This is a fairly large Winforms > application that excercises plenty of areas in Winforms and the > runtime.=20 I know it requires a lot of work so sorry for my suggestion with no real help, but it would be nice to also run SharpDevelop ;-) --=20 [aka Marble] Registered LiNUX user #140941 <> http://counter.li.org/ Socio #3274 de HispaLinux <> http://www.hispalinux.es Miembro de GPL URV <> http://www.gplurv.org GnuPG key: 0x0ED2CF9D <> pgp.escomposlinux.org --=-pLf9GBjzVAXFrOjnrPgm Content-Type: application/pgp-signature; name=signature.asc Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQA/SlHxfGXf5g7Sz50RAkwbAJ9rHawqeWHeYWUw6odtNj28LMpDCQCg0Seq 8SgmEsL4ZeJfg1VWfKuRmwM= =ZzId -----END PGP SIGNATURE----- --=-pLf9GBjzVAXFrOjnrPgm-- From RIsaacs@ConnectWise.com Mon Aug 25 19:20:56 2003 From: RIsaacs@ConnectWise.com (Robert Isaacs) Date: Mon, 25 Aug 2003 14:20:56 -0400 Subject: [Mono-winforms-list] RE: [Mono-list] Winforms progress and goals. Message-ID: <710BC1419F750B4AAF1759F105A131D0E7FD5E@cwexch01.corp.connectwise> I am guessing that if you get to the point that you can run WebMatrix, = you will either be pretty close, or already able to run SharpDevelop. Robert -----Original Message----- From: Sergio Blanco Cuaresma [mailto:sergio-blanco@iespana.es]=20 Sent: Monday, August 25, 2003 2:14 PM To: Mono Winforms; mono-list@ximian.com Subject: Re: [Mono-list] Winforms progress and goals. El lun, 25-08-2003 a las 19:36, Miguel de Icaza escribi=F3: > We want to push for a particular milestone: running WebMatrix out = of > the box on Linux and MacOS with Mono. This is a fairly large = Winforms > application that excercises plenty of areas in Winforms and the > runtime.=20 I know it requires a lot of work so sorry for my suggestion with no real help, but it would be nice to also run SharpDevelop ;-) --=20 [aka Marble] Registered LiNUX user #140941 <> http://counter.li.org/ Socio #3274 de HispaLinux <> http://www.hispalinux.es Miembro de GPL URV <> http://www.gplurv.org GnuPG key: 0x0ED2CF9D <> pgp.escomposlinux.org From christophw@alphasierrapapa.com Mon Aug 25 19:31:13 2003 From: christophw@alphasierrapapa.com (Christoph Wille) Date: Mon, 25 Aug 2003 20:31:13 +0200 Subject: [Mono-winforms-list] RE: [Mono-list] Winforms progress and goals. In-Reply-To: <710BC1419F750B4AAF1759F105A131D0E7FD5E@cwexch01.corp.conne ctwise> Message-ID: <5.2.0.9.2.20030825202835.038854a8@127.0.0.1> Just wanted to add an "I don't think so" from the SharpDevelop team=20 (depends on what you count as "run" or "pretty close", though); there are a= =20 few things in SharpDevelop that ain't in Web Matrix, such as the Windows=20 Forms Designer (in turn, Web Matrix has the ASP.NET design infrastructure=20 you need to implement, as well as a very tight IE integration). Chris At 02:20 PM 8/25/2003 -0400, Robert Isaacs wrote: >I am guessing that if you get to the point that you can run WebMatrix, you= =20 >will either be pretty close, or already able to run SharpDevelop. > >Robert > >-----Original Message----- >From: Sergio Blanco Cuaresma [mailto:sergio-blanco@iespana.es] >Sent: Monday, August 25, 2003 2:14 PM >To: Mono Winforms; mono-list@ximian.com >Subject: Re: [Mono-list] Winforms progress and goals. > >El lun, 25-08-2003 a las 19:36, Miguel de Icaza escribi=F3: > > We want to push for a particular milestone: running WebMatrix out of > > the box on Linux and MacOS with Mono. This is a fairly large Winforms > > application that excercises plenty of areas in Winforms and the > > runtime. > >I know it requires a lot of work so sorry for my suggestion with no real >help, but it would be nice to also run SharpDevelop ;-) From johannes@jroith.de Wed Aug 27 18:47:55 2003 From: johannes@jroith.de (Johannes Roith) Date: Wed, 27 Aug 2003 19:47:55 +0200 Subject: [Mono-winforms-list] SWF Wine Color integration Message-ID: <1062006474.5210.19.camel@localhost.localdomain> --=-w31voldokpnqlJRUs2Fl Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello, Windows.Formers! I have written a small patch yesterday, that themes SWF/Wine with Gtk+ colors. screenshot here: http://www.jroith.de/swfsample.png Miguel pointed out, that loading Gtk# probably probably eats to much memory, so the current approach would be * Read the values from a configuration file * store the values there once, using a small app * try to set up an event to call that app everytime the theme changes Owen suggested using XSETTINGS for the event stuff. Old patch is attached. Any comments? Johannes --=-w31voldokpnqlJRUs2Fl Content-Disposition: attachment; filename=gtkswf.cs Content-Type: text/plain; name=gtkswf.cs; charset=UTF-8 Content-Transfer-Encoding: 7bit // Gtk# Integration in System.Windows.Forms.dll // [C] 2003 by Johannes Roith // NOTE: The colors choosen, are not always correct, or the best solution. // This will be changed overtime to get best integration. using System; using System.Windows.Forms; using Gdk; using GdkSharp; using Gtk; using GtkSharp; class GtkSharpColorProvider { static uint Rgb (byte red, byte green, byte blue) { uint rgbvalue = blue; rgbvalue = rgbvalue<<8; rgbvalue +=green; rgbvalue = rgbvalue <<8; rgbvalue+=red; return rgbvalue; } static uint ConvertColor(Color color) { uint colorint = Rgb((byte) color.red, (byte) color.green, (byte) color.blue); return colorint; } public static uint[] GetColors() { Gtk.Application.Init(); Gtk.Invisible invisible1 = new Gtk.Invisible(); invisible1.EnsureStyle(); invisible1.Sink(); Gtk.Style style1 = invisible1.Style; Gtk.Button button1 = new Gtk.Button(); Gtk.Style buttonstyle = button1.Style; Gtk.VScrollbar scroll1 = new VScrollbar(null); scroll1.EnsureStyle(); Style scrollbarstyle = scroll1.Style; Gtk.Menu menu1 = new Gtk.Menu(); Gtk.MenuItem menuitem1 = new Gtk.MenuItem(); menu1.Add(menuitem1); menuitem1.EnsureStyle(); menuitem1.Sink(); Gtk.Style menustyle = menuitem1.Style; uint[] colors = { ConvertColor(scrollbarstyle.Background(Gtk.StateType.Normal)), // COLOR_SCROLLBAR ConvertColor(style1.Background(Gtk.StateType.Normal)), // COLOR_BACKGROUN ConvertColor(menustyle.Background(Gtk.StateType.Prelight)), // COLOR_ACTIVECAPTION ConvertColor(menustyle.Background(Gtk.StateType.Prelight)), // COLOR_INACTIVECAPTION ConvertColor(menustyle.Background(Gtk.StateType.Normal)), // COLOR_MENU ConvertColor(style1.Background(Gtk.StateType.Normal)), // COLOR_WINDOW ConvertColor(style1.Foreground(Gtk.StateType.Insensitive)), // COLOR_WINDOWFRAME ConvertColor(style1.Foreground(Gtk.StateType.Normal)), // COLOR_MENUTEXT ConvertColor(style1.Foreground(Gtk.StateType.Normal)), // COLOR_WINDOWTEXT ConvertColor(style1.Foreground(Gtk.StateType.Normal)), // COLOR_CAPTIONTEXT ConvertColor(menustyle.Background(Gtk.StateType.Prelight)), // COLOR_ACTIVEBORDER ConvertColor(style1.Background(Gtk.StateType.Normal)), // COLOR_INACTIVEBORDER ConvertColor(style1.Background(Gtk.StateType.Normal)), // COLOR_APPWORKSPACE ConvertColor(menustyle.Background(Gtk.StateType.Prelight)), // COLOR_HIGHLIGHT ConvertColor(style1.Foreground(Gtk.StateType.Prelight)), // COLOR_HIGHLIGHTTEXT ConvertColor(style1.Background(Gtk.StateType.Normal)), // COLOR_BTNFACE ConvertColor(style1.Background(Gtk.StateType.Insensitive)), // COLOR_BTNSHADOW ConvertColor(style1.Foreground(Gtk.StateType.Insensitive)), // COLOR_GRAYTEXT ConvertColor(style1.Foreground(Gtk.StateType.Normal)), // COLOR_BTNTEXT ConvertColor(style1.Foreground(Gtk.StateType.Insensitive)), // COLOR_INACTIVECAPTIONTEXT ConvertColor(style1.Background(Gtk.StateType.Normal)), // COLOR_BTNHIGHLIGHT ConvertColor(style1.Foreground(Gtk.StateType.Normal)), // COLOR_3DDKSHADOW ConvertColor(style1.Foreground(Gtk.StateType.Normal)), // COLOR_3DLIGHT ConvertColor(style1.Foreground(Gtk.StateType.Normal)), // COLOR_INFOTEXT ConvertColor(style1.Foreground(Gtk.StateType.Normal)), // COLOR_INFOBK ConvertColor(style1.Background(Gtk.StateType.Normal)), // COLOR_ALTERNATEBTNFACE ConvertColor(style1.Background(Gtk.StateType.Normal)), // COLOR_HOTLIGHT ConvertColor(style1.Background(Gtk.StateType.Normal)), // COLOR_GRADIENTACTIVECAPTION ConvertColor(style1.Background(Gtk.StateType.Normal)) // COLOR_GRADIENTINACTIVECAPTION }; return colors; } } --=-w31voldokpnqlJRUs2Fl Content-Disposition: attachment; filename=monocolors.patch Content-Type: text/x-patch; name=monocolors.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: win32functions.cs =================================================================== RCS file: /cvs/public/mcs/class/System.Windows.Forms/System.Windows.Forms/win32functions.cs,v retrieving revision 1.51 diff -u -r1.51 win32functions.cs --- win32functions.cs 11 Aug 2003 14:15:10 -0000 1.51 +++ win32functions.cs 26 Aug 2003 19:54:28 -0000 @@ -34,6 +34,7 @@ using System.Runtime.InteropServices; using System.Text; using System.Diagnostics; +using System.Reflection; //using UtilityLibrary.WinControls; @@ -567,6 +568,8 @@ internal static extern IntPtr WindowFromPoint( POINT pt); [DllImport("user32.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto)] internal static extern int GetSysColor( GetSysColorIndex color); + [DllImport("user32.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto)] + public static extern bool SetSysColors(int cElements, int[] lpaElements, uint[] lpaRgbValues); internal delegate void TimerProc(IntPtr hWnd, uint uMsg, uint idEvent, int dwTime); [DllImport("user32.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto)] @@ -1258,6 +1261,17 @@ [DllImport ("libwinnt.dll.so", EntryPoint="LoadLibraryA")] extern static void NTDLL_LoadLibraryA (string s); + static uint[] GetGtkSharpColors() { + + // This is needed to avoid a direct Gtk# dependency + + Assembly a = Assembly.LoadFrom("gtkswf.dll"); + Type type = a.GetType("GtkSharpColorProvider"); + Object obj = Activator.CreateInstance(type); + MethodInfo mi = type.GetMethod("GetColors"); + return (uint[]) mi.Invoke(obj, null); + } + internal static bool RunningOnUnix = false; // // Used to initialize the runtime @@ -1285,11 +1299,19 @@ string [] args = new string [1]; args [0] = "mono"; - + PROCESS_InitWine (0, args); NTDLL_LoadLibraryA ("kernel32.dll"); NTDLL_LoadLibraryA ("user32.dll"); NTDLL_LoadLibraryA ("comctl32.dll"); + + int[] elements = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28}; + + string gtk_colors = Environment.GetEnvironmentVariable ("SWF_GTK_COLORS"); + if (gtk_colors == "1") { + uint[] colors = GetGtkSharpColors(); + SetSysColors(29, elements, colors); + } } } } --=-w31voldokpnqlJRUs2Fl-- From brian.takita@runbox.com Wed Aug 27 20:11:43 2003 From: brian.takita@runbox.com (Brian Takita) Date: Wed, 27 Aug 2003 12:11:43 -0700 Subject: [Mono-winforms-list] DataBinding Message-ID: <3F4D026F.7080905@runbox.com> Hello, Is anybody working on any of the following classes? * BindingContext * BindingManagerBase * CurrencyManager * PropertyManager * ControlBindingsCollection If yes, please let me know. Thank you, Brian Takita From pigolkine@gmx.de Sun Aug 31 23:42:03 2003 From: pigolkine@gmx.de (Alexander Pigolkin) Date: 01 Sep 2003 00:42:03 +0200 Subject: [Mono-winforms-list] Mono-Wine patch 2 Message-ID: <1062369723.3932.20.camel@alexhome> --=-BcqnEdg9pcB0wM1GCCkw Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello Duncan, I made few changes in the WineLib to fix initialization problem and remove warning about missing function. Could you please make a new release of Mono-Wine packages. Thanks, Alex --=-BcqnEdg9pcB0wM1GCCkw Content-Disposition: attachment; filename=mono-wine.patch.2 Content-Type: text/x-patch; name=mono-wine.patch.2; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -Nru -x '*~' -x '*.o' -x '*.orig' -x '*.rej' -x '*.0' -x 'request*' -x '*.log' -x '*.status' -x '*.dbg.c' -x 'Makefile*' -x '*.rules' -x '*glue.c' -x '*.s' -x '*.lex.yy.c' wine-20030318.orig.patched/dlls/gdi/driver.c wine-20030318.my/dlls/gdi/driver.c --- wine-20030318.orig.patched/dlls/gdi/driver.c 2003-08-22 10:27:57.000000000 +0200 +++ wine-20030318.my/dlls/gdi/driver.c 2003-08-31 03:21:22.000000000 +0200 @@ -54,6 +54,7 @@ struct graphics_driver *driver; #ifdef MONO char buffer[MAX_PATH]; + char buffer_DIB[MAX_PATH]; #endif if (!(driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver)))) return NULL; driver->next = NULL; @@ -64,8 +65,10 @@ /* fill the function table */ #ifdef MONO strcpy( buffer, "X11DRV_" ); + strcpy( buffer_DIB, "X11DRV_DIB_" ); /* MONO SWF: Charge the buffer with initial content. Each function we need is started from "X11DRV_" */ #define GET_FUNC(name) { buffer[7] = 0; driver->funcs.p##name = (void*)GetProcAddress( module, strcat(buffer,#name) ); } +#define GET_FUNC_DIB(name) { buffer_DIB[11] = 0; driver->funcs.p##name = (void*)GetProcAddress( module, strcat(buffer_DIB,#name) ); } #else #define GET_FUNC(name) driver->funcs.p##name = (void*)GetProcAddress( module, #name ) #endif @@ -81,7 +84,11 @@ GET_FUNC(CloseFigure); GET_FUNC(CreateBitmap); GET_FUNC(CreateDC); +#ifdef MONO + GET_FUNC_DIB(CreateDIBSection); +#else GET_FUNC(CreateDIBSection); +#endif GET_FUNC(DeleteBitmap); GET_FUNC(DeleteDC); GET_FUNC(DescribePixelFormat); diff -Nru -x '*~' -x '*.o' -x '*.orig' -x '*.rej' -x '*.0' -x 'request*' -x '*.log' -x '*.status' -x '*.dbg.c' -x 'Makefile*' -x '*.rules' -x '*glue.c' -x '*.s' -x '*.lex.yy.c' wine-20030318.orig.patched/dlls/user/misc.c wine-20030318.my/dlls/user/misc.c --- wine-20030318.orig.patched/dlls/user/misc.c 2003-01-13 21:36:39.000000000 +0100 +++ wine-20030318.my/dlls/user/misc.c 2003-08-31 01:56:49.000000000 +0200 @@ -265,3 +265,13 @@ * USER_496 (USER.496) */ LONG WINAPI stub_USER_496(void) { FIXME("stub\n"); return 0; } + +BOOL SetLayeredWindowAttributes( + HWND hwnd, + COLORREF crKey, + BYTE bAlpha, + DWORD dwFlags +) +{ + return TRUE; +} diff -Nru -x '*~' -x '*.o' -x '*.orig' -x '*.rej' -x '*.0' -x 'request*' -x '*.log' -x '*.status' -x '*.dbg.c' -x 'Makefile*' -x '*.rules' -x '*glue.c' -x '*.s' -x '*.lex.yy.c' wine-20030318.orig.patched/dlls/user/user32.spec wine-20030318.my/dlls/user/user32.spec --- wine-20030318.orig.patched/dlls/user/user32.spec 2003-01-13 21:36:39.000000000 +0100 +++ wine-20030318.my/dlls/user/user32.spec 2003-08-31 01:58:18.000000000 +0200 @@ -659,6 +659,7 @@ @ stdcall SendInput(long ptr long) SendInput @ stdcall SetWinEventHook(long long long ptr long long long) SetWinEventHook @ stdcall UnhookWinEvent(long) UnhookWinEvent +@ stdcall SetLayeredWindowAttributes(ptr long long long) SetLayeredWindowAttributes ################################################################ # Wine extensions: Win16 functions that are needed by other dlls --=-BcqnEdg9pcB0wM1GCCkw--