Jump to content

Queue management


Kreg0
 Share

Recommended Posts

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 !! :

#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

  • Moderators

Kreg0,

Welcome to the AutoIt forums. :)

How about this: :)

#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
WEnd
Please ask if you have any questions. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Kreg0,

The displayed number only changes once you have selected the guichet. I have added a preview to show what will be displayed: ;)

#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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Kreg0,

The displayed number only changes once you have selected the guichet. I have added a preview to show what will be displayed: ;)

#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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...