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

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • Relying on outside companies to manage your network and server environments for your business and applications to meet the needs and demands of your users can be stressful. This is especially true as many Managed Hosting organizations fail to meet their service level agreements. Read this Forrester total economic impact report and learn what makes INetU different and how they exceed their customers' managed hosting expectations.

Most Popular Programming Stories

More for Developers

RSS Feeds