TD5x User Interface

From Team Developer SqlWindows Wiki
Jump to: navigation, search

TD 5.x and higher : user interface


Contents


Pointer2.png Menu Bar vs. Ribbon Bar under the hood Pointer.png

The possibility to create a Ribbon Bar is one of the features that allows us to improve our TD applications look and feel.
But is it done by setting bMenuBarAsRibbonBar to TRUE? No!
Beside rearranging the Menu Items and adding nice images, there is another very important thing to keep in mind, if you switch to Ribbon Bars.
You know, that there is this nice capability of defining Enabled When expressions to enable and disable Menu Items.
But do you know, how often those expressions are evaluated?


When using the Menu Bar, they are evaluated right before the Menu Item gets displayed.
The following image shows this.


MenuEnabledWhenBehaviourMenu.jpg


But if you use the Ribbon Bar, they get evaluated MUCH MUCH MUCH MORE OFTEN!


MenuEnabledWhenBehaviourRibbon.jpg


So the advice is: Don't use expensive expressions to control your menu behavior!
This could really decrease your applications performance a lot!
Instead you should use simple variables to store the Menu Item state and add them as the Enabled When expression.
You'll also face debugging issues, as the execution will step into your Enabled When evaluation functions (if any), during debug.


Just try using this application and play around to see what this article is about!
Down.png MenuEnabledWhenBehaviour.zip