TD5x User Interface

From Team Developer SqlWindows Wiki
Revision as of 08:11, 30 September 2011 by Lrcuess (Talk | contribs)

Jump to: navigation, search

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

Contents


Pointer2.png RACON.SQLWindows.UserInterface - UI enhancement library Pointer.png

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:
RACON.SQLWindows.UserInterface Screenshot.jpg

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)
  • Progress Bar (UIProgressBar)
  • Property Grid (UIPropertyGrid) (preview)
  • Spin Control (UISpinControl
  • 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.



History:
Version 2.1

  • Supports: Unify Team Developer 5.1 SP 6, Unify Team Developer 5.2 SP 1&2 and Unify Team Developer 6.0 RTM
  • Fixed some compatibility issues for supporting TD 5.2 SP 2
  • Fixed some compatibility issues for supporting TD 6.0 RTM
  • Added UIProgressBar
  • Added UISpinControl
  • Modified sample application to show a more realistic Grid usecase

Version 2.0

  • Supports: Unify Team Developer 5.1 SP 6 and Unify Team Developer 5.2 SP 1
  • Fixed some compatibility issues for supporting TD 5.2 SP 1
  • Added UISalSubclassChildWindows

Version 1.8

  • Background Painting improved, so the MDI client area can be painted using the selected theme.
  • New functions for managing docking/floating Dialogs.
  • New functions for managing Child Grids.
  • New functions for managing the Status Bar.

Version 1.7

  • 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
  • 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.

Version 1.2

  • 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
  • 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.

Version 1.1

  • 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
  • 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.

Version 1.0

  • 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, 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!!!

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

Here are the files for the version 2.0:
RACON.SQLWindows.UserInterface 2.0

Here are the files for the version 2.1:
RACON.SQLWindows.UserInterface 2.1



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

Pointer2.png RACON.SQLWindows.UI.WindowTools - Window management component Pointer.png

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?
This component gives some improvement features! Feature list:

  • UISalMDIWindowsListShow
    Shows a list of open MDI windows and offers navigation.
  • UISalMDIWindowsTabBarCreate/UISalMDIWindowsTabBarDestroy
    Displays a tab bar on top of the MDI client area which allows tabbed window navigation.
  • UISalBackgroundSetImage
    Allows you to display a custom MDI background image and activates theme consistent MDI background painting.
  • UISalGetMDIClient
    Returns the window handle of the MDI client area.
  • UISalSubclassChildWindows
    Subclasses all child windows of a given parent window to ensure theme consistent painting.
  • UISalGetDockBarTop/...Left/...Right/...Bottom
    Returns the window handles of the docking areas.
  • UISalGetRibbonBar
    Returns the window handle of the ribbon bar.



Example: The following call activates the theme consistent drawing of the MDI client background.

Call UISalBackgroundSetImage(UISalGetMDIClient( hWndMDI ), 0 )

And this is how it looks like:
RACON.SQLWindows.UI.WindowTools.jpg

Here you can download the necessary files!
RACON.SQLWindows.UI.WindowTools.zip