T-Menu API Reference

JS Constants



String TMENU_IMAGES_PATHpath to arrow images
boolean MENU_HOVER_MODEpretty self explanitory
int ITEM_BORDER_SIZEindavidual MenuItems border size
int ITEM_MARGIN_SIZEindavidual MenuItems margin size
int DEFAULT_ICON_SIZEdefault icon size for each MenuItem
int DEFAULT_MENU_WIDTHevery menu that's generated will have use this unless otherwise specified
int MENU_HIDE_TIMEOUTtime (in seconds) before menus time out after inactivity.
image _arrowDimage that points to the down arrow
image _arrowRimage that points to the right arrow

MenuBar

Constructor Summary
MenuBar()
creates the base object to build upon with MenuButtons and Menus
Method Summary
void add(MenuButton button)Adds MenuButton on this MenuBar
void add(Menu button)Adds what looks like another MenuButton onto this MenuBar but links off to a Menu
void setArrowImagesPath(String path)since v1.1: Sets the location of where to find the menus arrows (d_arrow.gif and arrow.gif)
void loadArrowImages()since v1.1: Should be called after setArrowImagesPath method, loads the arrow images preferred for this MenuBar
String toString()Returns the XHTML of this MenuBar
Properties
boolean isAbsolutewhether this MenuBar is absolute positioned or placed where ever it's written
int xthe left position of this MenuBar in the browser (only used if isAbsolute is true)
int ythe top position of this MenuBar in the browser (only used if isAbsolute is true)
Object[] objAn array of Menus and MenuButtons
String idSince v1.1: id of this object
img_pathsince v1.1: Path to arrow images, TMENU_IMAGES_PATH is left in for version compatibility
img_loadedsince v1.1: Loaded the preferred arrows for this object

MenuButton

Constructor Summary
MenuButton(String label, String href)
creates a new MenuButton with the specified label and location to goto (href)
MenuButton(String label, String href, String tooltip)
creates a new MenuButton with the specified label, a location to goto (href) and a tooltip
MenuButton(image imageButton, String href)
creates a new MenuButton with the specified label and location to goto (href)
MenuButton(image imageButton, String href, String tooltip)
creates a new MenuButton with the specified image object, a location to goto (href) and a tooltip
Method Summary
No methods
Properties
Menu tA Menu object which is used by tmenu.js

Menu

Constructor Summary
Menu()
Constructs a new menu with an empty label.
Menu(String buttonLabel)
Constructs a new menu with the specified label.
Menu(image buttonImage)
Constructs a new menu with the specified image object
Menu(String buttonLabel, String tooltip)
Constructs a new menu with the specified label and tooltip.
Menu(image buttonImage, String tooltip)
Constructs a new menu with the specified image object and tooltip.
Method Summary
void add(MenuItem item)Add a MenuItem onto this menu
void addSeparator()Add a seperator onto this menu
String getSubMenuCode()Should only really be used from within tmenu.js
String toString()Returns the XHTML of this Menu
Properties
int widthThe width of this menu in pixels
String tooltipThis menus tooltip, only be shown if this Menu is on the MenuBar
Object[] itemsAn array of MenuItems and separators
MenuItem[] submenusAn array of this menus submenus
String idThe id of this menu, will only exist after the toString() method has been called
Object imageIf there's no image this property will be false, otherwise the image object itself
Object labelIf there's no label this property will be false, otherwise a String
boolean isMenuWhether this is a menu or not
boolean hrefOnly applicable if this is a classed as a MenuButton
image _arrowDthe image object to the down arrow
image _arrowRthe image object to the right arrow

MenuItem

Constructor Summary
MenuItem(String label, String href)
Constructs a new Menu Item with a label and a location to goto.
MenuItem(String label, String href, String tooltip)
Constructs a new Menu Item with a location to goto and a tooltip.
MenuItem(String label, Menu submenu)
Constructs a new Menu Item, which points to another Menu object (a submenu).
MenuItem(String label, Menu submenu, String tooltip)
Constructs a new Menu Item with a tooltip, which points to another Menu object (a submenu).
Method Summary
void setIconImage(image icon)Give's this Menu Item an icon
Properties
String labelMenuItems label
String tooltipMenuItems tooltip, if it doesn't have one then this field is false
Object actionUsed by tmenu.js, will either be a Menu or a location to goto
boolean isSubto see if this MenuItem points to a anoter Menu
image iconImagethis MenuItems icon, if it doesn't have one this field will be false
boolean isSeparatorwhether or not this object is a separator

image

Constructor Summary
image(String location)
Creates a new image object with the mouseover and mouseclick the same as the original
image(String location,int width,int height)
Same as before except you specify the images width and height
Method Summary
void setImage(String location)sets this image object's normal image
void setOverImage(String location)sets this image object's image when the mouse is over it
void setClickedImage(String location)sets this image object's image when the mouse is down over it
Properties
int wif given at the constructor; the images width otherwise the value is false
int hif given at the constructor; the images height otherwise the value is false
Image objectthis image objects normal image
Image over_objectthis image objects over image
Image clicked_objectthis image objects clicked image
boolean isImagewhether this object is an image or not