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
- 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