void CResultDataWnd::OnToolbarCommand(UINT ID) { int index = m_wndToolBar.CommandToIndex(ID); CMFCToolBarComboBoxButton* pCtrl = (CMFCToolBarComboBoxButton*)m_wndToolBar.GetButton(index); ASSERT(pCtrl); int sel = pCtrl->GetCurSel(); m_grid.SetStatType(sel); }
void CTextPropertyToolBar::OnFontNameChanged() { CMFCToolBarComboBoxButton *pButton = (CMFCToolBarComboBoxButton*)this->GetButton(GetButtonIndex(ID_FONTCOMBO_TEXT)); CString name = pButton->GetItem(pButton->GetCurSel()); m_pObserver->PropertyChanged(TextPropertyBuilder::CreateTextProperty(PropertyEnum_FontName, name)); }
void CTextPropertyToolBar::OnFontSizeChanged() { CMFCToolBarComboBoxButton *pButton = (CMFCToolBarComboBoxButton*)this->GetButton(GetButtonIndex(ID_SIZECOMBO_TEXT)); CString size = pButton->GetItem(pButton->GetCurSel()); m_pObserver->PropertyChanged(TextPropertyBuilder::CreateTextProperty<int>(PropertyEnum_FontSize, std::stoi(size.GetBuffer()))); }