How to manage 3D control templates
The definition of "3D control template" is very simple: a collection of settings, stored inside a file with .3BT extension, that will be applied to the control all at once. The use of 3D control templates can simplify the support for skinned applications.
Let's create and use our first button template at Design-time:
After having edited the button properties as needed, click with your mouse right button the control surface and, from the context menu, select the "Save settings in Normal template..." item as displayed below:
Browse a directory in which you can store the 3D control template and assign it a name, then save it: your 3D template is now saved inside your hard disk and can be used for other buttons.
After this simple operation, say that you need to create one or more buttons, all with the same "look & feel": a very common task, developing an application, that can be sped up using the template you just created.
Select the button you want to modify, then click with your mouse right button the control surface and, from the context menu, select the "Load a 3D Control template..." item as displayed below:
Browse the directory containing the previously saved 3D template and select it: the button under editing will automatically take the settings stored inside the 3D template.
Repeat the operation for all the other buttons that must meet the same "look & feel".
If you would like to apply a 3D template to multiple buttons at once, please, take a look to the chapter Editing multiple controls at once contained inside the How to use the product in your projects section.
As you may note from the image above, there are two kinds of button templates:
Normal template: can be saved and loaded at Design-time using the procedure described above or at Runtime using the SaveTemplate and LoadTemplate methods. Inside this kind of template all the button settings are stored apart from binaries file paths (for pictures, textures, sounds and cursor) and button position over the form.
Extended template: can be saved and loaded at Runtime using the SaveTemplateEx and LoadTemplate methods. Inside this template are stored all of the control settings, including also extra information about the pathnames of binary files such as pictures, sounds or cursor and the control size; note that when using this kind of templates you will have to use the SetTemplateBinDir method in order to setup one or more directories over the target machine from which to get the binary files for pictures, animations, textures, sounds and cursor..
Button templates used by 3D Control Magic are fully compatible with templates created with our WYSIWYG application 3D Button Visual Editor, so you can:
Design your controls with 3D Button Visual Editor without having to open your development environment.
Save the edited control templates (both Normal and Extended templates are supported).
Use the saved templates from your development environment at Design-time or directly from your application at Runtime.
Obviously you can also define your templates inside 3D Button Visual Editor while the development environment is open:
From the context menu, select the "Edit properties with the Visual Editor..." item
Inside 3D Button Visual Editor, adjust the button's settings to achieve the desired appearance.
Now select the Button menu item and select the Save template (or Save Extended template, see below their difference) sub-item in order to save your first template inside a .3bt file.
Now if you wished to create another button with the same properties as the one above, you would simply import its template file into the the new button as follows. A big time-saver!
Right-click the control and choose Properties. The control's property sheet will appear.
Click the Edit properties... button
Inside 3D Button Visual Editor, select the Button menu item, select the Load template sub-item and choose the .3bt file you saved before: the button will now have the same characteristics as the previous one.
Repeat the operation for all buttons for which the same appearance is desired. Of course, once you have imported the template settings, you can always change the settings in the target control.
Note that, at Design-time, 3D Button Visual Editor allows the use of a set of predefined templates. Simply select one of the available Templates samples Tabs below and click the template you prefer: its settings will be automatically transferred to the button under editing.
a set of templates for Vista's "Aero" style is provided
and a set of templates for Office 2003 and Office 2007 styles are provided as well
You can also define a set of templates for future uses through the Your templates Tab.
This Tab can work in both Load Mode and Save Mode, depending upon the selected radio button:
In Load Mode, clicking one of the available templates will force the button under editing to change its settings accordingly.
In Save Mode, clicking one of the available templates will force the clicked template to receive the settings from the button under editing for future uses.