1 ////////////////////////////////////////////////////
\r
6 #include "resource.h"
\r
9 // Definitions for the CMainFrame class
\r
10 CMainFrame::CMainFrame()
\r
12 // Constructor for CMainFrame. Its called after CFrame's constructor
\r
14 //Set m_View as the view window of the frame
\r
17 // Set the registry key name, and load the initial window position
\r
18 // Use a registry key name like "CompanyName\\Application"
\r
19 LoadRegistrySettings(_T("Win32++\\PropertySheet Sample"));
\r
22 CMainFrame::~CMainFrame()
\r
24 // Destructor for CMainFrame.
\r
27 BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
\r
29 // OnCommand responds to menu and and toolbar input
\r
31 UNREFERENCED_PARAMETER(lParam);
\r
33 switch(LOWORD(wParam))
\r
36 // End the application
\r
37 ::PostMessage(m_hWnd, WM_CLOSE, 0, 0);
\r
40 // Permit only one Modeless property sheet
\r
41 if (!m_ModelessPS.IsWindow())
\r
43 m_ModelessPS.AddPage(new CButtonPage(IDD_BUTTONS, _T("Buttons")));
\r
44 m_ModelessPS.AddPage(new CComboPage(IDD_COMBOBOXES, _T("Combo Boxes")));
\r
45 m_ModelessPS.SetTitle(_T("Modeless Property Sheet"));
\r
46 m_ModelessPS.Create(this);
\r
51 CMyPropertySheet mps(_T("Modal Property Sheet"), this);
\r
52 mps.AddPage(new CButtonPage(IDD_BUTTONS, _T("Buttons")));
\r
53 mps.AddPage(new CComboPage(IDD_COMBOBOXES, _T("Combo Boxes")));
\r
59 CMyPropertySheet mps(NULL, this);
\r
60 mps.AddPage(new CButtonPage(IDD_BUTTONS, _T("Buttons")));
\r
61 mps.AddPage(new CComboPage(IDD_COMBOBOXES, _T("Combo Boxes")));
\r
62 mps.SetWizardMode(TRUE);
\r
66 case IDW_VIEW_STATUSBAR:
\r
69 case IDW_VIEW_TOOLBAR:
\r
72 case IDM_HELP_ABOUT:
\r
73 // Display the help dialog
\r
81 void CMainFrame::OnCreate()
\r
83 // OnCreate controls the way the frame is created.
\r
84 // Overriding CFrame::Oncreate is optional.
\r
85 // The default for the following variables is TRUE
\r
87 // m_bShowIndicatorStatus = FALSE; // Don't show statusbar indicators
\r
88 // m_bShowMenuStatus = FALSE; // Don't show toolbar or menu status
\r
89 // m_bUseReBar = FALSE; // Don't use rebars
\r
90 // m_bUseThemes = FALSE; // Don't use themes
\r
91 // m_bUseToolBar = FALSE; // Don't use a toolbar
\r
92 // m_bUseCustomDraw = FALSE; // Don't use custom draw for menu items
\r
94 // call the base class function
\r
98 void CMainFrame::OnInitialUpdate()
\r
100 // The frame is now created.
\r
101 // Place any additional startup code here.
\r
103 TRACE(_T("Frame created\n"));
\r
106 void CMainFrame::SetupToolBar()
\r
108 // Set the Resource IDs for the toolbar buttons
\r
109 AddToolBarButton( IDM_FILE_NEW );
\r
110 AddToolBarButton( IDM_FILE_OPEN );
\r
111 AddToolBarButton( IDM_FILE_SAVE );
\r
112 AddToolBarButton( 0 ); // Separator
\r
113 AddToolBarButton( IDM_EDIT_CUT );
\r
114 AddToolBarButton( IDM_EDIT_COPY );
\r
115 AddToolBarButton( IDM_EDIT_PASTE );
\r
116 AddToolBarButton( 0 ); // Separator
\r
117 AddToolBarButton( IDM_FILE_PRINT );
\r
118 AddToolBarButton( 0 ); // Separator
\r
119 AddToolBarButton( IDM_HELP_ABOUT );
\r
122 LRESULT CMainFrame::WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
\r
126 // Add case statements for each messages to be handled here
\r
129 // pass unhandled messages on for default processing
\r
130 return WndProcDefault(uMsg, wParam, lParam);
\r