scringamble Posted October 9, 2010 Share Posted October 9, 2010 What i'm making is a small score keeping program that is like a table, there are input boxes where you put in the score for each team and the coloumn at the right side of the GUI returns the totals.The input boxes are pretty big(40x40px) because the scores will be shown on a projector, so everyone can see them. The problem is that there are 20 tasks for 6 teams and that wouldn't fit on the laptop screens we have. So what i wanted to do is have a child GUI with a scroll bar, so you can scroll trough the boxes, but not the team names or the totals, which would stay in the original GUI.Here is a snippet from the GUI creation code:expandcollapse popup$main_gui = guicreate ( "Gólyabál Pontozó" , 780 , 380 , 200 , 200) guictrlcreatepic ( "stork_bg.jpg" , 0 , 0 , 780 , 380 , $WS_DISABLED ) ;About Button $about_button = guictrlcreatebutton ( "About" , 0, 360 , 60 , 20) ;Team labels, these are in the non-scrolling GUI $t1_label = guictrlcreatelabel ( $team1_name , 10 , 70, 200 , 30) guictrlsetfont( $t1_label , 20) $t2_label = guictrlcreatelabel ( $team2_name , 10 , 110, 200 , 30) guictrlsetfont( $t2_label , 20) $t3_label = guictrlcreatelabel ( $team3_name , 10 , 150, 200 , 30) guictrlsetfont( $t3_label , 20) $t4_label = guictrlcreatelabel ( $team4_name , 10 , 190, 200 , 30) guictrlsetfont( $t4_label , 20) $t5_label = guictrlcreatelabel ( $team5_name , 10 , 230, 200 , 30) guictrlsetfont( $t5_label , 20) $t6_label = guictrlcreatelabel ( $team6_name , 10 , 270, 200 , 30) guictrlsetfont( $t6_label , 20) ;totals, outside of the scrolling GUI as well $t1_total = guictrlcreateinput ( "000" , 700 , 68 , 60 , 40 , $ES_READONLY) $t2_total = guictrlcreateinput ( "000" , 700 , 108 , 60 , 40 , $ES_READONLY ) $t3_total = guictrlcreateinput ( "000" , 700 , 148 , 60 , 40 , $ES_READONLY ) $t4_total = guictrlcreateinput ( "000" , 700 , 188 , 60 , 40 , $ES_READONLY ) $t5_total = guictrlcreateinput ( "000" , 700 , 228 , 60 , 40 , $ES_READONLY ) $t6_total = guictrlcreateinput ( "000" , 700 , 268 , 60 , 40 , $ES_READONLY ) ;this is a hidden button for a pre-existing feature $announce_command = GUICtrlCreateLabel ( "" , 670 , 308 , 100 , 90 , $BS_ICON ) Global $rubicles = GUICreate("rubicles",490, 240, 250, 220, BitOR($WS_HSCROLL, $WS_CHILD));create a GUI inside the main one with a scroll bar ;Team 1 task scores $t1_task1 = guictrlcreateinput ( "00" , 200 , 68 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task1 , 20) $t1_task2 = guictrlcreateinput ( "00" , 250 , 68 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task2 , 20) $t1_task3 = guictrlcreateinput ( "00" , 300 , 68 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task3 , 20) $t1_task4 = guictrlcreateinput ( "00" , 350 , 68 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task4 , 20) $t1_task5 = guictrlcreateinput ( "00" , 400 , 68 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task5 , 20) $t1_task6 = guictrlcreateinput ( "00" , 450 , 68 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task6 , 20) $t1_task7 = guictrlcreateinput ( "00" , 500 , 68 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task7 , 20) $t1_task8 = guictrlcreateinput ( "00" , 550 , 68 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task8 , 20) $t1_task9 = guictrlcreateinput ( "00" , 600 , 68 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task9 , 20) $t1_task10 = guictrlcreateinput ( "00" , 650 , 68 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task10 , 20)It would also go on for team 2 task scores etc. like this. It keeps score for 10 tasks per team right now, i need 20, for which i need the scroll bar in the child GUI to work to keep the main GUI from becoming too wide.The problem is that when i do this, nothing changes. A scroll bar doesn't appear.So my question is, how do i make the scroll bar appear in the child GUI?Thanks in advance. Link to comment Share on other sites More sharing options...
martin Posted October 9, 2010 Share Posted October 9, 2010 There are examples around. Here's one which might help, though there are simpler ones which would be worth searching for. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
scringamble Posted October 10, 2010 Author Share Posted October 10, 2010 There are examples around. Here's one which might help, though there are simpler ones which would be worth searching for.Thanks, but unfortunately i cannot afford to experiment with that as i am on a tight deadline. I will just make it so you press some arrow buttons to switch between the first and the second 10.By the way, if i hide a label input, can i still type in it?Also, can AutoIt read inputs from hidden labels?Thanks in advance. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 10, 2010 Moderators Share Posted October 10, 2010 scringamble,Here is what you want in basic form - over to you to adjust the sizes and add the extra controls. You will need the GUIScrollBars_Ex UDF - look in my sig for it. expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> #include <GUIScrollBars_Ex.au3> $main_gui = GUICreate("Gólyabál Pontozó", 780, 380, 200, 200) GUICtrlCreatePic("stork_bg.jpg", 0, 0, 780, 380, $WS_DISABLED) ;About Button $about_button = GUICtrlCreateButton("About", 0, 360, 60, 20) ;Team labels, these are in the non-scrolling GUI $t1_label = GUICtrlCreateLabel(1, 10, 70, 200, 30) GUICtrlSetFont($t1_label, 20) $t2_label = GUICtrlCreateLabel(2, 10, 110, 200, 30) GUICtrlSetFont($t2_label, 20) $t3_label = GUICtrlCreateLabel(3, 10, 150, 200, 30) GUICtrlSetFont($t3_label, 20) $t4_label = GUICtrlCreateLabel(4, 10, 190, 200, 30) GUICtrlSetFont($t4_label, 20) $t5_label = GUICtrlCreateLabel(5, 10, 230, 200, 30) GUICtrlSetFont($t5_label, 20) $t6_label = GUICtrlCreateLabel(6, 10, 270, 200, 30) GUICtrlSetFont($t6_label, 20) ;totals, outside of the scrolling GUI as well $t1_total = GUICtrlCreateInput("000", 700, 68, 60, 40, $ES_READONLY) $t2_total = GUICtrlCreateInput("000", 700, 108, 60, 40, $ES_READONLY) $t3_total = GUICtrlCreateInput("000", 700, 148, 60, 40, $ES_READONLY) $t4_total = GUICtrlCreateInput("000", 700, 188, 60, 40, $ES_READONLY) $t5_total = GUICtrlCreateInput("000", 700, 228, 60, 40, $ES_READONLY) $t6_total = GUICtrlCreateInput("000", 700, 268, 60, 40, $ES_READONLY) GUISetState() ;this is a hidden button for a pre-existing feature $announce_command = GUICtrlCreateLabel("", 670, 308, 100, 90, $BS_ICON) ; Create the scrollable GUI as a child Global $rubicles = GUICreate("rubicles", 270, 300, 270, 230, $WS_POPUP, $WS_EX_TOOLWINDOW, $main_gui) ; Set child GUI just above main GUI in z-order DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $rubicles, "hwnd", $main_gui, "int", 270, "int", 230, "int", 290, "int", 300, "uint", 0x0010) ; $SWP_NOACTIVATE ;Team 1 task scores $t1_task1 = GUICtrlCreateInput("00", 10, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task1, 20) $t1_task2 = GUICtrlCreateInput("00", 50, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task2, 20) $t1_task3 = GUICtrlCreateInput("00", 100, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task3, 20) $t1_task4 = GUICtrlCreateInput("00", 150, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task4, 20) $t1_task5 = GUICtrlCreateInput("00", 200, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task5, 20) $t1_task6 = GUICtrlCreateInput("00", 250, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task6, 20) $t1_task7 = GUICtrlCreateInput("00", 300, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task7, 20) $t1_task8 = GUICtrlCreateInput("00", 350, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task8, 20) $t1_task9 = GUICtrlCreateInput("00", 400, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task9, 20) $t1_task10 = GUICtrlCreateInput("00", 450, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task10, 20) GUISetState() ;Generate scroll bars in child _GUIScrollbars_Generate($rubicles, 520) ; Look for the main window moving GUIRegisterMsg($WM_MOVE, "_Follow_GUI") While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd ; if the main window moves, move the child Func _Follow_GUI($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam If $hWnd <> $main_gui Then Return Local $aGUI_Main_Pos = WinGetPos($main_gui) ; Use WinGetPos and not $lParam values WinMove($rubicles, "", $aGUI_Main_Pos[0] + 60, $aGUI_Main_Pos[1] + 20) EndFunc ;==>_Follow_GUIPlease come back if you run into problems or do not understand anything. 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...
Imp05s1ble Posted October 10, 2010 Share Posted October 10, 2010 scringamble, Here is what you want in basic form - over to you to adjust the sizes and add the extra controls. You will need the GUIScrollBars_Ex UDF - look in my sig for it. expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> #include <GUIScrollBars_Ex.au3> $main_gui = GUICreate("Gólyabál Pontozó", 780, 380, 200, 200) GUICtrlCreatePic("stork_bg.jpg", 0, 0, 780, 380, $WS_DISABLED) ;About Button $about_button = GUICtrlCreateButton("About", 0, 360, 60, 20) ;Team labels, these are in the non-scrolling GUI $t1_label = GUICtrlCreateLabel(1, 10, 70, 200, 30) GUICtrlSetFont($t1_label, 20) $t2_label = GUICtrlCreateLabel(2, 10, 110, 200, 30) GUICtrlSetFont($t2_label, 20) $t3_label = GUICtrlCreateLabel(3, 10, 150, 200, 30) GUICtrlSetFont($t3_label, 20) $t4_label = GUICtrlCreateLabel(4, 10, 190, 200, 30) GUICtrlSetFont($t4_label, 20) $t5_label = GUICtrlCreateLabel(5, 10, 230, 200, 30) GUICtrlSetFont($t5_label, 20) $t6_label = GUICtrlCreateLabel(6, 10, 270, 200, 30) GUICtrlSetFont($t6_label, 20) ;totals, outside of the scrolling GUI as well $t1_total = GUICtrlCreateInput("000", 700, 68, 60, 40, $ES_READONLY) $t2_total = GUICtrlCreateInput("000", 700, 108, 60, 40, $ES_READONLY) $t3_total = GUICtrlCreateInput("000", 700, 148, 60, 40, $ES_READONLY) $t4_total = GUICtrlCreateInput("000", 700, 188, 60, 40, $ES_READONLY) $t5_total = GUICtrlCreateInput("000", 700, 228, 60, 40, $ES_READONLY) $t6_total = GUICtrlCreateInput("000", 700, 268, 60, 40, $ES_READONLY) GUISetState() ;this is a hidden button for a pre-existing feature $announce_command = GUICtrlCreateLabel("", 670, 308, 100, 90, $BS_ICON) ; Create the scrollable GUI as a child Global $rubicles = GUICreate("rubicles", 270, 300, 270, 230, $WS_POPUP, $WS_EX_TOOLWINDOW, $main_gui) ; Set child GUI just above main GUI in z-order DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $rubicles, "hwnd", $main_gui, "int", 270, "int", 230, "int", 290, "int", 300, "uint", 0x0010) ; $SWP_NOACTIVATE ;Team 1 task scores $t1_task1 = GUICtrlCreateInput("00", 10, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task1, 20) $t1_task2 = GUICtrlCreateInput("00", 50, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task2, 20) $t1_task3 = GUICtrlCreateInput("00", 100, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task3, 20) $t1_task4 = GUICtrlCreateInput("00", 150, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task4, 20) $t1_task5 = GUICtrlCreateInput("00", 200, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task5, 20) $t1_task6 = GUICtrlCreateInput("00", 250, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task6, 20) $t1_task7 = GUICtrlCreateInput("00", 300, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task7, 20) $t1_task8 = GUICtrlCreateInput("00", 350, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task8, 20) $t1_task9 = GUICtrlCreateInput("00", 400, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task9, 20) $t1_task10 = GUICtrlCreateInput("00", 450, 68, 40, 40, $ES_NUMBER) GUICtrlSetFont($t1_task10, 20) GUISetState() ;Generate scroll bars in child _GUIScrollbars_Generate($rubicles, 520) ; Look for the main window moving GUIRegisterMsg($WM_MOVE, "_Follow_GUI") While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd ; if the main window moves, move the child Func _Follow_GUI($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam If $hWnd <> $main_gui Then Return Local $aGUI_Main_Pos = WinGetPos($main_gui) ; Use WinGetPos and not $lParam values WinMove($rubicles, "", $aGUI_Main_Pos[0] + 60, $aGUI_Main_Pos[1] + 20) EndFunc ;==>_Follow_GUI Please come back if you run into problems or do not understand anything. M23 Thanks, that seems to work like a charm in the example you provided. However when i try to implement it into my whole program the labels won't appear. If i post the entire code, can you please take a look at it and tell/show me what i did wrong? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 11, 2010 Moderators Share Posted October 11, 2010 (edited) Imp05s1ble, Of course! M23 Edit: I assume you and scringamble are working on this together? Edited October 11, 2010 by Melba23 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...
scringamble Posted October 11, 2010 Author Share Posted October 11, 2010 Imp05s1ble,Of course! M23Edit: I assume you and scringamble are working on this together? Oh dear, I don't know how that could've happened. You see, I forgot the credentials for my original account so I created this new one, but how I managed to post that on my old account is beyond me since I still don't remember the password. This is really odd indeed. Anyway, I don't have access to the source code now, but I can give it to you later today. I have since started working on a different way to switch between part 1 and 2 because I didn't expect your response, so that might be a problem since I might not have been able to fully revert the code. We'll see when I post the source. Link to comment Share on other sites More sharing options...
scringamble Posted October 11, 2010 Author Share Posted October 11, 2010 Never mind, I got it working. I forgot to set it to show the child GUI. So now it works, I just gotta position it properly. Thanks anyway.I've got a minor problem though: the scrolling child GUI appears properly, however when I move the GUI it snaps a few pixels higher, though it works good afterwise. Any ideas on that?Also, can you please tell me what the values mean in here?DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $rubicles, "hwnd", $main_gui, "int", 270, "int", 230, "int", 290, "int", 300, "uint", 0x0010)I suppose it's width height left right, but I'm not sure.Thanks in advance! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 11, 2010 Moderators Share Posted October 11, 2010 scringamble,You need to ensure you coordinate the values in these 3 lines:; Creating the child GUI Global $rubicles = GUICreate("rubicles", 270, 300, 270, 230, $WS_POPUP, $WS_EX_TOOLWINDOW, $main_gui) ; Using WinMove to position it in the z-order - you have to specify all the parameters and so they need to match the ones above. DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $rubicles, "hwnd", $main_gui, "int", 270, "int", 230, "int", 290, "int", 300, "uint", 0x0010) ; In the _Follow_GUI - the 2 numeric values need to be set to the difference between the initial X/Y coordinates of the parent and child WinMove($rubicles, "", $aGUI_Main_Pos[0] + 60, $aGUI_Main_Pos[1] + 20)As my script was only a proof of concept, I did not check the _FollowGUI values too carefully. Your guess as to the DllCall parameters is correct.Glad you got it running. 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...
scringamble Posted October 11, 2010 Author Share Posted October 11, 2010 scringamble, You need to ensure you coordinate the values in these 3 lines: ; Creating the child GUI Global $rubicles = GUICreate("rubicles", 270, 300, 270, 230, $WS_POPUP, $WS_EX_TOOLWINDOW, $main_gui) ; Using WinMove to position it in the z-order - you have to specify all the parameters and so they need to match the ones above. DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $rubicles, "hwnd", $main_gui, "int", 270, "int", 230, "int", 290, "int", 300, "uint", 0x0010) ; In the _Follow_GUI - the 2 numeric values need to be set to the difference between the initial X/Y coordinates of the parent and child WinMove($rubicles, "", $aGUI_Main_Pos[0] + 60, $aGUI_Main_Pos[1] + 20) As my script was only a proof of concept, I did not check the _FollowGUI values too carefully. Your guess as to the DllCall parameters is correct. Glad you got it running. M23 Thanks, i'm almost done with it thanks to you. Now i just need to design the graphics in Photoshop. There is one problem, though. For Team1, the inputs won't appear for task #10, #15, #17 and #20. I'v checked and they aren't getting hidden, and they are not mispositioned(so they are not hidden behind another input). Here is the entire script, maybe you can find out what's wrong. expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> #include <GUIScrollBars_Ex.au3> $installed = fileinstall ( "stork_bg.jpg" , "stork_bg.jpg" , 0) if $installed Then FileSetAttrib ( "stork_bg.jpg" , "+HT") EndIf $team1_name = FileReadLine ( "csapatok.txt" , 1) if @error Then $team1_name = "1.Csapat" EndIf $team2_name = FileReadLine ( "csapatok.txt" , 2) if @error Then $team2_name = "2.Csapat" EndIf $team3_name = FileReadLine ( "csapatok.txt" , 3) if @error Then $team3_name = "3.Csapat" EndIf $team4_name = FileReadLine ( "csapatok.txt" , 4) if @error Then $team4_name = "4.Csapat" EndIf $team5_name = FileReadLine ( "csapatok.txt" , 5) if @error Then $team5_name = "5.Csapat" EndIf $team6_name = FileReadLine ( "csapatok.txt" , 6) if @error Then $team6_name = "6.Csapat" EndIf $about_gui = guicreate ( "Információ" , 300 , 150 , 200 , 200 , $WS_BORDER) $okbutton = guictrlcreatebutton( "OK" , 30 , 90 , 230 , 30) guictrlcreatelabel ( "Gólyabál Pontozó Rendszer v0.6.3 béta" , 10 , 10) guictrlcreatelabel ( "© Király Miklós 2010 Minden jog fenntartva." , 10 , 30) guictrlcreatelabel ( "KIZÁRÓLAG AZ ALSÓERDŐSORI BÁRDOS LAJOS" , 10 , 50) guictrlcreatelabel ( "ÁLTALÁNOS ISKOLA-ÉS GIMNÁZIUM HASZNÁLATÁRA" , 10 , 70) $main_gui = GUICreate("Gólyabál Pontozó", 780, 380, 200, 200) GUICtrlCreatePic("stork_bg.jpg", 0, 0, 780, 380, $WS_DISABLED) ;About Button $about_button = GUICtrlCreateButton("About", 0, 360, 60, 20) ;Team labels, these are in the non-scrolling GUI $t1_label = GUICtrlCreateLabel($team1_name , 10, 70, 200, 30) GUICtrlSetFont($t1_label, 20) $t2_label = GUICtrlCreateLabel($team2_name, 10, 110, 200, 30) GUICtrlSetFont($t2_label, 20) $t3_label = GUICtrlCreateLabel($team3_name, 10, 150, 200, 30) GUICtrlSetFont($t3_label, 20) $t4_label = GUICtrlCreateLabel($team4_name, 10, 190, 200, 30) GUICtrlSetFont($t4_label, 20) $t5_label = GUICtrlCreateLabel($team5_name, 10, 230, 200, 30) GUICtrlSetFont($t5_label, 20) $t6_label = GUICtrlCreateLabel($team6_name, 10, 270, 200, 30) GUICtrlSetFont($t6_label, 20) ;Winner displays: $winnertext = guictrlcreatelabel ( "Vezető csapat:" , 320 , 325, 200 , 30) $winnerdisplay = guictrlcreatelabel ( "Nincs" , 495 , 325, 200, 30) guictrlsetfont($winnertext , 20) guictrlsetfont($winnerdisplay , 20) ;totals, outside of the scrolling GUI as well $t1_total = GUICtrlCreateInput("000", 710, 68, 60, 40, $ES_READONLY) $t2_total = GUICtrlCreateInput("000", 710, 108, 60, 40, $ES_READONLY) $t3_total = GUICtrlCreateInput("000", 710, 148, 60, 40, $ES_READONLY) $t4_total = GUICtrlCreateInput("000", 710, 188, 60, 40, $ES_READONLY) $t5_total = GUICtrlCreateInput("000", 710, 228, 60, 40, $ES_READONLY) $t6_total = GUICtrlCreateInput("000", 710, 268, 60, 40, $ES_READONLY) ;this is a hidden button for a pre-existing feature $announce_command = GUICtrlCreateLabel("", 670, 308, 100, 90, $BS_ICON) ; Create the scrollable GUI as a child Global $rubicles = GUICreate("rubicles", 493 , 325 , -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW, $main_gui) GUISetBkColor ( $GUI_BKCOLOR_TRANSPARENT , $rubicles) ; Set child GUI just above main GUI in z-order DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $rubicles, "hwnd", $main_gui, "int", 500, "int", 68, "int", 493, "int", 325, "uint", 0x0010) ; $SWP_NOACTIVATE ;Team 1 task scores $t1_task1 = guictrlcreateinput ( "" , 0 , 73 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task1 , 20) $t1_task2 = guictrlcreateinput ( "" , 50 ,73 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task2 , 20) $t1_task3 = guictrlcreateinput ( "" , 100 , 73 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task3 , 20) $t1_task4 = guictrlcreateinput ( "" , 150 , 73 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task4 , 20) $t1_task5 = guictrlcreateinput ( "" , 200 , 73 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task5 , 20) $t1_task6 = guictrlcreateinput ( "" , 250 , 73 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task6 , 20) $t1_task7 = guictrlcreateinput ( "" , 300 , 73 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task7 , 20) $t1_task8 = guictrlcreateinput ( "" , 350 , 73 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task8 , 20) $t1_task9 = guictrlcreateinput ( "" , 400 , 73 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task9 , 20) $t1_task10 = guictrlcreateinput ( "" , 500 , 73 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task10 , 20) ;team 1 scores part 2 $t1_task11 = guictrlcreateinput ( "" , 550 , 73 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task11 , 20) $t1_task12 = guictrlcreateinput ( "" , 600 , 73 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task12 , 20) $t1_task13 = guictrlcreateinput ( "" , 650 , 73, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task13 , 20) $t1_task14 = guictrlcreateinput ( "" , 700 , 73, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task14 , 20) $t1_task15 = guictrlcreateinput ( "" , 800 , 73, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task15 , 20) $t1_task16 = guictrlcreateinput ( "" ,900, 73, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task16 , 20) $t1_task17 = guictrlcreateinput ( "" , 1000 , 73, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task17 , 20) $t1_task18 = guictrlcreateinput ( "" , 1050 , 73, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task18 , 20) $t1_task19 = guictrlcreateinput ( "" , 1100, 73, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task19 , 20) $t1_task20 = guictrlcreateinput ( "" , 1150, 73 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t1_task20 , 20) ;Team 2 task scores $t2_task1 = guictrlcreateinput ( "" , 0 , 116 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task1 , 20) $t2_task2 = guictrlcreateinput ( "" , 50 , 116 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task2 , 20) $t2_task3 = guictrlcreateinput ( "" , 100 , 116 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task3 , 20) $t2_task4 = guictrlcreateinput ( "" , 150 , 116 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task4 , 20) $t2_task5 = guictrlcreateinput ( "" , 200 , 116, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task5 , 20) $t2_task6 = guictrlcreateinput ( "" , 250 , 116, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task6 , 20) $t2_task7 = guictrlcreateinput ( "" , 300 , 116, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task7 , 20) $t2_task8 = guictrlcreateinput ( "" , 350 , 116, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task8 , 20) $t2_task9 = guictrlcreateinput ( "" , 400 , 116, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task9 , 20) $t2_task10 = guictrlcreateinput ( "" , 450 , 116 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task10 , 20) ;team 2 scores part 2 $t2_task11 = guictrlcreateinput ( "" , 500 , 116 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task11 , 20) $t2_task12 = guictrlcreateinput ( "" , 550 , 116, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task12 , 20) $t2_task13 = guictrlcreateinput ( "" , 600 , 116 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task13 , 20) $t2_task14 = guictrlcreateinput ( "" , 650 , 116 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task14 , 20) $t2_task15 = guictrlcreateinput ( "" , 700 , 116 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task15 , 20) $t2_task16 = guictrlcreateinput ( "" ,750, 116, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task16 , 20) $t2_task17 = guictrlcreateinput ( "" , 800 , 116, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task17 , 20) $t2_task18 = guictrlcreateinput ( "" , 850, 116, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task18 , 20) $t2_task19 = guictrlcreateinput ( "" , 900, 116, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task19 , 20) $t2_task20 = guictrlcreateinput ( "" , 950 , 116 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t2_task20 , 20) ;Team 3 task scores $t3_task1 = guictrlcreateinput ( "" , 0 , 158 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task1 , 20) $t3_task2 = guictrlcreateinput ( "" , 50 , 158 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task2 , 20) $t3_task3 = guictrlcreateinput ( "" , 100 , 158 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task3 , 20) $t3_task4 = guictrlcreateinput ( "" , 150 , 158 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task4 , 20) $t3_task5 = guictrlcreateinput ( "" , 200 , 158 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task5 , 20) $t3_task6 = guictrlcreateinput ( "" , 250 , 158, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task6 , 20) $t3_task7 = guictrlcreateinput ( "" , 300 , 158, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task7 , 20) $t3_task8 = guictrlcreateinput ( "" , 350 , 158, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task8 , 20) $t3_task9 = guictrlcreateinput ( "" , 400 , 158, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task9 , 20) $t3_task10 = guictrlcreateinput ( "" , 450 , 158 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task10 , 20) ;team 3 scores part 2 $t3_task11 = guictrlcreateinput ( "" , 500 , 158 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task11 , 20) $t3_task12 = guictrlcreateinput ( "" , 550 , 158 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task12 , 20) $t3_task13 = guictrlcreateinput ( "" , 600 , 158 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task13 , 20) $t3_task14 = guictrlcreateinput ( "" , 650 , 158 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task14 , 20) $t3_task15 = guictrlcreateinput ( "" , 700 , 158 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task15 , 20) $t3_task16 = guictrlcreateinput ( "" ,750, 158, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task16 , 20) $t3_task17 = guictrlcreateinput ( "" , 800 , 158, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task17 , 20) $t3_task18 = guictrlcreateinput ( "" , 850, 158, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task18 , 20) $t3_task19 = guictrlcreateinput ( "" , 900, 158, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task19 , 20) $t3_task20 = guictrlcreateinput ( "" , 950 , 158 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t3_task20 , 20) ;Team 4 task scores $t4_task1 = guictrlcreateinput ( "" , 0 , 201 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task1 , 20) $t4_task2 = guictrlcreateinput ( "" , 50 , 201, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task2 , 20) $t4_task3 = guictrlcreateinput ( "" , 100 , 201, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task3 , 20) $t4_task4 = guictrlcreateinput ( "" , 150 , 201, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task4 , 20) $t4_task5 = guictrlcreateinput ( "" , 200 , 201, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task5 , 20) $t4_task6 = guictrlcreateinput ( "" , 250 , 201, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task6 , 20) $t4_task7 = guictrlcreateinput ( "" , 300 , 201, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task7 , 20) $t4_task8 = guictrlcreateinput ( "" , 350 , 201, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task8 , 20) $t4_task9 = guictrlcreateinput ( "" , 400 , 201, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task9 , 20) $t4_task10 = guictrlcreateinput ( "" , 450 , 201 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task10 , 20) ;team 4 scores part 2 $t4_task11 = guictrlcreateinput ( "" , 500 , 201 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task11 , 20) $t4_task12 = guictrlcreateinput ( "" , 550 , 201 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task12 , 20) $t4_task13 = guictrlcreateinput ( "" , 600 , 201 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task13 , 20) $t4_task14 = guictrlcreateinput ( "" , 650 , 201 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task14 , 20) $t4_task15 = guictrlcreateinput ( "" , 700 , 201 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task15 , 20) $t4_task16 = guictrlcreateinput ( "" ,750, 201 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task16 , 20) $t4_task17 = guictrlcreateinput ( "" , 800 , 201, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task17 , 20) $t4_task18 = guictrlcreateinput ( "" , 850, 201, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task18 , 20) $t4_task19 = guictrlcreateinput ( "" , 900, 201, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task19 , 20) $t4_task20 = guictrlcreateinput ( "" , 950 , 201 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t4_task20 , 20) ;Team 5 task scores $t5_task1 = guictrlcreateinput ( "" , 0 , 243 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task1 , 20) $t5_task2 = guictrlcreateinput ( "" , 50 , 243, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task2 , 20) $t5_task3 = guictrlcreateinput ( "" , 100 , 243, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task3 , 20) $t5_task4 = guictrlcreateinput ( "" , 150 , 243, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task4 , 20) $t5_task5 = guictrlcreateinput ( "" , 200 , 243, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task5 , 20) $t5_task6 = guictrlcreateinput ( "" , 250 , 243, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task6 , 20) $t5_task7 = guictrlcreateinput ( "" , 300 , 243, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task7 , 20) $t5_task8 = guictrlcreateinput ( "" , 350 , 243, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task8 , 20) $t5_task9 = guictrlcreateinput ( "" , 400 , 243, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task9 , 20) $t5_task10 = guictrlcreateinput ( "" , 450 , 243 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task10 , 20) ;team 5 scores part 2 $t5_task11 = guictrlcreateinput ( "" , 500 , 243 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task11 , 20) $t5_task12 = guictrlcreateinput ( "" , 550 , 243 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task12 , 20) $t5_task13 = guictrlcreateinput ( "" , 600 , 243 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task13 , 20) $t5_task14 = guictrlcreateinput ( "" , 650 , 243 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task14 , 20) $t5_task15 = guictrlcreateinput ( "" , 700 , 243 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task15 , 20) $t5_task16 = guictrlcreateinput ( "" ,750, 243, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task16 , 20) $t5_task17 = guictrlcreateinput ( "" , 800 , 243, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task17 , 20) $t5_task18 = guictrlcreateinput ( "" , 850, 243, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task18 , 20) $t5_task19 = guictrlcreateinput ( "" , 900, 243, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task19 , 20) $t5_task20 = guictrlcreateinput ( "" , 950 , 243 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t5_task20 , 20) ;Team 6 task scores $t6_task1 = guictrlcreateinput ( "" , 0 , 287 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task1 , 20) $t6_task2 = guictrlcreateinput ( "" , 50 , 287, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task2 , 20) $t6_task3 = guictrlcreateinput ( "" , 100 , 287, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task3 , 20) $t6_task4 = guictrlcreateinput ( "" , 150 , 287, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task4 , 20) $t6_task5 = guictrlcreateinput ( "" , 200 , 287, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task5 , 20) $t6_task6 = guictrlcreateinput ( "" , 250 , 287, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task6 , 20) $t6_task7 = guictrlcreateinput ( "" , 300 , 287, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task7 , 20) $t6_task8 = guictrlcreateinput ( "" , 350 , 287, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task8 , 20) $t6_task9 = guictrlcreateinput ( "" , 400 , 287, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task9 , 20) $t6_task10 = guictrlcreateinput ( "" , 450 , 287 , 40 , 40 , $ES_NUMBER) ;team 6 scores part 2 $t6_task11 = guictrlcreateinput ( "" , 500 , 287 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task11 , 20) $t6_task12 = guictrlcreateinput ( "" , 550 , 287 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task12 , 20) $t6_task13 = guictrlcreateinput ( "" , 600 , 287 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task13 , 20) $t6_task14 = guictrlcreateinput ( "" , 650 , 287 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task14 , 20) $t6_task15 = guictrlcreateinput ( "" , 700 , 287 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task15 , 20) $t6_task16 = guictrlcreateinput ( "" ,750, 287, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task16 , 20) $t6_task17 = guictrlcreateinput ( "" , 800 , 287, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task17 , 20) $t6_task18 = guictrlcreateinput ( "" , 850, 287, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task18 , 20) $t6_task19 = guictrlcreateinput ( "" , 900, 287, 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task19 , 20) $t6_task20 = guictrlcreateinput ( "" , 950 , 287 , 40 , 40 , $ES_NUMBER) guictrlsetfont( $t6_task20 , 20) ;set other fonts guictrlsetfont( $t6_task10 , 20) guictrlsetfont( $t1_total , 20) guictrlsetfont( $t2_total , 20) guictrlsetfont( $t3_total , 20) guictrlsetfont( $t4_total , 20) guictrlsetfont( $t5_total , 20) guictrlsetfont( $t6_total , 20) ;Set limits ;team 1 limits GUICtrlSetLimit( $t1_task1 , 2) GUICtrlSetLimit( $t1_task2 , 2) GUICtrlSetLimit( $t1_task3 , 2) GUICtrlSetLimit( $t1_task4 , 2) GUICtrlSetLimit( $t1_task5 , 2) GUICtrlSetLimit( $t1_task6 , 2) GUICtrlSetLimit( $t1_task7 , 2) GUICtrlSetLimit( $t1_task8 , 2) GUICtrlSetLimit( $t1_task9 , 2) GUICtrlSetLimit( $t1_task10 , 2) ;team 2 limits GUICtrlSetLimit( $t2_task1 , 2) GUICtrlSetLimit( $t2_task2 , 2) GUICtrlSetLimit( $t2_task3 , 2) GUICtrlSetLimit( $t2_task4 , 2) GUICtrlSetLimit( $t2_task5 , 2) GUICtrlSetLimit( $t2_task6 , 2) GUICtrlSetLimit( $t2_task7 , 2) GUICtrlSetLimit( $t2_task8 , 2) GUICtrlSetLimit( $t2_task9 , 2) GUICtrlSetLimit( $t2_task10 , 2) ;team 3 limits GUICtrlSetLimit( $t3_task1 , 2) GUICtrlSetLimit( $t3_task2 , 2) GUICtrlSetLimit( $t3_task3 , 2) GUICtrlSetLimit( $t3_task4 , 2) GUICtrlSetLimit( $t3_task5 , 2) GUICtrlSetLimit( $t3_task6 , 2) GUICtrlSetLimit( $t3_task7 , 2) GUICtrlSetLimit( $t3_task8 , 2) GUICtrlSetLimit( $t3_task9 , 2) GUICtrlSetLimit( $t3_task10 , 2) ;team 4 limits GUICtrlSetLimit( $t4_task1 , 2) GUICtrlSetLimit( $t4_task2 , 2) GUICtrlSetLimit( $t4_task3 , 2) GUICtrlSetLimit( $t4_task4 , 2) GUICtrlSetLimit( $t4_task5 , 2) GUICtrlSetLimit( $t4_task6 , 2) GUICtrlSetLimit( $t4_task7 , 2) GUICtrlSetLimit( $t4_task8 , 2) GUICtrlSetLimit( $t4_task9 , 2) GUICtrlSetLimit( $t4_task10 , 2) ;team 5 limits GUICtrlSetLimit( $t5_task1 , 2) GUICtrlSetLimit( $t5_task2 , 2) GUICtrlSetLimit( $t5_task3 , 2) GUICtrlSetLimit( $t5_task4 , 2) GUICtrlSetLimit( $t5_task5 , 2) GUICtrlSetLimit( $t5_task6 , 2) GUICtrlSetLimit( $t5_task7 , 2) GUICtrlSetLimit( $t5_task8 , 2) GUICtrlSetLimit( $t5_task9 , 2) GUICtrlSetLimit( $t5_task10 , 2) ;team 6 limits GUICtrlSetLimit( $t6_task1 , 2) GUICtrlSetLimit( $t6_task2 , 2) GUICtrlSetLimit( $t6_task3 , 2) GUICtrlSetLimit( $t6_task4 , 2) GUICtrlSetLimit( $t6_task5 , 2) GUICtrlSetLimit( $t6_task6 , 2) GUICtrlSetLimit( $t6_task7 , 2) GUICtrlSetLimit( $t6_task8 , 2) GUICtrlSetLimit( $t6_task9 , 2) GUICtrlSetLimit( $t6_task10 , 2) ;total limits GUICtrlSetLimit ( $t1_total , 3) GUICtrlSetLimit ( $t2_total , 3) GUICtrlSetLimit ( $t3_total , 3) GUICtrlSetLimit ( $t4_total , 3) GUICtrlSetLimit ( $t5_total , 3) GUICtrlSetLimit ( $t6_total , 3) ;Set transparent GUICtrlSetBkColor( $winnertext , $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor( $winnerdisplay , $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor( $t1_label , $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor( $t2_label , $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor( $t3_label , $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor( $t4_label , $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor( $t5_label , $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor( $t6_label , $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor( $announce_command , $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor( $about_button , $GUI_BKCOLOR_TRANSPARENT) ;GuiSetState ( @SW_SHOW , $part1_gui) ;GUISetState ( $GUI_ONTOP , $part1_gui) ; ( $button_part1 , $GUI_DISABLE) ;Generate scroll bars in child _GUIScrollbars_Generate($rubicles, 985) ; Look for the main window moving GUIRegisterMsg($WM_MOVE, "_Follow_GUI") ; if the main window moves, move the child Func _Follow_GUI($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam If $hWnd <> $main_gui Then Return Local $aGUI_Main_Pos = WinGetPos($main_gui) ; Use WinGetPos and not $lParam values WinMove($rubicles, "", $aGUI_Main_Pos[0] + 200, $aGUI_Main_Pos[1] + 25) EndFunc ;==>_Follow_GUI winmove ($main_gui , "" , 500 , 500 ) while 1 ;calculate totals guisetstate( @SW_SHOW , $main_gui) guisetstate( @SW_SHOW , $rubicles) $msg = guigetmsg() Select ;case $msg = $button_part2 ;GUISetState ( @SW_HIDE , $part1_gui) ;GUISetState ( @SW_LOCK , $part1_gui) ;GUISetState ( @SW_SHOW , $part2_gui) ;GUISetState ( @SW_UNLOCK , $part2_gui) ;GUISetState ( @SW_ENABLE , $part2_gui) ;GUISetState ( $GUI_ONTOP , $part2_gui) ;GUICtrlSetState ( $t1_task1 , $GUI_HIDE) ;GUICtrlSetState ( $t1_task11 , $GUI_SHOW) ;GUICtrlSetState ( $button_part2 , $GUI_DISABLE) ;GUICtrlSetState ( $button_part1 , $GUI_ENABLE) ;case $msg = $button_part1 ;GUISetState ( @SW_HIDE , $part2_gui) ;GUISetState ( @SW_LOCK , $part2_gui) ;GUISetState ( @SW_SHOW , $part1_gui) ;GUISetState ( @SW_UNLOCK , $part1_gui) ;GUISetState ( @SW_ENABLE , $part1_gui) ;GUISetState ( $GUI_ONTOP , $part1_gui) ;GUICtrlSetState ( $t1_task11 , $GUI_HIDE) ;GUICtrlSetState ( $t1_task1 , $GUI_SHOW) ;GUICtrlSetState ( $button_part1 , $GUI_DISABLE) ;GUICtrlSetState ( $button_part2 , $GUI_ENABLE) case $msg = $about_button guisetstate ( @SW_SHOW , $about_gui) case $msg = $okbutton guisetstate ( @SW_HIDE , $about_gui) case $msg = $announce_command msgbox ( 48, "Megvan a győztes!" , "A győztes csapat:"&guictrlread($winnerdisplay)) case $msg = $GUI_EVENT_PRIMARYDOWN ;team 1 totals $t1_score1 = GUICtrlRead( $t1_task1) $t1_score2 = GUICtrlRead( $t1_task2) $t1_score3 = GUICtrlRead( $t1_task3) $t1_score4 = GUICtrlRead( $t1_task4) $t1_score5 = GUICtrlRead( $t1_task5) $t1_score6 = GUICtrlRead( $t1_task6) $t1_score7 = GUICtrlRead( $t1_task7) $t1_score8 = GUICtrlRead( $t1_task8) $t1_score9 = GUICtrlRead( $t1_task9) $t1_score10 = GUICtrlRead( $t1_task10) $t1_score11 = GUICtrlRead( $t1_task11) $t1_score12 = GUICtrlRead( $t1_task12) $t1_score13 = GUICtrlRead( $t1_task13) $t1_score14 = GUICtrlRead( $t1_task14) $t1_score15 = GUICtrlRead( $t1_task15) $t1_score16 = GUICtrlRead( $t1_task16) $t1_score17 = GUICtrlRead( $t1_task17) $t1_score18 = GUICtrlRead( $t1_task18) $t1_score19 = GUICtrlRead( $t1_task19) $t1_score20 = GUICtrlRead( $t1_task20) $t1_totalnum = $t1_score1+$t1_score2+$t1_score3+$t1_score4+$t1_score5+$t1_score6+$t1_score7+$t1_score8+$t1_score9+$t1_score10+$t1_score11+$t1_score12+$t1_score13+$t1_score14+$t1_score15+$t1_score16+$t1_score17+$t1_score18+$t1_score19+$t1_score20 ;team 2 totals $t2_score1 = GUICtrlRead( $t2_task1) $t2_score2 = GUICtrlRead( $t2_task2) $t2_score3 = GUICtrlRead( $t2_task3) $t2_score4 = GUICtrlRead( $t2_task4) $t2_score5 = GUICtrlRead( $t2_task5) $t2_score6 = GUICtrlRead( $t2_task6) $t2_score7 = GUICtrlRead( $t2_task7) $t2_score8 = GUICtrlRead( $t2_task8) $t2_score9 = GUICtrlRead( $t2_task9) $t2_score10 = GUICtrlRead( $t2_task10) $t2_score11 = GUICtrlRead( $t2_task11) $t2_score12 = GUICtrlRead( $t2_task12) $t2_score13 = GUICtrlRead( $t2_task13) $t2_score14 = GUICtrlRead( $t2_task14) $t2_score15 = GUICtrlRead( $t2_task15) $t2_score16 = GUICtrlRead( $t2_task16) $t2_score17 = GUICtrlRead( $t2_task17) $t2_score18 = GUICtrlRead( $t2_task18) $t2_score19 = GUICtrlRead( $t2_task19) $t2_score20 = GUICtrlRead( $t2_task20) $t2_totalnum = $t2_score1+$t2_score2+$t2_score3+$t2_score4+$t2_score5+$t2_score6+$t2_score7+$t2_score8+$t2_score9+$t2_score10+$t2_score11+$t2_score12+$t2_score13+$t2_score14+$t2_score15+$t2_score16+$t2_score17+$t2_score18+$t2_score19+$t2_score20 ;team 3 totals $t3_score1 = GUICtrlRead( $t3_task1) $t3_score2 = GUICtrlRead( $t3_task2) $t3_score3 = GUICtrlRead( $t3_task3) $t3_score4 = GUICtrlRead( $t3_task4) $t3_score5 = GUICtrlRead( $t3_task5) $t3_score6 = GUICtrlRead( $t3_task6) $t3_score7 = GUICtrlRead( $t3_task7) $t3_score8 = GUICtrlRead( $t3_task8) $t3_score9 = GUICtrlRead( $t3_task9) $t3_score10 = GUICtrlRead( $t3_task10) $t3_score11 = GUICtrlRead( $t3_task11) $t3_score12 = GUICtrlRead( $t3_task12) $t3_score13 = GUICtrlRead( $t3_task13) $t3_score14 = GUICtrlRead( $t3_task14) $t3_score15 = GUICtrlRead( $t3_task15) $t3_score16 = GUICtrlRead( $t3_task16) $t3_score17 = GUICtrlRead( $t3_task17) $t3_score18 = GUICtrlRead( $t3_task18) $t3_score19 = GUICtrlRead( $t3_task19) $t3_score20 = GUICtrlRead( $t3_task20) $t3_totalnum = $t3_score1+$t3_score2+$t3_score3+$t3_score4+$t3_score5+$t3_score6+$t3_score7+$t3_score8+$t3_score9+$t3_score10+$t3_score11+$t3_score12+$t3_score13+$t3_score14+$t3_score15+$t3_score16+$t3_score17+$t3_score18+$t3_score19+$t3_score20 ;team 4 totals $t4_score1 = GUICtrlRead( $t4_task1) $t4_score2 = GUICtrlRead( $t4_task2) $t4_score3 = GUICtrlRead( $t4_task3) $t4_score4 = GUICtrlRead( $t4_task4) $t4_score5 = GUICtrlRead( $t4_task5) $t4_score6 = GUICtrlRead( $t4_task6) $t4_score7 = GUICtrlRead( $t4_task7) $t4_score8 = GUICtrlRead( $t4_task8) $t4_score9 = GUICtrlRead( $t4_task9) $t4_score10 = GUICtrlRead( $t4_task10) $t4_score11 = GUICtrlRead( $t4_task11) $t4_score12 = GUICtrlRead( $t4_task12) $t4_score13 = GUICtrlRead( $t4_task13) $t4_score14 = GUICtrlRead( $t4_task14) $t4_score15 = GUICtrlRead( $t4_task15) $t4_score16 = GUICtrlRead( $t4_task16) $t4_score17 = GUICtrlRead( $t4_task17) $t4_score18 = GUICtrlRead( $t4_task18) $t4_score19 = GUICtrlRead( $t4_task19) $t4_score20 = GUICtrlRead( $t4_task20) $t4_totalnum = $t4_score1+$t4_score2+$t4_score3+$t4_score4+$t4_score5+$t4_score6+$t4_score7+$t4_score8+$t4_score9+$t4_score10+$t4_score11+$t4_score12+$t4_score13+$t4_score14+$t4_score15+$t4_score16+$t4_score17+$t4_score18+$t4_score19+$t4_score20 ;team 5 totals $t5_score1 = GUICtrlRead( $t5_task1) $t5_score2 = GUICtrlRead( $t5_task2) $t5_score3 = GUICtrlRead( $t5_task3) $t5_score4 = GUICtrlRead( $t5_task4) $t5_score5 = GUICtrlRead( $t5_task5) $t5_score6 = GUICtrlRead( $t5_task6) $t5_score7 = GUICtrlRead( $t5_task7) $t5_score8 = GUICtrlRead( $t5_task8) $t5_score9 = GUICtrlRead( $t5_task9) $t5_score10 = GUICtrlRead( $t5_task10) $t5_score11 = GUICtrlRead( $t5_task11) $t5_score12 = GUICtrlRead( $t5_task12) $t5_score13 = GUICtrlRead( $t5_task13) $t5_score14 = GUICtrlRead( $t5_task14) $t5_score15 = GUICtrlRead( $t5_task15) $t5_score16 = GUICtrlRead( $t5_task16) $t5_score17 = GUICtrlRead( $t5_task17) $t5_score18 = GUICtrlRead( $t5_task18) $t5_score19 = GUICtrlRead( $t5_task19) $t5_score20 = GUICtrlRead( $t5_task20) $t5_totalnum = $t5_score1+$t5_score2+$t5_score3+$t5_score4+$t5_score5+$t5_score6+$t5_score7+$t5_score8+$t5_score9+$t5_score10+$t5_score11+$t5_score12+$t5_score13+$t5_score14+$t5_score15+$t5_score16+$t5_score17+$t5_score18+$t5_score19+$t5_score20 ;team 6 totals $t6_score1 = GUICtrlRead( $t6_task1) $t6_score2 = GUICtrlRead( $t6_task2) $t6_score3 = GUICtrlRead( $t6_task3) $t6_score4 = GUICtrlRead( $t6_task4) $t6_score5 = GUICtrlRead( $t6_task5) $t6_score6 = GUICtrlRead( $t6_task6) $t6_score7 = GUICtrlRead( $t6_task7) $t6_score8 = GUICtrlRead( $t6_task8) $t6_score9 = GUICtrlRead( $t6_task9) $t6_score10 = GUICtrlRead( $t6_task10) $t6_score11 = GUICtrlRead( $t6_task11) $t6_score12 = GUICtrlRead( $t6_task12) $t6_score13 = GUICtrlRead( $t6_task13) $t6_score14 = GUICtrlRead( $t6_task14) $t6_score15 = GUICtrlRead( $t6_task15) $t6_score16 = GUICtrlRead( $t6_task16) $t6_score17 = GUICtrlRead( $t6_task17) $t6_score18 = GUICtrlRead( $t6_task18) $t6_score19 = GUICtrlRead( $t6_task19) $t6_score20 = GUICtrlRead( $t6_task20) $t6_totalnum = $t6_score1+$t6_score2+$t6_score3+$t6_score4+$t6_score5+$t6_score6+$t6_score7+$t6_score8+$t6_score9+$t6_score10+$t6_score11+$t6_score12+$t6_score13+$t6_score14+$t6_score15+$t6_score16+$t6_score17+$t6_score18+$t6_score19+$t6_score20 ;display total GUICtrlSetData ( $t1_total , $t1_totalnum) GUICtrlSetData ( $t2_total , $t2_totalnum) GUICtrlSetData ( $t3_total , $t3_totalnum) GUICtrlSetData ( $t4_total , $t4_totalnum) GUICtrlSetData ( $t5_total , $t5_totalnum) GUICtrlSetData ( $t6_total , $t6_totalnum) ;determine leading team if $t1_totalnum > $t2_totalnum and $t1_totalnum > $t3_totalnum and $t1_totalnum > $t4_totalnum and $t1_totalnum > $t5_totalnum and $t1_totalnum > $t6_totalnum Then ;if team 1 is leading GUICtrlSetData ($winnerdisplay , $team1_name) EndIf if $t2_totalnum > $t1_totalnum and $t2_totalnum > $t3_totalnum and $t2_totalnum > $t4_totalnum and $t2_totalnum > $t5_totalnum and $t2_totalnum > $t6_totalnum Then ;if team 2 is leading GUICtrlSetData ($winnerdisplay , $team2_name) EndIf if $t3_totalnum > $t2_totalnum and $t3_totalnum > $t1_totalnum and $t3_totalnum > $t4_totalnum and $t3_totalnum > $t5_totalnum and $t3_totalnum > $t6_totalnum Then ;if team 3 is leading GUICtrlSetData ($winnerdisplay , $team3_name) EndIf if $t4_totalnum > $t2_totalnum and $t4_totalnum > $t3_totalnum and $t4_totalnum > $t1_totalnum and $t4_totalnum > $t5_totalnum and $t4_totalnum > $t6_totalnum Then ;if team 4 is leading GUICtrlSetData ($winnerdisplay , $team4_name) EndIf if $t5_totalnum > $t2_totalnum and $t5_totalnum > $t3_totalnum and $t5_totalnum > $t1_totalnum and $t5_totalnum > $t4_totalnum and $t5_totalnum > $t6_totalnum Then ;if team 5 is leading GUICtrlSetData ($winnerdisplay , $team5_name) EndIf if $t6_totalnum > $t2_totalnum and $t6_totalnum > $t3_totalnum and $t6_totalnum > $t1_totalnum and $t6_totalnum > $t5_totalnum and $t6_totalnum > $t4_totalnum Then ;if team 6 is leading GUICtrlSetData ($winnerdisplay , $team6_name) EndIf case $msg = $GUI_EVENT_CLOSE if $installed and @Compiled Then filedelete ( "stork_bg.jpg") EndIf Exit endselect sleep (10) WEnd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 11, 2010 Moderators Share Posted October 11, 2010 scringamble, You need to learn about arrays and loops! This is a rather shorter version of your script which seems to work as you wish: expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> #include <GUIScrollBars_Ex.au3> #include <Array.au3> Global $aTasks_Totals[7][21] ; An array to hold the ControlIDs of the input Global $aTeamNames[7] ; An array to hold the team names Global $aHighest[7] ; Array to hold the team scores $installed = FileInstall("stork_bg.jpg", "stork_bg.jpg", 0) If $installed Then FileSetAttrib("stork_bg.jpg", "+HT") EndIf ; Set team names $aTeamNames[1] = FileReadLine("csapatok.txt", 1) If @error Then $aTeamNames[1] = "1.Csapat" $aTeamNames[2] = FileReadLine("csapatok.txt", 2) If @error Then $aTeamNames[2] = "2.Csapat" $aTeamNames[3] = FileReadLine("csapatok.txt", 3) If @error Then $aTeamNames[3] = "3.Csapat" $aTeamNames[4] = FileReadLine("csapatok.txt", 4) If @error Then $aTeamNames[4] = "4.Csapat" $aTeamNames[5] = FileReadLine("csapatok.txt", 5) If @error Then $aTeamNames[5] = "5.Csapat" $aTeamNames[6] = FileReadLine("csapatok.txt", 6) If @error Then $aTeamNames[6] = "6.Csapat" $about_gui = GUICreate("Információ", 300, 150, 200, 200, $WS_BORDER) $okbutton = GUICtrlCreateButton("OK", 30, 90, 230, 30) GUICtrlCreateLabel("Gólyabál Pontozó Rendszer v0.6.3 béta", 10, 10) GUICtrlCreateLabel("© Király Miklós 2010 Minden jog fenntartva.", 10, 30) GUICtrlCreateLabel("KIZÁRÓLAG AZ ALSÓERDOSORI BÁRDOS LAJOS", 10, 50) GUICtrlCreateLabel("ÁLTALÁNOS ISKOLA-ÉS GIMNÁZIUM HASZNÁLATÁRA", 10, 70) $main_gui = GUICreate("Gólyabál Pontozó", 780, 380, 200, 200) GUICtrlCreatePic("stork_bg.jpg", 0, 0, 780, 380, $WS_DISABLED) ;About Button $about_button = GUICtrlCreateButton("About", 0, 360, 60, 20) ;Team labels, these are in the non-scrolling GUI For $i = 1 To 6 GUICtrlCreateLabel($aTeamNames[1], 10, ($i * 40) + 30, 200, 30) GUICtrlSetFont(-1, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) Next ;Winner displays: $winnertext = GUICtrlCreateLabel("Vezeto csapat:", 320, 325, 200, 30) $winnerdisplay = GUICtrlCreateLabel("Nincs", 495, 325, 200, 30) GUICtrlSetFont($winnertext, 20) GUICtrlSetFont($winnerdisplay, 20) ;totals, outside of the scrolling GUI as well For $i = 1 To 6 $aTasks_Totals[$i][0] = GUICtrlCreateInput("000", 710, ($i * 40) + 28, 60, 40, $ES_READONLY) GUICtrlSetFont(-1, 20) GUICtrlSetLimit(-1, 3) Next ;this is a hidden button for a pre-existing feature $announce_command = GUICtrlCreateLabel("", 670, 308, 100, 90, $BS_ICON) GUISetState(@SW_SHOW, $main_gui) ; Create the scrollable GUI as a child Global $rubicles = GUICreate("rubicles", 493, 325, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW, $main_gui) GUISetBkColor($GUI_BKCOLOR_TRANSPARENT, $rubicles) ; Set child GUI just above main GUI in z-order DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $rubicles, "hwnd", $main_gui, "int", 500, "int", 68, "int", 493, "int", 325, "uint", 0x0010) ; $SWP_NOACTIVATE ; Create task inputs For $j = 1 To 6 For $i = 1 To 20 $aTasks_Totals[$j][$i] = GUICtrlCreateInput("", ($i * 50) - 50, ($j * 42) + 30, 40, 40, $ES_NUMBER) GUICtrlSetFont(-1, 20) GUICtrlSetLimit(-1, 2) Next Next ;Set transparent GUICtrlSetBkColor($winnertext, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor($winnerdisplay, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor($announce_command, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor($about_button, $GUI_BKCOLOR_TRANSPARENT) GUISetState(@SW_SHOW, $rubicles) ;Generate scroll bars in child _GUIScrollbars_Generate($rubicles, 985) ; Look for the main window moving GUIRegisterMsg($WM_MOVE, "_Follow_GUI") WinMove($main_gui, "", 500, 500) While 1 ;calculate totals Switch GUIGetMsg() ;case $button_part2 ;GUISetState ( @SW_HIDE , $part1_gui) ;GUISetState ( @SW_LOCK , $part1_gui) ;GUISetState ( @SW_SHOW , $part2_gui) ;GUISetState ( @SW_UNLOCK , $part2_gui) ;GUISetState ( @SW_ENABLE , $part2_gui) ;GUISetState ( $GUI_ONTOP , $part2_gui) ;GUICtrlSetState ( $t1_task1 , $GUI_HIDE) ;GUICtrlSetState ( $t1_task11 , $GUI_SHOW) ;GUICtrlSetState ( $button_part2 , $GUI_DISABLE) ;GUICtrlSetState ( $button_part1 , $GUI_ENABLE) ;case $msg = $button_part1 ;GUISetState ( @SW_HIDE , $part2_gui) ;GUISetState ( @SW_LOCK , $part2_gui) ;GUISetState ( @SW_SHOW , $part1_gui) ;GUISetState ( @SW_UNLOCK , $part1_gui) ;GUISetState ( @SW_ENABLE , $part1_gui) ;GUISetState ( $GUI_ONTOP , $part1_gui) ;GUICtrlSetState ( $t1_task11 , $GUI_HIDE) ;GUICtrlSetState ( $t1_task1 , $GUI_SHOW) ;GUICtrlSetState ( $button_part1 , $GUI_DISABLE) ;GUICtrlSetState ( $button_part2 , $GUI_ENABLE) Case $about_button GUISetState(@SW_SHOW, $about_gui) Case $okbutton GUISetState(@SW_HIDE, $about_gui) Case $announce_command MsgBox(48, "Megvan a gyoztes!", "A gyoztes csapat:" & GUICtrlRead($winnerdisplay)) Case $GUI_EVENT_PRIMARYDOWN ; Total the inputs and add them to the total boxes For $j = 1 To 6 Global $t_score = 0 For $i = 1 To 20 $t_score += GUICtrlRead($aTasks_Totals[$j][$i]) GUICtrlSetData($aTasks_Totals[$j][0], $t_score) Next Next ;determine leading team ; Copy the totlas to the 1D array For $i = 1 To 6 $aHighest[$i] = GUICtrlRead($aTasks_Totals[$i][0]) Next $iIndex = _ArrayMaxIndex($aHighest, 1) ; Find tegh highest score (only works on 1D arrays) GUICtrlSetData($winnerdisplay, $aTeamNames[$iIndex]) Case $GUI_EVENT_CLOSE If $installed And @Compiled Then FileDelete("stork_bg.jpg") Exit EndSwitch WEnd ; if the main window moves, move the child Func _Follow_GUI($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam If $hWnd <> $main_gui Then Return Local $aGUI_Main_Pos = WinGetPos($main_gui) ; Use WinGetPos and not $lParam values WinMove($rubicles, "", $aGUI_Main_Pos[0] + 200, $aGUI_Main_Pos[1] + 25) EndFunc ;==>_Follow_GUI Please ask if 1) you do not understand what I have done or 2) it does not do what you want. 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...
scringamble Posted October 11, 2010 Author Share Posted October 11, 2010 scringamble, You need to learn about arrays and loops! This is a rather shorter version of your script which seems to work as you wish: expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> #include <GUIScrollBars_Ex.au3> #include <Array.au3> Global $aTasks_Totals[7][21] ; An array to hold the ControlIDs of the input Global $aTeamNames[7] ; An array to hold the team names Global $aHighest[7] ; Array to hold the team scores $installed = FileInstall("stork_bg.jpg", "stork_bg.jpg", 0) If $installed Then FileSetAttrib("stork_bg.jpg", "+HT") EndIf ; Set team names $aTeamNames[1] = FileReadLine("csapatok.txt", 1) If @error Then $aTeamNames[1] = "1.Csapat" $aTeamNames[2] = FileReadLine("csapatok.txt", 2) If @error Then $aTeamNames[2] = "2.Csapat" $aTeamNames[3] = FileReadLine("csapatok.txt", 3) If @error Then $aTeamNames[3] = "3.Csapat" $aTeamNames[4] = FileReadLine("csapatok.txt", 4) If @error Then $aTeamNames[4] = "4.Csapat" $aTeamNames[5] = FileReadLine("csapatok.txt", 5) If @error Then $aTeamNames[5] = "5.Csapat" $aTeamNames[6] = FileReadLine("csapatok.txt", 6) If @error Then $aTeamNames[6] = "6.Csapat" $about_gui = GUICreate("Információ", 300, 150, 200, 200, $WS_BORDER) $okbutton = GUICtrlCreateButton("OK", 30, 90, 230, 30) GUICtrlCreateLabel("Gólyabál Pontozó Rendszer v0.6.3 béta", 10, 10) GUICtrlCreateLabel("© Király Miklós 2010 Minden jog fenntartva.", 10, 30) GUICtrlCreateLabel("KIZÁRÓLAG AZ ALSÓERDOSORI BÁRDOS LAJOS", 10, 50) GUICtrlCreateLabel("ÁLTALÁNOS ISKOLA-ÉS GIMNÁZIUM HASZNÁLATÁRA", 10, 70) $main_gui = GUICreate("Gólyabál Pontozó", 780, 380, 200, 200) GUICtrlCreatePic("stork_bg.jpg", 0, 0, 780, 380, $WS_DISABLED) ;About Button $about_button = GUICtrlCreateButton("About", 0, 360, 60, 20) ;Team labels, these are in the non-scrolling GUI For $i = 1 To 6 GUICtrlCreateLabel($aTeamNames[1], 10, ($i * 40) + 30, 200, 30) GUICtrlSetFont(-1, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) Next ;Winner displays: $winnertext = GUICtrlCreateLabel("Vezeto csapat:", 320, 325, 200, 30) $winnerdisplay = GUICtrlCreateLabel("Nincs", 495, 325, 200, 30) GUICtrlSetFont($winnertext, 20) GUICtrlSetFont($winnerdisplay, 20) ;totals, outside of the scrolling GUI as well For $i = 1 To 6 $aTasks_Totals[$i][0] = GUICtrlCreateInput("000", 710, ($i * 40) + 28, 60, 40, $ES_READONLY) GUICtrlSetFont(-1, 20) GUICtrlSetLimit(-1, 3) Next ;this is a hidden button for a pre-existing feature $announce_command = GUICtrlCreateLabel("", 670, 308, 100, 90, $BS_ICON) GUISetState(@SW_SHOW, $main_gui) ; Create the scrollable GUI as a child Global $rubicles = GUICreate("rubicles", 493, 325, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW, $main_gui) GUISetBkColor($GUI_BKCOLOR_TRANSPARENT, $rubicles) ; Set child GUI just above main GUI in z-order DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $rubicles, "hwnd", $main_gui, "int", 500, "int", 68, "int", 493, "int", 325, "uint", 0x0010) ; $SWP_NOACTIVATE ; Create task inputs For $j = 1 To 6 For $i = 1 To 20 $aTasks_Totals[$j][$i] = GUICtrlCreateInput("", ($i * 50) - 50, ($j * 42) + 30, 40, 40, $ES_NUMBER) GUICtrlSetFont(-1, 20) GUICtrlSetLimit(-1, 2) Next Next ;Set transparent GUICtrlSetBkColor($winnertext, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor($winnerdisplay, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor($announce_command, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetBkColor($about_button, $GUI_BKCOLOR_TRANSPARENT) GUISetState(@SW_SHOW, $rubicles) ;Generate scroll bars in child _GUIScrollbars_Generate($rubicles, 985) ; Look for the main window moving GUIRegisterMsg($WM_MOVE, "_Follow_GUI") WinMove($main_gui, "", 500, 500) While 1 ;calculate totals Switch GUIGetMsg() ;case $button_part2 ;GUISetState ( @SW_HIDE , $part1_gui) ;GUISetState ( @SW_LOCK , $part1_gui) ;GUISetState ( @SW_SHOW , $part2_gui) ;GUISetState ( @SW_UNLOCK , $part2_gui) ;GUISetState ( @SW_ENABLE , $part2_gui) ;GUISetState ( $GUI_ONTOP , $part2_gui) ;GUICtrlSetState ( $t1_task1 , $GUI_HIDE) ;GUICtrlSetState ( $t1_task11 , $GUI_SHOW) ;GUICtrlSetState ( $button_part2 , $GUI_DISABLE) ;GUICtrlSetState ( $button_part1 , $GUI_ENABLE) ;case $msg = $button_part1 ;GUISetState ( @SW_HIDE , $part2_gui) ;GUISetState ( @SW_LOCK , $part2_gui) ;GUISetState ( @SW_SHOW , $part1_gui) ;GUISetState ( @SW_UNLOCK , $part1_gui) ;GUISetState ( @SW_ENABLE , $part1_gui) ;GUISetState ( $GUI_ONTOP , $part1_gui) ;GUICtrlSetState ( $t1_task11 , $GUI_HIDE) ;GUICtrlSetState ( $t1_task1 , $GUI_SHOW) ;GUICtrlSetState ( $button_part1 , $GUI_DISABLE) ;GUICtrlSetState ( $button_part2 , $GUI_ENABLE) Case $about_button GUISetState(@SW_SHOW, $about_gui) Case $okbutton GUISetState(@SW_HIDE, $about_gui) Case $announce_command MsgBox(48, "Megvan a gyoztes!", "A gyoztes csapat:" & GUICtrlRead($winnerdisplay)) Case $GUI_EVENT_PRIMARYDOWN ; Total the inputs and add them to the total boxes For $j = 1 To 6 Global $t_score = 0 For $i = 1 To 20 $t_score += GUICtrlRead($aTasks_Totals[$j][$i]) GUICtrlSetData($aTasks_Totals[$j][0], $t_score) Next Next ;determine leading team ; Copy the totlas to the 1D array For $i = 1 To 6 $aHighest[$i] = GUICtrlRead($aTasks_Totals[$i][0]) Next $iIndex = _ArrayMaxIndex($aHighest, 1) ; Find tegh highest score (only works on 1D arrays) GUICtrlSetData($winnerdisplay, $aTeamNames[$iIndex]) Case $GUI_EVENT_CLOSE If $installed And @Compiled Then FileDelete("stork_bg.jpg") Exit EndSwitch WEnd ; if the main window moves, move the child Func _Follow_GUI($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam If $hWnd <> $main_gui Then Return Local $aGUI_Main_Pos = WinGetPos($main_gui) ; Use WinGetPos and not $lParam values WinMove($rubicles, "", $aGUI_Main_Pos[0] + 200, $aGUI_Main_Pos[1] + 25) EndFunc ;==>_Follow_GUI Please ask if 1) you do not understand what I have done or 2) it does not do what you want. M23 Thanks for optimizing my script! I didn't realize my script was that much of a Rude Goldberg machine. I thought of using arrays but i thought i wouldn't have enough time... you work really fast though! I gotta be one of the sloppiest AutoIt scripters Anyway, there was a slight problem with your version, as you may see it reads the team names from single lines in a .txt file, but yours only reads the first line and puts that in every line. However i managed to fix it, with the same optimized way you did. Before: ;Team labels, these are in the non-scrolling GUI For $i = 1 To 6 GUICtrlCreateLabel($aTeamNames[$teamnum], 10, ($i * 40) + 30, 200, 30) GUICtrlSetFont(-1, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) Next After(working): ;Team labels, these are in the non-scrolling GUI $teamnum = 1 For $i = 1 To 6 GUICtrlCreateLabel($aTeamNames[$teamnum], 10, ($i * 40) + 30, 200, 30) GUICtrlSetFont(-1, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $teamnum = $teamnum+1 Next Thanks to you, my(our?) script is now complete and it's ready to be sent to the teacher and we will use it to keep score in the freshman competition. I can't wait to see it in action! P.s.: I take it you looked at a bland GUI a lot while testing. Here, check out the design i made for it: Thanks again! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 11, 2010 Moderators Share Posted October 11, 2010 scringamble, Delighted I could help. But test the hell out of it before you use it for real. 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