void CChildFrame::OnSave() { CString filename; CMFCToolBarEditBoxButton* pEditButton = (CMFCToolBarEditBoxButton*) m_SaveDialog.GetButton(1); pEditButton->GetEditBox()->GetWindowText(filename); ((CMCPforNTDoc*)GetActiveView()->GetDocument())->OnSave(filename); }
void CStationsListToolBar::OnSize(UINT nType, int cx, int cy) { CMFCToolBar::OnSize(nType, cx, cy); //CObList buttons; int index = CommandToIndex(ID_STATION_LIST_FILTER); CMFCToolBarEditBoxButton* pCtrl = (CMFCToolBarEditBoxButton*) GetButton(index); if (pCtrl && pCtrl->GetEditBox()) { CRect rect = pCtrl->Rect(); rect.right = __max(rect.left+150, cx); pCtrl->SetRect(rect); } }
LRESULT CMainFrame::OnTimer(WPARAM wparam,LPARAM lparam) { double value; CString value_string; CMCPforNTApp* pMyApp = (CMCPforNTApp*)AfxGetApp(); if(m_icon_on) { m_icon_on = false; } else { m_icon_on = true; } // // HT text // value = pMyApp->GetIsoHighvolt(); value_string.Format("%.5g kV", value); CMFCToolBarEditBoxButton* pEditHtmeas = (CMFCToolBarEditBoxButton*) m_wndGPS_HTMEAS.GetButton(1); pEditHtmeas->GetEditBox()->SetWindowText(value_string); // // Protons text // value = pMyApp->GetIsoProtons(); value_string.Format("%.3g", value); CMFCToolBarEditBoxButton* pEditProtons = (CMFCToolBarEditBoxButton*) m_wndISOLDE_PROTONS.GetButton(1); pEditProtons->GetEditBox()->SetWindowText(value_string); return 0; }