Disabled 'menu' aliases.

Posted by Shadowfyr on Tue 01 Jul 2003 10:26 PM — 4 posts, 11,450 views.

USA #0
I have the following I am using:
<aliases>
  <alias
   name="Open_Winamp"
   script="Open_Winamp"
   match="OpenWinamp"
   enabled="y"
   menu="y"
   sequence="100"
  >
  </alias>
</aliases>

<aliases>
  <alias
   name="Close_Winamp"
   match="WinampKill"
   group="WinAmp"
   send_to="12"
   menu="y"
   sequence="100"
  >
  <send>winamp.stop
winamp.SendCommand(&quot;40001&quot;)
winamp=&quot;&quot;
enablealias &quot;Open_Winamp&quot;,1
enablegroup &quot;WinAmp&quot;,0</send>
  </alias>
  <alias
   name="Play"
   match="WMPlay"
   enabled="y"
   group="WinAmp"
   send_to="12"
   menu="y"
   sequence="100"
  >
  <send>winamp.play</send>
  </alias>

.... Some other commands.

  <alias
   name="Stop"
   match="WMStop"
   enabled="y"
   group="WinAmp"
   send_to="12"
   menu="y"
   sequence="100"
  >
  <send>winamp.stop</send>
  </alias>
</aliases>

dim winamp

sub Open_Winamp (name, output, wilds)
  set winamp=createobject("WinampCOM.application")
  if winamp.PlayListCount < 1 then
    winamp.AddFile("C:\My Documents\My Music\Playlists\Favorites.m3u")
    winamp.play
    winamp.fastforward
  end if
end sub

Now all these things appear on the Ctrl-click menu. The problem is that if disabled then they shouldn't be in the menu, or they should appear disabled and unclickable, like on a normal menu. If winamp is closed and I have no connection to it, it doesn't make much sense for me to still have access to any of the commands other than "Open Winamp". And if it is active, then that one should not appear. This is pretty much cosmetic, but it seems like a reasonable behaviour to expect that disabled items would be missing or greyed out. (Preferably absent, since that makes a cleaner appearance imho).
Amended on Tue 01 Jul 2003 10:29 PM by Shadowfyr
USA #1
It also occures to me that it might be useful if the sort order for the menu items was based off of the 'sequence' number used as well as alphabetically. That way you can group them the way you want, instead of just having them all show up in alphabetical order, which is just as ugly as having diabled things show up in the list.
Amended on Thu 03 Jul 2003 12:18 AM by Shadowfyr
Australia Forum Administrator #2
Your first idea sounds good.

As for the sequence, sequence number *and* name order? Do you mean a choice, or do you have a lot of identically named ones you want in a certain sequence (or vice-versa)?
USA #3
Well. Again this is mostly a cosmetic matter, but for instance the items I currently have on there are in this order:

Close Winamp
Next Track
Open Winamp
Pause Winamp
Play
Previous Track
Stop
Toggle Repeat
Toggle Shuffle

I would prefer:

Open Winamp -\_ Mutually exclusive, thus the first suggestion.
Close Winamp /
Play
Pause
Previous Track
Next Track
Stop
Toggle Repeat
Toggle Shuffle

This is how I have them sequenced, and had hoped they would therefor appear. Now consider if you added 5-6 more commands, say 'Set Notag', 'Reset Notag', 'Enable Yada', 'Respond as AFK', 'No Spam', 'Stop Following'...

Close Winamp
Enable Yada
Next Track
No Spam
Open Winamp
Pause Winamp
Play
Previous Track
Reset Notag
Respond as AFK
Set Notag
Stop
Stop Following
Toggle Repeat
Toggle Shuffle

The first menu was badly organised if sorted by name, since it placed other commands in between ones that are directly related to each other. Once you start adding collections of commands that are completely unrelated, like above, the menu will start to get confusing and 'very' ugly. This is made even worse by the lack of any real way to add a seperation line in the menu to place related commands in a visually different section.

Though... It may be possible to solve that too by adding a switch to aliases ("Use as seperator"), this would be skipped by the alias checking and ignore all fields except for Sequence and Label. Sequence would provide 'where' it goes, while the Label allows you to have more than one of them. Of course, this is only practical if you can use the sequence number to designate location in the menu.

In any case, having them sorted by name is ugly and functionally questionable. Unlike a normal menu, this is more or less taking the place of a user configurable tool bar, which uses obvious visual cues to what commands are related. Normal menus on the other hand are by definition already grouped into seperate command sets, something that simply can't be done here without being able to, at the minimum, provide a definite user chosen order.

Actually I suppose such a sub-grouping could be done if you used 'Group' to designate a drop-down sub menu, but that is going quite a bit beyond what started as a basic issue. lol