Difference between revisions of "TD5x User Interface"
DaveRabelink (Talk | contribs) m (Added link to sample in Menu Bar vs. Ribbon Bar under the hood section) |
DaveRabelink (Talk | contribs) m |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{PageHeader|TD 5.x and higher : user interface}} | |
+ | |||
__TOC__ | __TOC__ | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<!------------------------------------------------------------------------------------------------------------------------------> | <!------------------------------------------------------------------------------------------------------------------------------> | ||
Line 90: | Line 12: | ||
You know, that there is this nice capability of defining <b>Enabled When</b> expressions to enable and disable Menu Items.<br/> | You know, that there is this nice capability of defining <b>Enabled When</b> expressions to enable and disable Menu Items.<br/> | ||
But do you know, how often those expressions are evaluated?<br/> | But do you know, how often those expressions are evaluated?<br/> | ||
− | + | ||
+ | |||
When using the Menu Bar, they are evaluated right before the Menu Item gets displayed.<br/> | When using the Menu Bar, they are evaluated right before the Menu Item gets displayed.<br/> | ||
The following image shows this.<br/> | The following image shows this.<br/> | ||
+ | |||
+ | |||
[[Image:MenuEnabledWhenBehaviourMenu.jpg]] | [[Image:MenuEnabledWhenBehaviourMenu.jpg]] | ||
− | + | ||
− | But if you use the Ribbon Bar, they get evaluated MUCH MUCH MUCH MORE OFTEN!<br | + | |
+ | But if you use the Ribbon Bar, they get evaluated MUCH MUCH MUCH MORE OFTEN!<br> | ||
+ | |||
+ | |||
[[Image:MenuEnabledWhenBehaviourRibbon.jpg]] | [[Image:MenuEnabledWhenBehaviourRibbon.jpg]] | ||
− | + | ||
− | So | + | |
− | This could really decrease your applications performance a lot!<br | + | So the advice is: <b>Don't use expensive expressions to control your menu behavior!</b><br> |
− | Instead you should use simple variables to store the Menu Item state and add them as the Enabled When expression.<br | + | This could really decrease your applications performance a lot!<br> |
− | You'll also face debugging issues, as the execution will step into your Enabled When evaluation functions (if any), during debug. | + | Instead you should use simple variables to store the Menu Item state and add them as the Enabled When expression.<br> |
− | + | 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!<br/> | Just try using this application and play around to see what this article is about!<br/> | ||
− | + | {{Download | |
+ | |URL=http://samples.tdcommunity.net/index.php?dir=TD5x_specific/&file=MenuEnabledWhenBehaviour.zip | ||
+ | |TEXT=MenuEnabledWhenBehaviour.zip | ||
+ | }} |
Latest revision as of 09:46, 16 July 2013
TD 5.x and higher : user interface
Contents |
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 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!
MenuEnabledWhenBehaviour.zip