Re: Mouse clicks in EditText with CWindow as Parent

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

CChris wrote:
> 
> Judith Evans wrote:
> > 
> > Rad wrote:
> > 
> > > The EditText controls do not get focus with mouse clicks when their parent
> > > is
> > > ChildWindow control. One can neither click and place the cursor on
> > > them, nor can select a part or full text present in it.
> > 
> > One response was that this could be an IDE issue.
> > 
> > Here is a sample of what IDE produces.
> > 
> > }}}
<eucode>
> > include Win32Lib.ew
> > without warning
> >  
> >
> > --------------------------------------------------------------------------------
> > --  Window Window1
> > constant Window1 = createEx( Window, "Window1", 0, Default, Default, 400,
> > 300, 0, 0 )
> > constant CWindow3 = createEx( Window, "", Window1, 56, 24, 200, 100,
> > w32or_all({WS_CHILD}),
> > 0 )
> > openWindow(CWindow3, Normal)
> > constant EditText4 = createEx( EditText, "EditText4", CWindow3, 8, 28, 48,
> > 20, 0, 0 )
> > ---------------------------------------------------------
> >  
> >  
> > WinMain( Window1,Normal )
> > </eucode>
{{{

> > 
> > I've moved the createEx statements for CWindow3 and the EditText4 as well as
> > the openWindow(CWindow3, Normal) to an w32HOpen event or w32HActivate event
> > and the EditText still does not respond.
> > 
> > What needs to be changed in this program or in win32lib for this exw to
> > work?
> 
> Did you test this snippet with any of the "patch #67" versions? Or is the
> problem the same even there, with modified processing of focus (some of
> them due to Sascha Zindel)?
> 
> An explicit setFocus(EditText4) sets everything right. My working 
> version is not stable right now, so I didn't attempt to run this.
> 
> Note that setFocus(CWindow3) doesn't work, and the setFocus(EditText4)
> command has to be in a w32HActivate handler. Using w32HOpen doesn't work
> either. Same behaviour if adding a button to Window1 and opening
> CWindow3 as a result of clicking the button.
> 
> CChris

I'm not clear what patch#67 is but in doing a search of Eu messages I find C.K.
refered to it and labeled it as from January. I think I have applied all the
suggested revisions to Win32lib.

In any event I used the w32HActivate method with setFocus and that does work to
allow me to enter data into the EditText control. However using mouse in the
EditText control doesn't work and neither does a w32HMouse event handler.

Thank you, Chris, very much for your help so far. 

If anyone is interested here the is modified code:

include Win32Lib.ew
without warning

--------------------------------------------------------------------------------
--  Window Window1
constant Window1 = createEx( Window, "Window1", 0, Default, Default, 400, 300,
0, 0 )
constant CWindow3 = createEx( Window, "", Window1, 56, 24, 200, 100,
w32or_all({WS_CHILD}),
0 )
openWindow(CWindow3,Normal)
constant EditText4 = createEx( EditText, "123", CWindow3, 8, 28, 48, 20, 0, 0 )
---------------------------------------------------------
procedure Window1_Activate(integer self, integer event, sequence params)
--suggestion by CChris 4/17/2007
setFocus(EditText4)--This allows me to click in the text field and edit it but I
still can not use the mouse to select data or set cursor
setText(EditText4,"123") --if I don't do this the data is selected (highlighted)
end procedure
setHandler(Window1, w32HActivate, routine_id("Window1_Activate"))

WinMain( Window1,Normal )


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

Search



Quick Links

User menu

Not signed in.

Misc Menu