Kreg0 Posted October 27, 2014 Share Posted October 27, 2014 Hi guys, For fun I would like to make a small application for "queue management". In fact I would like a tool like this thing : http://www.heureka.fr/Images/Gestion%20file%20d%27attente/Afficheur%20guichet.jpg or maybe this one is better The goal is only one window (full screen?) with a frame to display a number (and with buttons to increment this number) For the moment i've this, but it's ugly !! : expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Local $nMsg, $i $GUI1 = GUICreate("File d'attente", 300, 150, 600, 250) $btnCountplus = GUICtrlCreateButton("+",10,40,70,30) $btnCountmoins = GUICtrlCreateButton("-",10,80,70 ,30) GUICtrlCreateLabel("Numéro appelé: ", 10,10) GUISetFont(55, 100,"") $Count = GUICtrlCreateLabel("", 92, 30, 200, 100) GUICtrlSetBkColor(-1, 0) GUICtrlSetColor(-1,65280) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $btnCountplus $i=$i+1 GUICtrlSetData($Count,$i) sleep(100) Case $btnCountmoins $i=$i-1 GUICtrlSetData($Count,$i) sleep(100) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd An idea to make it better ? Manyt thanks Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 28, 2014 Moderators Share Posted October 28, 2014 Kreg0,Welcome to the AutoIt forums. How about this: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> $iCount = 0 $sGuichetData = "" For $i = 1 To 12 $sGuichetData &= "|" & $i Next $hGUI = GUICreate("File d'attente", 500, 230, Default, Default, $WS_POPUP) GUISetBkColor(0x000000) $cLabel_1 = GUICtrlCreateLabel("Numéro appelé: ", 10, 10, 200, 40, $SS_CENTER) GUICtrlSetFont($cLabel_1, 14) GUICtrlSetColor($cLabel_1, 0xFFFFFF) $cLabel_2 = GUICtrlCreateLabel("Guichet: ", 250, 10, 200, 40, $SS_CENTER) GUICtrlSetFont($cLabel_2, 14) GUICtrlSetColor($cLabel_2, 0xFFFFFF) $cCount = GUICtrlCreateLabel("000", 10, 60, 150, 100, $SS_RIGHT) GUICtrlSetFont($cCount, 64) GUICtrlSetBkColor($cCount, 0x000000) GUICtrlSetColor($cCount, 0xFF0000) $cGuichet = GUICtrlCreateLabel("", 250, 60, 150, 100, $SS_CENTER) GUICtrlSetFont($cGuichet, 64) GUICtrlSetBkColor($cGuichet, 0x000000) GUICtrlSetColor($cGuichet, 0xFF0000) $cFleche = GUICtrlCreateLabel("", 410, 60, 80, 100) GUICtrlSetFont($cFleche, 64, Default, Default, "WingDings") GUICtrlSetBkColor($cFleche, 0x000000) GUICtrlSetColor($cFleche, 0xFF0000) $cPlus = GUICtrlCreateButton("+", 10, 180, 70, 30) GUICtrlSetFont($cPlus, 16) $cMoins = GUICtrlCreateButton("-", 100, 180, 70, 30) GUICtrlSetFont($cMoins, 16) $cRappel = GUICtrlCreateLabel("< Adjuster numéro", 180, 190, 100, 20) GUICtrlSetColor($cRappel, 0xFFFFFF) $cGuichetChoix = GUICtrlCreateCombo("", 290, 180, 100, 30) GUICtrlSetData($cGuichetChoix, $sGuichetData) GUICtrlSetFont($cGuichetChoix, 16) GUICtrlSetState($cGuichetChoix, $GUI_DISABLE) $cSortie = GUICtrlCreateButton("Sortie", 410, 180, 80, 30) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $cSortie Exit Case $cPlus $iCount += 1 If $iCount > 999 Then $iCount = 1 GUICtrlSetState($cPlus, $GUI_DISABLE) GUICtrlSetState($cGuichetChoix, $GUI_ENABLE) GUICtrlSetData($cRappel, "Choisir guichet >") Case $cMoins $iCount -= 1 If $iCount < 0 Then $iCount = 0 GUICtrlSetState($cMoins, $GUI_DISABLE) GUICtrlSetState($cGuichetChoix, $GUI_ENABLE) GUICtrlSetData($cRappel, "Choisir guichet >") Case $cGuichetChoix GUICtrlSetData($cRappel, "") GUICtrlSetData($cCount, $iCount) GUICtrlSetData($cGuichet, GUICtrlRead($cGuichetChoix)) For $i = 1 To 10 GUICtrlSetData($cFleche, ( (Mod($i, 2) = 1) ? ("") : ("à") )) Sleep(500) Next GUICtrlSetState($cPlus, $GUI_ENABLE) GUICtrlSetState($cMoins, $GUI_ENABLE) GUICtrlSetState($cGuichetChoix, $GUI_DISABLE) GUICtrlSetData($cRappel, "< Adjuster numéro") EndSwitch WEndPlease ask if you have any questions. 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...
Kreg0 Posted October 31, 2014 Author Share Posted October 31, 2014 Hi Melba23 Many thanks for the script ! It look like very nice, I like it! But I don't know why the "+" and the "-" do not work. I choose the guichet, but the number is not incremented. An idea ? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 31, 2014 Moderators Share Posted October 31, 2014 Kreg0,The displayed number only changes once you have selected the guichet. I have added a preview to show what will be displayed: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> $iCount = 0 $sGuichetData = "" For $i = 1 To 12 $sGuichetData &= "|" & $i Next $hGUI = GUICreate("File d'attente", 500, 230, Default, Default, $WS_POPUP) GUISetBkColor(0x000000) $cLabel_1 = GUICtrlCreateLabel("Numéro appelé: ", 10, 10, 200, 40, $SS_CENTER) GUICtrlSetFont($cLabel_1, 14) GUICtrlSetColor($cLabel_1, 0xFFFFFF) $cLabel_2 = GUICtrlCreateLabel("Guichet: ", 250, 10, 200, 40, $SS_CENTER) GUICtrlSetFont($cLabel_2, 14) GUICtrlSetColor($cLabel_2, 0xFFFFFF) $cCount = GUICtrlCreateLabel("000", 10, 60, 150, 100, $SS_RIGHT) GUICtrlSetFont($cCount, 64) GUICtrlSetBkColor($cCount, 0x000000) GUICtrlSetColor($cCount, 0xFF0000) $cGuichet = GUICtrlCreateLabel("", 250, 60, 150, 100, $SS_CENTER) GUICtrlSetFont($cGuichet, 64) GUICtrlSetBkColor($cGuichet, 0x000000) GUICtrlSetColor($cGuichet, 0xFF0000) $cFleche = GUICtrlCreateLabel("", 410, 60, 80, 100) GUICtrlSetFont($cFleche, 64, Default, Default, "WingDings") GUICtrlSetBkColor($cFleche, 0x000000) GUICtrlSetColor($cFleche, 0xFF0000) $cPlus = GUICtrlCreateButton("+", 10, 180, 50, 30) GUICtrlSetFont($cPlus, 16) $cMoins = GUICtrlCreateButton("-", 120, 180, 50, 30) GUICtrlSetFont($cMoins, 16) $cProchain = GUICtrlCreateLabel("Prochain", 65, 180, 50, 15, $SS_CENTER) GUICtrlSetColor($cProchain, 0xFFFFFF) $cProchainCount = GUICtrlCreateLabel("0", 75, 195, 30, 15, $SS_CENTER) GUICtrlSetBkColor($cProchainCount, 0xFFFFFF) $cRappel = GUICtrlCreateLabel("< Adjuster numéro", 180, 190, 100, 20) GUICtrlSetColor($cRappel, 0xFFFFFF) $cGuichetChoix = GUICtrlCreateCombo("", 290, 180, 100, 30) GUICtrlSetData($cGuichetChoix, $sGuichetData) GUICtrlSetFont($cGuichetChoix, 16) GUICtrlSetState($cGuichetChoix, $GUI_DISABLE) $cSortie = GUICtrlCreateButton("Sortie", 410, 180, 80, 30) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $cSortie Exit Case $cPlus $iCount += 1 If $iCount > 999 Then $iCount = 1 GUICtrlSetData($cProchainCount, $iCount) GUICtrlSetState($cPlus, $GUI_DISABLE) GUICtrlSetState($cGuichetChoix, $GUI_ENABLE) GUICtrlSetData($cRappel, "Choisir guichet >") Case $cMoins $iCount -= 1 If $iCount < 0 Then $iCount = 0 GUICtrlSetData($cProchainCount, $iCount) GUICtrlSetState($cMoins, $GUI_DISABLE) GUICtrlSetState($cGuichetChoix, $GUI_ENABLE) GUICtrlSetData($cRappel, "Choisir guichet >") Case $cGuichetChoix GUICtrlSetData($cRappel, "") GUICtrlSetData($cCount, $iCount) GUICtrlSetData($cGuichet, GUICtrlRead($cGuichetChoix)) GUICtrlSetData($cGuichetChoix, $sGuichetData) For $i = 1 To 10 GUICtrlSetData($cFleche, ( (Mod($i, 2) = 1) ? ("") : ("à") )) Sleep(500) Next GUICtrlSetState($cPlus, $GUI_ENABLE) GUICtrlSetState($cMoins, $GUI_ENABLE) GUICtrlSetState($cGuichetChoix, $GUI_DISABLE) GUICtrlSetData($cRappel, "< Adjuster numéro") EndSwitch WEndM23 Kreg0 1 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...
Kreg0 Posted November 3, 2014 Author Share Posted November 3, 2014 Kreg0, The displayed number only changes once you have selected the guichet. I have added a preview to show what will be displayed: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> $iCount = 0 $sGuichetData = "" For $i = 1 To 12 $sGuichetData &= "|" & $i Next $hGUI = GUICreate("File d'attente", 500, 230, Default, Default, $WS_POPUP) GUISetBkColor(0x000000) $cLabel_1 = GUICtrlCreateLabel("Numéro appelé: ", 10, 10, 200, 40, $SS_CENTER) GUICtrlSetFont($cLabel_1, 14) GUICtrlSetColor($cLabel_1, 0xFFFFFF) $cLabel_2 = GUICtrlCreateLabel("Guichet: ", 250, 10, 200, 40, $SS_CENTER) GUICtrlSetFont($cLabel_2, 14) GUICtrlSetColor($cLabel_2, 0xFFFFFF) $cCount = GUICtrlCreateLabel("000", 10, 60, 150, 100, $SS_RIGHT) GUICtrlSetFont($cCount, 64) GUICtrlSetBkColor($cCount, 0x000000) GUICtrlSetColor($cCount, 0xFF0000) $cGuichet = GUICtrlCreateLabel("", 250, 60, 150, 100, $SS_CENTER) GUICtrlSetFont($cGuichet, 64) GUICtrlSetBkColor($cGuichet, 0x000000) GUICtrlSetColor($cGuichet, 0xFF0000) $cFleche = GUICtrlCreateLabel("", 410, 60, 80, 100) GUICtrlSetFont($cFleche, 64, Default, Default, "WingDings") GUICtrlSetBkColor($cFleche, 0x000000) GUICtrlSetColor($cFleche, 0xFF0000) $cPlus = GUICtrlCreateButton("+", 10, 180, 50, 30) GUICtrlSetFont($cPlus, 16) $cMoins = GUICtrlCreateButton("-", 120, 180, 50, 30) GUICtrlSetFont($cMoins, 16) $cProchain = GUICtrlCreateLabel("Prochain", 65, 180, 50, 15, $SS_CENTER) GUICtrlSetColor($cProchain, 0xFFFFFF) $cProchainCount = GUICtrlCreateLabel("0", 75, 195, 30, 15, $SS_CENTER) GUICtrlSetBkColor($cProchainCount, 0xFFFFFF) $cRappel = GUICtrlCreateLabel("< Adjuster numéro", 180, 190, 100, 20) GUICtrlSetColor($cRappel, 0xFFFFFF) $cGuichetChoix = GUICtrlCreateCombo("", 290, 180, 100, 30) GUICtrlSetData($cGuichetChoix, $sGuichetData) GUICtrlSetFont($cGuichetChoix, 16) GUICtrlSetState($cGuichetChoix, $GUI_DISABLE) $cSortie = GUICtrlCreateButton("Sortie", 410, 180, 80, 30) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $cSortie Exit Case $cPlus $iCount += 1 If $iCount > 999 Then $iCount = 1 GUICtrlSetData($cProchainCount, $iCount) GUICtrlSetState($cPlus, $GUI_DISABLE) GUICtrlSetState($cGuichetChoix, $GUI_ENABLE) GUICtrlSetData($cRappel, "Choisir guichet >") Case $cMoins $iCount -= 1 If $iCount < 0 Then $iCount = 0 GUICtrlSetData($cProchainCount, $iCount) GUICtrlSetState($cMoins, $GUI_DISABLE) GUICtrlSetState($cGuichetChoix, $GUI_ENABLE) GUICtrlSetData($cRappel, "Choisir guichet >") Case $cGuichetChoix GUICtrlSetData($cRappel, "") GUICtrlSetData($cCount, $iCount) GUICtrlSetData($cGuichet, GUICtrlRead($cGuichetChoix)) GUICtrlSetData($cGuichetChoix, $sGuichetData) For $i = 1 To 10 GUICtrlSetData($cFleche, ( (Mod($i, 2) = 1) ? ("") : ("à") )) Sleep(500) Next GUICtrlSetState($cPlus, $GUI_ENABLE) GUICtrlSetState($cMoins, $GUI_ENABLE) GUICtrlSetState($cGuichetChoix, $GUI_DISABLE) GUICtrlSetData($cRappel, "< Adjuster numéro") EndSwitch WEnd M23 M23, just perfect! Many thanks 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