/** * Create the screen */ void ScreenMainCW_Create(void) { Create_PageObj(s_pThisScreen); // Title GL_PageControls_TypeDef* ctrlPskText = Widget_NewLabel("CW Screen", LCD_COLOR_YELLOW, LCD_COLOR_BLACK, 1, GL_FONTOPTION_16x24, 0); AddPageControlObj(0, 80, ctrlPskText, s_pThisScreen); // FFT Widget_AddToPage_NewFFTDisplay(80, 0, s_pThisScreen); // "Standard" complement of main screen buttons: // .. Mode GL_PageControls_TypeDef* btnMode = Widget_NewBigButtonMode(); AddPageControlObj(0, 0, btnMode, s_pThisScreen); // .. Options GL_PageControls_TypeDef* btnOptions = Widget_NewBigButtonOptions(); AddPageControlObj(0, LCD_HEIGHT - 42, btnOptions, s_pThisScreen); // .. Frequency GL_PageControls_TypeDef* btnFreq = Widget_NewBigButtonFrequency(); AddPageControlObj( LCD_WIDTH - ((GL_Custom_TypeDef*)(btnFreq->objPTR))->GetWidth(btnFreq), LCD_HEIGHT - ((GL_Custom_TypeDef*)(btnFreq->objPTR))->GetHeight(btnFreq), btnFreq, s_pThisScreen); // .. Rx & Tx buttons (Remove when code can automatically switch) GL_PageControls_TypeDef* btnRx = NewButton(10, " Rx ", rx_Click); GL_PageControls_TypeDef* btnTx = NewButton(9, " Tx ", tx_Click); AddPageControlObj(120, LCD_HEIGHT - 42, btnRx, s_pThisScreen); AddPageControlObj(165, LCD_HEIGHT - 42, btnTx, s_pThisScreen); }
/** * Create the screen */ void ScreenEditText_Create(void) { Create_PageObj(s_pThisScreen); /* * Create the UI widgets */ s_lblStatus = Widget_NewLabel("Tap Item then Edit.", LCD_COLOR_WHITE, LCD_COLOR_BLACK, 0, GL_FONTOPTION_8x12Bold, 0); GL_PageControls_TypeDef* btnStore = NewButton(0, " Store ", store_Click); GL_PageControls_TypeDef* btnEdit = NewButton(0, " Edit ", edit_Click); GL_PageControls_TypeDef* btnDone = NewButton(0, " Done ", done_Click); // Populate the options buttons: for (int i = 0; i < Text_Items; i++) { GL_PageControls_TypeDef* btnText = NewButton(ID_TEXT_START + i, Text_GetName(i), textButton_Click); int x = (i / BUTTONS_PER_COLUMN) * COLUMN_WIDTH; int y = (i % BUTTONS_PER_COLUMN) * SPACE_PER_BUTTON_Y + FIRST_BUTTON_Y; AddPageControlObj(x, y, btnText, s_pThisScreen); } // Button Row AddPageControlObj(90, LCD_HEIGHT - 50, s_lblStatus, s_pThisScreen); AddPageControlObj(120 , LCD_HEIGHT - 30, btnStore, s_pThisScreen); AddPageControlObj(0, LCD_HEIGHT - 30, btnEdit, s_pThisScreen); AddPageControlObj(LCD_WIDTH - 75, LCD_HEIGHT - 30, btnDone, s_pThisScreen); }
void ExampleInit() { bPlaySmall = NewButton("Play small file (it can overlap itself)"); bPlay1 = NewButton("Play big file 1"); bPlay2 = NewButton("Play big file 2"); bStop1 = NewButton("Stop big file 1"); bStop2 = NewButton("Stop big file 2"); //you must create a manager and specify if all your ogg is stereo and if audio should be stereo. soundManager = CSoundManager::createSoundManager(true, true); }
/** * Create the screen */ void ScreenMode_Create(void) { Create_PageObj(s_pThisScreen); /* * Create the title and directions texts */ GL_PageControls_TypeDef* lblTitle = Widget_NewLabel("Mode Selection", LCD_COLOR_WHITE, LCD_COLOR_BLACK, 0, GL_FONTOPTION_16x24, 0); GL_PageControls_TypeDef* lblDirections = Widget_NewLabel("Tap button for desired mode.", LCD_COLOR_BLUE, LCD_COLOR_BLACK, 0, GL_FONTOPTION_8x12Bold, 0); AddPageControlObj(0, 10, lblTitle, s_pThisScreen); AddPageControlObj(0, 35, lblDirections, s_pThisScreen); // Populate the Mode buttons and descriptions: for (int i = 0; i < USERMODE_NUM_MODES; i++) { GL_PageControls_TypeDef* btnMode = NewButton(ID_MODEBTN_START + i, Mode_GetUserModeName(i), modeButton_Click); int btnX = BUTTON_LEFT; int btnY = i * SPACE_PER_BUTTON_Y + FIRST_BUTTON_Y; AddPageControlObj(btnX, btnY, btnMode, s_pThisScreen); GL_PageControls_TypeDef* lblDescription = Widget_NewLabel(Mode_GetUserModeDescription(i), LCD_COLOR_YELLOW, LCD_COLOR_BLACK, 1, GL_FONTOPTION_8x12Bold, 0); int lblX = LABEL_LEFT; int lblY = i * SPACE_PER_BUTTON_Y + FIRST_BUTTON_Y + LABEL_OFFSET_Y; AddPageControlObj(lblX, lblY, lblDescription, s_pThisScreen); } }
void ExampleInit() { Presage::start(); AppendMessage(Presage::getStatus()); g_ShowAdButton = NewButton("Show an Ad"); }
void ScreenAdvanced_Create(void) { Create_PageObj(s_pThisScreen); /* * Create the UI widgets */ GL_PageControls_TypeDef* lblTitle = Widget_NewLabel("Advanced", LCD_COLOR_WHITE, LCD_COLOR_BLACK, 0, GL_FONTOPTION_16x24, 0); GL_PageControls_TypeDef* lblDirections1 = Widget_NewLabel("Tap to select", LCD_COLOR_WHITE, LCD_COLOR_BLACK, 0, GL_FONTOPTION_8x12Bold, 0); GL_PageControls_TypeDef* lblDirections2 = Widget_NewLabel("setting changes value", LCD_COLOR_WHITE, LCD_COLOR_BLACK, 0, GL_FONTOPTION_8x12Bold, 0); s_lblStatus = Widget_NewLabel("Tap setting to exit", LCD_COLOR_WHITE, LCD_COLOR_BLACK, 0, GL_FONTOPTION_8x12Bold, 0); GL_PageControls_TypeDef* btnOptionsBigButton = Widget_NewBigButtonOptions(); GL_PageControls_TypeDef* btnDefaults = NewButton(0, "Defaults", defaults_Click); GL_PageControls_TypeDef* btnCalibrate = NewButton(13, "Cal. Screen", calibrate_Click); /* * Place the widgets onto the screen */ // Title AddPageControlObj( 0, 0, lblTitle, s_pThisScreen); AddPageControlObj(115, 0, lblDirections1, s_pThisScreen); AddPageControlObj(115, 10, lblDirections2, s_pThisScreen); // Populate the options buttons: for (int i = START_ADVANCED_OPTIONS; i < END_ADVANCED_OPTIONS; i++) { GL_PageControls_TypeDef* btnOption = NewButton(ID_OPTION_START + i, Options_GetName(i), optionButton_Click); int x = ((i - START_ADVANCED_OPTIONS) / BUTTONS_PER_ADV_COLUMN) * COLUMN_WIDTH; int y = ((i - START_ADVANCED_OPTIONS) % BUTTONS_PER_ADV_COLUMN) * SPACE_PER_BUTTON_Y + FIRST_BUTTON_Y; AddPageControlObj(x, y, btnOption, s_pThisScreen); } // Button Row AddPageControlObj(0, LCD_HEIGHT - 42, btnOptionsBigButton, s_pThisScreen); AddPageControlObj(0, LCD_HEIGHT - 60, s_lblStatus, s_pThisScreen); AddPageControlObj(204, FIRST_BUTTON_Y, btnCalibrate, s_pThisScreen); AddPageControlObj(85, LCD_HEIGHT - 30, btnDefaults, s_pThisScreen); }
//-------------------------------------------------------------------------- void ExampleInit() { //Register for standard pointer events s3ePointerRegister(S3E_POINTER_BUTTON_EVENT, (s3eCallback)SingleTouchButtonCB, NULL); s3ePointerRegister(S3E_POINTER_MOTION_EVENT, (s3eCallback)SingleTouchMotionCB, NULL); // Init buttons. startBtn = NewButton("Start MAT SDK"); showParmsBtn = NewButton("Show SDK Parameters"); sendInstallBtn = NewButton("Send Install"); sendEventRefBtn = NewButton("Send Event With Ref"); sendEventBtn = NewButton("Send Event Items"); setDebugBtn = NewButton("Set Debug on/off"); int32 osInt = s3eDeviceGetInt(S3E_DEVICE_OS); if (osInt == S3E_OS_ID_ANDROID) { strcpy(g_package_name, "com.marmaladeandroidtest"); strcpy(g_site_id, "7488"); } else { strcpy(g_package_name, "2GLFC47AY5.com.hasoffers.marmaladeTestApp"); strcpy(g_site_id, "6864"); } SetButtonScale(2); }
void ExampleInit() { g_ButtonHidebarSticky = NewButton("Hide nav bar - sticky mode"); g_ButtonHideBarNonSticky = NewButton("Hide nav bar - non-sticky"); g_ButtonHideBarNonImmersive = NewButton("Hide nav bar - non-immersive"); g_ButtonShow = NewButton("Show nav bar"); g_ButtonShowBars = NewButton("Show nav & status bars if supported"); g_ButtonCheck = NewButton("Check available"); s3eDeviceRegister(S3E_DEVICE_PAUSE, _pauseCallback, NULL); s3eDeviceRegister(S3E_DEVICE_UNPAUSE, _resumeCallback, NULL); }
/** * Create the screen */ void ScreenOptions_Create(void) { Create_PageObj(s_pThisScreen); /* * Create the UI widgets */ GL_PageControls_TypeDef* lblTitle = Widget_NewLabel("Settings", LCD_COLOR_WHITE, LCD_COLOR_BLACK, 0, GL_FONTOPTION_16x24, 0); GL_PageControls_TypeDef* lblDirections1 = Widget_NewLabel("Tap to select", LCD_COLOR_WHITE, LCD_COLOR_BLACK, 0, GL_FONTOPTION_8x12Bold, 0); GL_PageControls_TypeDef* lblDirections2 = Widget_NewLabel("setting changes value", LCD_COLOR_WHITE, LCD_COLOR_BLACK, 0, GL_FONTOPTION_8x12Bold, 0); s_lblStatus = Widget_NewLabel("Tap setting to exit", LCD_COLOR_WHITE, LCD_COLOR_BLACK, 0, GL_FONTOPTION_8x12Bold, 0); GL_PageControls_TypeDef* btnOptionsBigButton = Widget_NewBigButtonOptions(); GL_PageControls_TypeDef* btnAdvanced = NewButton(15, " Advanced ", advanced_Click); GL_PageControls_TypeDef* btnFunctions = NewButton(17, "Keyboard Fn", functionEditButton_Click); GL_PageControls_TypeDef* btnPrograms = NewButton(18, " Screen Fn ", programEditButton_Click); GL_PageControls_TypeDef* btnTags = NewButton(19, " <Tags> ", tagEditButton_Click); GL_PageControls_TypeDef* btnFilter = NewButton(20, " Filter ", Screen_filter_Click); /* * Place the widgets onto the screen */ // Title AddPageControlObj( 0, 0, lblTitle, s_pThisScreen); AddPageControlObj(115, 0, lblDirections1, s_pThisScreen); AddPageControlObj(115, 10, lblDirections2, s_pThisScreen); // Populate the options buttons: for (int i = START_BASIC_OPTIONS; i < END_BASIC_OPTIONS; i++) { GL_PageControls_TypeDef* btnOption = NewButton(ID_OPTION_START + i, Options_GetName(i), optionButton_Click); int x = (i / BUTTONS_PER_COLUMN) * COLUMN_WIDTH; int y = (i % BUTTONS_PER_COLUMN) * SPACE_PER_BUTTON_Y + FIRST_BUTTON_Y; AddPageControlObj(x, y, btnOption, s_pThisScreen); } // Button Row AddPageControlObj(0, LCD_HEIGHT - 42, btnOptionsBigButton, s_pThisScreen); AddPageControlObj(0, LCD_HEIGHT - 60, s_lblStatus, s_pThisScreen); AddPageControlObj(220, FIRST_BUTTON_Y, btnAdvanced, s_pThisScreen); AddPageControlObj(220, FIRST_BUTTON_Y + SPACE_PER_BUTTON_Y, btnFunctions, s_pThisScreen); AddPageControlObj(220, FIRST_BUTTON_Y + 2 * SPACE_PER_BUTTON_Y, btnPrograms, s_pThisScreen); AddPageControlObj(220, FIRST_BUTTON_Y + 3 * SPACE_PER_BUTTON_Y, btnTags, s_pThisScreen); AddPageControlObj(220, FIRST_BUTTON_Y + 4 * SPACE_PER_BUTTON_Y, btnFilter, s_pThisScreen); }
/** * @brief Create a child sub-page * @param Page : Page handler * @retval None */ static void CONSOLE_CreatePage(uint8_t Page) { GL_PageControls_TypeDef *ExitButton; switch (Page) { case CONSOLE_MAIN_PAGE: { ConsoleMainPage = malloc(sizeof(GL_Page_TypeDef)); Create_PageObj( ConsoleMainPage, CONSOLE_MAIN_PAGE ); ExitButton = NewButton(1, (uint8_t *)" Return ", return_to_menu); AddPageControlObj(195, 212, ExitButton, ConsoleMainPage); GL_SetPageHeader(ConsoleMainPage , (uint8_t *)"Events Log"); Label0 = NewLabel(2, (uint8_t *)"", GL_HORIZONTAL, GL_FONT_SMALL, GL_Green, GL_TRUE); AddPageControlObj(307, 40, Label0, ConsoleMainPage); Label1 = NewLabel(3,(uint8_t *) "", GL_HORIZONTAL, GL_FONT_SMALL, GL_Green, GL_TRUE); AddPageControlObj(307, 52, Label1, ConsoleMainPage); Label2 = NewLabel(4, (uint8_t *)"", GL_HORIZONTAL, GL_FONT_SMALL, GL_Green, GL_TRUE); AddPageControlObj(307, 64, Label2, ConsoleMainPage); Label3 = NewLabel(5,(uint8_t *)"", GL_HORIZONTAL, GL_FONT_SMALL, GL_Green, GL_TRUE); AddPageControlObj(307, 76, Label3, ConsoleMainPage); Label4 = NewLabel(6, (uint8_t *)"", GL_HORIZONTAL, GL_FONT_SMALL, GL_Green, GL_TRUE); AddPageControlObj(307, 88, Label4, ConsoleMainPage); Label5 = NewLabel(7, (uint8_t *)"", GL_HORIZONTAL, GL_FONT_SMALL, GL_Green, GL_TRUE); AddPageControlObj(307, 100, Label5, ConsoleMainPage); Label6 = NewLabel(8, (uint8_t *)"", GL_HORIZONTAL, GL_FONT_SMALL, GL_Green, GL_TRUE); AddPageControlObj(307, 112, Label6, ConsoleMainPage); Label7 = NewLabel(9, (uint8_t *)"", GL_HORIZONTAL, GL_FONT_SMALL, GL_Green, GL_TRUE); AddPageControlObj(307, 124, Label7, ConsoleMainPage); Label8 = NewLabel(10, (uint8_t *)"", GL_HORIZONTAL, GL_FONT_SMALL, GL_Green, GL_TRUE); AddPageControlObj(307, 136, Label8, ConsoleMainPage); Label9 = NewLabel(11, (uint8_t *)"", GL_HORIZONTAL, GL_FONT_SMALL, GL_Green, GL_TRUE); AddPageControlObj(307, 148, Label9, ConsoleMainPage); Label10 = NewLabel(12, (uint8_t *)"", GL_HORIZONTAL, GL_FONT_SMALL, GL_Green, GL_TRUE); AddPageControlObj(307, 160, Label10, ConsoleMainPage); Label11 = NewLabel(13, (uint8_t *)"", GL_HORIZONTAL, GL_FONT_SMALL, GL_Green, GL_TRUE); AddPageControlObj(307, 172, Label11, ConsoleMainPage); ConsoleMainPage->CustomPreDraw = DrawConsoleBackground; ConsoleMainPage->CustomPostDraw = CONSOLE_Refresh; ptr_back = Console_Msg.ptr ; } break; default: break; } }
/** * @brief Create a child sub-page * @param Page: Page handler * @retval None */ static void ETHERNET_CreatePage(uint8_t Page) { GL_PageControls_TypeDef* item; GL_PageControls_TypeDef* BackButton; GL_PageControls_TypeDef* ConfirmButton; GL_PageControls_TypeDef* Message; GL_ComboBoxGrp_TypeDef* pTmp; uint8_t str_address[64]; GL_SetBackColor( GL_White ); GL_SetTextColor( GL_Blue ); switch (Page) { case ETHERNET_MAIN_PAGE: { EthernetMainPage = malloc(sizeof(GL_Page_TypeDef)); Create_PageObj( EthernetMainPage, ETHERNET_MAIN_PAGE ); item = NewIcon (5, ethernet_icon,50,50,MOD_NullFunc); AddPageControlObj(185,40,item,EthernetMainPage); if((Global_Config.b.DistantControlEnabled != 0) && (Global_Config.b.BackgroundModeEnabled != 0)) { GL_SetMenuItem(EthernetMainPage, (uint8_t *)"Web Server",0,goto_webserver ); GL_SetMenuItem(EthernetMainPage, (uint8_t *)"Distant Control",1,goto_distantcontrol); GL_SetMenuItem(EthernetMainPage, (uint8_t *)"Settings",2,goto_EthernetSettingss ); GL_SetMenuItem(EthernetMainPage, (uint8_t *)"Return",3,return_to_menu ); } else { GL_SetMenuItem(EthernetMainPage, (uint8_t *)"Web Server",0,goto_webserver ); GL_SetMenuItem(EthernetMainPage, (uint8_t *)"Settings",1,goto_EthernetSettingss ); GL_SetMenuItem(EthernetMainPage, (uint8_t *)"Return",2,return_to_menu ); } GL_SetPageHeader(EthernetMainPage , (uint8_t *)"Ethernet Menu"); } break; case ETHERNET_WEBSERVER_PAGE: { EthernetWebServerPage = malloc(sizeof(GL_Page_TypeDef)); Create_PageObj( EthernetWebServerPage, ETHERNET_WEBSERVER_PAGE ); GL_SetPageHeader(EthernetWebServerPage , (uint8_t *)"Web Server"); item = NewIcon (1,ethernet_disconn_icon,50,50,MOD_NullFunc); AddPageControlObj(185,40,item,EthernetWebServerPage); BackButton= NewButton(2, (uint8_t *)" Return ",return_from_webserver); AddPageControlObj(195, 212, BackButton, EthernetWebServerPage); Message = NewLabel(3, (uint8_t *)" ",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black,GL_FALSE); AddPageControlObj(290,113,Message,EthernetWebServerPage); Message = NewLabel(4, (uint8_t *)" ",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black,GL_FALSE); AddPageControlObj(290,126,Message,EthernetWebServerPage); Message = NewLabel(5, (uint8_t *)" ",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black,GL_FALSE); AddPageControlObj(290,139,Message,EthernetWebServerPage); Message = NewLabel(6, (uint8_t *)" ",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black,GL_FALSE); AddPageControlObj(290,160,Message,EthernetWebServerPage); Message = NewLabel(7, (uint8_t *)" ",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black,GL_FALSE); AddPageControlObj(290,173,Message,EthernetWebServerPage); Message = NewLabel(8, (uint8_t *)" ",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black,GL_FALSE); AddPageControlObj(290,186,Message,EthernetWebServerPage); EthernetWebServerPage->CustomPostDraw = InitEthernet; } break; case ETHERNET_DISTANTCONTROL_PAGE: { EthernetDistantControlPage = malloc(sizeof(GL_Page_TypeDef)); Create_PageObj( EthernetDistantControlPage, ETHERNET_DISTANTCONTROL_PAGE ); GL_SetPageHeader(EthernetDistantControlPage , (uint8_t *)"Distant Control"); item = NewIcon (1,ethernet_conn_icon,50,50,MOD_NullFunc); AddPageControlObj(185,40,item,EthernetDistantControlPage); BackButton= NewButton(2, (uint8_t *)" Return ",return_from_distantcontrol); AddPageControlObj(195, 212, BackButton, EthernetDistantControlPage); Message = NewLabel(3, (uint8_t *)" ",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black,GL_FALSE); AddPageControlObj(290,113,Message,EthernetDistantControlPage); Message = NewLabel(4, (uint8_t *)" ",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black,GL_FALSE); AddPageControlObj(290,126,Message,EthernetDistantControlPage); Message = NewLabel(5, (uint8_t *)" ",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black,GL_FALSE); AddPageControlObj(290,139,Message,EthernetDistantControlPage); Message = NewLabel(6, (uint8_t *)" ",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black,GL_FALSE); AddPageControlObj(290,160,Message,EthernetDistantControlPage); EthernetDistantControlPage->CustomPostDraw = InitEthernet; } break; case ETHERNET_SETTINGS: { EthernetSettingssPage = malloc(sizeof(GL_Page_TypeDef)); Create_PageObj( EthernetSettingssPage, ETHERNET_SETTINGS ); item = NewIcon (1,ethernet_settings_icon,50,50,MOD_NullFunc); AddPageControlObj(185,40,item,EthernetSettingssPage); BackButton= NewButton(2, (uint8_t *)" Return ",return_from_settings); AddPageControlObj(195, 212, BackButton, EthernetSettingssPage); item= NewCheckbox(3 , (uint8_t *)"Enable DHCP Client", GL_TRUE, MOD_NullFunc); AddPageControlObj(260, 105, item, EthernetSettingssPage); item = NewLabel(4, (uint8_t *)"Image Format:",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black,GL_FALSE); AddPageControlObj(260,145,item,EthernetSettingssPage); item = NewComboBoxGrp(5); AddComboOption (item->objPTR, (uint8_t *)"BMP QQVGA", MOD_NullFunc); AddComboOption (item->objPTR, (uint8_t *)"BMP QVGA", MOD_NullFunc); AddPageControlObj( 260, 160, item, EthernetSettingssPage); GL_SetPageHeader(EthernetSettingssPage , (uint8_t *)"Ethernet Settings Menu"); MOD_GetParam(3, &EthCfg.d32); if(EthCfg.b.DHCPEnable == 1) { GL_SetChecked(EthernetSettingssPage, 3, EthCfg.b.DHCPEnable); } pTmp = (GL_ComboBoxGrp_TypeDef*)(item->objPTR); if((EthCfg.b.SelectedImageFormat > 0) && (EthCfg.b.SelectedImageFormat < 3)) { pTmp->ComboOptions[0]->IsActive = GL_FALSE; pTmp->ComboOptions[EthCfg.b.SelectedImageFormat -1]->IsActive = GL_TRUE; } } break; case ETHERNET_WARNING_PAGE: { EthernetWarningPage = malloc(sizeof(GL_Page_TypeDef)); Create_PageObj( EthernetWarningPage, ETHERNET_WARNING_PAGE ); BackButton= NewButton(2, (uint8_t *)" Cancel ",return_from_warning); AddPageControlObj(230, 212,BackButton,EthernetWarningPage); ConfirmButton= NewButton(3, (uint8_t *)"Disable",disable_distant_control); AddPageControlObj(150, 212,ConfirmButton,EthernetWarningPage); item = NewIcon (4,error_icon,50,50,MOD_NullFunc); AddPageControlObj(185, 40, item, EthernetWarningPage); GL_SetPageHeader(EthernetWarningPage , (uint8_t *)"Ethernet : warning"); item = NewLabel(5, (uint8_t *)"The Distant control feature is currently",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black, GL_TRUE); AddPageControlObj(310,100,item,EthernetWarningPage); item = NewLabel(6, (uint8_t *)"enabled. You need to disable the used",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black, GL_TRUE); AddPageControlObj(310,113,item,EthernetWarningPage); item = NewLabel(7, (uint8_t *)"processes and try later. do you want to",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black, GL_TRUE); AddPageControlObj(310,126,item,EthernetWarningPage); item = NewLabel(8, (uint8_t *)"disable the Distant control feature?",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black, GL_TRUE); AddPageControlObj(310,139,item,EthernetWarningPage); if(ETHERNET_CableConnectionStatus == 0) { sprintf((char *)str_address, "[IP Address : %s]",IPAddressAssigned); item = NewLabel(9,str_address,GL_HORIZONTAL,GL_FONT_SMALL,GL_Black, GL_FALSE); } else { item = NewLabel(9, (uint8_t *)"Network Cable is unplugged !!!",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black, GL_FALSE); } AddPageControlObj(310,160,item,EthernetWarningPage); EthernetWarningPage->CustomPostDraw = wUpdateConnectionStatus; } break; case ETHERNET_BCKMSG_PAGE: { EthernetWarningPage = malloc(sizeof(GL_Page_TypeDef)); Create_PageObj( EthernetWarningPage, ETHERNET_BCKMSG_PAGE ); item= NewButton(2, (uint8_t *)" OK ",return_bkgnd_from_errorpage); AddPageControlObj(185,212,item,EthernetWarningPage); item = NewIcon (3,error_icon,50,50,MOD_NullFunc); AddPageControlObj(185, 40, item, EthernetWarningPage); GL_SetPageHeader(EthernetWarningPage , (uint8_t *)"System : Warning"); item = NewLabel(4, (uint8_t *)"A Background process is already running, (uint8_t *)",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black, GL_TRUE); AddPageControlObj(310,100,item,EthernetWarningPage); item = NewLabel(5, (uint8_t *)"Background mode can not be disabled.",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black, GL_TRUE); AddPageControlObj(310,113,item,EthernetWarningPage); } default: break; } }
void ExampleInit() { #define NUM_MESSAGES 30 #define MESSAGE_LEN 80 InitMessages(NUM_MESSAGES, MESSAGE_LEN); AppendMessageColour(GREEN, "Checking for extension"); SetButtonScale(GetButtonScale()-1); g_MessageBox = NewButton("MessageBox"); if (s3eNOpenFeintAvailable()) { g_NOFInitialize = NewButton("OF Initialize"); g_NOFShutdown = NewButton("OF Shutdown"); g_NOFLaunchDashboard = NewButton("OF LaunchDashboard"); g_NOFTestButton1 = NewButton("OF Test 1"); g_NOFTestButton2 = NewButton("OF Test 2"); // Register for callbacks AppendMessageColour(BLUE, "*************"); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessage(""); AppendMessageColour(GREEN, "Registering for callback"); s3eNOpenFeintRegister(S3E_NOPENFEINT_CALLBACK_PLAYER_LOGGEDIN, &playerLoggedIn, NULL); s3eNOpenFeintRegister(S3E_NOPENFEINT_CALLBACK_DASHBOARD_DID_APPEAR, &dashBoardAppeared, NULL); s3eNOpenFeintRegister(S3E_NOPENFEINT_CALLBACK_DID_DOWNLOAD_ALL_CHALLENGE_DEFINITIONS, &didDownloadAllChallengeDefinitions, NULL); s3eNOpenFeintRegister(S3E_NOPENFEINT_CALLBACK_DID_FAIL_DOWNLOAD_CHALLENGE_DEFINITIONS, &didFailDownloadChallengeDefinitions, NULL); s3eNOpenFeintRegister(S3E_NOPENFEINT_CALLBACK_USER_LAUNCHED_CHALLENGE, &userLaunchedChallenge, NULL); s3eNOpenFeintRegister(S3E_NOPENFEINT_CALLBACK_IS_OPENFEINT_NOTIFICATION_ALLOWED, &isOpenFeintNotificationAllowed, NULL); } else { AppendMessageColour(RED,"Could not load s3eNOpenFeint extension"); return; } if(s3eFacebookAvailable()) { s3eFBInit("193667878484"); } else AppendMessageColour(RED,"Could not load s3eFacebook extension"); // if (!s3eIOSNotificationsAvailable()) // { // AppendMessageColour(RED,"Extension Not Available"); // return; // } // else { // // Register IOS Notification // // s3eDeviceRegister(S3E_DEVICE_PUSH_NOTIFICATION, RemotePushNotificationRecieved, 0); // s3eIOSNotificationsRegister(S3E_IOSNOTIFICATIONS_REMOTE, RemotePushNotificationRecieved, NULL); // // // s3eIOSNotificationsGetLaunchNotification(); // } // g_is3eNGAvailable = NewButton("IsNGAvailable"); }
static void RECORDER_CreatePage(uint8_t Page) { GL_PageControls_TypeDef* item; GL_PageControls_TypeDef* TimeInfo; GL_PageControls_TypeDef* ExitEventButton; GL_ComboBoxGrp_TypeDef* pTmp; uint8_t path[129]; GL_SetBackColor( GL_White ); GL_SetTextColor( GL_Blue ); switch (Page) { case RECORDER_MAIN_PAGE: { RecorderMainPage = malloc(sizeof(GL_Page_TypeDef)); Create_PageObj( RecorderMainPage, RECORDER_MAIN_PAGE ); item = NewIcon (REC_MAINICON_ID, recorder_icon,50,50,MOD_NullFunc); AddPageControlObj(185,40,item,RecorderMainPage); GL_SetMenuItem(RecorderMainPage, (uint8_t *)"Start Recorder",0, go_to_record_page ); GL_SetMenuItem(RecorderMainPage,(uint8_t *)"Settings",1, go_to_settings_page ); GL_SetMenuItem(RecorderMainPage,(uint8_t *)"Return",2, return_to_menu ); GL_SetPageHeader(RecorderMainPage , (uint8_t *)"Recorder Menu"); } break; case RECORDER_RECORD_PAGE: { RECORDER_GetDefaultDirectory(); /* Store selected settings */ MOD_GetParam(RECORDER_SETTINGS_MEM , &RecCfg.d32); switch (RecCfg.b.SampleRate) { case 0: case 1: RecorderSampleRate = 8000; break; case 2: RecorderSampleRate = 16000; break; } /* Deinit */ AudioRecorder_DeInit(); /* Initialize the recorder */ AudioRecorder_Init(RecorderSampleRate); RecordPage = malloc(sizeof(GL_Page_TypeDef)); Create_PageObj( RecordPage, RECORDER_RECORD_PAGE ); GL_SetPageHeader(RecorderMainPage , (uint8_t *)"Recorder"); /* Static display */ item = NewIcon (REC_MICLOGO_ID , rec_mic_logo, 110, 180, MOD_NullFunc); AddPageControlObj(300, 30, item, RecordPage); /*------------- Control icons */ ExitEventButton = NewButton(REC_RECEXIT_ID, (uint8_t *)" Return ", Exit_recorder); AddPageControlObj(195, 212, ExitEventButton, RecordPage); TimeInfo = NewLabel(REC_TIME_ID, (uint8_t *)"00:00", GL_HORIZONTAL, GL_FONT_BIG, GL_Red, GL_FALSE); AddPageControlObj(130,80, TimeInfo, RecordPage); item= NewLabel(REC_FILNAME_ID,(uint8_t *)"Press Record to start",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black, GL_FALSE); AddPageControlObj(170,40, item, RecordPage); item = NewIcon (REC_STRT_ID, rec_start_icon, 40, 40, RECORDER_Start); AddPageControlObj(170,135,item, RecordPage); item = NewIcon (REC_PAUSE_ID, rec_pause_icon, 40, 40, MOD_NullFunc); AddPageControlObj(110,135,item, RecordPage); item = NewIcon (REC_PLAY_ID, rec_play_icon, 40, 40, RECORDER_Play); AddPageControlObj(50,135,item, RecordPage); } break; case RECORDER_SETTINGS_PAGE: { MOD_GetParam(RECORDER_SETTINGS_MEM , &RecCfg.d32); SettingsPage = malloc(sizeof(GL_Page_TypeDef)); Create_PageObj( SettingsPage, RECORDER_RECORD_PAGE ); GL_SetPageHeader( SettingsPage , (uint8_t *)"Recorder Settings"); /* Exit button */ ExitEventButton = NewButton(1, (uint8_t *)" OK ", return_from_settings); AddPageControlObj(195, 212, ExitEventButton, SettingsPage); item = NewLabel(2, (uint8_t *)"Storage :", GL_HORIZONTAL, GL_FONT_SMALL, GL_Black, GL_FALSE); AddPageControlObj(260, 140, item, SettingsPage); item = NewButton(3, (uint8_t *)"...", Sel_folder); AddPageControlObj(120 , 150, item, SettingsPage); Check_DefaultPath((char *)path); if(strlen((char *)path) > REC_DST_PATH_LENGTH) { path[REC_DST_PATH_LENGTH - 2] = '.'; path[REC_DST_PATH_LENGTH - 1] = '.'; path[REC_DST_PATH_LENGTH] = 0; } item = NewLabel(4, path, GL_HORIZONTAL, GL_FONT_SMALL, GL_Blue, GL_FALSE); AddPageControlObj(260, 155, item, SettingsPage); /* Format selection settings */ item = NewLabel(4, (uint8_t *)"Audio Format: ", GL_HORIZONTAL, GL_FONT_SMALL, GL_Black, GL_FALSE); AddPageControlObj(260, 50, item, SettingsPage); item = NewComboBoxGrp(5); AddComboOption (item->objPTR, (uint8_t *)" PCM Wav ", set_encoder_wav); AddPageControlObj( 260, 65, item, SettingsPage); /* Sample Rate selection settings */ item = NewLabel(6, (uint8_t *)"Sample Rate:", GL_HORIZONTAL, GL_FONT_SMALL, GL_Black, GL_FALSE); AddPageControlObj(260, 95, item, SettingsPage); item = NewComboBoxGrp(7); AddComboOption (item->objPTR, (uint8_t *)" 8000 Hz ", MOD_NullFunc); AddComboOption (item->objPTR, (uint8_t *)" 16000 Hz ", MOD_NullFunc); AddPageControlObj( 260, 110, item, SettingsPage); pTmp = (GL_ComboBoxGrp_TypeDef*)(item->objPTR); if ((RecCfg.b.SampleRate > 0) && (RecCfg.b.SampleRate < 3)) { pTmp->ComboOptions[0]->IsActive = GL_FALSE; pTmp->ComboOptions[RecCfg.b.SampleRate -1]->IsActive = GL_TRUE; } } break; case RECORDER_ERROR_PAGE: { RecorderErrorPage = malloc(sizeof(GL_Page_TypeDef)); Create_PageObj( RecorderErrorPage, RECORDER_ERROR_PAGE ); ExitEventButton= NewButton(2, (uint8_t *)" OK ",return_from_errorpage); AddPageControlObj(185,212,ExitEventButton,RecorderErrorPage); item = NewIcon (3,error_icon,50,50,MOD_NullFunc); AddPageControlObj(185, 40, item, RecorderErrorPage); GL_SetPageHeader(RecorderErrorPage , (uint8_t *)"Audio Recorder : Error"); item = NewLabel(4,(uint8_t *)"An Audio process is already running in ",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black, GL_TRUE); AddPageControlObj(310,100,item,RecorderErrorPage); item = NewLabel(5,(uint8_t *)"background, Please stop it and try again.",GL_HORIZONTAL,GL_FONT_SMALL,GL_Black, GL_TRUE); AddPageControlObj(310,113,item,RecorderErrorPage); } break; default: break; } }
//Example Main void ExampleInit() { InitMessages(10,60); g_ButtonLogEvent = NewButton("Log Event"); g_ButtonLogTimedEvent = NewButton("Log Timed Event"); g_ButtonEndTimedEvent = NewButton("End Timed Event"); g_ButtonLogError = NewButton("Log Error"); g_ButtonUserInfo = NewButton("Set User Info"); g_ButtonUserLocation = NewButton("Log User Location"); g_ButtonToggleSendOnClose = NewButton("Disable send session report on close"); g_ButtonToggleSendOnPause = NewButton("Disable send session report on pause"); g_ButtonSetDefaultMessage = NewButton("Set Default Banner Message"); g_ButtonToggleAdBanner = NewButton("Toggle Ad Banner"); g_ButtonShowOfferWall = NewButton("Display Offer Wall"); g_ButtonLogEvent->m_Enabled = false; g_ButtonLogTimedEvent->m_Enabled = false; g_ButtonEndTimedEvent->m_Enabled = false; g_ButtonLogError->m_Enabled = false; g_ButtonUserInfo->m_Enabled = false; g_ButtonUserLocation->m_Enabled = false; g_ButtonToggleSendOnClose->m_Enabled = false; g_ButtonToggleSendOnPause->m_Enabled = false; g_ButtonSetDefaultMessage->m_Enabled = false; g_ButtonToggleAdBanner->m_Enabled = false; g_ButtonShowOfferWall->m_Enabled = false; if (!s3eFlurryAvailable()) { AppendMessageColour(RED,"Extension Not Available"); return; } // Enable AppCircle // We need to call this *before* calling s3eFlurryStart s3eFlurryAppCircleEnable(); //iOS Applicaton Key if(s3eDeviceGetInt (S3E_DEVICE_OS) == S3E_OS_ID_IPHONE) s3eFlurryStart("DNWX7I7XZYYL9V1QAZFC"); //Android Applicaton Key else if(s3eDeviceGetInt (S3E_DEVICE_OS) == S3E_OS_ID_ANDROID) s3eFlurryStart("HD4EZJ147ELQAT9H43KM"); g_ButtonLogEvent->m_Enabled = true; g_ButtonLogTimedEvent->m_Enabled = true; g_ButtonEndTimedEvent->m_Enabled = true; g_ButtonLogError->m_Enabled = true; g_ButtonUserInfo->m_Enabled = true; g_ButtonUserLocation->m_Enabled = true; g_ButtonToggleSendOnClose->m_Enabled = true; g_ButtonToggleSendOnPause->m_Enabled = true; g_ButtonSetDefaultMessage->m_Enabled = true; g_ButtonToggleAdBanner->m_Enabled = true; g_ButtonShowOfferWall->m_Enabled = true; s3eLocationStart(); }