Sign in to follow this  
Followers 0

TrayMenu

56 posts in this topic

Posted

@Jon/jpm: did you start something on a new traymenu/icon?

@all:

Yeah, cause we already have a function TrayTip why we don't create additional functions like:

TrayCreateMenu() -> only 1 time can it be called with maybe one mode to choose if you wanna keep the autoit3-menu (with 'Pause' and 'Exit')

TrayAddMenu() -> for adding root and submenus

TrayAddMenuItem()

TraySetIcon() -> to set the trayicon

TraySetClick() -> to set the behaviour for i.e. left-click, leftdoubleclick, rightclick...

Maybe you have another ideas for this stuff :)

So post it please :)

Thanks and regards

Holger

Share this post


Link to post
Share on other sites



Posted

Fine ideas. Maybe, a function or improve something, to know if a GUI window it is minimized in Tray mode or taskbar? :)

Share this post


Link to post
Share on other sites

Posted

@josbe: hmmm... I don't know...for what do you need this info?

Holger

Share this post


Link to post
Share on other sites

Posted

TraySetToolTip?

TrayIconSetState? though we do already have Opt("TrayIconHide", $x)

Share this post


Link to post
Share on other sites

Posted

@josbe: hmmm... I don't know...for what do you need this info?

Holger

<{POST_SNAPBACK}>

Ok, here a case:

I have a GUI's window and then I minimize it to the tray, while, that window waits for certain event (a message box or something external) and depending its state it will do something.

For example if it's in the tray, it will show a balloon(TrayToolTip)...

(I don't sure if my explanation it's clear.) :)

Share this post


Link to post
Share on other sites

Posted

Ok, here a case:

I have a GUI's window and then I minimize it to the tray, while, that window waits for certain event (a message box or something external) and depending its state it will do  something.

For example if it's in the tray, it will show a balloon(TrayToolTip)...

(I don't sure if my explanation it's clear.)  :)

<{POST_SNAPBACK}>

Definitely. I understand what you're saying and I would like to see it too.

Share this post


Link to post
Share on other sites

Posted

TraySetClick() -> to set the behaviour for i.e. left-click, leftdoubleclick, rightclick...

TraySetClick() - it will be some sort of callback function or just attach event to controlid of root element? I think callback will be more flexible.

Share this post


Link to post
Share on other sites

Posted

@all: thanks for answers:)

At the moment I'm collecting some ideas for doing that thing.

Maybe I find time tomorrow to try something out.

What my idea was a more traymenu that you could without using the GUI but now I think I will start again first with only for the GUI.

Like Jon said, one script can only have 1 trayicon/menu.

With the state i.e. "SW_TRAY" I have to take a look.

So long :)

Holger

Yeah, maybe traysetclick is not needed but somehow we have to set the action for a mouseclick on the trayicon.

Share this post


Link to post
Share on other sites

Posted

I would say make a function "TrayMsg" like GUIGetMsg.

That function returns 0 when not clicked else:

1 = left click (once)

2 = left click (double)

3 = rightclick

4 >= clicked on an item in the tray menu

Share this post


Link to post
Share on other sites

Posted

@SlimShady: I don't know, cause GUIGetMsg() should do the same.

i.e. instead of the controlid if would return the id of the traymenu...

Share this post


Link to post
Share on other sites

Posted

@SlimShady: I don't know, cause GUIGetMsg() should do the same.

i.e. instead of the controlid if would return the id of the traymenu...

<{POST_SNAPBACK}>

And how would we know which item has been clicked on?

Share this post


Link to post
Share on other sites

Posted

@SlimShady: like with normal menuitems :)

Only the 'rootmenu' is different to the 'normal' menu.

So the create and msg-functions are the same like:

...
$traymenu = GUICtrlCreateTraymenu()
$trayitem = GUICtrlCreateMenuitem("Info",$traymenu)
...
While 1
   $msg = GUIGetMsg()
   If $msg = $trayitem Then...
WEnd
...

Share this post


Link to post
Share on other sites

Posted (edited)

Made 3 more functions:

TrayIcon( [iconfile [, iconid]] ) -> without parameters reset to default application icon

TrayFlash([mode]) -> 0 = flashing off, other (default) = flashing on

TrayTipText( [tooltiptext] ) -> will only set if debug mode is off, without parameters reset to default tooltiptext

The commands mean that you can use them without having any GUI.

With the traymenu I think they have to be together with a gui, otherwise we need more new commands like i.e.:

- TrayCreateMenu()

- TrayCreateMenuItem(...)

- TrayDeleteMenuItem(...)

- TraySetMenuItemState(...)

...

But this I don't like ;)

For the traymenu I will take a look later...have to go sleep now :)

Maybe we will use another mode for docking your own menu to the AutoitDefault-Menu or to overwrite it/to show only yours...

TrayMenuMode(option)

option:

0 = append your menu(items) (default)

1 = create your own traymenu (the default menuitems are not shown)

we will see

So long and good night :)

Holger

P.S. forgot: at the moment I hate the 'oneclicking' methode to see the traymenu :D, so I think we need one click/mouse-option to choose what happens when you click at the icon...

Edited by Holger

Share this post


Link to post
Share on other sites

Posted

P.S. forgot: at the moment I hate the 'oneclicking' methode to see the traymenu :), so I think we need one click/mouse-option to choose what happens when you click at the icon...

<{POST_SNAPBACK}>

I fully agree!

Share this post


Link to post
Share on other sites

Posted

I fully agree!

<{POST_SNAPBACK}>

I am not sure I agree because the oneclick is very good to stop a looping script which is important. I let JON to decide how to solve this issue :)

Share this post


Link to post
Share on other sites

Posted

@JP: I don't see the current mouseclicking-behaviour as an issue :)

But I would like to choose the clicking-behaviour (i.e. if I don't use the default autoit-traymenu)...

Regards Holger

P.S. I will try the menu things during the week cause it's too late for today and I had no time for doing something you know :)

Share this post


Link to post
Share on other sites

Posted (edited)

Added another function where you can choose for which mousebuttonclicks the traymenu is shown:

TrayClick( [click])

possible clicks:

1 - Left Button Down (default Autoit-behaviour)

2 - Left Button Up -> release the mouse button after first clicking

4 - Left Button DoubleClick

8 - Right Button Down (default Autoit-behaviour)

16 - Right Button Up -> release the mouse button after first clicking (my default mode :);) )

32 - Right Button DoubleClick

No parameter ( TrayClick() ) will reset the behaviour to the default Autoit setting.

You can combine modes, i.e.

TrayClick(20) -> means LeftButtonDoubleClick and RightButtonDown will show the traymenu.

You have to know: these are all some ideas from me.

Do you have an suggestions or ideas to this then post it please :)

Thanks and regards

Holger

Edited by Holger

Share this post


Link to post
Share on other sites

Posted

Wonderful. Could there be a mouseover and mouseout? I have seen that it can be done, but takes a little more effort than the others.

Share this post


Link to post
Share on other sites

Posted

@this-is-me: the function is onmly to set the click for _showing_ the menu!

Why you need a "mouseout" thing?

Can't really understand what you mean...

Can you explain it a little bit what you want to do with it?

Thanks :)

Holger

The "mouseover" should be no problem -> WM_MOUSEMOVE should do the thing...

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0