Jump to content

Update status checkmark


Willow
 Share

Recommended Posts

I am looking for a way to display an update status similar to the below in a GUI.

Once a step has been completed, a checkmark will be displayed to the left of the step completed.

√ File xx backed up

√ File xx copied

√ Registry updated

Service xx updated

Service xx restarted

etc....

I have already searched the help files and forums already, however I could not find a workable method to accomplish this. If someone can point me in the right direction, it will be appreciated.

Thanks

Willow

Link to comment
Share on other sites

  • Moderators

Willow,

Unless you disable it, a checkbox is not really suitable because the user can action it - which rather defeats the object of the exercise. :)

Here is a script which draws TickBoxes. At the moment it will tick the box when you click on the button, but it would be easy to amend so that you draw the "tick" when your script requires it:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <WinAPI.au3>

Global $iBorder = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME)
Global $iCaption = _WinAPI_GetSystemMetrics($SM_CYCAPTION)

Global $iX = 10, $iY = 10, $iSize = 12
Global $iDraw_X = $iX + $iBorder, $iDraw_Y = $iY + $iBorder + $iCaption

$hGUI = GUICreate("TickBox", 350, 300)

$hButton = GUICtrlCreateButton("Tick", 10, 100, 80, 30)

GUISetState(@SW_SHOW)

; Create our TickBox AFTER we have created the GUI

; Draw a "TickBox" box
$hDC = _WinAPI_GetWindowDC($hGUI)
$hPen = _WinAPI_CreatePen($PS_SOLID, 2, 0)
$obj_orig = _WinAPI_SelectObject($hDC, $hPen)
_WinAPI_DrawLine($hDC, $iDraw_X, $iDraw_Y, $iDraw_X + $iSize, $iDraw_Y)
_WinAPI_DrawLine($hDC, $iDraw_X + $iSize, $iDraw_Y, $iDraw_X + $iSize, $iDraw_Y + $iSize)
_WinAPI_DrawLine($hDC, $iDraw_X + $iSize, $iDraw_Y + $iSize, $iDraw_X, $iDraw_Y + $iSize)
_WinAPI_DrawLine($hDC, $iDraw_X, $iDraw_Y + $iSize, $iDraw_X, $iDraw_Y)

; Create the "TickBox" label - leave space for the Box!
GUICtrlCreateLabel("       File xx Backed Up", $iX, $iY, 200, 20)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            _WinAPI_SelectObject($hDC, $obj_orig)
            _WinAPI_DeleteObject($hPen)
            _WinAPI_ReleaseDC(0, $hDC)
            Exit
        Case $hButton
            ; Draw the "tick"
            _WinAPI_DrawLine($hDC, $iDraw_X + 3, $iDraw_Y + 6, $iDraw_X + 6, $iDraw_Y + 9)
            _WinAPI_DrawLine($hDC, $iDraw_X + 6, $iDraw_Y + 9, $iDraw_X + 9, $iDraw_Y + 2)
            _WinAPI_DeleteObject($hPen)
    EndSwitch
WEnd

I hope this helps. Ask if anything is unclear.

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

AndyG,

Why did I not think of that! - [image]Melba23 hitting forehead with palm of hand[/image] ;)

Actually I had just finished creating a transparent checkbox in response to another topic and had the basic code in SciTE already. But I think you have the better solution. :)

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

  • 8 months later...

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...