[perl-win32-gui-users] Textfield

2002-05-14 Thread larry moore
Is there a way to make the return key register for a Textfield.  I am using
a sub Textfield_1_Change and would like to use the -text for this object to
be used in a search string when the user has hit the return key.  As a first
step, I have been echoing each key press to the dos window, but the return
key seems to have no effect.

Thanks,

Larry




RE: [perl-win32-gui-users] Textfield

2002-05-14 Thread larry moore
Upon a little closer look at the documentation for -multiline, it says the
the return is \r\n, will this make a difference to my chomp?  Should I be
removing \r\n and searching for both chars?

Thanks,

Larry

-Original Message-
From: Sean Healy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 14, 2002 9:44 AM
To: [EMAIL PROTECTED]; perl-win32-gui-users@lists.sourceforge.net
Subject: Re: [perl-win32-gui-users] Textfield


>Is there a way to make the return key register for a Textfield.  I am using
>a sub Textfield_1_Change and would like to use the -text for this object to
>be used in a search string when the user has hit the return key.  As a
>first
>step, I have been echoing each key press to the dos window, but the return
>key seems to have no effect.

Here's a workaround:
Make the Textfield -multiline => 1.
Use the _Change event:
   Grab the text whenever the user changes it
   Test the text against =~s/\n//g;
   Return if this test fails
   Restore the text
   Do your search

I used to simply check that the text string ended with a \n and then chomp
it and restore the text.  But if a user wants to redo the same search, he
might just click anywhere in the textfield and hit enter, so your \n could
be anywhere in the text string.

_
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx




[perl-win32-gui-users] WS_HSCROLL

2002-05-14 Thread larry moore
I am trying to add both vertical and horizontal scroll bars.  For some
reason my WS_HSCROLL command in the -style doesn't work.


-style => WS_VSCROLL | WS_VISIBLE | 3 | WS_CHILD

works as expected, but

-style => WS_VSCROLL | WS_HSCROLL | WS_VISIBLE | 3 | WS_CHILD

does not produce a horizontal scroll bar when the liines for  the Listbox
are longer then the width of the Listbox.  I am still searching for example
code for this option but have yet to be successful.

Thanks,

Larry