Jump to content

_TrayMenu.au3 - advanced, completely random tray menus


jennico
 Share

Recommended Posts

I have read lots of posts that demand more individual tray menus. i have tried Holger's really wonderful "modern menu" and the new built in functions.

they all suffer from the same problem: they use system standards and the individualization is very limited.

with my TrayMenu UDF you can really define anything you like: size, colors, behaviour, style, background, pictures, delays, shadows, sidebars, gradients, icons .........

i tried to put every param into variables, though it was really hard to implement.

this UDF is still under development. you will find (logical) errors (no syntax errors, i hope) and limitations. please tell me about the things you find and more implementations you desire. not everything works yet like i wish it to do, but nevertheless it's a good beginning.

if you feel able to help me please contribute. When this has come to a satisfying release, i will transpose the script to work with context menus (shouldn't be a problem) and the system menu (a little bit harder).

the new version 0.91 has sidebars with rotated text and gradient colors. (groovy) :)

#cs
    ;#=#INDEX#============================================================================================================================#
    ;#  Title .........: _TrayMenu.au3
    ;#  Description ...: Advanced Tray Menu Functions.
    ;#  Date ..........: 14.12.08
    ;#  Version .......: 0.91 - added side menu bar with rotated text and color gradient - 
    ;#  History .......: 0.9 - 12.12.08 - first release
    ;#  Author ........: jennico (jennicoattminusonlinedotde)  ©  2008 by jennico
    ;#  AutoIt Version : written in v 3.2.12.1, upwards compatible ( no includes; will work forever )
    ;#  Remarks .......: _TrayMenu.au3 UDF is designed to replace the standard tray functions.
    ;#                   ------
    ;#                   It provides the utmost freedom in individualizing the tray menu.
    ;#                   The tray menu imitates nearly perfectly the standard menu. It uses the same GUI styles, shadows and delays. The main functions equal their corresponding origins.
    ;#                   Sizes, fonts, colors, backgrounds (pictures), icons, behaviour, side and title bars can be individualized as well as the standard settings.
    ;#                   The reaction on mouse hover events can be randomly designed.
    ;#                   ------
    ;#                   When _TrayMenu.au3 is used, the standard AutoIt tray functions and options MUST NOT be used at all.
    ;#                   _TrayMenu.au3 has no default icon, no default menu and no default traytip. All this has to be defined.
    ;#                   ------
    ;#                   Unlike standard functions, there is no need to differenciate between items and menuitems. There is only _TrayMenu_ItemCreate.
    ;#                   If a newly created item backreferences to a previous item, this item automatically becomes a menuitem and a new level is created.
    ;#                   ------
    ;#                   The control IDs of the items are used like common control IDs. The events can be caught by GUICtrlSetOnEvent or GUIGetMsg. @GUI_CTRLID instead of @TRAY_ID will be returned.
    ;#                   For instance, there can be set a tooltip for every single item (GUICtrlSetToolTip).
    ;#                   If needed the windows (menu) handle and the control handle can be retrieved with @GUI_WINHANDLE or @GUI_CTRLHANDLE.
    ;#                   ------
    ;#                   Unlike standard tray menu, events from separators and menuitem can be retrieved, too.
    ;#                   Menuitems can be checked and can even be created as radioitems.
    ;#                   ------
    ;#                   This UDF will be converted to replace also standard context and sys menus in future.
    ;#                   ------
    ;#  Limitations ...: The following current limitations are due to the construction progress and will be removed during development.
    ;#                   - only one tray icon per instance supported.
    ;#                   - only two menu levels entirely supported.
    ;#                   - text padding to be working with pixels not spaces.
    ;#                   - control icons only very basic. need better GDI coding.
    ;#                   - some functions not completely tested.
    ;#                   - icon flash and similar functions to be done.
    ;#                   - iconbar, titlebar to be done.
    ;#                   - generally replace functions with GDI functions.
    ;#  Main Functions : _TrayMenu_SetIcon( [ iconfile1 [, iconID1 [, iconfile2 [, iconID2]]]] )
    ;#                   _TrayMenu_IconSetState( [ flag ] )
    ;#                   _TrayMenu_ItemCreate ( text [, menuID [, menuentry [, menuradioitem]]] )
    ;#                   _TrayMenu_ItemSetState ( controlID, state )
    ;#                   _TrayMenu_ItemCheck ( [ controlID [, flag]] )
    ;#                   _TrayMenu_ItemUnCheck ( [ controlID] )
    ;#                   _TrayMenu_ItemGetState ( controlID )
    ;#                   _TrayMenu_ItemGetHandle ( controlID [, icon] )
    ;#                   _TrayMenu_ItemGetPos ( controlID )
    ;#                   _TrayMenu_ItemDelete ( controlID )
    ;#                   _TrayMenu_ItemRead ( controlID [, advanced] )
    ;#                   _TrayMenu_ItemSetHeight ( controlID [, height] )
    ;#                   _TrayMenu_ItemSetSelectMode ( controlID [, select] )
    ;#                   _TrayMenu_ItemSetUserIcon ( controlID [, filename [, iconname [, fileselected [, iconselected]]]] )
    ;#                   _TrayMenu_ItemSetMenuIcon ( controlID [, filename [, iconname [, fileselected [, iconselected]]]] )
    ;#                   _TrayMenu_ItemSetIconSize ( controlID [, size1 [, size2 [, size1sel [, size2sel]]]] )
    ;#                   _TrayMenu_ItemSetText ( controlID, text [, select] )
    ;#                   _TrayMenu_ItemSetPadding ( controlID [, padleft [, padright [, padleftsel [, padrightsel]]]] )
    ;#                   _TrayMenu_ItemSetFont ( controlID, size [, weight [, attribute [, fontname]]] )
    ;#                   _TrayMenu_ItemSetSelFont ( controlID, size [, weight [, attribute [, fontname]]] )
    ;#                   _TrayMenu_ItemSetColor ( controlID [, textcolor [, selected]] )
    ;#                   _TrayMenu_ItemSetBkColor ( controlID [, backgroundcolor [, selected]] )
    ;#                   _TrayMenu_ItemSetStyle ( controlID [, style [, selected]] )
    ;#                   _TrayMenu_ItemSetPic ( controlID [, image [, selected]] )
    ;#                   _TrayMenu_PopupSetPic ( [ level [, image]] )
    ;#                   _TrayMenu_SidebarCreate ( level [, width [, text [, orientation [, style [, color [, direction [, font [, fontsize [, attribute [, fontcolor [, trans]]]]]]]]]]] )
    ;#                   _TrayMenu_SidebarDelete ( level )
    ;#                   _TrayMenu_GetHotItem ( level )
    ;#                   _TrayMenu_GetHotItemLast ( )
    ;#                   _TrayMenu_ItemIsHot ( controlID )
    ;#                   _TrayMenu_LevelIsHot ( level )
    ;#                   _TrayMenu_LevelIsOpened ( level )
    ;#                   _TrayMenu_SetToolTip ( [text] )
    ;#                   _TrayMenu_Tip ( "title", "text", timeout [, option] )
    ;#  Options Section: _TrayMenu_SetDefault ( )
    ;#                   _TrayMenu_SetClick ( flag )
    ;#                   _TrayMenu_SetCheckMode ( [ check auto state [, radio auto state ]] )
    ;#                   _TrayMenu_SetSelectMode ( [ mode ] )
    ;#                   _TrayMenu_SetIconSize ( [ level [, size1 [, size2 ]]] )
    ;#                   _TrayMenu_SetPadding ( [ level [, padleft [, padright [, padleftsel [, padrightsel]]]]] )
    ;#                   _TrayMenu_SetFont ( [ level [, size [, weight [, attribute [, fontname]]]]] )
    ;#                   _TrayMenu_SetSelFont ( [ level [, size [, weight [, attribute [, fontname]]]]] )
    ;#                   _TrayMenu_SetColor ( [ level [, textcolor [, selected]]] )
    ;#                   _TrayMenu_SetBkColor ( [ level [, backgroundcolor [, selected]] )
    ;#                   _TrayMenu_SetStyle ( [ level [, style [, selected]]] )
    ;#                   _TrayMenu_SetItemSize ( [ level [, $width [, $height [, $blank]]]] )
    ;#                   _TrayMenu_SetCheckMark ( filename [, iconname [, fileselected [, iconselected]]] )
    ;#                   _TrayMenu_SetIndeterminateMark ( filename [, iconname [, fileselected [, iconselected]]] )
    ;#                   _TrayMenu_SetRadioMark ( filename [, iconname [, fileselected [, iconselected [, flag]]]] )
    ;#                   _TrayMenu_SetMenuMark ( filename [, iconname [, fileselected [, iconselected [, flag]]]] )
    ;#                   _TrayMenu_PopupSetDelay ( [ open [, close]] )
    ;#                   _TrayMenu_PopupSetColor ( [ open [, color]] )
    ;#                   _TrayMenu_PopupSetTrans ( [ open [, trans] )
    ;#                   _TrayMenu_ShadowShow ( [ level [, show]] )
    ;#                   _TrayMenu_ShadowSetColor ( [ level [, color]] )
    ;#                   _TrayMenu_ShadowSetTrans ( [ level [, trans]] )
    ;#                   _TrayMenu_Delete ( ) Deletes entire tray menu.
    ;#  Internal ......: __TM_Main ( $hWnd, $Msg, $iIDTimer, $dwTime ) Main timer called function.
    ;#                   __TM_ItemNotify ( $hRef ) Retrieves control on hover or click event.
    ;#                   __TM_Select ( $t ) Selects item.
    ;#                   __TM_Deselect ( $t ) Deselects item.
    ;#                   __TM_Radio ( $t ) Deselects radioitem.
    ;#                   __TM_IconSetImage ( $hWnd, $hctrl, $img, $nmr, $size ) Sets image to icon.
    ;#                   __TM_Show_1st ( ) Opens first level popup.
    ;#                   __TM_Show ( $hRef [, $timeout]) Opens higher level popups.
    ;#                   __TM_Hide ( $hRef [, $timeout]) Closes single higher level popups.
    ;#                   __TM_Hide_all ( ) Closes all popups.
    ;#                   __TM_Redim_Win ( $n ) Redims window properties.
    ;#                   __TM_Redim_Item_1 ( $n ) Redims item properties.
    ;#                   __TM_Redim_Item_2 ( $m ) Redims item properties.
    ;#                   __TM_Measure_Item ( $hRef, $hCnt ) Measures items according to max text length and height.
    ;#                   __TM_Resize_Win ( $hRef [, $mode] ) Calculates the popup size according to all its menu entries sizes and reorders the controls.
    ;#                   __TM_Create_Sidebar ( $s_ID, $iW, $nText, $iAngle, $pos, $gradcolor, $idirection, $nFontName, $nFontSize, $iStyle, $ifontcolor, $ialpha [, $mode] ) Creates sidebar.
    ;#                   __TM_Resize ( $x ) Resizes level.
    ;#                   __TM_Shadow ( $x ) Creates the popups' shadows.
    ;#                   __TM_Pad ( $txt, $x, $y ) Left and right pads given text.
    ;#                   __TM_SetFont ( $i, $size, $width, $attr, $name ) Sets font for a given level.
    ;#                   __TM_SetSelFont ( $i, $size, $width, $attr, $name ) Sets selected font for a given level.
    ;#                   __TM_SetOnEvent ( $x ) Determines which action opens tray menu.
    ;#                   __TM_GetPos ( $x ) Retrieves item position.
    ;#                   __TM_GetMenu ( $x ) Retrieves level from menu / item ID.
    ;#                   __TM_DLLStructSetData ( $x, $y, $w, $h ) Sets Data to rectangle structure.
    ;#====================================================================================================================================#
