锐英源软件
第一信赖

精通

英语

开源

擅长

开发

培训

胸怀四海 

第一信赖

当前位置:锐英源 / 英语翻译 / CFontListBox英语翻译英文原文
服务方向
人工智能数据处理
人工智能培训
kaldi数据准备
小语种语音识别
语音识别标注
语音识别系统
语音识别转文字
kaldi开发技术服务
软件开发
运动控制卡上位机
机械加工软件
软件开发培训
Java 安卓移动开发
VC++
C#软件
汇编和破解
驱动开发
联系方式
固话:0371-63888850
手机:138-0381-0136
Q Q:396806883
微信:ryysoft

锐英源精品开源心得,转载请注明:“锐英源www.wisestudy.cn,孙老师作品,电话13803810136。”需要全文内容也请联系孙老师。中文译文

fontlistBox
Content

  • Introduction
  • Background
  • Using the code
    • The list style flags
    • The tooltip style flags
    • The MRU list type flags
    • To use CFontListBox in a CDialog as an auto subclassing control
    • To use CFontListBox in a CDialog as a manual subclassing control
    • To dynamically create a CFontListBox control
  • The CFontListBox class
    • Member functions
    • Data members
  • The CFontDescriptor class
    • Member functions
    • Data members
  • Global functions
    • MRU list persistence functions
  • Installation guide
    • Library project installation
    • Demo project installation
  • Acknowledgements

Introduction

First of all, I beg your pardon for any errors in my English and in the content of this article (it's my first submission).
For a personal project (a PropertyList control), I needed a ListBox which could display and allow selection of fonts. After reading several articles on this subject, I decided to write my own control with the following main behaviors:

  • performance during the detection of font type (when I started this work, I had a Pentium 333 Mhz!),
  • can display the font names as standard text or using the font itself,
  • can display the tooltip (tracking the mouse pointer or the selected items) using the sample text or facename,
  • having MRU sublist, shared or not by multiple CFontListBox instances in the application,
  • no dependencies on a bitmap or an ImageList resource file in the project,
  • can be used as a dialog subclassing control or created by hand.

Background

To manage a MRU sublist, shared or not, CFontListBox uses the services offered by an instance of the CFontListManager. Only one instance of CFontListManager is created automatically during the application initialization. This class is responsible for loading the font list, managing the MRU list (private to a CFontListBox instance, shared between two or more controls, or global to the application) through the CFontDescriptor and CFontMruList objects and its various collections.
This control gets the bitmap used to display the list from a bitmap resource of COMDLG32.DLL, so there is no specific resource to be included in your project.
To allow the loading process of the font list, this control does not use the way used by other controls. I tried to distinguish between the font types (TrueType, OpenType and so on). It uses the flags given by the ::EnumFontFamiliesEx API to the callback function (see EnumFontProc and CFontListManager::FillFontList() functions in FontListManager.cpp).
The re-creation of the base ListBox window is needed to allow modifications of the control after its creation to follow the modifications of the CFontListBox style flags.
The persistence of the MRU list needs two functions called in the CWinApp::InitInstance and CWinApp::ExitInstance methods. This is due to the fact that when an instance of CFontListManager is created, the CWinApp::SetCurrentHandles() is not called (this function of the MFC library is responsible for the initialization of the data members of CWinApp object, like m_pszRegistryKey and m_pszProfileName). Persistence acts only on the global MRU list and the custom named ones, if these lists are marked to do so.
CFontListManager has a feature that allows it to react to the system-wide broadcasted message WM_FONTCHANGE. This feature needs a top-level window to receive the message which is created the first time a CFontListBox is created (which can only occur after the CWinApp object and other frame or dialog windows are initialized).

友情链接
版权所有 Copyright(c)2004-2021 锐英源软件
公司注册号:410105000449586 豫ICP备08007559号 最佳分辨率 1024*768
地址:郑州大学北校区院(文化路97号院)内