/** * 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); } }
/** * 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); }
/** * 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 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); }
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); }