Sign in to follow this  
Followers 0
Willow

Update status checkmark

8 posts in this topic

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

Share this post


Link to post
Share on other sites



What about using GUICtrlSetState ( controlID, state ), with the handle of the previously created checkbox and $GUI_CHECKED as the state if error level is 0?

Share this post


Link to post
Share on other sites

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


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

neat - didnt know you could do that...

nice one melba

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Thanks everyone, there are couple of real viable options shown that can be considered to suit the requirements I am looking for.

Willow.

Edited by Willow

Share this post


Link to post
Share on other sites

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


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

Andy G, appreciate the code contribution.

Share this post


Link to post
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
Sign in to follow this  
Followers 0