RE: Win32Lib setHandler() suggestion

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

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C210CD.63AF05F0
 charset=iso-8859-1

Tone,
v0.57+ can be used to create a chain of handlers for a control.

example:

  -- Set a chain of handlers.
  setHandler( btn1, w32HClick, routine_id("click_buttons"))
  if DebugSwitch = True then
      -- add a second routine to be called.
      setHandler( btn1, w32HClick, routine_id("Debugger"))
  end if

The routines are called in the same order as they are set.

To remove the current handler(s) for a control, set it to -1.

example:
  setHandler( btn1, w32HClick, -1)

To replace the current handler(s) for a control, set it the first one to -1.

example:
  setHandler( btn1, w32HClick, {-1, routine_id("Special_Click"))


To add a handler at the beginning of the chain use getHandler first...

example:
       object hl
       -- Make sure my handler is installed before any others.
       -- First, get the current handlers.
       hl = getHandler(myWindow, w32HPaint)
       -- Chain mine to the front.
       setHandler(myWindow, w32HPaint, -1 & routine_id("mypainter") & hl)

-----------
Derek.
> -----Original Message-----
> From: tone.skoda at siol.net [mailto:tone.skoda at siol.net]
> Sent: Sunday, 9 June 2002 11:13
> To: EUforum
> Subject: Win32Lib setHandler() suggestion
> 
> 
> 
> When you set two event handlers for same control
> first one is deleted.
> It would be better and more simple
> if both would be called
> when the event happens.
> 
> This would be especially useful
> for writing custom controls,
> like custom drawn treeview.
> 
> Or is it already working like that? :^)
> 
> 
> 
> 

==================================================================
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en 
is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht 
onterecht ontvangt wordt u verzocht de inhoud niet te gebruiken en 
de afzender direct te informeren door het bericht te retourneren. 
==================================================================
The information contained in this message may be confidential 
and is intended to be exclusively for the addressee. Should you 
receive this message unintentionally, please do not use the contents 
herein and notify the sender immediately by return e-mail.


==================================================================

------_=_NextPart_000_01C210CD.63AF05F0
Content-Type: application/ms-tnef

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

Search



Quick Links

User menu

Not signed in.

Misc Menu