TD5x User Interface
This page covers miscellaneous TD 5.x User Interface tips & tricks.
RACON.SQLWindows.UserInterface - UI enhancement library
With Team Developer 5.1, Unify introduced the new user interface drawing engine Prof-UIS which provides a nice way to support multiple themes and introduces some very useful new controls.
Some of them already got introduced into Team Developer.
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.
You can see a screenshot of the sample application here:
Heres a list of available controls:
- Button and Hyper Link Button (UIButton)
- Combo Box (UIComboBox) (just a try)
- Datafield (UIEdit)
- Group Box (UIGroupBox)
- Background Text (UILabel)
- Message Box (UIMessage) (still first implementation, to be enhanced)
- Page Container (UIPageContainer) (preview)
- Page Navigator (UIPageNavigator) (implemented lots of functions, management classes to be enhanced)
- Paint Manager (UIPaintManager) (just a try)
- Property Grid (UIPropertyGrid) (preview)
- Tab Bar (UITabBar) (classes for handling still missing)
- Theme Switcher Bar (first implementation, to be enhanced)
- Window Tools (UIWindowTools) (may be enhanced)
- And some additional features like Resizing, Popup Tip Window, MDI Background Image or MDI Windows Tab Bar.
- New functions for managing the Page Navigator control
- New functions for managing the Hyper Link Button control
- New functions for managing Popup Tip Windows
- New functions for displaying a Tab Bar showing the open MDI's
- Improved anchor (resizing) performance
- Fix of the required CRT to meet TD 5.1 SP 6 requirements
- UISalPaintManagerGetColor doesn't need a window handle any more
- New functions for managing anchors (resizing)
- New function for displaying background images
- New paint manager functions
- Preview of Hyper Link Button control
- Preview of Page Container control
- Fix of a missing calling convention specification.
- New functions for controling labels (Background Texts).
- New (simple) support for adding a Theme Switcher Bar
- New support for themed message boxes
- Splitting into multiple APLs, each for one control.
- Renaming the functions to UISal...
- Enhanced sample application using M!Image
- Preview of Page Navigator control
- Preview of Property Grid control
- Creation of the module with it's basic functionality.
- 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.
This library is meant to be an enhancement to Team Developer until the features are available there.
After all of the features are - hopefully - available through Sal-functions, this module will go away.
PLEASE NOTE, THAT THE FUNCTIONS INSIDE THE MODULE ARE FULLY EXPERIMENTAL AND CURRENTLY ONLY TESTED AGAINST TEAM DEVELOPER 5.1 SERVICE PACK 6. YOU MAY USE IT IN YOUR APPLICATIONS FOR FREE, BUT EXTENSIVE TESTING IN YOUR ENVIRONMENT IS ABSOLUTELY NECESSARY!!!
You can get the files here:
RACON.SQLWindows.UserInterface (DLL and APLs of the library) 1.7
RACON.SQLWindows.UserInterface (Sample application source) 1.7
RACON.SQLWindows.UserInterface (Images used in the sample) 1.7
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 my 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!
(Dave, please paste the link here! Thanks!)