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

  • On-demand Event Event Date: October 23, 2014 Despite the current "virtualize everything" mentality, there are advantages to utilizing physical hardware for certain tasks. This is especially true for backups. In many cases, it is clearly in an organization's best interest to make use of physical, purpose-built backup appliances rather than relying on virtual backup software (VBA - Virtual Backup Appliances). Join us for this webcast to learn why physical appliances are preferable to virtual backup appliances, …

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds