| 22 | } |
| 23 | |
| 24 | virtual void getView(int position, SWindow * pItem, pugi::xml_node xmlTemplate) |
| 25 | { |
| 26 | if (pItem->GetChildrenCount() == 0) |
| 27 | { |
| 28 | pItem->InitFromXml(xmlTemplate); |
| 29 | } |
| 30 | |
| 31 | SButton *pBtn = pItem->FindChildByName2<SButton>(L"btn_test"); |
| 32 | pBtn->SetWindowText(SStringT().Format(_T("button %d"), position)); |
| 33 | pBtn->GetRoot()->SetUserData(position); |
| 34 | |
| 35 | //由网友“从未来过” 修改的新事件订阅方式,采用模板函数从响应函数中自动提取事件类型,2016.12.13 |
| 36 | pBtn->GetEventSet()->subscribeEvent(&CTestAdapterFix::OnButtonClick, this); |
| 37 | |
| 38 | SComboBox * pCbx = pItem->FindChildByName2<SComboBox>(L"cbx_in_lv"); |
| 39 | if (pCbx) |
| 40 | { |
| 41 | pCbx->SetCurSel(m_pCbxSel[position]); |
| 42 | pCbx->GetEventSet()->subscribeEvent(&CTestAdapterFix::OnCbxSelChange, this); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | bool OnCbxSelChange(EventCBSelChange *pEvt) |
| 47 | { |
no test coverage detected