void xRenderSettingPane::Show(bool b) { m_wndPropList.RemoveAll(); if (!b) return ; IPropertyObj * obj = xRenderSetting::Instance(); int propSize = obj->GetPropertySize(); MultiMap<TString128, const Property *> mmap; for (int i = 0; i < propSize; ++i) { const Property * p = obj->GetProperty(i); mmap.Insert(p->group, p); } MultiMap<TString128, const Property *>::Iterator whr = mmap.Begin(); MultiMap<TString128, const Property *>::Iterator end = mmap.End(); while (whr != end) { CMFCPropertyGridProperty * gp = new CMFCPropertyGridProperty(whr->first.c_str()); List<const Property *>::Iterator w = whr->second.Begin(); List<const Property *>::Iterator e = whr->second.End(); while (w != e) { const Property * p = *w; _ToCtrl(gp, obj, p); ++w; } m_wndPropList.AddProperty(gp); ++whr; } }
void xEnvironmentPane::_Frush(CMFCPropertyGridCtrl & PropertyGrid, IPropertyObj * obj) { PropertyGrid.RemoveAll(); if (!obj) return ; int propSize = obj->GetPropertySize(); MultiMap<TString128, const Property *> mmap; for (int i = 0; i < propSize; ++i) { const Property * p = obj->GetProperty(i); mmap.Insert(p->group, p); } MultiMap<TString128, const Property *>::Iterator whr = mmap.Begin(); MultiMap<TString128, const Property *>::Iterator end = mmap.End(); while (whr != end) { CMFCPropertyGridProperty * gp = new CMFCPropertyGridProperty(whr->first.c_str()); List<const Property *>::Iterator w = whr->second.Begin(); List<const Property *>::Iterator e = whr->second.End(); while (w != e) { const Property * p = *w; _ToCtrl(gp, obj, p); ++w; } PropertyGrid.AddProperty(gp); ++whr; } }