#ce

To Do:

- allow several icons.

- enable random menu levels.

- text padding to be working with pixels not spaces.

- improve icons handling.

- improve icon flash and similar tray icon functions.

- iconbar.

- sidebar. done

- titlebar.

- generally replace functions with GDIplus functions.

- transcode to ContextMenu

- transcode to Caption/SysMenu

there are no third party apps. pure autoit.

the example script which is included in the zip file :)is not very beautiful, it is made to illustrate the abilities. i would appreciate if anyone posts own examples or screenshots.

have fun

j.

_TrayMenu_v0.91.zip

Edited by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

  • Developers

Nice! is 5 letters :)

nope: 5 characters but 4 letters.

@OP, looks pretty complete but will need so,metime for people to sort out and play with .... :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

best to start a menu with standard settings ( first define an icon: _TrayMenu_SetIcon. then use only _TrayMenu_ItemCreate. to start a submenu, just backreference to a previously created item ). the rest of the syntax is very similar to the built in functions.

and then, add your ideas step by step.

Edited by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

updated the UDF. now v 0.91. added sidebars with rotated text and color gradient. very nice !

edit: please gimme more feedback. i am going to loose my motivation.

j.

Edited by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

I CAN'T BELIEVE IT !!!

2778 views, 70 downloads and 3 :) replies !!!! what's the matter with you people ? move your asses and support me !

