CFontDialogImpl Class

class CFontDialogImpl: public CCommonDialogImplBase

This class presents the standard Windows font dialog box by calling ChooseFont on your behalf.

CFontDialogImpl includes the following member functions  CFontDialogImpl,  DoModal,  GetCurrentFont.  GetFaceName,  GetStyleName,  GetSize,  GetColor,  GetWeight,  IsUnderline,  IsStrikeOut,  IsItalic, and  IsBold

Defined in: CommonDialogs.h

Class Template Arguments

_Derived

The ultimately-derived class

Comments

The CFontDialogImpl and its finalized implementation  CFontDialog wrap the standard Windows font-selection dialog box into your application. A CFontDialog object is a dialog box with a list of fonts that are currently installed in the system. The user can select a particular font from the list.

To construct a CFontDialog object, use the provided constructor or derive a new subclass and use your own custom constructor.

The CFontDialog contains a data member of type CHOOSEFONT named m_cf. Once a CFontDialog object has been constructed, you can use the m_cf structure to initialize the values or states of controls in the dialog box. For more information on this structure, see the Win32 SDK documentation.

After initializing the dialog object's controls, call the DoModal member function to display the dialog box and allow the user to select a font. DoModal calls the standard Widnows ChooseFont API function. DoModal returns whether the user selected the OK (IDOK) or Cancel (IDCANCEL) button.

If DoModal returns IDOK, you can use one of CFontDialog's member functions to retrieve the information input by the user. You may also use m_cf directly.