From b3f6e3691f6ec237a60cb8ebbc14b441f10d96d4 Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 27 Jan 2006 06:44:21 +0000 Subject: Added themes section in quickstart tutorial. --- .../quickstart/protected/pages/Advanced/I18N.page | 6 ++++ .../protected/pages/Advanced/Performance.page | 5 +++ .../protected/pages/Advanced/Themes.page | 37 ++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 demos/quickstart/protected/pages/Advanced/I18N.page create mode 100644 demos/quickstart/protected/pages/Advanced/Performance.page (limited to 'demos') diff --git a/demos/quickstart/protected/pages/Advanced/I18N.page b/demos/quickstart/protected/pages/Advanced/I18N.page new file mode 100644 index 00000000..e8b5282e --- /dev/null +++ b/demos/quickstart/protected/pages/Advanced/I18N.page @@ -0,0 +1,6 @@ + + +

Internationalization (I18N) and Localization (L10N)

+TBC + +
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Advanced/Performance.page b/demos/quickstart/protected/pages/Advanced/Performance.page new file mode 100644 index 00000000..d1c5a49c --- /dev/null +++ b/demos/quickstart/protected/pages/Advanced/Performance.page @@ -0,0 +1,5 @@ + + +

Performance Tuning

+ +
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Advanced/Themes.page b/demos/quickstart/protected/pages/Advanced/Themes.page index f640aa7d..40030bd5 100644 --- a/demos/quickstart/protected/pages/Advanced/Themes.page +++ b/demos/quickstart/protected/pages/Advanced/Themes.page @@ -2,5 +2,42 @@

Themes and Skins

+

Introduction

+

+Themes in Prado provide a way for developers to provide a consistent look-and-feel across an entire web application. A theme contains a list of initial values for properties of various control types. When applying a theme to a page, all controls on that page will receive the corresponding initial property values from the theme. This allows themes to interact with the rich property sets of the various PRADO controls, meaning that themes can be used to specify a large range of presentational properties that other theming methods (e.g. CSS) cannot. For example, themes could be used to specify the default page size of all data grids across an application by specifying a default value for the PageSize property of the TDataGrid control. +

+ +

Understanding Themes

+

+A theme is a directory consists of skin files, javascript files and CSS files. Any javascript or CSS files contained in a theme will be registered with the page that the theme is applied to. A skin is a set of initial property values for a particular control type. A control type may have one or several skins, each identified by a unqiue SkinID. When applying a theme to a page, a skin is applied to a control if the control type and the SkinID value both match to those of the skin. Note, if a skin has an empty SkinID value, it will apply to all controls of the particular type whose SkinID is not set or empty. A skin file consists of one or several skins, for one or several control types. A theme is the union of skins defined in all skin files. +

+ +

Using Themes

+

+To use a theme, you need to set the Theme property of the page with the theme name, which is the theme directory name. You may set it in either page configurations or in the constructor or onPreInit() method of the page. You cannot set the property after onPreInit() because by that time, child controls of the page are already created (skins must be applied to controls right after they are created.) +

+

+To use a particular skin in the theme for a control, set SkinID property of the control in template like following, +

+ +<com:TButton SkinID="Blue" ... /> + +

+This will apply the 'Blue' skin to the button. Note, the initial property values specified by the 'Blue' skin will overwrite any existing property values of the button. Use stylesheet theme if you do not want them to be overwritten. To use stylesheet theme, set the StyleSheetTheme property of the page instead of Theme (you can have both StyleSheetTheme and Theme). +

+

+To use the javascript files and CSS files contained in a theme, a THead control must be placed on the page template. This is because the theme will register those files with the page and THead is the right place to load those files. +

+ +

Creating Themes

+

+Creating a theme involves creating the theme directory and writing skin files (and possibly javascript and CSS files). All themes by default must be placed under the [WebAppEntryPath]/themes directory, where WebAppEntryPath refers to the directory containing the application entry script. If you want to use a different directory, configure the BasePath and BaseUrl properties of the System.Web.UI.TThemeManager module. +

+

+The format of skin files are the same as that of control template files. Since skin files do not define parent-child presentational relationship among controls, you cannot place a component tag within another. And any static texts between component tags are discarded. To define the aforementioned 'Blue' skin for TButton, write the following in a skin file, +

+ +<com:TButton SkinID="Blue" BackColor="blue" /> + \ No newline at end of file -- cgit v1.2.3