Re: Mouse clicks in EditText with CWindow as Parent

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

Judith Evans wrote:
> 
> CChris wrote:
> > 
> > Judith Evans wrote:
> > > 
> > > CChris wrote:
> > > > 
> > > > Judith Evans wrote:
> > > > > 
> > > > > CChris wrote:
> > > > > > 
> > > > > > Judith Evans wrote:
> > > > > > 
> > > > > > [snipped]
> > > > > > > 
> > > > > > > I'm not clear what patch#67 is but in doing a search of Eu
> > > > > > > messages
> I find</font></i>
> > > > C.K.</font></i>
> > > > > > > refered to it and labeled it as from January. I think I have
> > > > > > > applied
> all</font></i>
> > > the</font></i>
> > > > > > > suggested revisions to Win32lib.
> > > > > > > 
> > > > > > 
> > > > > > I gave the version number 0.60.C to my modified versions I released
> > > > > > on
> the</font></i>
> > > > > > mailing list, since at the time it was not clear at all whether
> > > > > > Derek was
> > > > > > maintaining the package. Since 'C' is 67, that's why ck named it
> > > > > > that way.
> > > > > > 
> > > > > > CChris
> > > > > 
> > > > > In that case, yes I did test with your 0.60.C 04-09-07 version. After
> > > > > using
> > > > > setFocus in a w32HActivate setHandler I can use the keyboard to move
> > > > > the
> cursor,</font></i>
> > > > > delete data, add data, backspace but using the mouse does nothing.
> > > > > 
> > > > > judith
> > > > 
> > > > Same as per the official version.
> > > > Did you try locating the "classAttr[EditBox]" line and add w32Clickable
> > > > to
> > > > the class properties? Then at least w32HClick is fired - but still no
> > > > apparent reaction to mouse clicks, even though it always gets them.
> > > > Problem doesn't arise when replacing EditText with ListBox, or parenting
> > > > the edit field to the active window. This would look like a pesky bug.
> > > > Or
> > > > perhaps just Windows' perversity.
> > > > 
> > > > CChris
> > > 
> > > classAttr[EditText] had w32AutoSelect  so I added + w32Clickable to it.
> > > Doesn't
> > > seem to do anything though for firing w32HClick.
> > > 
> > > If this turns out to be some problem with a window with WS_CHILD style,
> > > perhaps
> > > Rad can use a regular window and position it in the main window's
> > > w32HOpen.
> > > But it is a bit of a pain to reposition any time the user moves the main
> > > window
> > > or Maximize/Restore/Minimize it.
> > > 
> > > judith
> > 
> > I just spent some time home spying at the messages the edit field and its
> > parent window get, both when the parent window has WS_CHILD and not.
> > 
> > The parent window, when it has WS_CHILD, doesn't reflect some messages like
> > WM_CTLCOLOREDIT, which is why the edit control does not paint properly. This
> > is supposed to be the job of a dialog box procedure. So, the problem comes
> > from incomplete emulation of dialog boxes by child windows.
> > I can't see a quick fix there. Using openDialog() is of no help, of course.
> > 
> > So, your solution could be the best workaround available, as unappealing as
> > it sounds. Sorry, Rad (unless someone gets a bright idea).
> > 
> > CChris
> 
> 
> Thanks CChris, you tried and that is all anyone can ask of you. Perhaps Derek
> will spot this discussion and have some insight.

You know what? There's a way out.

Since edit fields are old stuff designed for Win3.0 or earlier, the bright 
idea was to rely on newer controls that perform likewise in a way, namely
RichEdits.

The following gives a satisfactory display:
include Win32Lib.ew
without warning
 
--------------------------------------------------------------------------------
--  Window Window1
constant Window1 = createEx( Window, "Window1", 0, Default, Default, 200, 140,
0, 0 )
constant CWindow3 = createEx( Window, "", Window1, 56, 24, 200, 100,
w32or_all({WS_CHILD}),
0 )
openWindow(CWindow3, Normal)
constant EditText4 = createEx( RichEdit, "EditText4", CWindow3, 8, 28, 48, 20,
{w32or_all( {  WS_CLIPPINGCHILD,
	    	        WS_VISIBLE,
	    	        ES_AUTOHSCROLL,
	    	        WS_TABSTOP,
	    	        ES_SAVESEL,
	    	        WS_BORDER } )}
, 0 )

WinMain( Window1,Normal )


Don't try lazily using default styles and then removing some, it won't work.

And don't try finding text in the control under XP, because that will fail
until the newer win32lib is available. It should work fine under 98 and
perhaps NT4.

CChris

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

Search



Quick Links

User menu

Not signed in.

Misc Menu