#cs This is a script to run and display a GUI for EG-M62 group project It will call a window that will show the funtionality desired for the PC interaction of our product #ce #include <GUIConstantsEx.au3> #include <StaticConstants.au3> $today= @YEAR & "/" & @MON & "/" & @MDAY buildGUI() while 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $close $close_response = MsgBox(1,"Warning","Close without saving?") Select Case $close_response = 1 ExitLoop EndSelect Case $msg = $button progress("Saving") $ok_response = MsgBox(64,"Complete", "Please reinsert USB into the base of the light") Select Case $ok_response = 1 ExitLoop EndSelect Case $msg = $fact_reset MsgBox(48,"Warning","Pressing ok will reset all values to default, and erase any stored events") progress("Resetting all data") MsgBox(64,"Completed","Reset completed") Case $msg = $update MsgBox(64,"Update","About to update the calendar files") progress("Updating; please wait") Case $msg = $exitfilemenu $close_response = MsgBox(1,"Warning","Close without saving?") Select Case $close_response = 1 ExitLoop EndSelect Case $msg = $manualedit Run("notepad.exe") Case $msg = $softupdate progress("Updating Software") Case $msg = $aboutdisp MsgBox(64,"About","LiteTawe Configuration Software; Version 0.1 BETA") Case $msg = $saveevent MsgBox(64,"Success","Event Saved") EndSelect WEnd func buildGUI() Global $button, $close, $fact_reset, $update, $exitfilemenu, $manualedit, $softupdate, $aboutdisp, $selecteddate, $eventname, $iconselect, $saveevent $m=700 $n=600 GUICreate("Display Control",$m,$n) GUISetState(@SW_SHOW) $filemenu = GUICtrlCreateMenu("&File") $advancedmenu = GUICtrlCreateMenu("&Advanced") $aboutmenu = GUICtrlCreateMenu("&About") $exitfilemenu = GUICtrlCreateMenuItem("Exit", $filemenu) $manualedit = GUICtrlCreateMenuItem("Manual Edit",$advancedmenu) $softupdate = GUICtrlCreateMenuItem("Update Software",$aboutmenu) $aboutdisp = GUICtrlCreateMenuItem("About",$aboutmenu) $button = GUICtrlCreateButton("Ok", $m-166, $n-80, 75, 23) $close = GUICtrlCreateButton("Close", $m-85, $n-80, 75, 23) $fact_reset = GUICtrlCreateButton("Factory Reset", $m-85,$n-50,75,23) $update = GUICtrlCreateButton("Update", $m-166,$n-50,75,23) GUICtrlCreateLabel("Clock format set-up", $m-136,10) $12hour = GUICtrlCreateRadio("12 Hour",$m-126,30) $24hour = GUICtrlCreateRadio("24 Hour",$m-126,50) $digital = GUICtrlCreateCheckbox("Digital",$m-126,70) $analogue = GUICtrlCreateCheckbox("Analogue",$m-126,90) GUICtrlCreateLabel("Add events to calendar",10,10) $selecteddate = GUICtrlCreateMonthCal($today,10,30,230,165) $eventname = GUICtrlCreateInput("",250,40,250,20) GUICtrlCreateLabel("Event Name",260,20,100,20) GUICtrlCreateLabel("Choose Icon",260,70,100,20) $iconselect = GUICtrlCreateButton("...",270,90,35,23) $annual = GUICtrlCreateCheckbox("Annual Event",315,90) $saveevent = GUICtrlCreateButton("Save Event",315,120,75,23) GUICtrlSetState($digital,$GUI_CHECKED) GUICtrlSetState($annual,$GUI_CHECKED) GUICtrlSetState($12hour,$GUI_CHECKED) GUICtrlCreatePic(@WorkingDir & "...\GUI\Screen.jpg",10,270,100,100) GUICtrlCreatePic(@WorkingDir & "...\GUI\Info.jpg",$m-110,$n-113,100,100) EndFunc func progress($textstring) ProgressOn("Progress", $textstring, "Working...") For $i = 0 To 100 ProgressSet($i) Sleep(5) Next ProgressSet(100, "Done!") Sleep(500) ProgressOff() EndFunc
#1
Posted 18 February 2012 - 03:09 PM
#2
Posted 18 February 2012 - 04:46 PM
Are you sure you have a valid path in those 2 statements? @WorkingDir defaults to the script folder and does not have a final "\" - so your path is currently "Script_Folder...\GUI\Info.jpg". Does not look very likely to work to me.
When I put a valid path in those lines I get the images displayed - try doing the same.
M23
Toast - Small GUIs which pop out of the Systray   Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI   NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure   Notify - Small notifications on the edge of the display
RecFileListToArray- An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
#3
Posted 19 February 2012 - 07:39 AM
Why are you using @WorkingDir anyway? Do you know what a working directory is? You probably want @ScriptDir
How to Report Bugs Effectively
Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC Shift
Some of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
#4
Posted 19 February 2012 - 09:38 PM
Well I thought that would have been the way to go about it, I've come from a MATLAB programming background, so I'm having a bit of difficulty trying to get the syntax right.@adz89
Why are you using @WorkingDir anyway? Do you know what a working directory is? You probably want @ScriptDir
I've adjusted the script to now read
GUICtrlCreatePic(@ScriptDir & "GUIScreen.jpg",10,270,100,100) GUICtrlCreatePic(@ScriptDir & "GUIInfo.jpg",$m-110,$n-113,100,100)
but it still doesn't work...
Edited by adz89, 19 February 2012 - 10:02 PM.
#5
Posted 20 February 2012 - 08:52 AM
@ScriptDir returns the path your AU3 script is ran from.


