VFontSelect: Difference between revisions
Created page with "A utility class to select or set a file name. ==Synopsis== ; '''Header:''' : <tt><v/vfontsel.h></tt> ; '''Class name:''' : vFontSelect ; '''Hierarchy:''' : vModalDialog ->vFont..." |
mNo edit summary |
||
Line 2: | Line 2: | ||
==Synopsis== | ==Synopsis== | ||
; '''Header:''' | ; '''Header:''' | ||
: <tt><v/vfontsel.h></tt> | : <tt><v/vfontsel.h></tt> | ||
Line 11: | Line 10: | ||
==Description== | ==Description== | ||
This class provides the <tt>FontSelect</tt> 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. | This class provides the <tt>FontSelect</tt> 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== | ==Methods== | ||
====vFontSelect(vBaseWindow* win)==== | ====vFontSelect(vBaseWindow* win)==== | ||
====vFontSelect(vApp* app)==== | ====vFontSelect(vApp* app)==== | ||
The <tt>vFontSelect</tt> constructor requires a pointer to a <tt>vBaseWindow</tt>, which includes all '''''V''''' windows and dialogs, or a pointer to the <tt>vApp</tt> object. You will usually pass the <tt>this</tt> to the constructor. | The <tt>vFontSelect</tt> constructor requires a pointer to a <tt>vBaseWindow</tt>, which includes all '''''V''''' windows and dialogs, or a pointer to the <tt>vApp</tt> object. You will usually pass the <tt>this</tt> to the constructor. | ||
====int FontSelect(vFont& font, const char* msg="Select Font", int fixedOnly=0)==== | ====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 <tt>fixedOnly</tt> is true. The font dialog will display the current characteristics of the <tt>font</tt> object, and change them upon successful return. A <tt>false</tt> return means the user selected Cancel, while a <tt>true</tt> return means the user finished the selection with an OK. | 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 <tt>fixedOnly</tt> is true. The font dialog will display the current characteristics of the <tt>font</tt> object, and change them upon successful return. A <tt>false</tt> return means the user selected Cancel, while a <tt>true</tt> return means the user finished the selection with an OK. | ||
[[Category: | [[Category:V C++ GUI Framework]] |
Revision as of 18:24, 1 March 2017
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.