/** * @brief Close parent page and display a child sub-page * @param pParent : parent page * @param PageIndex : sub-page index * @retval None */ static void CONSOLE_SwitchPage(GL_Page_TypeDef* pParent, uint32_t PageIndex) { /* Switch to new page, and free previous one. */ GL_Page_TypeDef* NextPage = NULL; (*pParent).ShowPage(pParent, GL_FALSE); DestroyPage(pParent); free(pParent); pParent = NULL; if (PageIndex == PAGE_MENU) { GL_ShowMainMenu(); return; } CONSOLE_CreatePage(PageIndex); switch (PageIndex) { case CONSOLE_MAIN_PAGE: NextPage = ConsoleMainPage; break; default: break; } RefreshPage(NextPage); }
void CNewWizDialog::OnDestroy() { CNewWizPage* pPage; POSITION Pos = m_PageList.GetHeadPosition(); while (Pos) { pPage = (CNewWizPage*)m_PageList.GetNext(Pos); // this function could return FALSE, but if it happens here // it is too late to do anything about it! VERIFY(DestroyPage(pPage)); } CDialog::OnDestroy(); }
/** * @brief Close parent page and display a child sub-page * @param pParent : parent page * @param PageIndex : sub-page index * @retval None */ static void ETHERNET_SwitchPage(GL_Page_TypeDef* pParent, uint32_t PageIndex) { /* Switch to new page, and free previous one */ GL_Page_TypeDef* NextPage = NULL; (*pParent).ShowPage(pParent, GL_FALSE); DestroyPage(pParent); free(pParent); pParent = NULL; if(PageIndex == PAGE_MENU) { GL_ShowMainMenu(); return; } ETHERNET_CreatePage(PageIndex); switch (PageIndex) { case ETHERNET_MAIN_PAGE: NextPage = EthernetMainPage; break; case ETHERNET_WEBSERVER_PAGE: NextPage = EthernetWebServerPage; break; case ETHERNET_DISTANTCONTROL_PAGE: NextPage = EthernetDistantControlPage; break; case ETHERNET_SETTINGS: NextPage = EthernetSettingssPage; break; case ETHERNET_WARNING_PAGE: case ETHERNET_BCKMSG_PAGE: NextPage = EthernetWarningPage; break; default: break; } EthernetWebServerPage = NextPage; RefreshPage(NextPage); }
static void RECORDER_SwitchPage(GL_Page_TypeDef* pParent, uint32_t PageIndex) { /* Switch to new page, and free previous one. */ GL_Page_TypeDef* NextPage = NULL; (*pParent).ShowPage(pParent, GL_FALSE); DestroyPage(pParent); free(pParent); pParent = NULL; if(PageIndex == PAGE_MENU) { GL_ShowMainMenu(); return; } RECORDER_CreatePage(PageIndex); switch (PageIndex) { case RECORDER_MAIN_PAGE: NextPage = RecorderMainPage; break; case RECORDER_RECORD_PAGE: NextPage = RecordPage; break; case RECORDER_SETTINGS_PAGE: NextPage = SettingsPage; break; case RECORDER_ERROR_PAGE: NextPage = RecorderErrorPage; break; default: break; } RefreshPage(NextPage); }