[Lazarus] Custom draw menu

Sven Barth pascaldragon at googlemail.com
Fri Nov 5 17:19:09 CET 2010


Am 05.11.2010 17:08, schrieb Birger Jansen:
>> If it uses native controls, you have to ask Microsoft. I doubt they will
>> give you the code, though. ;)
>>
>> Joost.
>
> I can try...
> But there has to be a link somewhere between the TMenuItem class and the code that actually draws this menu, right? How does Windows knwt that is has to look for a TMenu control and then draw the menu?

Basically the LCL creates a native menu item (e.g. for Windows API, for 
GTK2, for QT, etc). This native item knows how to draw itself (cause 
that's implemented in the used widgetset) and the LCL just passes 
necessary information (e.g. Caption, Checked, etc) to the native item.

The glue code between the LCL and that native widgetset is in 
lcl/interfaces/<widgetset>. For menues on Win32/64 you'd look at 
lcl/interfaces/win32/win32wsmenus.pp

Regards,
Sven




More information about the Lazarus mailing list