The V C++ GUI Framework:vFontSelect

From EDM2
Jump to: navigation, search

A utility class to select or set a file name.

Synopsis

Header:
<v/vfontsel.h>
Class name:
vFontSelect
Hierarchy:
vModalDialog ->vFontSelect

Description

This class provides the FontSelect method to set the font being used. This class provides a platform independent way to change fonts. Depending on the platform, the user will be able to select many or most of the fonts available on the platform. On Windows, for example, the standard Windows font selection dialog is be used. On X, a relatively full set of fonts are available.

Methods

vFontSelect(vBaseWindow* win)

vFontSelect(vApp* app)

The vFontSelect constructor requires a pointer to a vBaseWindow, which includes all V windows and dialogs, or a pointer to the vApp object. You will usually pass the this to the constructor.

int FontSelect(vFont& font, const char* msg="Select Font", int fixedOnly=0)

This method displays a dialog that lets the user select font characteristics. If possible, the native font selection dialog will be used (e.g., Windows). If possible, the font selection will include fixed width fonts only if fixedOnly is true. The font dialog will display the current characteristics of the font object, and change them upon successful return. A false return means the user selected Cancel, while a true return means the user finished the selection with an OK.