From: Steven S. <ssw...@su...> - 2002-07-02 03:03:14
|
Thanks Roger, '-mulitline' seems to do the trick! I will have to do some=20 cleaning but I think I can get it to work. I already had a similar test for Text() to check for return character by character and Text doesn't=20 return those characters. Thanks for your help. --steve At 09:02 PM 7/1/02, Rogers, John wrote: >Hi, >If you specify, -multiline=3D>1, when you define the textfield, then the >Change() event occurs when the user presses enter. > >My idea is you could search the text string as each character is typed >and match on "enter". >something like this, > >#untested code >sub textfield_Change{my $rtest =3D 0; > my $input =3D''; > $input=3D$MW->tf->Text(); > $rtest =3D $input=3D~s/\r\n/''/egsm; > if($rtest){print "User pressed enter, better do somthing >here"; > } >} > > >JohnR > > > > -----Original Message----- > > From: Steven Swenson [mailto:ssw...@su...] > > Sent: Tuesday, 2 July 2002 10:19 AM > > To: per...@li... > > Subject: RE: [perl-win32-gui-users] How do I recognize that > > the user has > > pressed enter inside a text box? > > > > > > Basically I want the equivalent of the pascal readln or perl $input =3D > > <STDIN>; from within a textbox. > > the Text() method does allow me to gain access to the > > information entered > > but does not tell me whether the information > > was committed to by the user. I don't want to use a button > > if I can get > > away with it. > > > > any ideas? > > > > --Steve > > > > > > At 06:03 PM 7/1/02, you wrote: > > >Uh-oh ... that's a tricky one as far as I remember. Never > > did it myself, I > > >only have dialogs where the user triggers something with a > > button anyway. If > > >you want to capture the enter key, I'm afraid you have to go > > with those very > > >much not trivial accelerators. There has been a recent > > posting about them, > > >if that doesn't help you, you should go back to the list and post a > > >follow-up question. > > > > > >cya > > >Harald > > > > > > > -----Original Message----- > > > > From: Steven Swenson [mailto:ssw...@su...] > > > > Sent: Monday, July 01, 2002 16:03 > > > > To: Piske, Harald > > > > Subject: RE: [perl-win32-gui-users] How do I read the > > information in a > > > > tex tbox? > > > > > > > > > > > > You assumed correctly :). However, the Text() method doesn't > > > > appear to > > > > return either a \r or a \n ... so how do I determine whether > > > > the user has > > > > in fact entered the data? > > > > > > > > --Steve > > > > > > > > > > > > At 05:14 PM 7/1/02, you wrote: > > > > >I'm assuming you want to get the contents of a text field, > > > > not text file ... > > > > >;-) > > > > >There is the Text() method, defined as a general function, > > > > i.e. should be > > > > >valid for all widgets. It returns all of a field's contents. > > > > If you want the > > > > >bit that's selected: > > > > > > > > > >($from, $to) =3D $Main->MyField->Selection() > > > > >$selectedText =3D substr ($Main->MyField->Text(), $from, > > $to - $from); > > > > > > > > > >I'm not too sure about special cases (what are the values of > > > > Selection() > > > > >when there is nothing selected, what if the selection > > > > includes the very last > > > > >character, do you have to adjust the values by one for each > > > > crlf etc), but > > > > >that's the basic idea. > > > > > > > > > >Have fun, > > > > >Harald > > > > > > > > > > > -----Original Message----- > > > > > > From: Steven Swenson > > [mailto:ssw...@su...] > > > > > > Sent: Monday, July 01, 2002 15:06 > > > > > > To: per...@li... > > > > > > Subject: [perl-win32-gui-users] How do I read the > > information in a > > > > > > textbox? > > > > > > > > > > > > > > > > > > Ok, This feels like a silly question. However the > > > > > > documentation I have on > > > > > > Win32::Gui does not seem to specify a method by which I can > > > > > > actually read > > > > > > the content of a text file. All select, selectAll do is tell > > > > > > me they are > > > > > > successful. And Change() is called for every > > > > character... so I hope > > > > > > someone can give me a hand. > > > > > > > > > > > > --Steve > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > > This sf.net email is sponsored by:ThinkGeek > > > > > > Welcome to geek heaven. > > > > > > http://thinkgeek.com/sf > > > > > > _______________________________________________ > > > > > > Perl-Win32-GUI-Users mailing list > > > > > > Per...@li... > > > > > > > > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Perl-Win32-GUI-Users mailing list > > Per...@li... > > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > > > >############################################################## >Disclaimer > >If this e-mail has been sent to you in error, please notify >Oc=E9-Australia Limited immediately and delete this e-mail from >your system. > >Any views expressed in this e-mail are those of the individual >sender and may not necessarily reflect the views of >Oc=E9-Australia Limited. >############################################################## > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >Perl-Win32-GUI-Users mailing list >Per...@li... >https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |