norjms Posted November 30, 2009 Share Posted November 30, 2009 (edited) I'm having trouble with a Input box. I created it just fine and it populates properly when there is no data or there is data. The problem is later on when I try to change the value the text box doesn't change. ;File System Broswer for Target Path $BrowseFileSystem = GUICtrlCreateButton("Browse", 280, 232, 75, 25, $WS_GROUP) Local $BrowseFileSystemSelect = IniRead($Configure,"DVD Rip Output Path","Key", "Default") ;setting up for blank info If $BrowseFileSystemSelect = "" Then $RipTargetPath = GUICtrlCreateInput("...", 16, 232, 257, 21) ;setting up for populated info Else $RipTargetPath = GUICtrlCreateInput($BrowseFileSystemSelect, 16, 232, 257, 21) EndIf Here is where I call the changes but nothing happens as it doesn't redraw or change the text box above Case $nMsg = $BrowseFileSystem $BrowseSelect = FileSelectFolder("Select the folder/drive where you want the DVD Rips stored.", "") IniWrite($Configure,"DVD Rip Output Path","Key",$BrowseSelect) Local $RipTargetPath = GUICtrlCreateInput($BrowseFileSystemSelect, 16, 232, 257, 21) Thanks for taking a look. Edited December 2, 2009 by norjms Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 30, 2009 Moderators Share Posted November 30, 2009 norjms,Do not recreate your input to change the text - just use GUICtrlSetData to change the text within the existing control. But read the Helpfile carefully as to how to format the data or you will just add to the text already there. 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...
norjms Posted November 30, 2009 Author Share Posted November 30, 2009 I must be missing something.... ;File System Broswer for Target Path $BrowseFileSystem = GUICtrlCreateButton("Browse", 280, 232, 75, 25, $WS_GROUP) Local $BrowseFileSystemSelect = IniRead($Configure,"DVD Rip Output Path","Key", "Default") If $BrowseFileSystemSelect = "" Then $RipTargetPath = GUICtrlCreateInput("...", 16, 232, 257, 21) Else $RipTargetPath = GUICtrlCreateInput($BrowseFileSystemSelect, 16, 232, 257, 21) EndIf Changed to GuiCtrlSetData Case $nMsg = $BrowseFileSystem $BrowseSelect = FileSelectFolder("Select the folder/drive where you want the DVD Rips stored.", "") IniWrite($Configure,"DVD Rip Output Path","Key",$BrowseSelect) Local $BrowseFileSystemSelect = IniRead($Configure,"DVD Rip Output Path","Key", "Default") $RipTargetPath = GUICtrlSetData($BrowseFileSystemSelect,$RipTargetPath) No idea here I'm quite new at this Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 30, 2009 Moderators Share Posted November 30, 2009 norjms,Looks like you have the syntax a little wrong:$RipTargetPath = GUICtrlSetData($BrowseFileSystemSelect,$RipTargetPath)$RipTargetPath is the ControlID returned when you created the Input control - you use that to identify the control to other commands.When you look at GUICtrlSetData in the Helpfile you find the following syntax:GUICtrlSetData ( controlID, data [, default] )You need to put $RipTargetPath as the ControlID (so AutoIt knows where to put the data!) and then whatever you need as data. You can ignore the final parameter as it only affects Combo and List controls.So I would imagine your seocnd snippet should read:Case $nMsg = $BrowseFileSystem ; Get the folder to use $BrowseSelect = FileSelectFolder("Select the folder/drive where you want the DVD Rips stored.", "") ; Save it to the ini file IniWrite($Configure,"DVD Rip Output Path","Key",$BrowseSelect) ; Change the input box text GUICtrlSetData($RipTargetPath, $BrowseSelect) ; Note syntax ; Not sure if you need this line, it depends on whether you want this variable set to the new folder Local $BrowseFileSystemSelect = $BrowseSelect ; But there is certainly no point in re-reading the value from the ini file!!! ; Local $BrowseFileSystemSelect = IniRead($Configure,"DVD Rip Output Path","Key", "Default")I hope this helps. If anything is unclear, please ask. If you need more help, it might be better to post a bit more code - trying to work off 2 small snippets is a bit limiting! 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...
norjms Posted November 30, 2009 Author Share Posted November 30, 2009 Thank You it worked great last question would I use the same method for guictrlcreatepic? Trying to use little leds to show what options are enabled. i.e create the the gui portion then add the guictrlsetdata to the case strings? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 30, 2009 Moderators Share Posted November 30, 2009 norjms,From the Help file for GUICtrlCreatePic:"To update the picture after the dialog box is displayed just use GUICtrlSetImage"It is a wonderful resource, you know! 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...
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