PRODUCTS » Quick Links

FEATURED PRODUCT

The most powerful, fastest & flexible suite for native Excel file manipulation and Excel,PDF,HTML report generation for .NET

License only 125 EUR See More

LOGIN

Customer login to access products, support information & special benefits.

SEARCH

STAY IN TOUCH

Add your e-mail address here to receive the monthly TMS Software alerts.

 

LINKS

Using the TMS form-wide or application-wide styler components

Over the past couple of years, appearances as these from Windows XP, Office 2003, Visual Studio .NET and now Office 2007/2010 have set standards for how an application should look. The techniques for defining the appearance of controls have also become more complex. Before Windows XP, controls were generally flat with single colors for normal state, hover state, checked or down state...  With Windows XP, Office 2003, simple gradients for the different control states have become the norm. Now with Office 2007/2010, appearance control has become yet more complex. Controls can now have multiple radial/linear gradients and have subtle transitioning of appearance from state to state. To be able to have full control & flexibility over the appearance of controls, the number of properties has been steadily increasing over the years.

At TMS software we have always tried and keep trying to provide components with the latest look & feel as well as keeping backwards compatibility. We want to enable you to create applications with a brand new appearance and simultaneously do not want to break the look & feel of applications that were created perhaps years ago when installing new updates of the components. As the requirements for appearance control have evolved over the years, so have the properties to control look and feel of the TMS components. It has not always been easy to apply new appearance types to existing controls that were originally not designed for more complex appearances. This has caused that various components have sometimes different ways to control the latest and greatest appearance, let alone to synchronously change appearance of multiple controls to a new consistent style.

We have spent quite some effort to simplify form-wide and application-wide appearance control for TMS components and possibly also your custom controls. To do this, two new components have been designed:

TAdvFormStyler
TAdvAppStyler

A TAdvFormStyler is supposed to be dropped on a form. In a way, it will control just like TXPManifest the style of the TMS controls on the form. A TAdvFormStyler will only affect controls on the form itself. For application-wide appearance control, in addition to a TAdvFormStyler on a form, a TAdvAppStyler component can be dropped on a datamodule and is connected to the TAdvFormStyler components on the forms. By setting then a single property in TAdvAppStyler on the datamodule, the complete application appearance can change, both at design time but also dynamically at runtime.

Scenario

The component TAdvFormStyler has a property style. Setting this style property causes all components on the form that support the interface to set the style to change to the selected style.
Similary, setting the style property for the TAdvAppStyler on a central datamodule invokes all TAdvFormStyler style changes and thus the style of all TMS controls on the form.
Currently the TAdvFormStyler, TAdvAppStyler support following styles:

tsOffice2003Blue : Office 2003 style on a blue XP theme
tsOffice2003Silver : Office 2003 style on a silver XP theme
tsOffice2003Olive : Office 2003 style on an olive XP theme
tsOffice2003Classic : Office 2003 style on a non themed XP or pre XP operating system
tsOffice2007Luna : Office 2007 Luna style
tsOffice2007Obsidian : Office 2007 Obsidian style
tsWindowsXP : Windows XP / Office XP style
tsWhidbey : Visual Studio 2005 style
tsCustom : unforced style
tsOffice2010Blue : Office 2010 Blue style
tsOffice2010Silver : Office 2010 Silver style
tsOffice2010Black : Office 2010 Black style

Following TMS controls are currently TAdvFormStyler, TAdvAppStyler aware:

TAdvAlertWindow
TAdvCardList
TAdvDockPanel
TAdvMainMenu & TAdvPopupMenu (via TAdvMenuStyler)
TAdvMemo
TAdvNavBar
TAdvOfficePager (via TAdvOfficePagerOfficeStyle)
TAdvOutlookList
TAdvPanel (via TAdvPanelStyler)
TAdvStringGrid & descending controls
TAdvToolBar (via TAdvToolBarStyler)
TAdvToolBarPager (via TAdvToolBarStyler)
TAdvToolButton & TAdvRepeatButton
TAdvToolPanel, TAdvToolPanelTab
TInspectorBar & descending controls
TPlanner & descending controls
TPlannerCalendar
TPlannerDatePicker
TPlannerMonthView
TTodoList & descending controls

TAdvSmoothButton
TAdvSmoothCalculator
TAdvSmoothCalendar
TAdvSmoothComboBox
TAdvSmoothDatePicker
TAdvSmoothDock
TAdvSmoothExpanderButtonPanel
TAdvSmoothExpanderGroup
TAdvSmoothGauge
TAdvSmoothImageListBox
TAdvSmoothListbox
TAdvSmoothMegaMenu
TAdvSmoothMenu
TAdvSmoothMessageDialog
TAdvSmoothPanel
TAdvSmoothProgressBar
TAdvSmoothScrollBar
TAdvSmoothSlider
TAdvSmoothSpinner
TAdvSmoothSplashScreen
TAdvSmoothTabPager
TAdvSmoothTimeLine
TAdvSmoothToggleButton
TAdvSmoothTrackBar

You can make your own controls also easily TAdvFormStyler, TAdvAppStyler aware so that your controls also automatically change their appearance when the application and/or form style changes. To do this, it is sufficient to add and implement the ITMSStyle interface to your control. This code snippet shows a sample custom control that was made TMS style aware:

interface

uses
  Classes, TAdvStyleIF;
type
  TMyCustomControl = class(TCustomControl, ITMSStyle)
  public
    procedure SetComponentStyle(AStyle: TTMSStyle);
  end;

{ TMyCustomControl }

procedure TMyCustomControl.SetComponentStyle(AStyle: TTMSStyle);
begin
  case AStyle of
  tsOffice2003Blue: // set properties correct here for the selected style
  tsOffice2003Silver:
  tsOffice2003Olive:
  tsOffice2003Classic:
  tsOffice2007Luna:
  tsOffice2007Obsidian:
  tsWindowsXP:
  tsWhidbey:
  tsCustom:
  tsOffice2010Blue:
  tsOffice2010Silver:
  tsOffice2010Black:
  end;
end;

We hope these new style control components will simplify & accelerate the programmers job to create a consistent user interface and make it easier than ever to switch your complete application appearance by setting a single property.

Copyright © 1995 - 2010 TMS Software v3.3