Re: w32HChange event on RichEdit

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

Rad wrote:
> 
> CChris wrote:
> > 
> > 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
> > }}}
<eucode>
> >     {w32HChange,  w32CHG_Chg},   -- editbox notify change
> > </eucode>
{{{

> > Add below it:
> > }}}
<eucode>
> >     {w32HChange,  w32CHG_Chg},   -- RichEdit notify change
> > </eucode>
{{{

> > Likewise, line 30537 says
> > }}}
<eucode>
> >     {EDIT,EN_CHANGE},      -- editbox notify change
> > </eucode>
{{{

> > Add below this:
> > }}}
<eucode>
> >     {COMMON_CONTROL,EN_CHANGE},      -- RichEdit (and others) notify change
> > </eucode>
{{{

> > 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
> 
> Hi CChris,
> 
> Still something is missing.
> 
> Added the required lines in win32lib.ew, but still not getting _onChange()
> invoked.
> 
> }}}
<eucode>
>     EM_GETTEXTEX  = WM_USER + 94,
>     EM_GETTEXTLENGTHEX = WM_USER + 95,
> -- rad 2007-05-02
>     ENM_CHANGE = 1,
>     EM_GETEVENTMASK = #0459,
>     EM_SETEVENTMASK = #0469,
> -- rad 2007-05-02
>     TM_PLAINTEXT                        = 1,
>     TM_RICHTEXT                                = 2,
> 
> constant kMsgCommandCode = {
>     {BUTTON,BN_CLICKED},     -- Button click
>     {STATIC,STN_CLICKED},    -- Label(static) click
>     {LISTBOX,LBN_SELCHANGE},  -- combo/list box selection change
>     {EDIT,EN_CHANGE},      -- editbox notify change
> -- rad 2007-05-03
>     {COMMON_CONTROL,EN_CHANGE}, -- RichEdit (and others) notify change
> -- rad 2007-05-03
>     {COMBO,CBN_EDITCHANGE}, -- combo notify change has occured
>     {COMBO,CBN_SELCHANGE},  -- combo/list box notify change
>     {COMBO,CBN_DROPDOWN},   -- The combobox is about to dropdown.
>     {COMBO,CBN_CLOSEUP}     -- The combobox dropdown has just been closed
>     }
> 
> constant kW32EventCode = {
>     {w32HClick,   0},    -- Button
>     {w32HClick,   0},    -- Label Click
>     {w32HChange,  w32CHG_Sel},   -- list box notify change
>     {w32HChange,  w32CHG_Chg},   -- editbox notify change
> -- rad 2007-05-03
>     {w32HChange,  w32CHG_Chg},   -- RichEdit notify change
> -- rad 2007-05-03
>     {w32HChange,  w32CHG_Chg},   -- combo data changed
>     {w32HChange,  w32CHG_Sel},   -- combo selection changed
>     {w32HDropDown,0}, -- combo is about to dropdown.
>     {w32HCloseUp, 0}   -- combo dropdown has just been closed
>     }
> </eucode>
{{{

> 
> 
> Anything else has to be changed/included?
> 
> Tried suggested line additions in both IDE as well as official win32lib.ew,
> but getting same result.
> (in official version, the line numbers were at 30538 and 30527 instead of
> 30548
> and 30537 respectively.)
> 
> I am using WinXP SP2, hope noting to do with this.
> 
> Regards,
> Rad.

Gotcha! My bad.
EM_GETEVENTMASK is WM_USER+59 actually (that would be #043B), and
EM_SETEVENTMASK
is WM_USER+69, ie #0445. Hate these mixed hex/decimal. Or I'm too used to hex.
With these right definitions, under XP SP2 pro, the event does fire.

CChris

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

Search



Quick Links

User menu

Not signed in.

Misc Menu