Difference between revisions of "TD5x User Interface"

From Team Developer SqlWindows Wiki
Jump to: navigation, search
(Added the description for RACON.SQLWindows.UI.ResourceManager-component.)
m (Moved RACON articles to their own page)
Line 1: Line 1:
'''This page covers miscellaneous TD 5.x User Interface tips & tricks.'''
+
'''This page covers miscellaneous TD 5.x/6.x User Interface tips & tricks.'''
  
 
__TOC__
 
__TOC__
 
<br>
 
<br>
 
<!------------------------------------------------------------------------------------------------------------------------------>
 
{{TipHeader|RACON.SQLWindows.UserInterface - UI enhancement library}}
 
With Team Developer 5.1, Unify introduced the new user interface drawing engine [http://www.prof-uis.com/ Prof-UIS] which provides a nice way to support multiple themes and introduces some very useful new controls.<br/>
 
Some of them already got introduced into Team Developer.<br/>
 
As some of the controls completely, and some features of existing controls are missing, I decided to implement this module.
 
This gives the possibility to developers, to use the features before Team Developer has them.<br/>
 
<br/>
 
You can see a screenshot of the sample application here:<br/>
 
[[Image:RACON.SQLWindows.UserInterface_Screenshot.jpg]]
 
<br/><br/>
 
<u>Heres a list of available controls:</u><br/>
 
<ul>
 
<li>Button and Hyper Link Button (UIButton)</li>
 
<li>Combo Box (UIComboBox) (just a try)
 
<li>Datafield (UIEdit)</li>
 
<li>Group Box (UIGroupBox)</li>
 
<li>Background Text (UILabel)</li>
 
<li>Message Box (UIMessage) (still first implementation, to be enhanced)</li>
 
<li>Page Container (UIPageContainer) (preview)</li>
 
<li>Page Navigator (UIPageNavigator) (implemented lots of functions, management classes to be enhanced)</li>
 
<li>Paint Manager (UIPaintManager) (just a try)</li>
 
<li>Progress Bar (UIProgressBar)</li>
 
<li>Property Grid (UIPropertyGrid) (preview)</li>
 
<li>Spin Control (UISpinControl</li>
 
<li>Tab Bar (UITabBar) (classes for handling still missing)</li>
 
<li>Theme Switcher Bar (first implementation, to be enhanced)</li>
 
<li>Window Tools (UIWindowTools) (may be enhanced)</li>
 
<li>And some additional features like Resizing, Popup Tip Window, MDI Background Image or MDI Windows Tab Bar.</li>
 
</ul>
 
<br/><br/>
 
<b><u>History:</u></b><br/>
 
<u>Version 2.1</u>
 
<ul>
 
<li>Supports: Unify Team Developer 5.1 SP 6, Unify Team Developer 5.2 SP 1&2 and Unify Team Developer 6.0 RTM</li>
 
<li>Fixed some compatibility issues for supporting TD 5.2 SP 2</li>
 
<li>Fixed some compatibility issues for supporting TD 6.0 RTM</li>
 
<li>Added UIProgressBar</li>
 
<li>Added UISpinControl</li>
 
<li>Modified sample application to show a more realistic Grid usecase</li>
 
</ul>
 
<u>Version 2.0</u>
 
<ul>
 
<li>Supports: Unify Team Developer 5.1 SP 6 and Unify Team Developer 5.2 SP 1</li>
 
<li>Fixed some compatibility issues for supporting TD 5.2 SP 1</li>
 
<li>Added UISalSubclassChildWindows</li>
 
</ul>
 
<u>Version 1.8</u>
 
<ul>
 
<li>Background Painting improved, so the MDI client area can be painted using the selected theme.</li>
 
<li>New functions for managing docking/floating Dialogs.</li>
 
<li>New functions for managing Child Grids.</li>
 
<li>New functions for managing the Status Bar.</li>
 
</ul>
 
<u>Version 1.7</u>
 
<ul>
 
<li>New functions for managing the Page Navigator control</li>
 
<li>New functions for managing the Hyper Link Button control</li>
 
<li>New functions for managing Popup Tip Windows</li>
 
<li>New functions for displaying a Tab Bar showing the open MDI's</li>
 
<li>Improved anchor (resizing) performance</li>
 
<li>I got support of Unify while building this version to be able to call the newest UI functions. But this implies, that the version needs SP6 to work. Using any other version of Team Developer may break the functionality of this module.</li>
 
</ul>
 
<u>Version 1.2</u>
 
<ul>
 
<li>Fix of the required CRT to meet TD 5.1 SP 6 requirements</li>
 
<li>UISalPaintManagerGetColor doesn't need a window handle any more</li>
 
<li>New functions for managing anchors (resizing)</li>
 
<li>New function for displaying background images</li>
 
<li>New paint manager functions</li>
 
<li>Preview of Hyper Link Button control</li>
 
<li>Preview of Page Container control</li>
 
<li>I got support of Unify while building this version to be able to call the newest UI functions. But this implies, that the version needs SP6 to work. Using any other version of Team Developer may break the functionality of this module.</li>
 
</ul>
 
<u>Version 1.1</u>
 
<ul>
 
<li>Fix of a missing calling convention specification.</li>
 
<li>New functions for controling labels (Background Texts).</li>
 
<li>New (simple) support for adding a Theme Switcher Bar</li>
 
<li>New support for themed message boxes</li>
 
<li>Splitting into multiple APLs, each for one control.</li>
 
<li>Renaming the functions to UISal...</li>
 
<li>Enhanced sample application using M!Image</li>
 
<li>Preview of Page Navigator control</li>
 
<li>Preview of Property Grid control</li>
 
<li>I got support of Unify while building this version to be able to call the newest UI functions. But this implies, that the version needs SP6 to work. Using any other version of Team Developer may break the functionality of this module.</li>
 
</ul>
 
<u>Version 1.0</u>
 
<ul>
 
<li>Creation of the module with it's basic functionality.</li>
 
<li>This version is built with Team Developer 5.1 SP 5. Using any other version of Team Developer may break the functionality of this module.</li>
 
</ul> 
 
<br/><br/>
 
This library is meant to be an enhancement to Team Developer until the features are available there.<br/>
 
After all of the features are - hopefully - available through Sal-functions, this module will go away.<br/>
 
<br/><br/>
 
<font color="#ff0000"><b>PLEASE NOTE, THAT THE FUNCTIONS INSIDE THE MODULE ARE FULLY EXPERIMENTAL AND CURRENTLY ONLY TESTED AGAINST TEAM DEVELOPER 5.1 SERVICE PACK 6, TEAM DEVELOPER 5.2 SERVICE PACK 1&2 AND TEAM DEVELOPER 6.0 RTM. YOU MAY USE IT IN YOUR APPLICATIONS FOR FREE, BUT EXTENSIVE TESTING IN YOUR ENVIRONMENT IS ABSOLUTELY NECESSARY!!!</b></font>
 
<br/><br/>
 
You can get the files here:<br/>
 
[http://samples.tdcommunity.net/index.php?dir=TD5x_specific/&file=RACON.SQLWindows.UserInterface.Library.zip RACON.SQLWindows.UserInterface (DLL and APLs of the library) 1.7]<br/>
 
[http://samples.tdcommunity.net/index.php?dir=TD5x_specific/&file=RACON.SQLWindows.UserInterface.Sample.zip RACON.SQLWindows.UserInterface (Sample application source) 1.7]<br/>
 
[http://samples.tdcommunity.net/index.php?dir=TD5x_specific/&file=RACON.SQLWindows.UserInterface.Sample.Resources.zip RACON.SQLWindows.UserInterface (Images used in the sample) 1.7]<br>
 
<br>
 
Here are the files for the version 2.0:<br>
 
[http://samples.tdcommunity.net/index.php?dir=TD5x_specific/&file=RACON.SQLWindows.UserInterface%202.0.zip RACON.SQLWindows.UserInterface 2.0]<br>
 
<br>
 
Here are the files for the version 2.1:<br>
 
[http://samples.tdcommunity.net/index.php?dir=TD5x_specific/&file=RACON.SQLWindows.UserInterface%202.1.zip RACON.SQLWindows.UserInterface 2.1]<br>
 
 
<br><br>
 
  
 
<!------------------------------------------------------------------------------------------------------------------------------>
 
<!------------------------------------------------------------------------------------------------------------------------------>
Line 124: Line 14:
 
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/>
 +
<br>
 
[[Image:MenuEnabledWhenBehaviourMenu.jpg]]
 
[[Image:MenuEnabledWhenBehaviourMenu.jpg]]
<br/>
+
<br>
But if you use the Ribbon Bar, they get evaluated MUCH MUCH MUCH MORE OFTEN!<br/>
+
<br>
 +
But if you use the Ribbon Bar, they get evaluated MUCH MUCH MUCH MORE OFTEN!<br>
 +
<br>
 
[[Image:MenuEnabledWhenBehaviourRibbon.jpg]]
 
[[Image:MenuEnabledWhenBehaviourRibbon.jpg]]
<br/>
+
<br>
So my advice is: <b>Don't use expensive expressions to control your menu behaviour!</b><br/>
+
<br>
This could really decrease your applications performance a lot!<br/>
+
So the advice is: <b>Don't use expensive expressions to control your menu behaviour!</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>
 +
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.<br/>
 
You'll also face debugging issues, as the execution will step into your Enabled When evaluation functions (if any), during debug.<br/>
 
<br/>
 
<br/>
 
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/>
 
[http://samples.tdcommunity.net/index.php?dir=TD5x_specific/&file=MenuEnabledWhenBehaviour.zip MenuEnabledWhenBehaviour.zip]<br>
 
[http://samples.tdcommunity.net/index.php?dir=TD5x_specific/&file=MenuEnabledWhenBehaviour.zip MenuEnabledWhenBehaviour.zip]<br>
 
<!------------------------------------------------------------------------------------------------------------------------------>
 
{{TipHeader|RACON.SQLWindows.UI.WindowTools - Window management component}}
 
Sometimes you just need some special window handles or you want to add some useful features to your application.
 
But why should you implement everything from scratch, if it's already there?
 
<br/>
 
This component gives some improvement features!
 
<br/><br/>
 
<u>Feature list:</u>
 
<ul>
 
<li><b>UISalMDIWindowsListShow</b><br/>Shows a list of open MDI windows and offers navigation.</li>
 
<li><b>UISalMDIWindowsTabBarCreate/UISalMDIWindowsTabBarDestroy</b><br/>Displays a tab bar on top of the MDI client area which allows tabbed window navigation.</li>
 
<li><b>UISalBackgroundSetImage</b><br/>Allows you to display a custom MDI background image and activates theme consistent MDI background painting.</li>
 
<li><b>UISalGetMDIClient</b><br/>Returns the window handle of the MDI client area.</li>
 
<li><b>UISalSubclassChildWindows</b><br/>Subclasses all child windows of a given parent window to ensure theme consistent painting.</li>
 
<li><b>UISalGetDockBarTop/...Left/...Right/...Bottom</b><br/>Returns the window handles of the docking areas.</li>
 
<li><b>UISalGetRibbonBar</b><br/>Returns the window handle of the ribbon bar.</li>
 
</ul>
 
<br/><br/>
 
<u>Example:</u><br/>
 
The following call activates the theme consistent drawing of the MDI client background.<br/><br/>
 
<pre>
 
Call UISalBackgroundSetImage( UISalGetMDIClient( hWndMDI ), 0 )
 
</pre>
 
<br/>
 
And this is how it looks like:<br/>
 
[[Image:RACON.SQLWindows.UI.WindowTools.jpg]]
 
<br/>
 
<br/>
 
Here you can download the necessary files!<br/>
 
[http://samples.tdcommunity.net/index.php?dir=TD5x_specific/&file=RACON.SQLWindows.UI.WindowTools.zip RACON.SQLWindows.UI.WindowTools.zip]<br>
 
 
<!------------------------------------------------------------------------------------------------------------------------------>
 
{{TipHeader|RACON.SQLWindows.UI.ResourceManager - Control the resource manager}}
 
Currently, this component has just one function, but this function may help you very much!
 
Consider your application has an English UI but if the user runs it on a German Windows, some built in menus are localized.
 
TD's UI library - Prof UI - uses a Resource Manager to display strings and menus based on the Windows locale.
 
But this Resource Manager has a function to override the system setting and specify another language.
 
This is what this component gives to you!
 
<br/><br/>
 
<u>Feature list:</u>
 
<ul>
 
<li><b>UISalResourceManagerSetDesiredLangId</b><br/>Override the language used by the Resource Manager.</li>
 
</ul>
 
<br/><br/>
 
<u>Example:</u><br/>
 
My system runs with German locale, but this call changes the Resource Manager language to French!<br/><br/>
 
<pre>
 
Call UISalResourceManagerSetDesiredLangId( UISalResourceManagerLanguages.French, TRUE )
 
</pre>
 
<br/>
 
And this is how it looks like:<br/>
 
[[Image:RACON.SQLWindows.UI.ResourceManager.jpg]]
 
<br/>
 
<br/>
 
Here you can download the necessary files!<br/>
 
[http://samples.tdcommunity.net/index.php?dir=TD5x_specific/&file=RACON.SQLWindows.UI.ResourceManager.zip RACON.SQLWindows.UI.ResourceManager.zip]<br>
 

Revision as of 11:53, 9 November 2012

This page covers miscellaneous TD 5.x/6.x User Interface tips & tricks.

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 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!
MenuEnabledWhenBehaviour.zip