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

  • Wednesday, September 24, 2014 8:00 AM - 9:00 AM PDT According to a recent Forrester Research report, many companies are choosing low-code platforms over traditional programming platforms, due to the speed with which low-code apps can be assembled and tested. With customer-facing applications on the rise, traditional programming platforms simply can't keep up with the "short schedules and rapid change cycles" required to develop these applications. Check out this upcoming webinar and join Clay Richardson from …

  • Best-in-Class organizations execute on a strategy that supports the multi-channel nature of customer requests. These leading organizations do not just open up their service infrastructures to accommodate new channels, but also empower their teams to deliver an effective and consistent experience regardless of the channel selected by the customer. This document will highlight the key business capabilities that support a Best-in-Class customer engagement strategy.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds