예제 #1
0
void
KeyboardWidget::MoveButtons(const PixelRect &rc)
{
  MoveButtonsToRow(rc, _T("1234567890"), 0);
  MoveButtonsToRow(rc, _T("QWERTYUIOP"), 1);
  MoveButtonsToRow(rc, _T("ASDFGHJKL"), 2, button_width / 3);
  MoveButtonsToRow(rc, _T("ZXCVBNM,."), 3, button_width);

  if (IsLandscape(rc)) {
    MoveButton(_T('-'),
               rc.left + button_width * 9,
               rc.top + Layout::Scale(160));

    MoveButton(_T(' '),
               rc.left + Layout::Scale(80),
               rc.top + Layout::Scale(160));
    ResizeButton(_T(' '), Layout::Scale(93), Layout::Scale(40));
  } else {
    MoveButton(_T('-'),
               rc.left + button_width * 8,
               rc.top + button_height * 4);

    MoveButton(_T(' '),
               rc.left + button_width * 2,
               rc.top + button_height * 4);
    ResizeButton(_T(' '), button_width * 11 / 2, button_height);
  }

  if (show_shift_button)
    shift_button.Move(rc.left, rc.top + 3 * button_height);
}
예제 #2
0
파일: Keyboard.cpp 프로젝트: MindMil/XCSoar
void
KeyboardControl::MoveButtons()
{
  MoveButtonsToRow(_T("1234567890"), 0);
  MoveButtonsToRow(_T("QWERTYUIOP"), 1);
  MoveButtonsToRow(_T("ASDFGHJKL"), 2, button_width / 3);
  MoveButtonsToRow(_T("ZXCVBNM,."), 3, button_width * 2 / 3);

  if (IsLandscape()) {
    MoveButton(_T('-'), button_width * 9, Layout::Scale(160));

    MoveButton(_T(' '), Layout::Scale(80), Layout::Scale(160));
    ResizeButton(_T(' '), Layout::Scale(93), Layout::Scale(40));
  } else {
    MoveButton(_T('-'), button_width * 8, button_height * 4);

    MoveButton(_T(' '), button_width * 2, button_height * 4);
    ResizeButton(_T(' '), button_width * 11 / 2, button_height);
  }
}