Search the Community
Showing results for tags 'simulator'.
-
I am trying to create a GUI Simulator and feel there must be a better way to do it than the way I'm doing it now. I am loading a .jpg and enabling/disabling transparent(made black for this example) labels which load a different picture when clicked. See my code below. It works but I will be working with about 100 pictures total. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=ico\control_panel.ico #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=C:\Users\knichols\Desktop\frmMain.kxf $frmMain = GUICreate("Simulator", 1024, 643) $Picture = GUICtrlCreatePic("C:\Simulator\ScreenShots\Image1.jpg", 0, 0,1024,643,$SS_BITMAP) $lblCopy = GUICtrlCreateLabel("", 73, 169, 220, 280) GUICtrlSetBkColor(-1, 000000);$GUI_BKCOLOR_TRANSPARENT GUICtrlSetCursor(-1, 0) $lblPrintFrom = GUICtrlCreateLabel("", 328, 169, 220, 280) GUICtrlSetBkColor(-1, 000000);$GUI_BKCOLOR_TRANSPARENT GUICtrlSetCursor(-1, 0) $lblScanTo = GUICtrlCreateLabel("", 583, 169, 220, 280) GUICtrlSetBkColor(-1, 000000);$GUI_BKCOLOR_TRANSPARENT GUICtrlSetCursor(-1, 0) $lblServicesHome = GUICtrlCreateLabel("", 223, 553, 42, 42) GUICtrlSetBkColor(-1, 000000);$GUI_BKCOLOR_TRANSPARENT GUICtrlSetCursor(-1, 0) $lblJobStatus = GUICtrlCreateLabel("", 473, 553, 42, 42) GUICtrlSetBkColor(-1, 000000);$GUI_BKCOLOR_TRANSPARENT GUICtrlSetCursor(-1, 0) $lblMachineStatus = GUICtrlCreateLabel("", 600, 553, 42, 42) GUICtrlSetBkColor(-1, 000000);$GUI_BKCOLOR_TRANSPARENT GUICtrlSetCursor(-1, 0) $lblOK = GUICtrlCreateLabel("", 733, 124, 94, 34) GUICtrlSetBkColor(-1, 000000);$GUI_BKCOLOR_TRANSPARENT GUICtrlSetCursor(-1, 0) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $bFileInstall = False Local $sFldr = "C:\Simulator\ScreenShots\" If DirGetSize($sFldr) <> -1 Then Local $bFileInstall = False Else DirCreate($sFldr) FileInstall("C:\Users\knichols\Desktop\ScreenShots\Image1.jpg", $sFldr & "Image1.jpg") FileInstall("C:\Users\knichols\Desktop\ScreenShots\Image3.jpg", $sFldr & "Image3.jpg") FileInstall("C:\Users\knichols\Desktop\ScreenShots\Image21.jpg", $sFldr & "Image21.jpg") FileInstall("C:\Users\knichols\Desktop\ScreenShots\Image21.jpg", $sFldr & "Image22.jpg") FileInstall("C:\Users\knichols\Desktop\ScreenShots\Image43.jpg", $sFldr & "Image43.jpg") FileInstall("C:\Users\knichols\Desktop\ScreenShots\Image68.jpg", $sFldr & "Image68.jpg") FileInstall("C:\Users\knichols\Desktop\ScreenShots\Image69.jpg", $sFldr & "Image69.jpg") EndIf While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $lblJobStatus GUICtrlSetImage($Picture, "C:\Simulator\ScreenShots\Image69.jpg") DisableLabels() Case $lblServicesHome GUICtrlSetImage($Picture, "C:\Simulator\ScreenShots\Image1.jpg") EnableLabels() Case $lblMachineStatus GUICtrlSetImage($Picture, "C:\Simulator\ScreenShots\Image43.jpg") DisableLabels() Case $lblCopy GUICtrlSetImage($Picture, "C:\Simulator\ScreenShots\Image3.jpg") DisableLabels() Case $lblPrintFrom GUICtrlSetImage($Picture, "C:\Simulator\ScreenShots\Image68.jpg") DisableLabels() Case $lblScanTo GUICtrlSetImage($Picture, "C:\Simulator\ScreenShots\Image21.jpg") GUICtrlSetState($lblOK, $GUI_ENABLE) DisableLabels() Case $lblOK GUICtrlSetImage($Picture, "C:\Simulator\ScreenShots\Image22.jpg") GUICtrlSetState($lblOK, $GUI_DISABLE) EndSwitch WEnd Func DisableLabels() GUICtrlSetState($lblCopy,$GUI_DISABLE) GUICtrlSetState($lblScanTo,$GUI_DISABLE) GUICtrlSetState($lblPrintFrom,$GUI_DISABLE) EndFunc Func EnableLabels() GUICtrlSetState($lblCopy,$GUI_ENABLE) GUICtrlSetState($lblScanTo,$GUI_ENABLE) GUICtrlSetState($lblPrintFrom,$GUI_ENABLE) EndFunc
-
Is there a way to simualte command line parameters instead of having to: Compile the script. Enter Windows' DOS prompt and run the script with paramerers and/or create a shortcut.every time you want to run the script (if it can't run without parameters)? $cmdlineraw can be re-assigned but it doesn't affect $cmdline, which is a non editable constant. Is there any way around it? Thanks!