j.

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

thank you.

a main difference to Holgers ModernMenuRaw (which is excellent !), is, that i use labels for the items instead of the system's menu items. this makes it far easier to manipulate them. in doing so, it is possible to set e.g. the select mode. you can choose how the items are supposed to behave. you can tell them only to change their color or the font. you can indicividualize your menu completely and achieve nice effects.

from the parent program, you can read out which item is currently "hot" and react to it. you can set tooltips to the items. at times, it can be helpful to explain the function of an item.

many professional programs use inividualized menus and i have always asked myself how the developers made that. now i know.

i will have to work on the script to implement more gdi plus elements and if anyone has a suggestion, at this stage of development i can implement the ideas.

j.

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

why aren't there any screen shots TMs possible to be made with this tool ?!?

[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Link to comment
Share on other sites

i don't quite understand u 2. download and start the example script in it...... :) i don't know what more to do. do you need a flash version uploaded or a video ?

edit: what are "TMs" ? TradeMarks ? TennisMatches ? or anything pornographic? no, no porno inside.

TMs possible to be made with this tool ?!?

Edited by jennico
Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Link to comment
Share on other sites

almost a week already... no screens ?!? too bad !

[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Link to comment
Share on other sites

  • 4 weeks later...

Oh, I don't know why I got so many warnings, I can't run this script.

Anyone can help me? I will post the screenshot by return.

D:\Code\_TrayMenu_v0.91\_TrayMenu.au3(312,28) : WARNING: $TM_type: possibly used before declaration.
        If $ref > UBound($TM_type)
        ~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Code\_TrayMenu_v0.91\_TrayMenu.au3(317,20) : WARNING: $TM_gui_cnt possibly not declared/created yet
            $TM_gui_cnt += 1
            ~~~~~~~~~~~~~~~~^
D:\Code\_TrayMenu_v0.91\_TrayMenu.au3(319,122) : WARNING: $TM_shdw_GUI possibly not declared/created yet
            $TM_shdw_GUI[$TM_gui_cnt] = GUICreate("", 0, 0, -1000, -1000, $TM_def_shdw_style, $TM_def_ex_style);, $TM_main_GUI[0])
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~^
D:\Code\_TrayMenu_v0.91\_TrayMenu.au3(320,125) : WARNING: $TM_main_GUI possibly not declared/created yet
            $TM_main_GUI[$TM_gui_cnt] = GUICreate("", 0, 0, -1000, -1000, $TM_def_style, $TM_def_ex_style, $TM_shdw_GUI[$TM_gui_cnt])
Link to comment
Share on other sites

  • 3 months later...

the same here, modern menu tray UDF is way too advanced for me at the moment i wont be able to concentrate much on learning it, but i wanted to use ur UDf and more or less the same list of errors undeclared vars , too many of 'em can u fix them for v3.3 thanks a lot.

<edit> winAPi.au3 inclusion helped ward out errors related to API Function calls,

<edit> hunderds of warnings, but working version hope this helps!

_TrayMenu.au3

Edited by rajeshontheweb
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...