Re: OwnerDrawn Controls with Win32lib?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hello,

Absolutely a brain backfire, thanks Derek for the correction.
I guess I was thinking that since most other messages are
subclass-able for the listbox that WM_DRAWITEM would be 
aswell. I looked back at my API code and you are right about
the parent recieving the message. Just not thinking!

Euman

----- Original Message ----- 
From: "Derek Parnell" <Derek.Parnell at SYD.RABOBANK.COM>
To: "EUforum" <EUforum at topica.com>
Sent: Sunday, June 02, 2002 9:58 PM
Subject: RE: OwnerDrawn Controls with Win32lib?


> 
> Isn't it the control's parent that receives that message and not the control
> itself?
> 
> Here is code (that does not use subclassing) to test the effect you are
> after.
> ---------------------
> without warning
> include win32lib.ew
> 
> -- Window Test
> global constant
>   Test = create( Window, "List Sync", 0, Default, Default,333, 230, 0 )
> ,
>   SB = createEx(StatusBar, "", Test, 0, 0, 0, 0, 0, 0),
>   List1 = create( List, "List1", Test, 8, 12, 192, 172,
>  
> or_all({WS_CHILD,WS_TABSTOP,LBS_OWNERDRAWFIXED,LBS_HASSTRINGS,LBS_NOTIFY}) )
>     
> 
> constant WM_DRAWITEM = 43
> 
> procedure Test_WndProc( atom self, integer event, sequence parms )
>     sequence msg
>     
> if parms[1] = WM_DRAWITEM then
>     if self = List1 then
>         msg = "The list got it."
>     else
>         msg = "The main window got it."
>     end if        
>     
>     setText(SB, sprintf("%s: wParam:%d lParam:%d ", {msg, parms[2],
> parms[3]}))
> end if
> end procedure
> setHandler({List1,Test}, w32HEvent, routine_id("Test_WndProc"))
> 
> -- Display window
> WinMain( Test, Normal )
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu