Jump to content

VFontSelect: Difference between revisions

From EDM2
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..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:


==Synopsis==
==Synopsis==
 
;Header: <tt><v/vfontsel.h></tt>
; '''Header:'''
;Class name: vFontSelect
: <tt><v/vfontsel.h></tt>
;Hierarchy: vModalDialog ->vFontSelect
; '''Class name:'''
: vFontSelect
; '''Hierarchy:'''
: vModalDialog ->vFontSelect


==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):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.
 
====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.
 
====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.
;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.


[[Category:Tools Articles]]
[[Category:V C++ GUI Framework]]

Latest revision as of 21:59, 9 April 2020

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.