PropertyPage
Property page is a small dialog window usually displays data fields of some category of an object.
Property Sheet
Property Sheet is the top window which holdes a collection of property pages. property pages generally comes as category with some heading and appears as tabs in property sheet dialog.
Example
An easy example of property sheet dialog is the property dialog of drives in windows explorer. The steps to see this dialog is to "right" click on any drive and click on "Properties" in the context menu. A dialog like below image will open. This is the property sheet dialog box. It contains several property pages and "General" page is the default selected page.
Design
Design of property sheet and property page are simple. A property page is like a normal dialog and derived from the class CPropertyPage. It has its own messsage handing part to manage its own events.
A Property sheet is also a general dialog box derived from CPropertySheet class. CPropertySheet class has AddPage() function to add individual pages to the propery sheet. Property sheet can implement its own events for buttons and controls. Very common buttons which are included in the main sheet is "OK", "Cancel", "Apply" etc. Property sheet always have a default selected property page in it. This page index can be passed in constructor. Default index is zero.
This example is with the help of C++ wrapped classes. CPropertyPage and CPropertySheet actually wraps some basic data structure in it. In the next section we will see these data structures.
PropertySheet VC++ Project
A VC++ project should have two types of dialog resources. One main dialog for property sheet display and other are a series of property page dialog resources for each property page. These resources can be added to the project using "Insert -> Resource" menu option in VC++.
There are three dialogs one main property sheet and two property pages dialog resource in our project. Resources looks -
Project should include an Application class, PropSheet dialog class and series of property page classes.
Source code
Output
About our authors: Team EQA
Further readings
Where is WinMain() function in MFC application ?
MFC hides WinMain in its framework and includes source file on WinMain(). This explains how framework calls global CWinApp::Initinstance() from entry WinMain.
What is the utility of CWinApp class?
This is constructed during global C++ objects are constructed and is already available when Windows calls the WinMain function, which is supplied by the ...
Basic steps in Win32 GUI Application with source code.
Define a custom Window class structure, Register the class name, CreateWindow, Show windows and write message get and dispatch loop statements. Define the Window CallBack procedure and write the handlers.
What is a Window CallBack procedure and what is its utility?
DispatchMessage() is a API which indirectly triggers the Window CallBack procedure. Message structure members from this function are passed to the CallBack procedure. CallBack procedure should implement event handlers depending on the need of the application.
What are LPARAM and WPARAM in window proc function?
LPARAM and WPARAM are the two parameters in Window CallBack procedure. They signifies parameters of various events. They are used in handing individual events.
What are the basic steps of a typical MFC based application?
We need to write WinMain and need to follow all these in a Win32 application. However we need not to write much if we are writing an application with MFC ...