Customizing the font dialog

This is an implementation of my class and the dialog template.

The motivation for doing that:

Our program stores font info in the drawing. It may happen that I save the picture on one machine, take it to the other one, edit it there and take it back to the first one. Now suppose the first machine has font "StrangeFont CE" while the second one does not. We do not want to convert anything if the user does not intend to (we just display some other font but save with the original one).

To make the things more complicated (we do zooming), we save font height as double, negative meaning "height undefined" - ie. specified by other means. (Therefore the two added controls to the dialog.)

This example:

1. Adds two controls and handles them, using DDX and Fail() method as well. It also shows handling of WM_ACTIVATEAPP and WM_QUERYENDSESSION not to pop-up error messagebox in vain.

2. It adds a special font to the combo box and if it is selected, disables font style and script combos.

Download files



Comments

  • Works well !!

    Posted by Legacy on 02/22/2002 12:00am

    Originally posted by: Saravanan K


    This code works well for me.

    Try to change the code as below in the InitDialog() function as below..

    CWnd *cwnd = 0;
    cwnd = GetDlgItem(0x0442); // address for stc3
    if(cwnd)cwnd->ShowWindow(SW_HIDE);

    Happy coding!!!

    sarav

    Reply
  • This does not work

    Posted by Legacy on 10/06/1998 12:00am

    Originally posted by: Craig

    These files arent even close to compiling right, whats the deal with the 10 includes at the top of the .cpp file? Who has those?

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • When it comes to desktops – physical or virtual – it's all about the applications. Cloud-hosted virtual desktops are growing fast because you get local data center-class security and 24x7 access with the complete personalization and flexibility of your own desktop. Organizations make five common mistakes when it comes to planning and implementing their application management strategy. This eBook tells you what they are and how to avoid them, and offers real-life case studies on customers who didn't …

  • Ever-increasing workloads and the challenge of containing costs leave companies conflicted by the need for increased processing capacity while limiting physical expansion. Migration to HP's new generation of increased-density rack-and-blade servers can address growing demands for compute capacity while reducing costly sprawl. Sponsored by: HP and Intel® Xeon® processors Intel, the Intel logo, and Xeon Inside are trademarks of Intel Corporation in the U.S. and/or other countries. HP is the sponsor …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds