From: Rogers, J. <rog...@oc...> - 2002-07-02 02:10:22
|
Hi, If you specify, -multiline=>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 = 0; my $input =''; $input=$MW->tf->Text(); $rtest = $input=~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 = > <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) = $Main->MyField->Selection() > > > >$selectedText = 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é-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é-Australia Limited. ############################################################## |
From: Andrea M. <mae...@fr...> - 2002-07-02 10:09:24
|
"Rogers, John" wrote: > > Hi, > If you specify, -multiline=>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 = 0; > my $input =''; > $input=$MW->tf->Text(); > $rtest = $input=~s/\r\n/''/egsm; better is (I hope): $rtest = $input=~/\r\n$/; :) -- $_=q,6;-16;-1;-8;0;7;-13;-12;-9;-3;13#4A75737420616E6F74686572,,($_,$b)= split?#?;@b=split?;?;map{$c.=$_,$d.=chr$b[$e++]+ord}split??,pack'H24',$b ;chop$d,print$c.chr(32).$d |
From: Steven S. <ssw...@su...> - 2002-07-03 02:18:41
|
At 08:35 PM 7/2/02, you wrote: So... Once I have placed a list of things into a listview how do I retrieve them later? having a GetList() method returning a List would be nice :) Any ideas? --Steve |
From: Steven S. <ssw...@su...> - 2002-07-03 01:28:18
|
When the number of items inserted into the list exeeds its current displayable size my list box disappears... That is it vanishes and does not redraw itself... I have placed $listview->Update() and $listview->SetReDraw (1) but that doesnot appear to make a difference. Is there an option I should make sure is enabled in the Listview ? --Steve |