title | description | ms.date | f1_keywords | helpviewer_keywords | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CMFCRibbonFontComboBox Class |
Learn more about: CMFCRibbonFontComboBox Class |
11/04/2016 |
|
|
Implements a combo box that contains a list of fonts. You place the combo box on a ribbon panel.
class CMFCRibbonFontComboBox : public CMFCRibbonComboBox
Name | Description |
---|---|
CMFCRibbonFontComboBox::~CMFCRibbonFontComboBox |
Destructor. |
Name | Description |
---|---|
CMFCRibbonFontComboBox::CMFCRibbonFontComboBox | Constructs and initializes a CMFCRibbonFontComboBox object. |
Name | Description |
---|---|
CMFCRibbonFontComboBox::BuildFonts | Populates the ribbon font combo box with fonts of the specified font type, character set, and pitch and family. |
CMFCRibbonFontComboBox::CreateObject |
Used by the framework to create a dynamic instance of this class type. |
CMFCRibbonFontComboBox::GetCharSet | Returns the specified character set. |
CMFCRibbonFontComboBox::GetFontDesc | |
CMFCRibbonFontComboBox::GetFontType | Returns which font types to display in the combo box. Valid options are DEVICE_FONTTYPE, RASTER_FONTTYPE, and TRUETYPE_FONTTYPE, or any bitwise combination thereof. |
CMFCRibbonFontComboBox::GetPitchAndFamily | Returns the pitch and the family of the fonts that are displayed in the combo box. |
CMFCRibbonFontComboBox::GetThisClass |
Used by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type. |
CMFCRibbonFontComboBox::RebuildFonts | Populates the ribbon font combo box with fonts of the previously specified font type, character set, and pitch and family. |
CMFCRibbonFontComboBox::SetFont | Selects the specified font in the combo box. |
After you create a CMFCRibbonFontComboBox
object, add it to a ribbon panel by calling CMFCRibbonPanel::Add.
Header: afxRibbonComboBox.h
Populates the combo box on the ribbon with fonts.
void BuildFonts(
int nFontType = DEVICE_FONTTYPE | RASTER_FONTTYPE | TRUETYPE_FONTTYPE,
BYTE nCharSet = DEFAULT_CHARSET,
BYTE nPitchAndFamily = DEFAULT_PITCH);
nFontType
[in] Specifies the font type of the fonts to add.
nCharSet
[in] Specifies the character set of the fonts to add.
nPitchAndFamily
[in] Specifies the pitch and family of the fonts to add.
Constructs and initializes a CMFCRibbonFontComboBox object.
CMFCRibbonFontComboBox(
UINT nID,
int nFontType = DEVICE_FONTTYPE | RASTER_FONTTYPE | TRUETYPE_FONTTYPE,
BYTE nCharSet = DEFAULT_CHARSET,
BYTE nPitchAndFamily = DEFAULT_PITCH,
int nWidth = -1);
nID
[in] The command ID of the command that executes when the user selects an item from the combo box.
nFontType
[in] Specifies which font types to display in the combo box. Valid options are DEVICE_FONTTYPE, RASTER_FONTTYPE, and TRUETYPE_FONTTYPE, or any bitwise combination thereof.
nCharSet
[in] Filters the fonts in the combo box to those that belong to the specified character set.
nPitchAndFamily
[in] Specifies the pitch and the family of the fonts that are displayed in the combo box.
nWidth
[in] Specifies the width, in pixels, of the combo box.
For more information about possible nFontType parameter values, see EnumFontFamProc in the Windows SDK documentation.
For more information about valid character sets that can be assigned to nCharSet, and valid values that can be assigned to nPitchAndFamily, see LOGFONT in the Windows SDK documentation.
For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
const CMFCFontInfo* GetFontDesc(int iIndex = -1) const;
[in] iIndex
Populates the combo box on the ribbon with fonts of a previously specified font type, character set, and pitch and family.
void RebuildFonts();
You can specify the font type, character set, and pitch and family of the fonts to include in the ribbon font combo box in the constructor for this class, or by calling CMFCRibbonFontComboBox::BuildFonts.
Selects the specified font in the combo box.
BOOL SetFont(
LPCTSTR lpszName,
BYTE nCharSet = DEFAULT_CHARSET,
BOOL bExact = FALSE);
lpszName
Specifies the name of the font to select.
nCharSet
Specifies the character set for the selected font.
bExact
TRUE to specify that the character set must match when selecting a font; FALSE to specify that the character set can be ignored when selecting a font.
Nonzero if the specified font was found and selected; otherwise, zero.
Returns the specified character set.
BYTE GetCharSet() const;
Character set (see LOGFONT in the Windows SDK documentation).
Returns which font types to display in the combo box. Valid options are DEVICE_FONTTYPE, RASTER_FONTTYPE, and TRUETYPE_FONTTYPE, or any bitwise combination thereof.
int GetFontType() const;
Font types (see EnumFontFamProc in the Windows SDK documentation).
Returns the pitch and the family of the fonts that are displayed in the combo box.
BYTE GetPitchAndFamily() const;
Pitch and the family (see LOGFONT in the Windows SDK documentation).