void CFormatTabDlg::UpdateButtons() { UpdateButton(m_buttonClearAll, m_nCount > 0); BOOL bHasText = (m_comboBox.GetWindowTextLength() > 0); UpdateButton(m_buttonSet, bHasText); UpdateButton(m_buttonClear, bHasText); WORD wID = LOWORD(GetDefID()); if (bHasText && wID != IDC_BUTTON_SET) SetDefID(IDC_BUTTON_SET); else if (!bHasText && wID != IDOK) SetDefID(IDOK); }
void CFormatTabDlg::OnSelchange() { UpdateButton(m_buttonClearAll, m_nCount > 0); // force these since if the edit control is empty and // an item in the box is clicked on, the edit control will // not be filled in first UpdateButton(m_buttonSet, TRUE); UpdateButton(m_buttonClear, TRUE); WORD wID = LOWORD(GetDefID()); if (wID != IDC_BUTTON_SET) SetDefID(IDC_BUTTON_SET); }
void COptionsDlgSelector::ResetOKAsDefault(bool bAndFocus) { if(GetDefID() != IDOK) { SetDefID(IDOK); if(bAndFocus) m_btnOk.SetFocus(); m_btnOk.Invalidate(); // Otherwise the changes are not all drawn m_StaticHyperLinkHelp.Invalidate(); m_btnCancel.Invalidate(); m_btnDoc1.Invalidate(); m_btnOptions.Invalidate(); m_btnSwap.Invalidate(); m_multiModifiedDlg.Invalidate(); } }