Re: w32HChange event on RichEdit
- Posted by CChris <christian.cuvier at agriculture.gouv.fr> May 03, 2007
- 565 views
Rad wrote: > > CChris wrote: > > > > ENM_CHANGE is 1 (Google is your friend). I think the ENM constants are the > > same as the corresponding EN_ ones, but I didn't check. > > You'll have to define constants: > > EM_GETEVENTMASK = #0459 > > EM_SETEVENTMASK = #0469 > > > > v0.60.6 is the latest version, and Judith's is an adaptation to IDE, > > specially for Win98 users. There may be a newer release some weeks ahead. > > > > CChris > > Hi CChris, > > In win32lib.ew, EN_CHANGE has been declared as #300, and I declared - > > ENM_CHANGE = 1 > EM_GETEVENTMASK = #0459 > EM_SETEVENTMASK = #0469 > > > I used EM_GETEVENTMASK and EM_SETEVENTMASK as follows: > > In General area of window: > > }}} <eucode> > atom flags, void > > flags = sendMessage(RichEdit41, EM_GETEVENTMASK, 0, 0) > flags = or_bits(flags, ENM_CHANGE) -- also tried EN_CHANGE > void = sendMessage(RichEdit41, EM_SETEVENTMASK, 0, flags) > </eucode> {{{ > > In w32HChange area for RichEdit41: > > }}} <eucode> > procedure RichEdit41_onChange (integer self, integer event, sequence > params)--params is () > VOID = message_box("RichEdit Changed", "onChange", MB_ICONINFORMATION) > end procedure > setHandler( RichEdit41, w32HChange, routine_id("RichEdit41_onChange")) > </eucode> {{{ > > But still I can not get the display from w32HChange event for RichEdit41. > Where am I going wrong? > > Regards, > Rad. Damn you are right, this is trapped by the lib for edit boxes only. There's a quick fix (line #s refer to official win32lib v0.60.6): * at line 30548, there's a line that says
{w32HChange, w32CHG_Chg}, -- editbox notify change
Add below it:
{w32HChange, w32CHG_Chg}, -- RichEdit notify change
Likewise, line 30537 says
{EDIT,EN_CHANGE}, -- editbox notify change
Add below this:
{COMMON_CONTROL,EN_CHANGE}, -- RichEdit (and others) notify change
This is not the cleanest way, but it will work (I just checked that the notification is indeed received by the parent, it's just that the library currently ignores it). CChris