/** * @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 CUITradeSellBBS::MsgRecv_RefreshData(DataPack *pDataPack, int &iOffset) { int iLen; m_Datas.clear(); for( int i = 0 ; i < TRADE_BBS_MAX_LINE ; i++ ) { __InfoTradeSellBBS Info; Info.sID = CAPISocket::Parse_GetShort(pDataPack->m_pData, iOffset); iLen = CAPISocket::Parse_GetShort(pDataPack->m_pData, iOffset); if(iLen>0) CAPISocket::Parse_GetString(pDataPack->m_pData, iOffset, Info.szID, iLen); iLen = CAPISocket::Parse_GetShort(pDataPack->m_pData, iOffset); if(iLen>0) CAPISocket::Parse_GetString(pDataPack->m_pData, iOffset, Info.szTitle, iLen); iLen = CAPISocket::Parse_GetShort(pDataPack->m_pData, iOffset); if(iLen>0) CAPISocket::Parse_GetString(pDataPack->m_pData, iOffset, Info.szExplanation, iLen); Info.iPrice = CAPISocket::Parse_GetDword(pDataPack->m_pData, iOffset); //아이템에 제시한 가격 Info.sIndex = CAPISocket::Parse_GetShort(pDataPack->m_pData, iOffset); //등록된 인덱스 if( Info.sID != -1 ) m_Datas.push_back(Info); } short sPage = CAPISocket::Parse_GetShort(pDataPack->m_pData, iOffset); short sTotal = CAPISocket::Parse_GetShort(pDataPack->m_pData, iOffset); TRACE("TRADE_BBS_PAGE:%d\n",sPage); m_iCurPage = sPage; m_iMaxPage = sTotal / TRADE_BBS_MAX_LINE; if( (sTotal % TRADE_BBS_MAX_LINE) > 0 ) m_iMaxPage++; RefreshPage(); }
bool CWebClient::OnContextMenuCommand( CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefContextMenuParams> params, int command_id, EventFlags event_flags) { CEF_REQUIRE_UI_THREAD(); switch (command_id) { case CLIENT_ID_SHOW_DEVTOOLS: ShowDevTools(this, browser, CefPoint()); return true; case CLIENT_ID_CLOSE_DEVTOOLS: CloseDevTools(browser); return true; case CLIENT_ID_INSPECT_ELEMENT: ShowDevTools(this, browser, CefPoint(params->GetXCoord(), params->GetYCoord())); return true; case CLIENT_ID_RELOAD: RefreshPage(browser, true); return true; default: // Allow default handling, if any. return false; } }
/** * @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); }
/** * @brief Display the main menu * @param None * @retval None */ void GL_ShowMainMenu(void) { uint8_t TempStr[25]; RTC_TimeTypeDef RTC_TimeStructure; RTC_DateTypeDef RTC_DateStructure; GL_PageControls_TypeDef *Icon , *LabelTime , *LabelDate, *LabelBkgnd; uint8_t sec, min, hour, day, month; uint16_t year; GL_Clear(White); GL_HomePage = malloc(sizeof(GL_Page_TypeDef)); Create_PageObj( GL_HomePage, HOME_PAGE_ID ); /* Add group icons */ Icon = NewIcon(2 , Group_Connectivity_icon, BF_XSIZE, BF_YSIZE ,GL_ShowConnectivityGroup ); AddPageControlObj(305, 40, Icon, GL_HomePage ); Icon = NewIcon(3 , Group_Multimedia_icon, BF_XSIZE, BF_YSIZE ,GL_ShowMultimediaGroup ); AddPageControlObj(305, 103, Icon, GL_HomePage ); Icon = NewIcon(4 , Group_System_icon, BF_XSIZE, BF_YSIZE ,GL_ShowUtilitiesGroup ); AddPageControlObj(305, 166, Icon, GL_HomePage ); Icon = NewIcon(32 , STLogo, 40, 22 ,MOD_NullFunc ); AddPageControlObj(240, 216, Icon, GL_HomePage ); LabelBkgnd = NewLabel(33, (uint8_t *)"",GL_HORIZONTAL,GL_FONT_SMALL,GL_Red, GL_FALSE); AddPageControlObj(195, 227, LabelBkgnd, GL_HomePage); /* add modules */ switch(GL_Group) { case CONNECTIVITY_GROUP : GL_ShowConnectivityGroup(); break; case MULTIMEDIA_GROUP : GL_ShowMultimediaGroup(); break; case UTILITIES_GROUP : GL_ShowUtilitiesGroup(); break; } GL_HomePage->CustomPreDraw = DrawBackgroundZone; /* time section */ /* Get info from RTC here */ RTC_GetTime(RTC_Format_BIN, &RTC_TimeStructure); sec = RTC_TimeStructure.RTC_Seconds; min = RTC_TimeStructure.RTC_Minutes; hour = RTC_TimeStructure.RTC_Hours; sprintf((char *)TempStr, "%02d:%02d:%02d", hour , min, sec); LabelTime = NewLabel(30,TempStr,GL_HORIZONTAL,GL_FONT_SMALL,0x1253, GL_FALSE); AddPageControlObj(60, 215, LabelTime, GL_HomePage); RTC_GetDate(RTC_Format_BIN, &RTC_DateStructure); year = RTC_DateStructure.RTC_Year + 2000; month = RTC_DateStructure.RTC_Month; day = RTC_DateStructure.RTC_Date; sprintf((char *)TempStr, "%02d %s %04d", day , strMonth[month-1], year); LabelDate = NewLabel(31,TempStr,GL_HORIZONTAL,GL_FONT_SMALL,0x1253, GL_FALSE); AddPageControlObj(88, 227, LabelDate, GL_HomePage); RefreshPage(GL_HomePage); vTaskResume(Core_Time_Task_Handle); Global_Config.b.Force_Background_Refresh = 1; }