dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]ChecBox & DrawCheckBox


From: Rhys Weatherley
Subject: Re: [DotGNU]ChecBox & DrawCheckBox
Date: Thu, 19 Jun 2003 22:01:47 +1000
User-agent: KMail/1.4.3

On Thursday 19 June 2003 09:11 pm, Bernardi Mario Luca wrote:

> 1) I've noticed that DrawCheckBox on .NET paint a checkbox in various
> styles depending on his ButtonState argument. But ButtonState can't
> handle all the paint states CheckBox needs. When FlatStyle is Flat or
> Popup the checkbox on .NET changes background color or border type and
> color in response to OnMouseEnter and OnMouseLeave.

I think you'll find that all of the states can be decomposed into the given 
button states.  e.g. popup without mouse entered is the same as flat, popup 
with mouse entered is the same as non-flat, etc.  For our purposes, "System" 
and "Standard" will be the same.  i.e. you need to combine the FlatStyle with 
the current enter/press states to determine the final draw style.

See "ButtonBase.CalculateState" for an example for regular buttons.  You 
should override this method in "CheckBox" to provide the functionality you 
require.

> 2) I've noticed that when i push down the mouse on a button , in
> pnet/winforms it raise OnMouseLeave , OnMouseEnter and then OnMouseDown
> events. Simon has tried that on .NET/Winforms and sayed that this isn't
> actually appening on it. There is something isn't working properly ?

I tested it here on both Xsharp (running under KDE) and .NET, and I see the 
following on both:

1. OnMouseEnter when the mouse enters a button control.
2. OnMouseDown when the mouse button is clicked.
3. OnMouseUp when the mouse button is released.
4. OnMouseLeave when the mouse leaves the button control.

Seems consistent to me.  What window managers are you two using?

> Ah here is a screenshot :)

Cool.

Cheers,

Rhys.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]