[lazarus] Patch: progressbar smooth and vertical (win32)

Micha Nelissen mdvpost at hotmail.com
Thu Jun 26 09:30:00 EDT 2003


Micha Nelissen wrote:
> Michael Van Canneyt wrote:
>> On Thu, 26 Jun 2003, Micha Nelissen wrote:
>>
>>> As you can see, I have commented the BarShowText functionality,
>>> because I can't get it to work. I think there is no functionality in
>>> win32 natively to draw text on a progressbar. How is it supposed to
>>> look?
>>
>> A question. I have been testing this, and I always get an 'Invalid
>> Class typecast' when I try the quit menu. Do you have this too ?
>
> I've found it. It happens right after the line I patched earlier;
> win32object.inc:542. Sender.Owner = nil there. Is there a difference
> for a TMenuItem between a parent and an owner? Shouldn't those both
> be simply Sender.Parent? (Or Sender.Owner)?

The first one is Sender.Parent for sure. But the second one: DrawMenuBar
wants a handle of the window of the menu which needs to be redrawn. Which
often happens to be Sender.Owner. What guarantees me that Sender.Owner is a
TWinControl? It could be a TComponent just as well....We're just lucky here
that all menuitems on a form are owned by the form, but they could have been
owned by a TButton just as well...no restriction there. How to get the form
of the menu it's on? It could be a popup menu as well...

Regards,

Micha.






More information about the Lazarus mailing list