char* alphaShowDialogue(void)
{
  char result;

  /* These need to be instantiated here since the width and height of 
     the lcd is retrieved dynamically depending on screen orientation */
  alphaBtnX[0] = ALPHA_COL1_LEFT;
  alphaBtnX[1] = ALPHA_COL2_LEFT;
  alphaBtnX[2] = ALPHA_COL3_LEFT;
  alphaBtnX[3] = ALPHA_COL4_LEFT;
  alphaBtnX[4] = ALPHA_COL5_LEFT;
  alphaBtnY[0] = ALPHA_ROW1_TOP;
  alphaBtnY[1] = ALPHA_ROW2_TOP;
  alphaBtnY[2] = ALPHA_ROW3_TOP;
  alphaBtnY[3] = ALPHA_ROW4_TOP;
  alphaBtnY[4] = ALPHA_ROW5_TOP;
  alphaBtnY[5] = ALPHA_ROW6_TOP;

  /* Initialise the string buffer */
  memset(&alphaString[0], 0, sizeof(alphaString));
  alphaString_ptr = alphaString;
  alphaPage = 0;

  /* Draw the background and render the buttons */
  drawFill(ALPHA_COLOR_BACKGROUND);
  alphaRefreshScreen();

  /* Capture results until the 'OK' button is pressed */
  while(1)
  {
    result = alphaHandleTouchEvent();
    if (result == '>') return (char *)&alphaString;
  }
}
Exemplo n.º 2
0
char* alphaShowDialogue(void)
{
  char result;

  /* These need to be instantiated here since the width and height of 
     the lcd is retrieved dynamically depending on screen orientation */
  alphaBtnX[0] = ALPHA_COL1_LEFT;
  alphaBtnX[1] = ALPHA_COL2_LEFT;
  alphaBtnX[2] = ALPHA_COL3_LEFT;
  alphaBtnX[3] = ALPHA_COL4_LEFT;
  alphaBtnX[4] = ALPHA_COL5_LEFT;
  alphaBtnY[0] = ALPHA_ROW1_TOP;
  alphaBtnY[1] = ALPHA_ROW2_TOP;
  alphaBtnY[2] = ALPHA_ROW3_TOP;
  alphaBtnY[3] = ALPHA_ROW4_TOP;
  alphaBtnY[4] = ALPHA_ROW5_TOP;
  alphaBtnY[5] = ALPHA_ROW6_TOP;

  /* Initialise the string buffer */
  memset(&alphaString[0], 0, sizeof(alphaString));
  alphaString_ptr = alphaString;
  alphaPage = 0;

  /* Draw the background and render the buttons */
  drawFill(COLOR_WHITE);
  drawRectangleFilled(0, ALPHA_KEYPAD_TOP - ALPHA_BTN_SPACING, lcdGetWidth() - 1, lcdGetHeight() - 1, COLOR_DARKGRAY);
  drawLine(0, (ALPHA_KEYPAD_TOP - ALPHA_BTN_SPACING) + 1, lcdGetWidth() - 1, (ALPHA_KEYPAD_TOP - ALPHA_BTN_SPACING) + 1, COLOR_LIGHTGRAY);
  alphaRefreshScreen();

  /* Capture results until the 'OK' button is pressed */
  while(1)
  {
    result = alphaHandleTouchEvent();
    if (result == '>') return (char *)&alphaString;
  }
}