1. MLE question revisited

Regarding the long, involved dilemma I was facing earlier in the week; =
creating the MLE with ES_READONLY (#00000800) in the style field works =
beautifully.  I can scroll the read only mle without losing focus in the =
read/write MLE, and I (of course) cannot modify anything in the read only =
box.  One problem fixed.

Regarding the changing of colors (background & foreground), I uncommented =
the traps David mentioned in the message handling section of Win32Lib.  =
Result -- just like the comment next to them says, they don't work.  It's =
not an urgent problem for me, so I'll let another brave soul figure out =
why not.

Now for my question -- I figured out why setText(mle3,"") leaves a blank =
line in the mle.  mle3 is the read/write box and I process the data in the =
box by trapping VK_RETURN in an OnKeyPress routine.  Part of the routine =
is to clear the mle.  But when the routine completes, the trapped Return =
is passed along to the mle to be written.  How do I get rid of the trapped =
Return so it isn't passed along?

Michael J. Sabal
mjs at osa.att.ne.jp=20

new topic     » topic index » view message » categorize

2. Re: MLE question revisited

Mike Sabal wrote:

> How do I get rid of the trapped Return so
> it isn't passed along?

Try something like:

   if key = VK_RETURN then
      -- tell Win32Lib to stop processing
      returnValue( True )
   end if

or even uglier:

   -- sorry, couldn't resist...
   returnValue( key = VK_RETURN )

The returnValue function tells Win32Lib that your program handled the
function, and doesn't need any further processing by Windows. The routine is
called 'returnValue' because it's the value returned by the WndProc
callback. A bit obscure; I may rename the procedure.

Hope this helps!

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu