static void FWL_SetChildThemeID(IFWL_Widget* pParent, uint32_t dwThemeID) { CFWL_WidgetMgr* pWidgetMgr = CFWL_WidgetMgr::GetInstance(); IFWL_Widget* pChild = pWidgetMgr->GetFirstChildWidget(pParent); while (pChild) { IFWL_ThemeProvider* pTheme = pChild->GetThemeProvider(); if (pTheme) { pTheme->SetThemeID(pChild, dwThemeID, FALSE); } FWL_SetChildThemeID(pChild, dwThemeID); pChild = pWidgetMgr->GetNextSiblingWidget(pChild); } }
static void FWL_SetChildThemeID(IFWL_Widget* pParent, FX_DWORD dwThemeID) { IFWL_WidgetMgr* pWidgetMgr = FWL_GetWidgetMgr(); IFWL_Widget* pChild = pWidgetMgr->GetWidget(pParent, FWL_WGTRELATION_FirstChild); while (pChild) { IFWL_ThemeProvider* pTheme = pChild->GetThemeProvider(); if (pTheme) { pTheme->SetThemeID(pChild, dwThemeID, FALSE); } FWL_SetChildThemeID(pChild, dwThemeID); pChild = pWidgetMgr->GetWidget(pChild, FWL_WGTRELATION_NextSibling); } }
IFWL_ThemeProvider* IFWL_Widget::GetAvailableTheme() { if (m_pProperties->m_pThemeProvider) return m_pProperties->m_pThemeProvider; IFWL_Widget* pUp = this; do { pUp = (pUp->GetStyles() & FWL_WGTSTYLE_Popup) ? m_pWidgetMgr->GetOwnerWidget(pUp) : m_pWidgetMgr->GetParentWidget(pUp); if (pUp) { IFWL_ThemeProvider* pRet = pUp->GetThemeProvider(); if (pRet) return pRet; } } while (pUp); return nullptr; }