Jump to content
Sign in to follow this  
Slym

Real time update on TrayMenu

Recommended Posts

Slym

Hi there,

I'm currently coding a versatile server monitoring tool called PeekMon : http://dl.dropbox.com/u/174850/PeekMon.zip

I'm using the ModernMenuRaw Library of this thread :

It's fully working but I would like to improve it. It would be great if the TrayMenu could be updated in real time because currently you need to close it and open it again to let the program run.

I'm using OnEventMode and it looks like when I'm clicking on the tray icon, the program stops until I close it.

Do you have any idea if I can do this ?

Another problem I ran into was that I was not able to create a second GUI for options using OnEventMode. It just does not work. This is why the options are managed by another executable.

I hope you can help me.

You can also use this thread to say what you think about this little software or make a few suggestions.

Thank you for your help,

Tibo


--------------------- [font="Franklin Gothic Medium"]LinuxLive USB Creator[/font], [size="3"]The only Linux Live USB creator with easy integrated virtualization (made with AutoIT)[/size] ---------------------

Share this post


Link to post
Share on other sites
Slym

Argh ... I created another software and I desperately need to do this.

No one have an idea ?

PS: PeekMon can be downloaded from my new website http://slymsoft.com


--------------------- [font="Franklin Gothic Medium"]LinuxLive USB Creator[/font], [size="3"]The only Linux Live USB creator with easy integrated virtualization (made with AutoIT)[/size] ---------------------

Share this post


Link to post
Share on other sites
Melba23

Slym,

As far as I know, menus are modal and so you cannot do anything while they are open other than select an option. :D

But you can very easily create multiple GUIs such as "Options" dialogs - just check the Managing Multiple GUIs tutorial in the Wiki to see how. :oops:

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
Slym

Do you suggest that instead of using a TrayMenu I use a GUI ? I can do this but it will be a little bit more complicated.

Thank you for your answer.

PS: Would you be interested in having a look (or contributing) to LinuxLive USB Creator project ? I got a few bugs driving me nuts for quite some time now.


--------------------- [font="Franklin Gothic Medium"]LinuxLive USB Creator[/font], [size="3"]The only Linux Live USB creator with easy integrated virtualization (made with AutoIT)[/size] ---------------------

Share this post


Link to post
Share on other sites
Melba23

Slym,

Do you suggest that instead of using a TrayMenu I use a GUI ?

I have no idea what you are doing with your menu. I do not have a server to "Peek" at and you have provided no code for us to look over. :oops:

Why not make a small reproducer script which shows the sort of thing you want to do - we can then suggest alternatives. For example, the Toast UDF in my sig pops up small GUIs from the systray - that might be something to look at. :rip:

As to your LinuxLive USB Creator project - thanks, but no thanks. :D

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
Slym

This is an example script : http://dl.dropbox.com/u/174850/LiLi%20Downloader.zip . It's very basic. It downloads a file (10MB) from internet onto your desktop.

Progress cannot be updated in real time in systray menu.

I'm sorry to hear you don't want to contribute to LinuxLive USB Creator. I guess it will remain a one-guy project.

Edited by Slym

--------------------- [font="Franklin Gothic Medium"]LinuxLive USB Creator[/font], [size="3"]The only Linux Live USB creator with easy integrated virtualization (made with AutoIT)[/size] ---------------------

Share this post


Link to post
Share on other sites
Melba23

Slym,

404 error on your link. :D

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
martin

You could have a separate script which only produced the tray menu. When a choice from the tray menu ahs been made it can send a message to your main script which can do whatever. It can receive messages to set menu options etc. This way the main script won't be stopped because the tray menu is showing.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
Slym

That would be a solution but it adds a level of complexity for such a simple thing.

Will it still pause if I use a GUICreate instead of a TrayMenu ?


--------------------- [font="Franklin Gothic Medium"]LinuxLive USB Creator[/font], [size="3"]The only Linux Live USB creator with easy integrated virtualization (made with AutoIT)[/size] ---------------------

Share this post


Link to post
Share on other sites
Melba23

Slym,

I see what you are trying to do and as I suggested earlier I do not think you can as the menu will block the script while it is open. :oops:

However, I do believe my Toast UDF might be of use - here is a script to show you how you might use it in a loop in much the same way as you were trying to use the traymenu:

#include <Toast.au3>

HotKeySet("{ESC}", "On_Exit")

; Set the colours - note message colour is the same as the backgound so we do not see the original message
; We need to have this original label to correctly size the Toast
_Toast_Set(4, 0xFF0000, 0xFFFF00, 0xCCFFCC, 0xCCFFCC, 10, "Arial")

; Create the Toast to display and let the scritpt continue immediately
_Toast_Show(64, "Download Progress", "Current percentage = XXX", 0, False)

; Overwrite the existing label with one we can update - play with the position to get them as you wish, but 60, 30 is about where the original is siutated
$hLabel = GUICtrlCreateLabel("Current percentage = 000", 60, 30, 200, 20)

; Start the autoupdate for the percentage
$iBegin = TimerInit()
$iPercent = 0

While 1
    Sleep(10)

    ; Run teh autoupdate
    If TimerDiff($iBegin) > 500 Then
        $iPercent += 1
        ; I used a lower figure for testing - obviously this would be 100 in normal use
        If $iPercent > 25 Then ExitLoop
        ; Update the label
        GUICtrlSetData($hLabel, "Current percentage = " & StringFormat("%03i", $iPercent))
        ; Reset the autoupdate timer
        $iBegin = TimerInit()
    EndIf

WEnd

; Retract the Toast when the count is complete
_Toast_Hide()

Func On_Exit()
    Exit
EndFunc

Note you will need both the Toast and StringSize UDFs from my sig. :rip:

I hope it helps. :D

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
Slym

Toast could effectively be what I'm looking for. Thanks.

Can I put some buttons inside Toast GUI ?


--------------------- [font="Franklin Gothic Medium"]LinuxLive USB Creator[/font], [size="3"]The only Linux Live USB creator with easy integrated virtualization (made with AutoIT)[/size] ---------------------

Share this post


Link to post
Share on other sites
Melba23

Slym,

Can I put some buttons inside Toast GUI ?

It is a standard AutoIt GUI so you add whatever controls you want - all you have to do is make sure there is enough room. Perhaps a progress bar might be a useful addition? :D

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
Melba23

Slym,

Give it a try - you know where I am if you need a hand. :D

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

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  

×