This sample demonstrates the power of the dmbAPI_setTBWidth() function.
As you can see, the toolbar and its items have been resized to fit the width of the page and if you resize the page the toolbar and its items will be resized as well. This is something that cannot be done with the Standard Edition!So, how do we call the dmbAPI_setTBWidth function? Easy!
Just follow these simple steps:
- Click File->Project Properties->Advanced->Menus Offset->Advanced
- Click Add
- Type a description for the new custom offset definition... it can be
anything...
- Click the "Advanced" tab
- Click the "Toolbars" tab
- Paste this code inside the "javascript" textbox:
if(cFrame.lwh != wh) {
cFrame.lwh = wh;
dmbAPI_setTBWidth(1, wh[0]);
} |
- Save your changes and click Tools->Preview to see the custom offset code
in action.
NOTE #1: Remember to activate the DynAPI option under Tools (Tools->DynAPI)
NOTE #2: If for some reason your toolbar extends beyond the width of the page
try reducing the width of the toolbar by a couple of pixels by changing the
last line of code. For example, to reduce the width by 4 pixels use this code:
dmbAPI_setTBWidth(1, wh[0] - 4);