TD5x User Interface
This page covers miscellaneous TD 5.x/6.x User Interface tips & tricks.
Menu Bar vs. Ribbon Bar under the hood
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.
But if you use the Ribbon Bar, they get evaluated MUCH MUCH MUCH MORE OFTEN!
So the advice is: Don't use expensive expressions to control your menu behaviour!
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!