Penisaurus Posted March 4, 2010 Share Posted March 4, 2010 (edited) So, I'm really bad at GUI's but if anyone could help me it would be great!I would like to make an input box, a small one, to where I could put something in it, and then it would take me to a link with that something.Let me make an example, or try.So lets say I have the input box pop up, and I type in 1234I would like my input box, we'll name it $input to be in some links.Just confused. o_eExample of what I would like.; Input box pops up ; I put in input ; Takes me here with input ; Lets say $input = 1234 $input = 1234 ShellExecute("http://www.somesite.com/user/"& $input) Sleep(2000) ShellExecute("http://www.somesite.com/search/"& $input) Sleep(2000) ShellExecute("http://www.somesite.com/forums/topic/"& $input)I know it doesn't have the GUI Inputbox.Could someone start me off on how to make one though, or how it would work like that? :\I would like to add a button to execute the input. Like after I type it I can press the button "Go!" or something, then it does it. o.o Edited March 4, 2010 by Penisaurus Link to comment Share on other sites More sharing options...
Fulano Posted March 4, 2010 Share Posted March 4, 2010 (edited) So, I'm really bad at GUI's but if anyone could help me it would be great! I would like to make an input box, a small one, to where I could put something in it, and then it would take me to a link with that something. Let me make an example, or try. So lets say I have the input box pop up, and I type in 1234 I would like my input box, we'll name it $input to be in some links. Just confused. o_e Example of what I would like. ; Input box pops up ; I put in input ; Takes me here with input ; Lets say $input = 1234 $input = 1234 ShellExecute("http://www.somesite.com/user/"& $input) Sleep(2000) ShellExecute("http://www.somesite.com/search/"& $input) Sleep(2000) ShellExecute("http://www.somesite.com/forums/topic/"& $input) I know it doesn't have the GUI Inputbox. Could someone start me off on how to make one though, or how it would work like that? :\ I would like to add a button to execute the input. Like after I type it I can press the button "Go!" or something, then it does it. o.o For something this simple InputBox will work beautifully. $input = InputBox ("Title", "Prompt", "Default") if not $input then return ; So you can change your mind Also, AutoIt should be able to queue the ShellExecutes, so the Sleep() isn't strictly needed. Edited March 4, 2010 by Fulano #fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja! Link to comment Share on other sites More sharing options...
Penisaurus Posted March 4, 2010 Author Share Posted March 4, 2010 For something this simple InputBox will work beautifully. $input = InputBox ("Title", "Prompt", "Default") if not $input then return ; So you can change your mind Ah. Okay. I get it now. I guess I was thinking it would be more difficult than it seemed. Thank you! :] Is there anyway to make it a bit smaller and more compact? If I go too small it only seems to do the default. D': Link to comment Share on other sites More sharing options...
Fulano Posted March 4, 2010 Share Posted March 4, 2010 I'm not sure what you mean by 'smaller and more compact' - do you mean the code, or the box itself (which I believe has a minimum size, though I've never really bothered with it as it sizes itself well enough for me). #fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja! Link to comment Share on other sites More sharing options...
Penisaurus Posted March 4, 2010 Author Share Posted March 4, 2010 I'm not sure what you mean by 'smaller and more compact' - do you mean the code, or the box itself (which I believe has a minimum size, though I've never really bothered with it as it sizes itself well enough for me).I mean, can I make it this size - ExampleWithout sizing it myself each time I run it? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 4, 2010 Moderators Share Posted March 4, 2010 Penisaurus,From the Help file for InputBox:The InputBox is user-resizable, but has a minimum size of approximately 190 x 115 pixels. Default size is approximately 250 x 190 pixels.If you want it any smaller, you will have to write your own GUI code like this: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $vID = _Get_ID() MsgBox(0, "ID", $vID) Func _Get_ID() $hGUI = GUICreate("ID Information", 180, 100, Default, Default, BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU), $WS_EX_TOPMOST) GUICtrlCreateLabel("Please type the ID!", 10, 10, 160, 20) $hInput = GUICtrlCreateInput("", 10, 40, 160, 20) $hOK_Button = GUICtrlCreateButton("OK", 10, 70, 75, 20) $hCan_Button = GUICtrlCreateButton("Cancel", 95, 70, 75, 20) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $hCan_Button Exit Case $hOK_Button $vID = GUICtrlRead($hInput) GUIDelete($hGUI) Return $vID EndSwitch WEnd EndFuncAlthough this user-drawn GUI (which is based on your example) is only marginally smaller than the minimum size of an InputBox (180 x 100 vs 190 x 115) so you have to ask if it is worth the effort. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Fulano Posted March 4, 2010 Share Posted March 4, 2010 @Melba Thanks for the assist #fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now