Skip to content

Commit

Permalink
Fixed the same bug involving disabled controls in the Global Preferen…
Browse files Browse the repository at this point in the history
…ces dialog.
  • Loading branch information
worstje committed Sep 28, 2010
1 parent 03d9dd1 commit 132847d
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 0 deletions.
76 changes: 76 additions & 0 deletions dialogs/global_prefs/GlobalPrefs.cpp
Expand Up @@ -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();
}
21 changes: 21 additions & 0 deletions dialogs/global_prefs/GlobalPrefs.h
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions dialogs/global_prefs/GlobalPrefsSheet.cpp
Expand Up @@ -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);
}


1 change: 1 addition & 0 deletions dialogs/global_prefs/GlobalPrefsSheet.h
Expand Up @@ -52,6 +52,7 @@ class CGlobalPrefsSheet : public CPropertySheet
// Implementation
public:
virtual ~CGlobalPrefsSheet();
void PageHasChanged (CPropertyPage* pPage);

// Generated message map functions
protected:
Expand Down

0 comments on commit 132847d

Please sign in to comment.