Re: input nowindow - INPUTBOX RUNNING

"flicknemo" <[email protected]>
Newsgroups gmane.comp.windows.gui4cli
Message-ID <[email protected]>

--- In [email protected], "flicknemo" <flicknemo@...> wrote:
>
> 
> input nowindow
> 
> ~~~~~~~~~~~
> 
> Saturday.
> 
> 
> 
> Hi Dimitris,
> 
> 
> 
> Your input window works without a gui window as I suspected, but it does
> not record what is entered into the variable.
> 
> ~~~~~~~~~~~~
> 
> G4C  r
> 
> 
> 
> xOnLoad
> 
>            GCWin Font "Tahoma/14"
> 
>            GCWin clear
> 
>            GCWin open
> 
> 
> 
>            word = ' '
> 
> while $word > ''
> 
> input "enter something" word
> 
> say 'answer: $word'
> 
> endwhile
> 
> 
> 
> guiquit #this
> 
> ~~~~~~~~~~~~
> 
> I would have guessed that it would keep putting up a box each time new
> data is entered until it is cancelled without data.  Looking at a run,
> the variable has nothing in it so the box doesn't appear again.  Maybe
> 'input' has a bug?
> 
> 
> 
> Later, Flicknemo.
>


 INPUTBOX RUNNING

/***
Hi All,

Whilst testing the Input  Box, which is painted  when you have INPUT  command,
I could not get it to appear on its own in a windowless gui. So I put a window  in
the script, which I may not want  otherwise, for the sole purpose, to open  this
Box.  I tried to HIDE the window. This worked.  So did MINIMIZE.  I suppose
this is a place where you can use  "WinAttr shape image gcPic" to make a shaped
frame about the inputbox, where you use some art or photo for gcPic.  I have not
tried that yet but you could do a "guiwindow #this HIDE" to delete the whole thing
when it has done its job.

I include this while loop as the box seems to sometimes return empty if you just
hit enter to accept the editbox default  entry on the first use. The while  test
finds it empty and allows you another  chance to work it right. I added  a local
counter which you can take out if you want.

The loop also prevents the user from using  the x to bypass the box.  This is  a
handy,  ready made  box to  get a  response typed  in by  the user,  like Name,
Address, City, Zip code.  You dont need to make an elaborate form.  Of course,
in a real script you MUST give the user an option to exit your script at any time.
You could do that with a hotkey, and/or test the value of the entry = q, quit exit or bye.

Just use the  box repeatedly in  a loop. They  have to enter  all the fields  to
continue in the  script.  I hope  this helps anyone  who stopped using  this Box
because of the flaw in its action.

This seems to be a problem with  the box which needs fixing.  Probably it  needs
the focus forcing to the editbox first, Most systems will focus to the OK button
when the box windows appear.
Whilst fixing it the Box can be improved. A better Box
would have a combo to  store previous entries so they  can be picked off, so  it
types the choice into its editbox for  you.  There should also be an easy  way of
saving the contents of the list maybe to INI for automatic retrieval.
Try my script. ***/

~~~~~~~~~~~~~
G4C INPUTBOX
//Chunk of code by flicknemo
WINDOW -1 -1 222 1 "INPUTBOX RUNNING"
xonload
	guiload #this
	   txt = "Example text.."
	guiopen #this
	guiwindow #this HIDE //OR MINIMIZE
	GCWIN Clear

	while $myvar = ""
	   gosub #this ask $txt
	endwhile

xroutine ask  me
	local c
	inc c

	Input "Click OK - Enter some text:$c" myvar $me
      //Say '$c :You entered: $myvar'
	Msgbox 'You entered: $myvar' OK "ENTRY $c"

GuiQuit #this
~~~~~~~~~~~~~




------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/gui4cli/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/gui4cli/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.