Create Resource Templates

One simple way to promote user interface consistency is to create resource templates. Although Visual C++ does not have direct support for user-defined resource templates—it does support predefined templates, such as dialog box templates for the large and small OLE property pages—you can make any resource into a template simply by copying and pasting an existing resource instead of creating a new one.

For dialog boxes, you can create the following templates:

  • Wide, standard, and narrow dialog boxes with the main command buttons on the bottom.
  • Wide, standard, and narrow dialog boxes with the main command buttons on the right.
  • Wide, standard, and narrow property pages.

Note that the dialog box template size determines the width only. The height can be adjusted as needed. Also note that the template should contain preset guides and even placeholder group boxes and buttons. For example, you could use this dialog box template:

to create this dialog box:

While resource templates are most effective with dialog boxes, you can create templates for any other resource as well. The Visual C++ AppWizard makes what is in effect a template for the menu bar and toolbar, but you can go beyond that and create additional template menu commands and toolbar buttons that can be reused. You can also create template bitmaps and icons if you have graphics that can be used in several projects.

By using resource templates, different programmers can with little effort create resources with a consistent appearance.

TIP
Use resource templates to create consistent-looking resources.



Developing User Interfaces for Microsoft Windows
Developing User Interfaces for Microsoft Windows
ISBN: 0735605866
EAN: 2147483647
Year: 2005
Pages: 334

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net