1. Mouse clicks in EditText with CWindow as Parent

Hi,

The EditText controls do not get focus with mouse clicks when their parent is
ChildWindow (CWindow) control. One can neither click and place the cursor on
them, nor can select a part or full text present in it. Other controls like
PushButtons, Combo etc respond correctly to mouse click. Only the EditText
control seems to have this problem.

Any suggestions about how to overcome this?

Regards,
Rad.

new topic     » topic index » view message » categorize

2. Re: Mouse clicks in EditText with CWindow as Parent

Rad wrote:
> 
> Hi,
> 
> The EditText controls do not get focus with mouse clicks when their parent is
> ChildWindow (CWindow) control. One can neither click and place the cursor on
> them, nor can select a part or full text present in it. Other controls like
> PushButtons, Combo etc respond correctly to mouse click. Only the EditText
> control
> seems to have this problem.
> 
> Any suggestions about how to overcome this?
> 
> Regards,
> Rad.


Which GUI library are you using? If win32lib, this could be an IDE issue,
 are you using it? (CWindow isn't a native control in win32lib)

CChris

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

3. Re: Mouse clicks in EditText with CWindow as Parent

CChris wrote:
> 
> Rad wrote:
> > 
> > Hi,
> > 
> > The EditText controls do not get focus with mouse clicks when their parent
> > is
> > ChildWindow (CWindow) control. One can neither click and place the cursor on
> > them, nor can select a part or full text present in it. Other controls like
> > PushButtons, Combo etc respond correctly to mouse click. Only the EditText
> > control
> > seems to have this problem.
> > 
> > Any suggestions about how to overcome this?
> > 
> > Regards,
> > Rad.
> 
> 
> Which GUI library are you using? If win32lib, this could be an IDE issue,
>  are you using it? (CWindow isn't a native control in win32lib)
> 
> CChris

Chris, CWindow is not the class it the way IDE identifies the control
internally. When the exw is generated the child window is Window class.

BTW, I ran a program generated by IDE which has a child window with an EditText
control and it also has the same problem using your latest test win32lib.

judith

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

4. Re: Mouse clicks in EditText with CWindow as Parent

Judith Evans wrote:
> 
> CChris wrote:
> > 
> > Rad wrote:
> > > 
> > > Hi,
> > > 
> > > The EditText controls do not get focus with mouse clicks when their parent
> > > is
> > > ChildWindow (CWindow) control. One can neither click and place the cursor
> > > on
> > > them, nor can select a part or full text present in it. Other controls
> > > like
> > > PushButtons, Combo etc respond correctly to mouse click. Only the EditText
> > > control
> > > seems to have this problem.
> > > 
> > > Any suggestions about how to overcome this?
> > > 
> > > Regards,
> > > Rad.
> > 
> > 
> > Which GUI library are you using? If win32lib, this could be an IDE issue,
> >  are you using it? (CWindow isn't a native control in win32lib)
> > 
> > CChris
> 
> Chris, CWindow is not the class it the way IDE identifies the control
> internally.
> When the exw is generated the child window is Window class.
> 
> BTW, I ran a program generated by IDE which has a child window with an
> EditText
> control and it also has the same problem using your latest test win32lib.
> 
> judith

I forgot to include the example.....

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 )


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

5. Re: Mouse clicks in EditText with CWindow as Parent

CChris wrote:
> 
> Rad wrote:
> > 
> > Hi,
> > 
> > The EditText controls do not get focus with mouse clicks when their parent
> > is
> > ChildWindow (CWindow) control. One can neither click and place the cursor on
> > them, nor can select a part or full text present in it. Other controls like
> > PushButtons, Combo etc respond correctly to mouse click. Only the EditText
> > control
> > seems to have this problem.
> > 
> > Any suggestions about how to overcome this?
> > 
> > Regards,
> > Rad.
> 
> 
> Which GUI library are you using? If win32lib, this could be an IDE issue,
>  are you using it? (CWindow isn't a native control in win32lib)
> 
> CChris

Yes, I am using win32lib v0.60.6 and Judith's IDE v1.0.0.

Regards,
Rad.

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

6. Re: Mouse clicks in EditText with CWindow as Parent

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.

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 )


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?

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

7. Re: Mouse clicks in EditText with CWindow as Parent

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

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

8. Re: Mouse clicks in EditText with CWindow as Parent

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

It may have been a little late when I wrote this. Actually the behaviour
exhibited is quite logical:
* creting a control doesn't set focus to it;
* for the control to naturally get focus, it would need to be in the internal
list of focusable chilren of its parent. But there is no natural place to
insert the new control, so it is the  coder's job to add a setFocus() call
if a control is created after its parent is opened.

Perhaps there is a need for a w32FOCUS_NOW style flag, which would force focus 
on creation and insertion as last (or first?) focusable control in the parent.
What do you think?

CChris

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

9. Re: Mouse clicks in EditText with CWindow as Parent

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 message » categorize

10. Re: Mouse clicks in EditText with CWindow as Parent

CChris wrote:
> 
> 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
> 
> It may have been a little late when I wrote this. Actually the behaviour
> exhibited is quite logical:
> * creting a control doesn't set focus to it;
> * for the control to naturally get focus, it would need to be in the internal
> list of focusable chilren of its parent. But there is no natural place to
> insert the new control, so it is the  coder's job to add a setFocus() call
> if a control is created after its parent is opened.

I made this change:
constant EditText4 = createEx( EditText, "123", CWindow3, 8, 28, 48, 20, 0, 0 )
openWindow(CWindow3,Normal)

and it doesn't change the behavior. I still need the w32HActivate for the
EditText control.
> 
> Perhaps there is a need for a w32FOCUS_NOW style flag, which would force focus
>
> on creation and insertion as last (or first?) focusable control in the parent.
> What do you think?

The problem I see is that setting focus will highlight (select) the data and
that may not always be desirable.

> 
> CChris

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

11. Re: Mouse clicks in EditText with CWindow as Parent

Judith Evans wrote:

[snipped]
> 
> 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.
> 

I gave the version number 0.60.C to my modified versions I released on the
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

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

12. Re: Mouse clicks in EditText with CWindow as Parent

CChris wrote:
> 
> Judith Evans wrote:
> 
> [snipped]
> > 
> > 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.
> > 
> 
> I gave the version number 0.60.C to my modified versions I released on the
> 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,
delete data, add data, backspace but using the mouse does nothing.

judith

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

13. Re: Mouse clicks in EditText with CWindow as Parent

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
> > > C.K.
> > > refered to it and labeled it as from January. I think I have applied all
> > > the
> > > suggested revisions to Win32lib.
> > > 
> > 
> > I gave the version number 0.60.C to my modified versions I released on the
> > 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,
> 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

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

14. Re: Mouse clicks in EditText with CWindow as Parent

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
> C.K.</font></i>
> > > > refered to it and labeled it as from January. I think I have applied all
> > > > the
> > > > suggested revisions to Win32lib.
> > > > 
> > > 
> > > I gave the version number 0.60.C to my modified versions I released on the
> > > 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,
> > 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

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

15. Re: Mouse clicks in EditText with CWindow as Parent

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
> > C.K.</font></i>
> > > > > refered to it and labeled it as from January. I think I have applied
> > > > > all
> the</font></i>
> > > > > suggested revisions to Win32lib.
> > > > > 
> > > > 
> > > > I gave the version number 0.60.C to my modified versions I released on
> > > > the
> > > > 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,
> > > 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

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

16. Re: Mouse clicks in EditText with CWindow as Parent

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
> > > C.K.</font></i>
> > > > > > refered to it and labeled it as from January. I think I have applied
> > > > > > all
> > the</font></i>
> > > > > > suggested revisions to Win32lib.
> > > > > > 
> > > > > 
> > > > > I gave the version number 0.60.C to my modified versions I released on
> > > > > the
> > > > > 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,
> > > > 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.

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

17. Re: Mouse clicks in EditText with CWindow as Parent

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 message » categorize

18. Re: Mouse clicks in EditText with CWindow as Parent

CChris wrote:
> 
> 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</font></i>
> > > > > > > maintaining the package. Since 'C' is 67, that's why ck named it
> > > > > > > that
> way.</font></i>
> > > > > > > 
> > > > > > > CChris
> > > > > > 
> > > > > > In that case, yes I did test with your 0.60.C 04-09-07 version.
> > > > > > After
> using</font></i>
> > > > > > 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
> </font></i>
> > > > > 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:
> }}}
<eucode>
> 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 )
> </eucode>
{{{

> 
> 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

Thanks, CChris.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu