void TFilePanel::DispatchMessage(BMessage* message, BHandler* handler) { _inherited::DispatchMessage(message, handler); if (message->what == B_KEY_DOWN || message->what == B_MOUSE_DOWN) AdjustButton(); }
void TFilePanel::SelectionChanged() { AdjustButton(); if (fClientObject) fClientObject->SelectionChanged(); }
BOOL CFundRiskTestDlg::OnInit() { AFX_MANAGE_STATE(AfxGetStaticModuleState()); if (__super::OnInit()) { m_pFundAccRiskList = m_pAccountParamList->GetFundAccRiskTypes(); m_pQuestionList = m_pAccountParamList->GetFundRiskQuestionList(); CString sCode = ""; CMyGroupBox* pMyGroupbox = NULL; int j = 0; CFont* font = this->GetFont(); for (int i = 0; i < m_pQuestionList->GetCount(); i++) { IFundRiskQuestionItem* pItem = m_pQuestionList->GetItems(i); CString sCaption = pItem->GetChoice() + "、" + pItem->GetChoiceText(); CString sCode1 = pItem->GetCode(); if (sCode1 != sCode) { pMyGroupbox = new CMyGroupBox(); m_MyGroupBoxList.Add(pMyGroupbox); sCode = sCode1; pMyGroupbox->SetCode(sCode); //pMyGroupbox->SetRadioHeight(20); CString sTitle = pItem->GetTitle(); pMyGroupbox-> Create(sTitle, WS_CHILD|BS_GROUPBOX, CRect(10, 10, 500, 200),this,IDC_GROUP_BEGIN + j); pMyGroupbox->SetFont(font); j++; } pMyGroupbox->NewRadio(sCaption, IDC_RADIO_BEGIN + i); pMyGroupbox->AddItem(pItem); } if (m_MyGroupBoxList.GetCount() > 0) { pMyGroupbox = m_MyGroupBoxList.GetAt(0); pMyGroupbox->ShowWindow(SW_SHOW); m_nCurrIndex = 0; } m_btBack.EnableWindow(FALSE); if (m_MyGroupBoxList.GetCount() == 1) { m_btOK.EnableWindow(TRUE); m_btNext.EnableWindow(FALSE); } else { m_btOK.EnableWindow(FALSE); m_btNext.EnableWindow(TRUE); } AdjustButton(); return TRUE; } else return FALSE; }
void CFundRiskTestDlg::OnBnClickedBtBack() { // TODO: Add your control notification handler code here CMyGroupBox* pMyGroupbox = m_MyGroupBoxList.GetAt(m_nCurrIndex); pMyGroupbox->ShowWindow(SW_HIDE); m_nCurrIndex--; pMyGroupbox = m_MyGroupBoxList.GetAt(m_nCurrIndex); pMyGroupbox->ShowWindow(SW_SHOW); if (0 == m_nCurrIndex) { m_btBack.EnableWindow(FALSE); } else m_btNext.EnableWindow(); m_btOK.EnableWindow(FALSE); AdjustButton(); }