void DlgSettingsMain::CreateSettingsTree() { CRect rect; CWindow wndPlaceholder(GetDlgItem(IDC_CHILD_PLACEHOLDER)); wndPlaceholder.GetWindowRect(&rect); ScreenToClient(&rect); // create console settings dialog std::shared_ptr<DlgSettingsBase> dlgConsole(new DlgSettingsConsole(m_pSettingsRoot)); AddDialogToTree(L"Console", dlgConsole, rect); // create appearance settings dialog std::shared_ptr<DlgSettingsBase> dlgAppearance(new DlgSettingsAppearance(m_pSettingsRoot)); HTREEITEM htiAppearance = AddDialogToTree(L"Appearance", dlgAppearance, rect); // create styles settings dialog std::shared_ptr<DlgSettingsBase> dlgStyles(new DlgSettingsStyles(m_pSettingsRoot)); AddDialogToTree(L"Styles", dlgStyles, rect, htiAppearance); // create styles settings dialog std::shared_ptr<DlgSettingsBase> dlgFont(new DlgSettingsFont(m_pSettingsRoot)); AddDialogToTree(L"Font", dlgFont, rect, htiAppearance); // create full screen settings dialog std::shared_ptr<DlgSettingsBase> dlgFullScreen(new DlgSettingsFullScreen(m_pSettingsRoot)); AddDialogToTree(L"Full screen", dlgFullScreen, rect, htiAppearance); // create behavior settings dialog std::shared_ptr<DlgSettingsBase> dlgBehavior(new DlgSettingsBehavior(m_pSettingsRoot)); HTREEITEM htiBehavior = AddDialogToTree(L"Behavior", dlgBehavior, rect); std::shared_ptr<DlgSettingsBase> dlgBehavior2(new DlgSettingsBehavior2(m_pSettingsRoot)); AddDialogToTree(L"More...", dlgBehavior2, rect, htiBehavior); // create hotkeys settings dialog std::shared_ptr<DlgSettingsBase> dlgHotKeys(new DlgSettingsHotkeys(m_pSettingsRoot)); HTREEITEM htiHotkeys = AddDialogToTree(L"Hotkeys", dlgHotKeys, rect); // create mouse commands settings dialog std::shared_ptr<DlgSettingsBase> dlgMouseCmds(new DlgSettingsMouse(m_pSettingsRoot)); AddDialogToTree(L"Mouse", dlgMouseCmds, rect, htiHotkeys); // create tabs settings dialog shared_ptr<DlgSettingsBase> dlgTabs(new DlgSettingsTabs(m_pSettingsRoot, dynamic_cast<DlgSettingsConsole*>(dlgConsole.get())->m_consoleSettings)); AddDialogToTree(L"Tabs", dlgTabs, rect); m_treeCtrl.Expand(htiAppearance); m_treeCtrl.Expand(htiBehavior); m_treeCtrl.Expand(htiHotkeys); m_treeCtrl.SelectItem(m_treeCtrl.GetRootItem()); }
void CPageController::OnButtonTitleFont() { // TODO: Add your control notification handler code here LOGFONT lf; memset(&lf, 0, sizeof(LOGFONT)); strcpy(lf.lfFaceName, this->m_strTitleFontName); lf.lfHeight = this->m_nTitleFontSize; CFontDialog dlgFont(&lf, CF_EFFECTS | CF_SCREENFONTS, NULL, this); if (dlgFont.DoModal() == IDOK) { dlgFont.GetCurrentFont(&lf); this->m_strTitleFontName = lf.lfFaceName; this->m_nTitleFontSize = lf.lfHeight; this->ShowPreview(); } }