star2 Posted April 26, 2007 Posted April 26, 2007 this is the GUI #include <GUIConstants.au3> GUICreate("test", 400, 200) GUISetFont(12) GUICtrlCreateLabel("please select your picture", 8, 4) $put1 = GUICtrlCreateInput("", 8, 25, 200, 25) $open = GUICtrlCreateButton("select picture", 214, 25, 150, 25) GUICtrlCreateLabel("enter your name please", 8, 60) $put2 = GUICtrlCreateInput("", 8, 80, 200, 25) $save = GUICtrlCreateButton("Save", 44, 150, 200, 25) GUICtrlSetState ($save,$GUI_DISABLE) GUISetState() GUICtrlSetFont ($put1, 9) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop if $msg = $open Then $sFile = FileOpenDialog ("open image", @DesktopDir , "images (*.bmp)") If Not @error Then GUICtrlSetData($put1,$sFile) EndIf Select Case GUICtrlRead($put1) And GUICtrlSetData($img,$sFile) GUICtrlSetState ($sav,$GUI_ENABLE) EndSelect WEnd all what I want it to do is to enable the save button but after these conditions: 1- user must have selected an image file using the select picture button. 2- some text must be entered in the input control. if both conditions are ok then enable the save button what's wrong with my script? [quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]
BrettF Posted April 26, 2007 Posted April 26, 2007 Well at the moment the only way I can see this happening is through a custom GUI, or maybe a dll. Have a search through the forums for File Save Advanced. Might turn something up Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
HardCopy Posted April 26, 2007 Posted April 26, 2007 Just a few typos is all. While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop if $msg = $open Then $sFile = FileOpenDialog ("open image", @DesktopDir , "images (*.bmp)") If Not @error Then GUICtrlSetData($put1,$sFile) EndIf Select ; Case GUICtrlRead($put1) And GUICtrlSetData($img,$sFile) ;;; the control called $img has not been defined in your example! Case GUICtrlRead($put1) And GUICtrlRead($put2) ; GUICtrlSetState ($sav,$GUI_ENABLE) ; Typo!! $save not $sav ! GUICtrlSetState($save,$GUI_ENABLE) EndSelect WEnd HardCopy Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad
star2 Posted April 26, 2007 Author Posted April 26, 2007 (edited) Just a few typos is all.HardCopythis is more than beautifulbig thanks to 'HardCopy' Edited April 26, 2007 by star2 [quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]
BrettF Posted April 27, 2007 Posted April 27, 2007 (edited) this is more than beautifulbig thanks to 'HardCopy'I didn't know that it could do that Oh well. If you can't beat the best, join the best??? Is that it??? EDIT: Spelling.... Edited April 27, 2007 by Bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
star2 Posted April 29, 2007 Author Posted April 29, 2007 (edited) INFO UPDATED thanks to " HardCopy " the conditions were in the input fields were modified the save button will be enabled but if I erase the fields contents it keeps enabled so I've added this to the script and it worked perfectly Case GUICtrlRead($put1)="" Or GUICtrlRead($put2)="" GUICtrlSetState ($save,$GUI_DISABLE) oÝ÷ Ú«¨µéÚ HardCopy Edited April 29, 2007 by star2 [quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]
star2 Posted October 10, 2007 Author Posted October 10, 2007 Updated !! #include <GUIConstants.au3> GUICreate("test", 400, 200) GUISetFont(12) GUICtrlCreateLabel("please select your picture", 8, 4) $put1 = GUICtrlCreateInput("", 8, 25, 200, 25) $open = GUICtrlCreateButton("select picture", 214, 25, 150, 25) GUICtrlCreateLabel("enter your name please", 8, 60) $put2 = GUICtrlCreateInput("", 8, 80, 200, 25) $save = GUICtrlCreateButton("Save", 44, 150, 200, 25) GUICtrlSetState ($save,$GUI_DISABLE) GUISetState() GUICtrlSetFont ($put1, 9) $s = 2 While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop if $msg = $open Then $sFile = FileOpenDialog ("open image", @DesktopDir , "images (*.bmp)") If Not @error Then GUICtrlSetData($put1,$sFile) EndIf If fileexists (GUICtrlRead($put1)) = 1 and GUICtrlRead($put2) Then If BitAND(GUICtrlGetState($save), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($save, $GUI_ENABLE) EndIf EndIf If fileexists (GUICtrlRead($put1)) = 0 Or GUICtrlRead($put2) = "" Then If BitAND(GUICtrlGetState($save), $GUI_disable) <> $GUI_disable Then GUICtrlSetState($save, $GUI_disable) EndIf EndIf WEnd [quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]
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