Willow Posted November 30, 2009 Share Posted November 30, 2009 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 More sharing options...
mikjay Posted November 30, 2009 Share Posted November 30, 2009 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? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 30, 2009 Moderators Share Posted November 30, 2009 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: expandcollapse popup#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 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...
gcue Posted November 30, 2009 Share Posted November 30, 2009 neat - didnt know you could do that... nice one melba Link to comment Share on other sites More sharing options...
AndyG Posted November 30, 2009 Share Posted November 30, 2009 GUICreate("") For $i = 1 To 5 GUICtrlCreateLabel("Program " & $i, 30, 20 + $i * 30, 100, 20) Next GUISetState() For $i = 1 To 5 Sleep(1000) GUICtrlCreateLabel(Chr(214), 10, 20 + $i * 30, 10, 10) ;the "checkmark" GUICtrlSetFont(-1, 9, 600, 4, "Symbol") Next Do Until GUIGetMsg() = -3 Link to comment Share on other sites More sharing options...
Willow Posted December 1, 2009 Author Share Posted December 1, 2009 (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 December 1, 2009 by Willow Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 1, 2009 Moderators Share Posted December 1, 2009 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 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...
pGwtech Posted August 12, 2010 Share Posted August 12, 2010 Andy G, appreciate the code contribution. 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