Click here to Skip to main content
Click here to Skip to main content

CPushPinButton v1.13 - A Push Pin Implementation

, 3 Mar 2000
Rate this:
Please Sign up or sign in to vote.
A Freeware MFC PushPin button class.
  • Download source files - 15 Kb
  • Introduction

    Welcome to CPushPinButton, A Freeware MFC PushPin button class.

    Its appearance is similar to the pin button as seen on the OpenLook window manager on X-Windows & property dialogs in MSDEV aka VC++ IDE. The class is derived from CButton and when used appears as follows:

    Sample Image


    Usage
    History
    Planned Enhancements
    Contacting the Author


    Usage

    • To use the class in your code simply include PushPin.cpp and PushPin.h in your project and #include "PushPin.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.
    • Create a dialog template with an owner-draw button positioned where you want the push pin button. The size of the button in the template does not matter.
    • Using Classwizard associate a CBitmap with the button you just created. Then modify the declaration of the variable to make it a CPushPinButton instead of CButton.
    • To ensure that the class operates correctly when a color scheme change occurs, You should call the ReloadBitmaps() method in response to WM_SETTINGCHANGE or WM_WININICHANGE messages.
    • Your code will need to include MFC either statically or dynamically.


    History

    V1.0 (7 December 1997)
    • Minor code changes to fix a small redraw bug.

    V1.01 (26 November 1997)

    • Minor code changes to facilitate new CPushPinFrame module.

    V1.1 (20 November 1997)

    • Supports non default color schemes.
    • Supports dynamic changes to color schemes.
    • Complete restructuring of code.
    • Can now use an edged bitmap if you want to.
    • Dropped support for Win16.
    • Redid the example program.
    • Simplified external usage of class.

    V1.11 (22 February 1999)

    • A number of small code updates.
    • Code now compiles cleanly at warning level 4.
    • Code is now UNICODE enabled and build configurations are provided.

    V1.12 (2 June 1999)

    • Added a number of comments to improve code readability.
    • Changed the resource id of the button bitmaps to more meaningful values.
    • Class no longer uses message reflection to catch changes in the clicked state. This means that parent classes can now catch the clicked notification.
    • Code now uses mouse capturing which means that the button appears pressed if you click and hold the left mouse button over the push pin. This gives the pushpin class this standard button behavior.

    V1.13 (12 January 2000)

    • Fixed minor typo on the resource dialog.


    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
    12 January 2000


    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

    Share

    About the Author

    PJ Naughter

    United States United States
    No Biography provided

    Comments and Discussions

     
    GeneralThemes PinmemberDevil for ever17-Jun-06 11:28 
    QuestionTAB key press not supported for selection? Pinmembersatishkumar24-Apr-01 0:53 
    GeneralSlight Difference To the VC++ IDE PinsussJeremy Davis6-Jun-00 5:14 

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

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

    | Advertise | Privacy | Terms of Use | Mobile
    Web04 | 2.8.1411023.1 | Last Updated 4 Mar 2000
    Article Copyright 2000 by PJ Naughter
    Everything else Copyright © CodeProject, 1999-2014
    Layout: fixed | fluid