Adding Controls to the Default Property Page
When ControlWizard was used to create the Circle control, it included a default property page as part of the project. Property pages are listed in the property page ID table in CIRCCTL.CPP:
BEGIN_PROPPAGEIDS(CCircCtrl, 3)
PROPPAGEID(CCircPropPage::guid)
PROPPAGEID(CLSID_CColorPropPage)
PROPPAGEID(CLSID_CFontPropPage)
END_PROPPAGEIDS(CCircCtrl)
The first entry in the Property page ID table is the default (or general) property page. The second and third entries are the stock color and font property pages that were added in Lesson 7, Handling Text and Fonts.
Initially, the default property page dialog box template is empty. You can use the dialog editor to add controls to the default property page.
To add the Caption property to the default property page
-
In the ResourceView pane, open the Circ project folder.
-
Open the Dialog folder.
-
Open the IDD_PROPPAGE_CIRC entry in the Dialog folder to edit the property page template.
-
Right click the static text control and click Properties on the shortcut menu to open the Text Properties dialog box.
-
Using the Text Properties dialog box, change the static text control caption to &Caption:.
-
Select the Edit Box tool in the Controls toolbar and place an edit box control next to the static text control in the dialog box.
-
Right click the edit box control and click Properties on the shortcut menu to open the Edit Properties dialog box.
-
Using the Edit Properties dialog box, change the edit control’s ID to IDC_CAPTION.
To add the CircleOffset property to the default property page
-
Select the Static Text tool in the Controls toolbar and place another static text control in the dialog box.
-
Right click the static text control and click Properties on the shortcut menu to open the Text Properties dialog box.
-
Using the Text Properties dialog box, change the static text control’s caption to Circle&Offset:.
-
Select the Edit Box tool in the Controls toolbar and place an edit box control next to the static text control in the dialog box.
-
Right click the edit box control and click Properties on the shortcut menu to open the Edit Properties dialog box.
-
Using the Edit Properties dialog box, change the edit control’s ID to IDC_CIRCLEOFFSET.
To add the CircleShape property to the default property page
-
Select the Check Box tool in the Controls toolbar and place a check box control in the dialog box.
-
Right click the check box control and click Properties on the shortcut menu to open the Check Box Properties dialog box.
-
Using the Check Box Properties dialog box, change the check box’s ID to IDC_CIRCLESHAPE and change the check box’s caption to Circle&Shape; on the Styles tab, check the Left Text check box.
Once you have completed these procedures, arrange the controls using the Layout menu options and click Save on the File menu to save the property page template.