Jump to content

Progress in a TrayTip?


 Share

Recommended Posts

No idea whether this is possible but i have a simple Progress set which i wondered if it could be done in a tray tip with the progress.

The progress set is like this

ProgressOn("Checking ...", "Please Wait", "0 %", -1, -1, 16)
ProgressSet(10, 10 & " %")
ProgressSet(20, 20 & " %")
ProgressSet(30, 30 & " %")
; etc

So i tried this

TrayTip( "Checking ... Please Wait", "0 %", -1, 1)
TraySetToolTip("10 %")
; etc

But it doesnt work, it just stays on zero, admittedly the program changes quite quickly so it needs to be instant

I searched but there seems to be very little on this subject

It would be cool if i could have the green progress bar in the tooltip :)

Link to comment
Share on other sites

  • Moderators

Chimaera,

Does it have to be a traytip? You can easily put a progress bar in a Toast. ;)

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

Hmm its abit nuts but ill have a play :)

Update

_Toast_Set(Default)
$aRet = _Toast_Show(0, "Progress Bar", $sMsg, 0, True) ; No delay or progress bar will not display immediately
ConsoleWrite("Toast size: " & $aRet[0] & " x " & $aRet[1] & @CRLF)
$hProgress = GUICtrlCreateProgress(10, 65, $aRet[0] - 20, 20)
;using
GUICtrlSetData($hProgress,  10 & " %") ;20/ 30 etc
_Toast_Hide()

the toast shows but its a tiny box and i cant read the bar at the top, is there a way to make it bigger?

Edited by Chimaera
Link to comment
Share on other sites

  • Moderators

Chimaera,

Use the "text" parameter to get the Toast to a reasonable size like this: :)

#include <Toast.au3>

_Toast_Set(Default)

$sMsg = "Working..."

; If you need something wider in the "text" parameter to get the Toast to have some width - just use some tabs
; And do not forget at least one @CRLF so that the Toast is high enough to show the progress bar

$aRet = _Toast_Show(0, "Progress Bar", $sMsg & @CRLF & @TAB & @TAB & @TAB & @TAB, 0, True) ; No delay or progress bar will not display immediately
$cProgress = GUICtrlCreateProgress(10, 45, $aRet[0] - 20, 20)
For $i = 1 To 10
    GUICtrlSetData($cProgress,  ($i * 10) & " %")
    Sleep(1000)
Next
_Toast_Hide()

Clearer now? :)

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

Not quite

ive amended like this

$aRet = _Toast_Show(0, " Checking Files ... Please Wait ", $sMsg & @CRLF & @CRLF & @TAB & @TAB & @TAB, 0) ; No delay or progress bar will not display immediately
ConsoleWrite("Toast size: " & $aRet[0] & " x " & $aRet[1] & @CRLF)
$hProgress = GUICtrlCreateProgress(10, 65, $aRet[0] - 20, 20)

But i get this

post-60350-0-59516900-1358269871_thumb.p

Ive tried diff combinations of tab or crlf cant seem to get the progress in the middle of the toast and the toast to strech longer. probably twice as long

Thx for the help

Wait wait i did not have any input specified for $sMsg so it wasn't stretching the bar

Got it showing now but one other thought

Is there a way to add the 10/20/30% under the progress bar?

Edited by Chimaera
Link to comment
Share on other sites

  • Moderators

Chimaera,

My mistake: a line using only @TABs is ignored - you need some characters. Just adjust the size of the $sMasg creation loop to get the width you want. Remember that the normal max width is set at 500 - if you want it any wider then you need to set the "raw" parameter so the text does not wrap. ;)

Use the returned height of the Toast to determine the Progress bar vertical position in the same way that you have for the horizontal size: ;)

#include <Toast.au3>
_Toast_Set(Default)

; Create a string of spaces to get the Toast to expand horizontally
$sMsg = " "
For $i = 1 To 150
    $sMsg &= " "
Next

$aRet = _Toast_Show(0, "Progress Bar", @CRLF & $sMsg)
$cProgress = GUICtrlCreateProgress(10, $aRet[1] - 40, $aRet[0] - 20, 20)
For $i = 1 To 10
    GUICtrlSetData($cProgress,  ($i * 10) & " %")
    Sleep(1000)
Next
_Toast_Hide()

That is pretty near the middle for me. :)

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

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