AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

InputBox II

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
Beastmaster
Guest





PostPosted: Sun Mar 21, 2004 11:06 am    Post subject: InputBox II Reply with quote

Maybe I've overseen it (?)
Is there a default value possible @ an AHK input box ???
Here's a sample syntax from another scripting tool :

-----

Quote:
Input>variable,prompt[,default_value]

Displays a dialog box to request information from the user. The dialog box displays the prompt specified in prompt and accepts input into variable. Optionally, a default value can be specified.

The Input box now also has a file browse button, making it useful for accepting filenames from the user.

If the Input dialog is cancelled (cancel is pressed) Input returns an empty string.

prompt can be a variable, containing the prompt to display.

It is possible to mask the value entered by the user with asterisks by setting the INPUT_PASSWORD variable to 1. Set to zero for default behaviour.


-----

The file browse button could be a nice feature, but shouldn't be part of the InputBox by default.
Maybe an advanced switch like H=Hide, F=FileBrowse ?

InputBox, OutputVar [, Title, Prompt, Default_value, H/F]
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Sun Mar 21, 2004 12:53 pm    Post subject: Reply with quote

Having a default value is a good idea. I'll try to get that into this upcoming version (due around Tuesday) or the one after that.

However, the need to select a file in InputBox seems rare. Would FileSelectFile meet your needs? Perhaps I should add an option for a default value in FileSelectFile as well.
Back to top
View user's profile Send private message Send e-mail
Beastmaster
Guest





PostPosted: Wed Mar 24, 2004 9:30 am    Post subject: Reply with quote

A workaround for those who can't wait any longer Wink

SetEnv, PathVar, C:\WinNT\System32
MsgBox, 36, Install Path Confirmation, We'd install XY on C:\WinNT\... `nPlease confirm, 10
IfMsgBox, NO, Goto, Input

.
.
.


Input:
Inputbox, PathVar, Install Path Confirmation, Please input the path where XY should be installed.
.
.
.
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Thu Mar 25, 2004 11:16 pm    Post subject: Reply with quote

There's an example in SetTimer of how to provide a default value for InputBox. I still intend to add the feature to the next release, but in the meantime this might help:

http://www.autohotkey.com/docs/commands/SetTimer.htm
Back to top
View user's profile Send private message Send e-mail
Guest






PostPosted: Fri Mar 26, 2004 11:51 am    Post subject: Reply with quote

As always,
thank you CHRIS! for these ingeniuous new commands (i.e. SetTimer).
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Fri Apr 23, 2004 6:06 pm    Post subject: Reply with quote

With respect to this topic, I added a few things to the Installer, which you can redownload if you wish. I hope to release the next version early next week. Also, I plan to start updating the change log more often, or somehow changing the way releases are done so that the version number doesn't always stay the same.

Improved InputBox with an optional timeout, as well as a default string for the edit field. [thanks Beastmaster]

Improved FileSelectFile to optionally provide a default filename in the dialog's edit field. [thanks Beastmaster]

Improved FileSelectFolder to optionally provide an edit field for the user to type the name of a folder.


OTHER CHANGES:
Fixed Run & RunWait on Windows 95/98/Me: They would sometimes incorrectly report a failure.

Removed the "Hook is not supported" warning message when a hook script is launched on Win9x.

Improved Send so that it obeys #HotkeyModifierTimeout even when the Send isn't called from a hotkey subroutine (e.g. called from a timer).

Improved the mouse click commands so that you can use just the first letter of the button name (L/R/M). [thanks Rajat]

Improved parsing loops with built-in handling for CSV (comma separated value) format. [thanks Robert Yaklin]

Improved the security of compiled scripts. If preventing hackers from viewing the source code of your compiled scripts is important, recompile the affected scripts with this version. [thanks Rajat]

Added the ability to show/hide the tray icon *while the script is running*. [thanks beardboy] See the menu command.

Added an option that allows the main window of a *compiled script* to become accessible. [thanks beardboy] See the menu command.
Back to top
View user's profile Send private message Send e-mail
beardboy



Joined: 02 Mar 2004
Posts: 444
Location: SLC, Utah

PostPosted: Sat Apr 24, 2004 6:42 am    Post subject: Reply with quote

Quote:
Improved InputBox with an optional timeout, as well as a default string for the edit field. [thanks Beastmaster]

Improved FileSelectFile to optionally provide a default filename in the dialog's edit field. [thanks Beastmaster]

Am I just not seeing it or were these left out on the last Help File (04/23/04 10:11am)?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Sat Apr 24, 2004 12:17 pm    Post subject: Reply with quote

They should be in there (they're in my copy, I just installed again to make sure). FileSelectFile's is listed in its RootDir parameter (since it's combined with that parameter).
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group