forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Disable popup menu item

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Help for VDS 5 & Up
View previous topic :: View next topic  
Author Message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 412
Location: Australia

PostPosted: Sun Jun 24, 2007 4:43 am    Post subject: Disable popup menu item Reply with quote

Is there a way (GadgetX.dll or VDSUG.dll?) to disable an item in a popup menu?

Like this (but with 'menu disable' replaced with an API message or defined command):
Code:
  dialog popup,&Add New|-|D&elete All|-|Information|About
  if @greater(@count(Table1),0)
    # Table is empty
    menu disable,Delete All
  end


So it appears as:
------------
Add New
------------
Delete All
------------

Information
About

------------

Currently I use conditional statements to determine which menu items to include in popup menus:
Code:
  if @equal(1,@selected(Table1))
    # Single item selected
    dialog popup,&Run|-|&Add|-|Re&name|-|&Delete|D&elete All
  elsif @greater(@selected(Table1),1)
    # Multiple items selected
    dialog popup,&Add|-|&Delete Selected|D&elete All
  else
    # No items selected
    if @greater(@count(Table1),0)
      # Table has at least one item
      dialog popup,&Add|-|D&elete All
    else
      # Table empty
      dialog popup,&Add
    end
  end


But I'd prefer if all menu items were always shown, but with unusable items disabled, so the user would know what all the possible menu items are each time the menu is shown.

_________________
cheers

Dave
Back to top
View user's profile Send private message Visit poster's website
uvedese
Contributor
Contributor


Joined: 21 Jan 2006
Posts: 159
Location: Spain

PostPosted: Sun Jun 24, 2007 5:59 pm    Post subject: Reply with quote

Hi Dave Very Happy :

There would be magnificent the option on that you comment. I suppose that a more professional option would be to use vdspopup.dll by PGWARE. But, if you want domestic recipe for this try to use my script popmenu.

Version 1.1 allows to disable any options.

download link:

http://vds.uvedese.es/index.php?option=com_content&task=view&id=47&Itemid=27

Good luck
________________________
uVeDeSe


Last edited by uvedese on Wed Apr 02, 2008 7:30 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Jun 25, 2007 4:34 pm    Post subject: Reply with quote

Dave,
While it is possible to do this with GadgetX. I think you would like using the vdspopup.dll from PGWARE since it would not require as much work as it would with GadgetX.

With GadgetX you would have to completely create the menu with API functions.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Help for VDS 5 & Up All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum




Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group