MCPcopy Create free account
hub / github.com/SOUI2/soui / getView

Method getView

demo/CAdapter.h:24–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 7

UpdateVisibleItemsMethod · 0.45
UpdateVisibleItemMethod · 0.45
UpdateVisibleItemsMethod · 0.45
UpdateVisibleItemMethod · 0.45
UpdateVisibleItemMethod · 0.45
UpdateVisibleItemsMethod · 0.45
UpdateVisibleItemsMethod · 0.45

Calls 7

GetChildrenCountMethod · 0.45
InitFromXmlMethod · 0.45
SetWindowTextMethod · 0.45
FormatMethod · 0.45
SetUserDataMethod · 0.45
subscribeEventMethod · 0.45
SetCurSelMethod · 0.45

Tested by

no test coverage detected