[lazarus] BitButton in Win32
Mattias Gaertner
nc-gaertnma at netcologne.de
Fri Sep 5 14:20:07 EDT 2003
On Fri, 05 Sep 2003 18:37:40 +0200
Martin Smat <martin.smat at tiscali.cz> wrote:
> Hi,
> I tried to implement the bitmap buttons under win32 interface to show
> correctly the image and the button caption (now the caption is not
> displayed - it's because the button is defined with flag BS_BITMAP). It
> should be defined with flag BS_OWNERDRAW and painted in processing
> WM_DRAWITEM message.
This is win32 specific. Under gtk you don't need to draw it yourself, you
can simply insert a pixmap into a button. Every used custom draw function in
the LCL should be avoided to get theme dependent controls.
Can we delegate the bitmap drawing to the win32 interface?
Mattias
> In WM_DRAWITEM I filled the TLMDrawItems structure. The LM_DRAWITEM
> message is processed in procedure TCustomForm.WndProc but only for
> ODT_MENU. Can this procedure be extended about processing ODT_BUTTON?
> I think something like this:
> ...
> if CtlType = ODT_BUTTON then
> begin
> CNSendMessage(LM_DRAWITEM, TObject(GetProp(hwndItem ,'WinControl')),
> Pointer(TheMessage.LParam)); { or calling an interface function - what
> would be better? }
> end;
> ...
>
> When processing ODT_BUTTON will be there I will make the rest and send a
> patch.
>
> Martin Smat.
>
> _________________________________________________________________
> To unsubscribe: mail lazarus-request at miraclec.com with
> "unsubscribe" as the Subject
> archives at http://www.lazarus.freepascal.org/mailarchives
--
More information about the Lazarus
mailing list