References
LoadThemeFromFile
This function loads a theme from a file and returns the successor object of TTeTheme class in case if everything has passed successfully or nil if the theme cannot be loaded. LoadThemeFromFile can load all available for ThemeEngine themes, whether they are ThemeEngine or MS Visual Styles themes.
The name of the theme's file is transferred as a parameter, it must contain the full path and the extension to the file as 'c:\themes\xp_blue.mskn'. Besides, this function supports the alternative recording of the path the '\themes\xp_blue.mskn' kind, in that case the function will make the substitution of the path from which the application is run. For example, if your application is located in the 'c:\myprogram' catalogue, '\themes\xp_blue.mskn' will be transformed into 'c:\myprogram\themes\xp_blue.mskn'. In other words you won't have to calculate the full path to the theme every time.
The returned object can be used for the theme activization (ChangeTheme procedure), for the recording to another file (SaveThemeToFile procedure) or a stream (SaveThemeToStream procedure) or otherwise.
More preferable method of theme loading is the use of the TTeThemeEngine component and ThemeFile properties.
SaveThemeToFile
Procedure saves the theme into a file.
LoadThemeFromStream
Function LoadThemeFromStream loads the previous recorded theme from the stream with the help of the SaveThemeToStream function. If the theme will be loaded successfully and will return the successor object of the TTeTheme class you can use it for the activation of the theme.
SaveThemeToStream
It's a theme-to-stream saving procedure for the further reading by the LoadThemeFromFile procedure.
ChangeTheme
This procedure changes the active theme to the given one and initiates the updating process of all the components and forms. The user does not have to look after the correct updating of the application.
The follow items can be used as parameters:
- a class, only for the built-in themes (TTeFlat)
- the theme name, only for the built-in ones ('Flat')
- the class of the successor object from TTeTheme
The theme transferred as a parameter cannot be deleted from the memory, the ThemeEngine will automatically remove it at the end of the application or at the next change of the active theme.
ReleaseTheme
This function unloads the active theme from the memory and initiates the process of the application updating. When the process is over ThemeEngine goes into the NoTheme mode.
RepaintThemedControls
The Function forces all the theme supporting components to repaint themselves.
GetDialogFilter
This function returns the line which you can use for the installation of the Filter property of the TOpenDialog, TSaveDialog component. This line will contain all theme types available for reading.
IsThemeAvailable
The function checks the theme availability. If the returned value is true, this theme can be used. Otherwise the reference to this object can call AV. Usually this function is used with the CurrentTheme parameter.
DrawControlBackground
The function correctly traces the background of the control element if it has transparent places. Use this function to guarantee compatibility with control elements and the forms of ThemeEngine.
TTeThemeEngine
It is the basic theme-operating component. It used for loading, switching-over, disconnecting, changing of the brightness and the contrast of a theme. The TTeThemeEngine component is necessary only in one copy for all applications, you can put it on the main form or the TDataModule form. At the same time it is possible to use only one of the ThemeBuilding, ThemeFile or ThemeIndex property for switching-over. Using TTeThemeEngine both in the performing and in the designing modes you can:
- load themes from files, streams or the TTeThemeList object
- switch themes on the built-in ones or disconnect themes in general
- change the brightness or/and the contrast of the active theme
- process events at the change of the current theme
TTeThemeEngine.ThemeBuilding
String property switching-over the built-in themes. In the designing mode it shows all available built-in themes in the dropdown list. In the performing mode the assignment of the value by the text line such as string is possible.
TTeThemeEngine.ThemeFile
Specifies a file of the theme which will be immediately loaded or be loaded at the start of the application. The filename must be specified with the extension.
TTeThemeEngine.ThemeIndex
Contains the theme number from the TTeThemeList object which will be immediately activezed or loaded at the start of the application. The ThemeList property must be set, and the TTeThemeList component must contain at least one theme, otherwise at the change of this property it is automatically set as -1.
TTeThemeEngine.ThemeList
Specifies the TTeThemeList component used for loading of the theme and switching-over by changing ThemeIndex property.
TTeThemeEngine.DeltaHue
Property sets the values of changing of the theme contrast. Using the DeltaHue and the DeltaBrightness properties it is possible to receive many various themes from one source. The values can be from 0 up to 255. The changing of the property results in the immediate changes of the theme and repainting of all its components. If at loading of the theme its values are not equal to the default values, the changes are made with the loaded theme.
TTeThemeEngine.DeltaBrightness
The property sets the values of change of theme brightness. Using the DeltaHue and the DeltaBrightness properties it is possible to receive many of various themes from one source. The values can be from-50 up to +50. The changing of the property results in the immediate changes of the theme and repainting of all its components. If at loading of the theme its values are not equal to the default values, the changes are made with the loaded theme.
TTeThemeEngine.OnThemeChanged
The event is caused at the activation of the theme, the changing of the active theme, switching off the themes.
TTeThemeList
The component is used for the theme's storage in the form file. It can store any themes and contain any number of them. It is shared with the TTeThemeEngine and the TTeThemeLink components and the ThemeList and the ThemeIndex properties.
TTeThemeList.Themes
It is the subproperty for the convenient access to the themes in the designing mode.
TTeThemeStream
The collection element is used by the TTeThemeList component for the theme storage and its modification in the designing mode. This class is necessary for the convenient editing in the designing mode.
TTeThemeStream.ThemeStore
It is the subproperty which provides an access to the theme in the designing mode. Do not use this property in the performance mode.
TTeThemeLink
The component allows to use several themes in one application. Some visual ThemeEngine components have the ThemeLink property, and it is possible to make this object to use not the general theme but the one stored in the TTeThemeLink object by setting this property into the TTeThemeLink object. This component contains the properties similar to the TTeThemeEngine component.
TTeThemeLink.ThemeBuilding
String property switching-over the built-in themes. In the designing mode it shows all available built-in themes in the dropdown list. In the performing mode the assignment of the value by the text line such as string is possible.
TTeThemeLink.ThemeFile
Specifies a file of the theme which will be immediately loaded or be loaded at the start of the application. The filename must be specified with the extension.
TTeThemeLink.ThemeIndex
Contains the theme number from the TTeThemeList object which will be immediately activezed or loaded at the start of the application. The ThemeList property must be set, and the TTeThemeList component must contain at least one theme, otherwise at the change of this property it is automatically set as -1.
TTeThemeLink.ThemeList
Specifies the TTeThemeList component used for loading of the theme and switching-over by changing ThemeIndex property.
TTeManager
The component allows to set your own font scheme replacing the active theme font scheme. All the settings of the component are made in the designing mode of with the help of the Fonts property editor.
You can set both your own values for all the elements of the theme, and optionally only for the necessary ones by checking the boxes in the Manager list.
TTeManager.FontChangeOptions
Having set the values of this property it is possible to allow/forbid to change any of the font metrics, such as the font name, the size, the color, the style, etc. For example, if you want only the color of the font to be changed set the fcoChangeFontColor value true and other parameters - false. The values of this property is also possible to set in the editor of the Change Options group properties.
TTeAdapter
This component allows you to adapt the components which do not support ThemeEngine. The adaptation takes place by the automatic change of various properties of the TColor type components considering the active theme. The component setting is carried out only in the designing mode with the help of the component editor.
You can choose any component you want to adapt in the editor. When choosing the component the list of properties which you can be used for adaptation will show. After choosing the adapted property press the "Add to Adapter" button, and the new element will appear in the list. For each of these elements you can put in the color from the "Theme colors" list accordingly. This list is filled at loading the theme.
If you have set everything correctly, TTeAdapter will automatically change the adjusted properties of the components not supporting ThemeEngine at changing of the active theme.
TTeThemeSwitcher
TTeThemeSwitcher is a convenient visual component, such as the drop-down list, which allows the user to change themes in performance mode. It is enough to put this component on the form and to set the required properties and your application user can easily change or switch off the themes, using intuitively understandable interface.
TTeThemeSwitcher.ShowBrowse
It allows/forbids to show the BROWSE element, which opens the dialog box of the theme choice.
TTeThemeSwitcher.ShowNoTheme
It allows/forbids to show the NOTHEME element, which switches-off themes.
TTeThemeSwitcher.ShowSeparator
It allows/forbids to show strips-separators in the drop-down list.
TTeThemeSwitcher.TextBrowse
It is the text which will be displayed in the BROWSE element.
TTeThemeSwitcher.TextNoTheme
It is the text which will be displayed in the NOTHEME element.
TTeThemeSwitcher.ThemeEngine
The link to the TTeThemeEngine component is required for TTeThemeSwitcher to be able to use the theme collection from the TTeThemeEngine.ThemeList component.
TTeThemePreview
This component can make and display a little screenshot of the theme. You can use it as the realization of the theme's preview before its loading.
TTeThemePreview.ThemeLink
The component makes the screenshot of the loaded theme into the component to which this property refers. You can make screenshots of various themes by updating the TteThemeLink component.
TTeMessage
This component realizes the messages boxes mechanism. It contains the analogues of standard procedures such as: MessageDlg, ShowMessage, InputQuery.
TTeMessage.ShowButtonGlyph
Forbids/allows to show button's icons.
TTeMessage.ShowHints
Forbids/allows floating hints.
TTeMessage.ShowIconImage
Forbids/allows system icons in messages.
TTeMessage.MessageDlg
This method is the analogue of the standard function from the Dialogs.pas module. All the parameters are according to the standard, you can read the detailed information in the Borland's documentation.
TTeMessage.MessageDlgPos
This method is the analogue of the standard function from the Dialogs.pas module. All the parameters are according to the standard, you can read the detailed information in the Borland's documentation.
TTeMessage.MessageDlgPosHelp
This method is the analogue of the standard function from the Dialogs.pas module. All the parameters are according to the standard, you can read the detailed information in the Borland's documentation.
TTeMessage.ShowMessage
This method is the analogue of the standard function from the Dialogs.pas module. All the parameters are according to the standard, you can read the detailed information in the Borland's documentation.
TTeMessage.ShowMessagePos
This method is the analogue of the standard function from the Dialogs.pas module. All the parameters are according to the standard, you can read the detailed information in the Borland's documentation.
TTeMessage.ShowMessageFmt
This method is the analogue of the standard function from the Dialogs.pas module. All the parameters are according to the standard, you can read the detailed information in the Borland's documentation.
TTeMessage.InputBox
This method is the analogue of the standard function from the Dialogs.pas module. All the parameters are according to the standard, you can read the detailed information in the Borland's documentation.
TTeMessage.InputQuery
This method is the analogue of the standard function from the Dialogs.pas module. All the parameters are according to the standard, you can read the detailed information in the Borland's documentation.
TTeDefaultForm
This component adds support of the themes and the additional properties to any form (except the child MDI window). The TTeForm component is necessary for each form of your application. For the child MDI windows it is necessary to use the TTeMDIChild component.
TTeDefaultForm.Active
The internal ThemeEngine property is necessary for the activization of the form messages interception. If there is no necessity do not change this property.
TTeDefaultForm.Animation
This property does animation adjustment within the form show. You can switch on/off animation, set the time in milliseconds, and choose one of more than 70 effects.
TTeDefaultForm.Blending
ThemeEngine supports transparent forms in any Windows versions. The blending property allows to switch on transparency, and to adjust intensity. Since transparency in ThemeEngine is realized with the help of our own algorithms they have some restrictions in the comparison with Windows 2k, XP a transparency, but it works much faster on all Windows versions. We recommend to use transparency only in small-sized modal forms, such as MessageBox.
TTeDefaultForm.BorderIcons
The property is similar to the standard one of the TForm class, but it has additional values. Use this property instead of the TForm.BorderIcons to avoid any conflict situations. The following properties are additional:
kbiRollup - points out whether to show or not the additional system button in the headline, minimizing the form into a small strip.
kbiTray - points out whether to show or not the additional system button in the headline, allowing to minimize the form in the system tray.
TTeDefaultForm.BorderStyle
The property is similar to the standard one of the TForm class. Use this property instead of the TForm.BorderStyle to avoid conflict situations.
TTeDefaultForm.Dragging
This property allows to forbid/allow the user to change the size and to move the form over the screen. The additional DragMode property sets the way the form will move.
DragMode can possess the following values:
- kfdmFullDrag - the form changes alongside with its contents
- kfdmBorder - during moving or changing the size instead of the form the rectangular with thin borders is displayed.
TTeDefaultForm.Gravitation
This property allows to switch on/off and adjust gravitation, in other words the property of the form to stick to the edges of the screen.
TTeDefaultForm.MenuBar
The link to the TTeMenuBar component is necessary for the correct processing of shortkeys and the correct activation of the menu. ThemeEngine tries to set this property automatically but if there is TTeMenuBar component on the form and the MenuBar property is empty, set it manually.
TTeDefaultForm.MinimizeApplication
If the value is true the application will be minimized by pressing the minimize-button, otherwise only the form will be minimized.
TTeDefaultForm.Performance
This property operates the form buffering. It can possess the following values:
- ksfpNoBuffer - the form does not use any buffers. It has the most preferable value and the default value. The Buffering was widely used in ThemeEngine 2.x, but now ThemeEngine has well optimized code which allows to do without buffering. But if necessary you can use buffering as many times as you need.
- ksfpDoubleBuffer - the temporary buffer is created and is destroyed if necessary, basically for very short time intervals. It allows to use the memory more effectively, but it takes a lot of processor's time to create and destroy the buffer.
- ksfpPersitentBuffer - is the same as ksfpDoubleBuffer, except that the buffer is created once and is used all the time. ksfpDoubleBuffer is much faster, but it spends many system resources on the constant buffer maintenance.
- ksfpSharedBuffer - using this type of buffering, ThemeEngine creates one buffer of screen-size for the whole application. It is faster than both of the previous types of buffering, but it is necessary to create a screen-size buffer. Use this type of buffering if buffering is necessary for you, and your application has many forms.
TTeDefaultForm.Shadow
Switches on/off the effect of a dropped shadow by a window. We recommend to use this effect only in small-size modal forms, such as MessageBox.
TTeDefaultForm.SystemMenuOptions
The system menu form's settings.
TTeDefaultForm.TrayMenuLink
It is the link to the TteThemeLink component. Usually TTeForm uses the general theme, this property allows to use your own theme for the given form.
TTeDefaultForm.TrayMenuOptions
It is the link to the TPopupMenu component or its successor TTePopupMenu. This menu will be shown when the application is minimized in the tray.
TTeDefaultForm.WindowMenu
This property is similar to the standard one of the TForm class. It is used in MDI applications.
TTeDefaultForm.WindowState
It shows and changes the form state. It can possess the following values:
- kwsNormal - the form in the normal state
- kwsMaximized - the form is maximized
- kwsMinimized - the form is minimized
- kwsTray - the form is minimized in the tray
- kwsRollup - the form is minimized in headline
TTeForm
This component adds support of the themes and the additional properties to any form (except the child MDI window). The TTeForm component is necessary for each form of your application. For the child MDI windows it is necessary to use the TTeMDIChild component.
TTeForm.ThemeLink
It is the link to the TteThemeLink component. Usually TTeForm uses the general theme, this property allows to use your own theme for the given form.
TTeForm.ThemeObject
It sets a name of an object from the theme which will be used by this form (for example, it is possible to use the non-standard form for your AboutBox). Use this value only in case you use your own or modified themes in which there is an object with the name set in the ThemeObject property. If this theme doesn't contain such object, TTeForm uses the default object.
TTeMDIChild
This component is used as TTeForm, but only for child MDI windows. Look for detailed information on its use in TTeForm section.