[Mono-winforms-list] Enabling VisualStyles in the 1.1 profile

Ernesto equistango at gmail.com
Wed Apr 23 19:44:05 EDT 2008

Ok, here's what I got so far:

* Button, CheckBox, ProgressBar, RadioButton and ScrollBar mostly working.
* TabControl mostly not working (I mean working, but looking really bad).
* Implemented CheckBoxGlyph and RadioButtonGlyph for other controls to 
use (like ListBox w/CheckBoxes).
* Drawing of ManagedWindowDecorations (for MDI child windows) is working 
but transparency (to make window corner's round) is not implemented.

Per file:

* ThemeVisualStyles.cs: incomplete initial implementation.
* FontProperty.cs, VisualStyleElement.cs: Implemented some enums.
* ButtonBase.cs: changed IsDefault from private to internal, so the 
theme can draw a window's default button with a special frame (this 
should be back ported to other themes).
* ScrollBar.cs: implemented thumb_state, firstbutton_entered, 
secondbutton_entered and thumb_entered to allow for different "hot" 
effects of XP and Vista.
* XplatUIWin32: changed Win32GetSystemMetrics from private to internal, 
so Theme.ScrollBarButtonSize uses the system's default.

The code in ThemeVisualStyles.cs is slightly Windows-dependent. I guess 
this is ok given that this is basically a wrapper for a Windows-only 
feature. I guess other visual styles (or whatever they are called on OS 
X et al) should be implemented as separate classes. In case I'm wrong, 
Windows dependencies can be reworked easily.

Due to what looks like a problem in VisualStyles fonts are not rendered 
correctly. I couldn't isolate the problem, but I've got the feeling that 
it's in VisualStyleRenderer.cs and/or UXTheme.OpenThemeData(). Like this 
comment on VisualStylesRenderer.GetFont(): [MonoTODO(@"I can't get MS's 
to return anything but null, so I can't really get this one right")]


Jonathan Pobst wrote:
> It is probably best if both you and George frequently post your 
> patches here and perhaps coordinate which controls you are working 
> on.  I think there are plenty of controls to go around.  ;)
> Jonathan
> Ernesto wrote:
>> I'm working on a VisualStyles theme. I have a little work done, but 
>> it's a bit stalled because of other commitments.
>> Should someone need it, I can send what I have done so far (which is 
>> basically command button, scrollbars, checkbox and radio button).
>> Regards,
>> Ernesto
>> Jonathan Pobst escribió:
>>> George is our SoC student working to make a theme that uses 
>>> VisualStyles so we can get a more-native look in winforms.  He isn't 
>>> writing an application that wants to use VisualStyles on the 1.1 
>>> platform.  :)
>>> Jonathan
>>> Rafael Teixeira wrote:
>>>> That won't work in .NET 1.1.
>>>> If an application needs Visual Styles while running on 1.x 
>>>> profiles, it should either:
>>>> 1) demand version/profile 2.0 as a dependency.
>>>> -or-
>>>> 2) have it's own implementation of that code (you can reuse Mono's 
>>>> MIT-licensed code, if needed)
>>>> AFAIR, VisualStyles is scattered all around  winforms controls, so 
>>>> you need to build an wrapping layer, extending them with that feature.
>>>> :|
>>>> On Wed, Apr 23, 2008 at 2:19 PM, George Giolfan 
>>>> <georgegiolfan at yahoo.com <mailto:georgegiolfan at yahoo.com>> wrote:
>>>>     Hello,
>>>>     I am implementing a theme that uses the VisualStyles
>>>>     API. I assume it will need to support the 1.1 profile
>>>>     so I will need a way to call the VisualStyles code
>>>>     from the 1.1 version of the theme code even if
>>>>     VisualStyles is a 2.0 feature. Please review the
>>>>     attached patch. Basically it attempts to always
>>>>     compile the code but make it public only on 2.0.
>>>> ____________________________________________________________________________________ 
>>>>     Be a better friend, newshound, and
>>>>     know-it-all with Yahoo! Mobile.  Try it now.
>>>>      http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>>>>     _______________________________________________
>>>>     Mono-winforms-list maillist  -  
>>>> Mono-winforms-list at lists.ximian.com
>>>>     <mailto:Mono-winforms-list at lists.ximian.com>
>>>>     http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>>>> -- 
>>>> Rafael "Monoman" Teixeira
>>>> ---------------------------------------
>>>> "I myself am made entirely of flaws, stitched together with good 
>>>> intentions."
>>>> Augusten Burroughs
>>>> ------------------------------------------------------------------------ 
>>>> _______________________________________________
>>>> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
>>>> http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>>> _______________________________________________
>>> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/mono-winforms-list

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: VisualStyles.patch
Url: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20080423/19ae61b2/attachment-0001.pl 

More information about the Mono-winforms-list mailing list