My TSpeedbutton code has been commited. It's not anywhere near done, but this way you guys can is declared in Buttons.pp.
The paint calls DrawFrameControl to draw itself. DrawFrameControl calls DrawEdge. A few problems exist right now. For example, DrawFrameCotrol isn't finished. The second problem I have is determining what I pass Drawframecontrol. The parent handle? Do I pass getdc(parent.handle)? How about the canvas.handle, etc. I'm not sure yet.
The problems with not getting a paint message still exist too. We'll have to figure out how to send it messages telling it to update itself. Maybe each parent should run through it's list of controls and send a LM_PAINT or invalidate message when it paints?
Shane
>> 03/10/00 12:47PM >>>
I'm a bit closer. I see TGraphiccontrol has a message LM_PAINT procedure so in gtkObject.inc when a LM_REDRAW is sent (from an invalidate) and it's a TSpeedButton I perform a LM_PAINT which calls TSpeedButton's paint procedure.
This still doesn't fix the problem if the form with the button on it is pushed off screen then brought back.
Shane
>> 03/10/00 10:45AM >>>
but, how does a PAINT occur?
How does it get called? gtk usually calls it via the signal (expose, resize, etc) but in this case it doesn't get called.
Shane
>> 03/10/00 10:21AM >>>
+ From: Shane Miller
+
+ Speed buttons are really just canvas'. They paint the border
+ around themselves so they look like buttons and then paint
+ the glyph onto themselves.
+
+ I am trying to figure out how to implement them.
Derive them from TGraphicsControl like Delphi and paint on its canvas in the Paint method. I don't think you need gtk for this one.
Marc
_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus
_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus
_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus