Dynamic Button
It may seem silly, but I like the image buttons used in the Personal WebSite with the commands written on top, such as “Add”, “Delete”, “Download Photo” etc. However, as the commands are in English, in a multi-language site, one would have to create those buttons for every supported language. Given that most sites also may use different themes (or imposed by the administrator or user-selectable), one must also create those buttons for each supported theme (Note: it seems like the button face consists of ordinairy text, but they need to be made with the use of a graphics program). Moreover, those of us that have been looking at sites, such as that of Jeremy Wadsworth (and have downloaded some stuff), have found additional buttons which, beside text, may also contain some icons. Thus, even a modest site can have a large number of image buttons in its inventory. On the otherhand, the AspNet Button and LinkButton provide the opportunity to use ordinairy text to be displayed on the button face, text that can be localized using resource files (see part 3). Wanting the presentation aspects of an ImageButton and the ease-of-use of a normal button, I decided to write one myself: the DynamicButton (included in my ArnoldusLib, which may be downloaded by registered users from the download section).
Environment
The current version of the DynamicButton has been designed with the PersonalWebSite in mind: It relies on the structure of the PWS (although it will work in any site that applies the same structure). Alternatively it should also function in a website that does not use themes and has one directory where images are kept: “~/Images/”. It also relies on a DataTable (Themes) that includes the themes used, and contains fields for the color values in which the text will appear: alpha, red green, blue. The theme-handling code is included in the download. Note: the DynamicButton expects that a “Connection String” has been defined (in the “Web.config” file) with the name: “name="Personal"”. Currently, only two themes are supported: White and Black, but it is very easy to use the DynamicButton also with other themes with a minimum amount of work (only a simple graphics program that handles .png files is required) to create the bases for the Buttons and the (optional) Icons (see below).
|