[Mono-winforms-list] button implmentation

Jonathan Gilbert 2a5gjx302@sneakemail.com
Tue, 12 Aug 2003 09:40:52


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 <denisraytek@yahoo.com> 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
>