Changing default behaviour
T-Menu's default behaviour can be changed, by behaviour I mean things like default
Menu width, default path to find images, default icon size and so on.
These values are essentially global constants, they are as follows:
- TMENU_IMAGES_PATH
- by default should be "images/"
- MENU_HOVER_MODE
- either true or false
- ITEM_BORDER_SIZE
- Border line width surrounding each MenuItem in pixels
- ITEM_MARGIN_SIZE
- Margin size of each MenuItem in pixels
- DEFAULT_ICON_SIZE
- The space between the far left of a MenuItem and the text (Without an Icon) in pixels
- DEFAULT_MENU_WIDTH
- Default Menu width in pixels
- MENU_HIDE_TIMEOUT
- Menu hide timeout in seconds if MENU_HOVER_MODE is true
- _arrowD
- Down arrow (Image object)
- _arrowR
- Right arrow (Image object)
- amt
- Arrow Margin Top (RIGHT ARROW)
- amr
- Arrow Margin Right (RIGHT ARROW)
- amCSS
- Arrow Magin CSS (RIGHT ARROW)
- imt
- Arrow Margin Top (DOWN ARROW)
- imr
- Arrow Margin Right (DOWN ARROW)
- iml
- Arrow Margin Left (DOWN ARROW)
- imCSS
- Arrow Margin CSS (DOWN ARROW)
You can either change these inside tmenu.js, or you can override them before you write the MenuBar.
You may well need to change the DEFAULT_MENU_WIDTH variable in your project.
TMENU_IMAGES_PATH specifies the path where the arrow images are stored, if you don't change it in
tmenu.js then you MUST use setArrowImagesPath(String) which is a method on the MenuBar object.
That is the end of the tutorial, there is an API Reference for
T-Menu and if you run into any problems try contacting me.