/********************************************************************* * * _GetNextInGroup */ static WM_HWIN _GetNextInGroup(WM_HWIN hWin, U8 GroupId) { for (; hWin; hWin = WM_GetNextSibling(hWin)) { if (_IsInGroup(hWin, GroupId)) { return hWin; } } return 0; }
/********************************************************************* * * _SetWidgetEffect * * Purpose: * Sets the effect for the given widget and recursive for its child windows */ static void _SetWidgetEffect(WM_HWIN hWin, const WIDGET_EFFECT * pEffect) { WM_HWIN hChild; if (hWin) { WIDGET_SetEffect(hWin, pEffect); /* Set effect for the widget*/ /* Iterate over the child windows */ hChild = WM_GetFirstChild(hWin); while (hChild) { _SetWidgetEffect(hChild, pEffect); /* Set effect for the child windows */ hChild = WM_GetNextSibling(hChild); } } }
/***************************************************************************** * FUNCTION - ShowErrorMessage_C * DESCRIPTION: Displays an error message. * Further actions (Rebooting or ignoring errors when not debugging) depend * on the caller (or the caller of the caller...). * * Called by embOS\D3018X\OS_Error and Factory::FatalErrorOccured() * ****************************************************************************/ extern "C" void ShowErrorMessage_C(const char* errorDescription = "-") { int i; char sz_msg[250]; WM_HWIN win; WM_HWIN win_next; GUI_RECT rect; WM_SelectWindow(WM_GetDesktopWindow()); win = WM_GetFirstChild(WM_GetDesktopWindow()); while(win != (WM_HWIN) NULL) { win_next = WM_GetNextSibling(win); WM_DeleteWindow(win); win = win_next; } WM_SetStayOnTop(WM_GetDesktopWindow(),1); WM_BringToTop(WM_GetDesktopWindow()); GUI_SetBkColor(GUI_WHITE); GUI_SetColor(GUI_BLACK); GUI_SetFont(&Helvetica_57_13); GUI_Clear(); sprintf(sz_msg, "Fatal error.\n\n %s", errorDescription); rect.x0 = 0; rect.y0 = 10; rect.x1 = 239; rect.y1 = 319; for (i=0; i<5; i++) { GUI_Clear(); GUI_Delay(100); GUI_DispStringInRect(sz_msg,&rect,GUI_TA_VCENTER|GUI_TA_HCENTER); GUI_Delay(500); } }