#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include #include #include #include #include #include #include $InputFileName = "C:\Text.txt" If FileExists($InputFileName) = 0 Then $InputFileName = "Select File ------------------------------------------------->" IniWrite("MyGUI.ini", "Main", "InputFileName", $InputFileName) EndIf #Region ### START Koda GUI section ### Form=c:\users\stmi\dropbox\mainfolder\xyz_eav production\mainmenu.kxf $Form1_1 = GUICreate("My Test GUI", 623, 449, -1, -1) $Tab1 = GUICtrlCreateTab(16, 16, 585, 417) ;~ Main Tab ===================================== GUICtrlSetFont(-1, 14, 800, 0, "Arial") $MainTabSheet = GUICtrlCreateTabItem("Main") $ExitButtonM = GUICtrlCreateButton("Exit", 504, 392, 81, 28) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ;~ Input Tab ===================================== $InputTabSheet = GUICtrlCreateTabItem("Input") GUICtrlSetState(-1, $GUI_SHOW) $SingleFileRadio = GUICtrlCreateRadio("Select Single File", 24, 56, 180, 20) GUICtrlSetFont(-1, 12, 600, 0, "MS Sans Serif") $SingleFileLocText = GUICtrlCreateLabel(IniRead("MyGUI.ini", "Main", "InputFileName", " "), 24, 80, 400, 84) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $SingleFileSelectButton = GUICtrlCreateButton("Select", 430, 80, 73, 28) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $SingleFileEditButton = GUICtrlCreateButton("Edit", 518, 80, 73, 28) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $ExitButtonI = GUICtrlCreateButton("Exit", 504, 392, 81, 28) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $RunButtonI = GUICtrlCreateButton("Run", 24, 392, 81, 28) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") If IniRead("MyGUI.ini", "Main", "InputRadio", 0) = 1 Then GUICtrlSetState($SingleFileRadio, $GUI_CHECKED) EndIf $MultipleFileRadio = GUICtrlCreateRadio("Select Multiple Files", 24, 176, 180, 20) GUICtrlSetFont(-1, 12, 600, 0, "MS Sans Serif") If IniRead("MyGUI.ini", "Main", "InputRadio", 0) = 2 Then GUICtrlSetState($MultipleFileRadio, $GUI_CHECKED) EndIf $FolderRadio = GUICtrlCreateRadio("Select Folder", 24, 296, 180, 20) GUICtrlSetFont(-1, 12, 600, 0, "MS Sans Serif") If IniRead("MyGUI.ini", "Main", "InputRadio", 0) = 3 Then GUICtrlSetState($FolderRadio, $GUI_CHECKED) EndIf GUICtrlCreateTabItem("") ;~ Filter Tab ===================================== $FiltersTabSheet = GUICtrlCreateTabItem("Filters") $RunButtonF = GUICtrlCreateButton("Run", 24, 392, 81, 28) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $ExitButtonF = GUICtrlCreateButton("Exit", 504, 392, 81, 28) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ;~ Output Tab ===================================== $OutputTabSheet = GUICtrlCreateTabItem("Output") $RunButtonO = GUICtrlCreateButton("Run", 24, 392, 81, 28) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $ExitButtonO = GUICtrlCreateButton("Exit", 504, 392, 81, 28) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ExitButtonM Exit Case $ExitButtonI Exit Case $ExitButtonF Exit Case $ExitButtonO Exit Case $SingleFileRadio IniWrite("MyGUI.ini", "Main", "InputRadio", 1) Case $MultipleFileRadio IniWrite("MyGUI.ini", "Main", "InputRadio", 2) Case $FolderRadio IniWrite("MyGUI.ini", "Main", "InputRadio", 3) Case $SingleFileSelectButton $SingleFileLocText = FileOpenDialog("Select Input File", @ScriptDir & "\", "Text Files (*.txt)", $FD_FILEMUSTEXIST) IniWrite("MyGUI.ini", "Main", "InputFileName", $SingleFileLocText) $SingleFileLocText = GUICtrlCreateLabel(IniRead("MyGUI.ini", "Main", "InputFileName", " "), 24, 80, 400, 84) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") EndSwitch WEnd ;~ Func DiableSingleFileInput() ;~ GUICtrlSetState($InputFileName, $GUI_DISABLE) ;~ GUICtrlSetState($SingleFileSelectButton, $GUI_DISABLE) ;~ GUICtrlSetState($SingleFileEditButton, $GUI_DISABLE) ;~ GUICtrlSetState($SingleFileLocText, $GUI_DISABLE) ;~ EndFunc ;==>DiableSingleFileInput ;~ Func EnableSingleFileInput() ;~ GUICtrlSetState($InputFileName, $GUI_ENABLE) ;~ GUICtrlSetState($SingleFileSelectButton, $GUI_ENABLE) ;~ GUICtrlSetState($SingleFileEditButton, $GUI_ENABLE) ;~ GUICtrlSetState($SingleFileLocText, $GUI_ENABLE) ;~ EndFunc ;==>EnableSingleFileInput