OSDN Git Service

Make Options dialog resizable (2)
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Tue, 4 Aug 2020 23:49:27 +0000 (08:49 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Tue, 4 Aug 2020 23:49:27 +0000 (08:49 +0900)
Src/Common/PreferencesDlg.cpp
Src/Common/PreferencesDlg.h

index 4bb8f7b..9f1950e 100644 (file)
@@ -76,7 +76,6 @@ void CPreferencesDlg::DoDataExchange(CDataExchange* pDX)
 BEGIN_MESSAGE_MAP(CPreferencesDlg, CDialog)
        //{{AFX_MSG_MAP(CPreferencesDlg)
        ON_WM_SIZE()
-       ON_WM_DESTROY()
        ON_COMMAND(ID_HELP, OnHelpButton)
        ON_BN_CLICKED(IDC_TREEOPT_HELP, OnHelpButton)
        ON_NOTIFY(TVN_SELCHANGED, IDC_TREEOPT_PAGES, OnSelchangedPages)
@@ -142,6 +141,8 @@ void CPreferencesDlg::OnOK()
        m_pphost.OnOK();
 
        SaveOptions();
+
+       AfxGetApp()->WriteProfileInt(_T("Settings"), _T("OptStartPage"), m_pphost.GetActiveIndex());
 }
 
 void CPreferencesDlg::OnSize(UINT nType, int cx, int cy)
@@ -157,13 +158,6 @@ void CPreferencesDlg::OnSize(UINT nType, int cx, int cy)
        }
 }
        
-void CPreferencesDlg::OnDestroy() 
-{
-       CDialog::OnDestroy();
-       
-       AfxGetApp()->WriteProfileInt(_T("Settings"), _T("OptStartPage"), m_pphost.GetActiveIndex());
-}
-
 void CPreferencesDlg::OnHelpButton() 
 {
        theApp.ShowHelp(OptionsHelpLocation);
index cc5f070..fcb21c7 100644 (file)
@@ -91,7 +91,6 @@ protected:
        //{{AFX_MSG(CPreferencesDlg)
        virtual BOOL OnInitDialog() override;
        afx_msg void OnSize(UINT nType, int cx, int cy);
-       afx_msg void OnDestroy();
        afx_msg void OnHelpButton();
        afx_msg void OnImportButton();
        afx_msg void OnExportButton();