#6
Posted 20 February 2012 - 04:31 PM
The only thing I can say about this is, are you sure those are valid paths?
@ScriptDir returns the path your AU3 script is ran from.
Well I've created the GUI folder within the folder that the script is, and of course the correct file name/extension
#7
Posted 20 February 2012 - 04:35 PM
Just to be sure that you are using the correct paths, try running FileExists with the same strings as you use in the script and see if that returns 1. That will tell you if the script is looking in the right place.
M23
- adz89 likes this
Toast - Small GUIs which pop out of the Systray   Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI   NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure   Notify - Small notifications on the edge of the display
RecFileListToArray- An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
#8
Posted 20 February 2012 - 04:44 PM
Well I added this;adz89,
Just to be sure that you are using the correct paths, try running FileExists with the same strings as you use in the script and see if that returns 1. That will tell you if the script is looking in the right place.
M23
$check = FileExists(@ScriptDir & "GUIScreen.jpg") If $check = 1 Then MsgBox(0,"Success","File Exists") ElseIf $check = 0 Then MsgBox(0,"Fail","File not found") EndIf
and it said that the file exists.
#9
Posted 20 February 2012 - 04:47 PM
And yet using those same strings with GUICtrlCreatePic fails?
Try creating a GUI with only those 2 image controls within it and see if you can get them to work in that case.
M23
Toast - Small GUIs which pop out of the Systray   Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI   NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure   Notify - Small notifications on the edge of the display
RecFileListToArray- An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
#10
Posted 20 February 2012 - 05:06 PM
adz89,
And yet using those same strings with GUICtrlCreatePic fails?
Try creating a GUI with only those 2 image controls within it and see if you can get them to work in that case.
M23
Ok will do, I'll let you know in due course
#11
Posted 20 February 2012 - 09:17 PM
Here is the code I used;
#include <GUIConstantsEx.au3> buildGUI() while 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd func buildGUI() $m=700 $n=600 GUICreate("Display Control",$m,$n) GUISetState(@SW_SHOW) GUICtrlCreatePic(@ScriptDir & "GUIScreen.jpg",10,270,100,100) GUICtrlCreatePic(@ScriptDir & "GUIInfo.jpg",$m-110,$n-113,100,100) EndFunc
#12
Posted 20 February 2012 - 09:29 PM
I created the same folder structure as you and my images showed up without problem using your code - so I have no idea what is going on.
Really clutching at straws here, but I take it the images do actually have some content that you can see against the GUI background? Do they show up in other apps such as Paint? Have you tried using other images in their place?
M23
Toast - Small GUIs which pop out of the Systray   Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI   NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure   Notify - Small notifications on the edge of the display
RecFileListToArray- An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
#13
Posted 21 February 2012 - 01:53 PM
adz89,
I created the same folder structure as you and my images showed up without problem using your code - so I have no idea what is going on.
Really clutching at straws here, but I take it the images do actually have some content that you can see against the GUI background? Do they show up in other apps such as Paint? Have you tried using other images in their place?
M23
Well I'm out at the moment, but I'll try other images later, but the images can be open in picture viewer, and are both .jpg's...
I'll let you know how it goes with other images.
#14
Posted 21 February 2012 - 03:18 PM
All working now though!
Thanks for the help guys, if anyone's interested I'll post the working, final script later!
#15
Posted 21 February 2012 - 04:31 PM
Glad you got it working despite my ineffective help.
M23
Toast - Small GUIs which pop out of the Systray   Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI   NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure   Notify - Small notifications on the edge of the display
RecFileListToArray- An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
#16
Posted 21 February 2012 - 09:29 PM
adz89,
Glad you got it working despite my ineffective help.
M23
It was the help that was ineffective, it was my programming skills!
Also tagged with one or more of these keywords: GUI
AutoIt v3 →
Graphical User Interface (GUI) Help and Support →
SOLVED----GUI Window Remembers Screen PositionStarted by atnextc , 14 Jun 2013 |
|
|
||
AutoIt v3 →
General Help and Support →
Link two windowsStarted by Reinhardt1julian , 02 Jun 2013 |
|
|
||
AutoIt v3 →
General Help and Support →
Keyboard Layout for Autoit GUIStarted by Anas , 19 May 2013 |
|
|
||
GDI+ Wrapping TextStarted by Artisan , 10 May 2013 |
|
|
||
AutoIt v3 →
Example Scripts →
GDI+ Loading AnimationsStarted by UEZ , 03 May 2013 |
|
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users




