Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed the same bug involving disabled controls in the Global Preferen…

…ces dialog.
  • Loading branch information...
commit 132847dda4aef0702e934f59470e57b8b3e0f27c 1 parent 03d9dd1
@worstje worstje authored
View
76 dialogs/global_prefs/GlobalPrefs.cpp
@@ -1855,3 +1855,79 @@ LRESULT CGlobalPrefsP13::OnKickIdle(WPARAM, LPARAM)
UpdateDialogControls (AfxGetApp()->m_pMainWnd, false);
return 0;
} // end of CGlobalPrefsP13::OnKickIdle
+
+/////////////////////////////////////////////////////////////////////////////
+// Sometimes it is useful to know when we become the active page
+// Copied the structure from World Properties.
+
+BOOL CGlobalPrefsP1::OnSetActive()
+{
+ ((CGlobalPrefsSheet *) GetParent ())->PageHasChanged (this);
+ return CPropertyPage::OnSetActive();
+}
+
+BOOL CGlobalPrefsP2::OnSetActive()
+{
+ ((CGlobalPrefsSheet *) GetParent ())->PageHasChanged (this);
+ return CPropertyPage::OnSetActive();
+}
+
+BOOL CGlobalPrefsP3::OnSetActive()
+{
+ ((CGlobalPrefsSheet *) GetParent ())->PageHasChanged (this);
+ return CPropertyPage::OnSetActive();
+}
+
+BOOL CGlobalPrefsP4::OnSetActive()
+{
+ ((CGlobalPrefsSheet *) GetParent ())->PageHasChanged (this);
+ return CPropertyPage::OnSetActive();
+}
+
+BOOL CGlobalPrefsP5::OnSetActive()
+{
+ ((CGlobalPrefsSheet *) GetParent ())->PageHasChanged (this);
+ return CPropertyPage::OnSetActive();
+}
+
+BOOL CGlobalPrefsP6::OnSetActive()
+{
+ ((CGlobalPrefsSheet *) GetParent ())->PageHasChanged (this);
+ return CPropertyPage::OnSetActive();
+}
+
+BOOL CGlobalPrefsP7::OnSetActive()
+{
+ ((CGlobalPrefsSheet *) GetParent ())->PageHasChanged (this);
+ return CPropertyPage::OnSetActive();
+}
+
+BOOL CGlobalPrefsP9::OnSetActive()
+{
+ ((CGlobalPrefsSheet *) GetParent ())->PageHasChanged (this);
+ return CPropertyPage::OnSetActive();
+}
+
+BOOL CGlobalPrefsP10::OnSetActive()
+{
+ ((CGlobalPrefsSheet *) GetParent ())->PageHasChanged (this);
+ return CPropertyPage::OnSetActive();
+}
+
+BOOL CGlobalPrefsP11::OnSetActive()
+{
+ ((CGlobalPrefsSheet *) GetParent ())->PageHasChanged (this);
+ return CPropertyPage::OnSetActive();
+}
+
+BOOL CGlobalPrefsP12::OnSetActive()
+{
+ ((CGlobalPrefsSheet *) GetParent ())->PageHasChanged (this);
+ return CPropertyPage::OnSetActive();
+}
+
+BOOL CGlobalPrefsP13::OnSetActive()
+{
+ ((CGlobalPrefsSheet *) GetParent ())->PageHasChanged (this);
+ return CPropertyPage::OnSetActive();
+}
View
21 dialogs/global_prefs/GlobalPrefs.h
@@ -36,6 +36,7 @@ class CGlobalPrefsP1 : public CPropertyPage
//{{AFX_VIRTUAL(CGlobalPrefsP1)
public:
virtual void OnOK();
+ virtual BOOL OnSetActive();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
@@ -106,6 +107,8 @@ class CGlobalPrefsP2 : public CPropertyPage
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CGlobalPrefsP2)
+ public:
+ virtual BOOL OnSetActive();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
@@ -145,6 +148,8 @@ class CGlobalPrefsP3 : public CPropertyPage
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CGlobalPrefsP3)
+ public:
+ virtual BOOL OnSetActive();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
@@ -187,6 +192,8 @@ class CGlobalPrefsP4 : public CPropertyPage
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CGlobalPrefsP4)
+ public:
+ virtual BOOL OnSetActive();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
@@ -228,6 +235,8 @@ class CGlobalPrefsP5 : public CPropertyPage
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CGlobalPrefsP5)
+ public:
+ virtual BOOL OnSetActive();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
@@ -265,6 +274,8 @@ class CGlobalPrefsP6 : public CPropertyPage
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CGlobalPrefsP6)
+ public:
+ virtual BOOL OnSetActive();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
@@ -304,6 +315,8 @@ class CGlobalPrefsP7 : public CPropertyPage
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CGlobalPrefsP7)
+ public:
+ virtual BOOL OnSetActive();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
@@ -364,6 +377,8 @@ class CGlobalPrefsP9 : public CPropertyPage
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CGlobalPrefsP9)
+ public:
+ virtual BOOL OnSetActive();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
@@ -428,6 +443,7 @@ class CGlobalPrefsP10 : public CPropertyPage
//{{AFX_VIRTUAL(CGlobalPrefsP10)
public:
virtual void OnOK();
+ virtual BOOL OnSetActive();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
@@ -472,6 +488,8 @@ class CGlobalPrefsP11 : public CPropertyPage
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CGlobalPrefsP11)
+ public:
+ virtual BOOL OnSetActive();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
@@ -512,6 +530,7 @@ class CGlobalPrefsP12 : public CPropertyPage
//{{AFX_VIRTUAL(CGlobalPrefsP12)
public:
virtual void OnOK();
+ virtual BOOL OnSetActive();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
@@ -558,6 +577,8 @@ class CGlobalPrefsP13 : public CPropertyPage
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CGlobalPrefsP13)
+ public:
+ virtual BOOL OnSetActive();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
View
13 dialogs/global_prefs/GlobalPrefsSheet.cpp
@@ -73,3 +73,16 @@ BOOL CGlobalPrefsSheet::OnInitDialog()
return bResult;
}
+void CGlobalPrefsSheet::PageHasChanged (CPropertyPage* pNewPage)
+{
+ /* Theming has these nice fades inbetween controls being disabled and enabled.
+ * That is all nice and well, but switching a page for the _first_ time since
+ * the dialog had been opened causes the dialog controls to be updated in plain
+ * sight - a rather visible and eye-catching affair once you are aware of it.
+ * Updating the dialog controls manually before switching to the active page
+ * causes these updates to be done while the user cannot see it. -JW
+ */
+ pNewPage->UpdateDialogControls(this, false);
+}
+
+
View
1  dialogs/global_prefs/GlobalPrefsSheet.h
@@ -52,6 +52,7 @@ class CGlobalPrefsSheet : public CPropertySheet
// Implementation
public:
virtual ~CGlobalPrefsSheet();
+ void PageHasChanged (CPropertyPage* pPage);
// Generated message map functions
protected:
Please sign in to comment.
Something went wrong with that request. Please try again.