Click here to Skip to main content
15,879,239 members
Articles / Desktop Programming / MFC
Article

CPushPinFrame v1.11

Rate me:
Please Sign up or sign in to vote.
4.20/5 (3 votes)
3 Mar 2000 79.3K   889   22   7
A Freeware MFC PushPin property page dialog class.
  • Download source files - 19 Kb
  • Introduction

    Welcome to CPushPinFrame, A freeware MFC PushPin property page dialog class.

    This class emulates the properties dialogs as seen in Microsoft Developer Studio. They sport a push pin button in the top left hand corner which when unpinned automatically closes the property dialog when the dialog loses focus. The MS implementation seems to use custom draw controls which seems a shame when you lose all the functionality provided by the MFC property sheet classes. The class of interest is CPushPinFrame and is derived from CFrameWnd. It provides a look which is similar to the modal MFC property sheets.

    When the property page is correctly setup it will look like:


    Usage
    History
    Planned Enhancements
    Contacting the Author


    Usage

    • You will also need to download the CPushPinButton class from my web site and copy in the PushPin.cpp and PushPin.h files from that archive. The bitmaps CPushPin uses are already in the demo program supplied with CPushPinFrame.
    • To use the class in your code simply include PushPin.cpp/.h and PushPinFrame.cpp/.h in your project and #include "PushPinFrame.h" in which ever of your modules needs to make calls to the class.
    • You should also ensure that the 4 bitmaps (namely IDB_PP_PINNED, IDB_PP_PINNEDEDGE, IDB_PP_UNPINNED and IDB_PP_UNPINNEDEDGE) are copied over into your rc file from the PushPinFrameDemo.rc file.
    • To use the CPushPinFrame class, you must create one on the heap and you then attach a property sheet to it by using the SetAttachedProperySheet method. This method uses CRuntimeClass so your property sheet will need DYNCREATE attributes.
    • You can then use the ChangeAttachedPropertySheet() of the CPushPinFrame class to change the displayed property sheet.
    • To see the class in action, have a look at the code in CDemoAppDlg::OnButton1() and CDemoAppDlg::OnButton1() in the module dlg.cpp in the sample app.
    • Your code will need to include MFC either statically or dynamically.


    History

    16 April 1998
    • Window now only closes if the window which is going active is owned by the same parent as the pushpin frame. To see why this is a problem hook up help to a pushpinframe and watch the window being closed when help is brought up.

    V1.1 (1st June 1999)

    • Now supports changing the attached property sheet through the new ChangeAttachedPropertySheet() function.
    • Did a bit of a tidy up of the source code.
    • Now includes a HTML file describing the class and its usage.
    • Unicode enabled the code.
    • Code now compiles cleanly at warning level 4.
    • Sample app now also demonstrates the new ChangeAttachedPropertySheet() function.
    • Sample app has been tidied up.

    V1.11 (2nd June 1999)

    • Updated code to work with the new v1.12 release of CPushPinButton.
    • Removed a number of unnecessary comments in the code.
    • Renamed a number of project files and workspace files to be more descriptive.
    • Update a number of bugs / errors in this help file.
    • Fixed a small clipping bug where the push pin was being clipped by the edge of the property sheet.


    Planned Enhancements

    • If you have any other suggested improvements, please let me know so that I can incorporate them into the next release.


    Contacting the Author

    PJ Naughter
    Email: pjn@indigo.ie
    Web: http://www.naughter.com
    2nd June 1999

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here


    Written By
    United States United States
    This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

    Comments and Discussions

     
    GeneralVisual Styles Pin
    Devil for ever17-Jun-06 9:22
    Devil for ever17-Jun-06 9:22 
    GeneralEscape key Pin
    TheRogue5-Aug-05 3:39
    TheRogue5-Aug-05 3:39 
    GeneralRe: Escape key Pin
    amihud2-Oct-05 5:36
    amihud2-Oct-05 5:36 
    Generaloffsetting the tabs Pin
    15-Nov-01 20:36
    suss15-Nov-01 20:36 
    Generalproblem Pin
    11-Sep-01 0:51
    suss11-Sep-01 0:51 
    GeneralCPushPin Pin
    12-Mar-01 4:02
    suss12-Mar-01 4:02 
    Generalclass CPushPinButton Pin
    Vitaly16-Aug-00 2:58
    Vitaly16-Aug-00 2:58 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.