Exemplo n.º 1
0
bool
AnalysisWidget::KeyPress(unsigned key_code)
{
  switch (key_code) {
  case KEY_LEFT:
#ifdef GNAV
  case '6':
    // Key F14 added in order to control the Analysis-Pages with the Altair RemoteStick
  case KEY_F14:
#endif
    previous_button.SetFocus();
    NextPage(-1);
    return true;

  case KEY_RIGHT:
#ifdef GNAV
  case '7':
    // Key F13 added in order to control the Analysis-Pages with the Altair RemoteStick
  case KEY_F13:
#endif
    next_button.SetFocus();
    NextPage(+1);
    return true;

  default:
    return false;
  }
}
Exemplo n.º 2
0
static bool
FormKeyDown(unsigned key_code)
{
  switch (key_code) {
  case KEY_UP:
    wDetails->ScrollVertically(-3);
    return true;

  case KEY_DOWN:
    wDetails->ScrollVertically(3);
    return true;

  case KEY_LEFT:
#ifdef GNAV
  case '6':
#endif
    ((WndButton *)wf->FindByName(_T("cmdPrev")))->SetFocus();
    NextPage(-1);
    return true;

  case KEY_RIGHT:
#ifdef GNAV
  case '7':
#endif
    ((WndButton *)wf->FindByName(_T("cmdNext")))->SetFocus();
    NextPage(+1);
    return true;

  default:
    return false;
  }
}
Exemplo n.º 3
0
static bool
FormKeyDown(unsigned key_code)
{
  assert(wf != NULL);

  switch (key_code) {
  case KEY_LEFT:
#ifdef GNAV
  case '6':
    // Key F14 added in order to control the Analysis-Pages with the Altair RemoteStick
  case KEY_F14:
#endif
    ((WndButton *)wf->FindByName(_T("cmdPrev")))->SetFocus();
    NextPage(-1);
    return true;

  case KEY_RIGHT:
#ifdef GNAV
  case '7':
    // Key F13 added in order to control the Analysis-Pages with the Altair RemoteStick
  case KEY_F13:
#endif
    ((WndButton *)wf->FindByName(_T("cmdNext")))->SetFocus();
    NextPage(+1);
    return true;

  default:
    return false;
  }
}
Exemplo n.º 4
0
static bool
FormKeyDown(WndForm &Sender, unsigned key_code)
{
  (void)Sender;

  switch (key_code) {
  case VK_LEFT:
#ifdef GNAV
  case '6':
#endif
    ((WndButton *)wf->FindByName(_T("cmdPrev")))->set_focus();
    NextPage(-1);
    return true;

  case VK_RIGHT:
#ifdef GNAV
  case '7':
#endif
    ((WndButton *)wf->FindByName(_T("cmdNext")))->set_focus();
    NextPage(+1);
    return true;

  default:
    return false;
  }
}
Exemplo n.º 5
0
static void
OnGesture(const TCHAR* gesture)
{
  if (_tcscmp(gesture, _T("R")) == 0)
    NextPage(-1);
  else if (_tcscmp(gesture, _T("L")) == 0)
    NextPage(+1);
}
Exemplo n.º 6
0
void
AnalysisWidget::OnGesture(const TCHAR *gesture)
{
  if (StringIsEqual(gesture, _T("R")))
    NextPage(-1);
  else if (StringIsEqual(gesture, _T("L")))
    NextPage(+1);
}
Exemplo n.º 7
0
  /* virtual methods from class ActionListener */
  void OnAction(int id) override {
    switch (id) {
    case PREVIOUS:
      NextPage(-1);
      break;

    case NEXT:
      NextPage(1);
      break;

    case DETAILS:
      OnCalcClicked();
      break;
    }
  }
Exemplo n.º 8
0
void CTextWindow::WinKeyL(const TKeyEvent &aKey,const TTime &)
	{
	if (iDrawMode!=EDrawModeFonts || (aKey.iCode==EKeyEscape || NextPage()))
		CActiveScheduler::Stop();
	else
		iWin.Invalidate();
	}
Exemplo n.º 9
0
bool ScrollBar::HorzKey(dword key) {
	if(!IsVisible() || !IsEnabled() || GetRect().IsEmpty())
		return false;
	switch(key) {
	case K_CTRL_LEFT:
		PrevPage();
		break;
	case K_CTRL_RIGHT:
		NextPage();
		break;
	case K_LEFT:
		PrevLine();
		break;
	case K_RIGHT:
		NextLine();
		break;
	case K_HOME:
		Begin();
		break;
	case K_END:
		End();
		break;
	default:
		return false;
	}
	return true;
}
Exemplo n.º 10
0
bool ScrollBar::VertKey(dword key, bool homeend) {
	if(!IsVisible() || !IsEnabled() || GetRect().IsEmpty())
		return false;
	switch(key) {
	case K_PAGEUP:
		PrevPage();
		break;
	case K_PAGEDOWN:
		NextPage();
		break;
	case K_UP:
		PrevLine();
		break;
	case K_DOWN:
		NextLine();
		break;
	case K_HOME:
		if(!homeend) break;
	case K_CTRL_HOME:
	case K_CTRL_PAGEUP:
		Begin();
		break;
	case K_END:
		if(!homeend) break;
	case K_CTRL_END:
	case K_CTRL_PAGEDOWN:
		End();
		break;
	default:
		return false;
	}
	return true;
}
Exemplo n.º 11
0
void ScrollBar::LeftDown(Point p, dword) {
	push = GetMousePart();
	LLOG("ScrollBar::LeftDown(" << p << ")");
	LLOG("MousePos = " << GetMousePos() << ", ScreenView = " << GetScreenView()
	<< ", rel. pos = " << (GetMousePos() - GetScreenView().TopLeft()));
	LLOG("GetWorkArea = " << GetWorkArea());
	LLOG("VisibleScreenView = " << GetVisibleScreenView());
	LLOG("PartRect(0) = " << GetPartRect(0));
	LLOG("PartRect(1) = " << GetPartRect(1));
	LLOG("PartRect(2) = " << GetPartRect(2));
	LLOG("ScrollBar::LeftDown: mousepart = " << (int)push << ", rect = " << GetPartRect(push)
		<< ", overthumb = " << style->overthumb << ", slider = " << Slider());
	LLOG("thumbpos = " << thumbpos << ", thumbsize = " << thumbsize);
	if(push == 2)
		delta = GetHV(p.x, p.y) - thumbpos;
	else {
		if(jump) {
			delta = thumbsize / 2;
			Drag(p);
		}
		else
			if(push == 0)
				PrevPage();
			else
				NextPage();
	}
	SetCapture();
	Refresh();
	WhenLeftClick();
}
Exemplo n.º 12
0
void
PutPsFile(void)
{
    Prologue();
    Variables();

    CurvesInit();

    DoTitleAndBox();

    if (multipageflag) {
      Key(); // print multi-page key even if there are more than 20 bands 
      NextPage();
    }

    Axes();

    if (!multipageflag && (TWENTY != 0)) Key();

    Curves();

    if (!yflag) Marks();

    fprintf(psfp, "showpage\n");
}
Exemplo n.º 13
0
void
dlgChecklistShowModal(void)
{
  static bool first = true;
  if (first) {
    LoadChecklist();
    first = false;
  }

  wf = LoadDialog(CallBackTable, XCSoarInterface::main_window,
                      Layout::landscape ?
                      _T("IDR_XML_CHECKLIST_L") : _T("IDR_XML_CHECKLIST"));
  if (!wf)
    return;

  nTextLines = 0;

  wf->SetKeyDownNotify(FormKeyDown);

  ((WndButton *)wf->FindByName(_T("cmdClose")))->SetOnClickNotify(OnCloseClicked);

  wDetails = (WndProperty*)wf->FindByName(_T("frmDetails"));
  assert(wDetails != NULL);

  page = 0;
  NextPage(0); // JMW just to turn proper pages on/off

  wf->ShowModal();

  delete wf;
}
Exemplo n.º 14
0
/*****************************************************************************
 * Advance by one line. I crossed page boundary, go to next page
*****************************************************************************/
static void NextLine( void )
{
  row++;
  column = 0;
  if ( row == HIWORD( dwCharExtent ) )
     NextPage();
}
Exemplo n.º 15
0
void
dlgChecklistShowModal()
{
  static bool first = true;
  if (first) {
    LoadChecklist();
    first = false;
  }

  wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
                      Layout::landscape ?
                      _T("IDR_XML_CHECKLIST_L") : _T("IDR_XML_CHECKLIST"));
  if (!wf)
    return;

  nTextLines = 0;

  wf->SetKeyDownNotify(FormKeyDown);

  wDetails = (WndProperty*)wf->FindByName(_T("frmDetails"));
  assert(wDetails != NULL);

  page = 0;
  NextPage(0); // JMW just to turn proper pages on/off

  wf->ShowModal();

  delete wf;
}
Exemplo n.º 16
0
void ScrollBar::LeftRepeat(Point p, dword) {
	if(jump || push < 0 || push == 2) return;
	if(push == 0)
		PrevPage();
	else
		NextPage();
	Refresh();
}
Exemplo n.º 17
0
bool
WaypointDetailsWidget::KeyPress(unsigned key_code)
{
  switch (key_code) {
  case KEY_LEFT:
    previous_button.SetFocus();
    NextPage(-1);
    return true;

  case KEY_RIGHT:
    next_button.SetFocus();
    NextPage(+1);
    return true;

  default:
    return false;
  }
}
Exemplo n.º 18
0
static int FormKeyDown(WindowControl * Sender, WPARAM wParam, LPARAM lParam){
  (void)lParam; (void)Sender;
  switch(wParam & 0xffff){
    case VK_LEFT:
    case '6':
      SetFocus(((WndButton *)wf->FindByName(TEXT("cmdPrev")))->GetHandle());
      NextPage(-1);
      //((WndButton *)wf->FindByName(TEXT("cmdPrev")))->SetFocused(true, NULL);
    return(0);
    case VK_RIGHT:
    case '7':
      SetFocus(((WndButton *)wf->FindByName(TEXT("cmdNext")))->GetHandle());
      NextPage(+1);
      //((WndButton *)wf->FindByName(TEXT("cmdNext")))->SetFocused(true, NULL);
    return(0);
  }
  return(1);
}
Exemplo n.º 19
0
void dlgChecklistShowModal(void){
  static bool first=true;
  if (first) {
    LoadChecklist();
    first=false;
  }

  //  WndProperty *wp;

  if (!ScreenLandscape) {
    char filename[MAX_PATH];
    LocalPathS(filename, TEXT("dlgChecklist_L.xml"));
    wf = dlgLoadFromXML(CallBackTable, 
                        filename, 
                        hWndMainWindow,
                        TEXT("IDR_XML_CHECKLIST_L"));
  } else {
    char filename[MAX_PATH];
    LocalPathS(filename, TEXT("dlgChecklist.xml"));
    wf = dlgLoadFromXML(CallBackTable,                        
                        filename, 
                        hWndMainWindow,
                        TEXT("IDR_XML_CHECKLIST"));
  }

  nTextLines = 0;

  if (!wf) return;

  wf->SetKeyDownNotify(FormKeyDown);

  ((WndButton *)wf->FindByName(TEXT("cmdClose")))->SetOnClickNotify(OnCloseClicked);

  wDetails = (WndListFrame*)wf->FindByName(TEXT("frmDetails"));
  ASSERT(wDetails!=NULL);

  wDetailsEntry = 
    (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmDetailsEntry"));
  ASSERT(wDetailsEntry!=NULL);
  wDetailsEntry->SetCanFocus(true);

  wDetails->SetBorderKind(BORDERLEFT);

  page = 0;

  NextPage(0); // JMW just to turn proper pages on/off

  wf->ShowModal();

  delete wf;

  wf = NULL;

}
Exemplo n.º 20
0
DIntermissionController::DIntermissionController(FIntermissionDescriptor *Desc, bool DeleteDesc, BYTE state)
{
	mDesc = Desc;
	mDeleteDesc = DeleteDesc;
	mIndex = 0;
	mAdvance = false;
	mSentAdvance = false;
	mScreen = NULL;
	mFirst = true;
	mGameState = state;
	NextPage();
}
Exemplo n.º 21
0
bool ComixFrameHandler::KeyPressed( const OIS::KeyEvent &arg )
{	
	if( arg.key == OIS::KC_LCONTROL ||
		arg.key == OIS::KC_RCONTROL ||
		arg.key == OIS::KC_LMENU ||
		arg.key == OIS::KC_RMENU ||
		arg.key == OIS::KC_TAB)
		return false;
	
	NextPage();
	return true;
}
Exemplo n.º 22
0
static bool FormKeyDown(WndForm* pWnd, unsigned KeyCode) {
    Window * pBtn = NULL;

    switch (KeyCode & 0xffff) {
        case KEY_LEFT:
        case '6':
            pBtn = pWnd->FindByName(TEXT("cmdPrev"));
            NextPage(pWnd, -1);
            break;
        case KEY_RIGHT:
        case '7':
            pBtn = pWnd->FindByName(TEXT("cmdNext"));
            NextPage(pWnd, +1);
            break;;
    }
    if (pBtn) {
        pBtn->SetFocus();
        return true;
    }

    return false;
}
Exemplo n.º 23
0
/*****************************************************************************
 * Write a string to the current document
*****************************************************************************/
void WriteString(char* sz, int len)
{
   int tabn = (int)CURRENT_FILE->tabsout_num;
   int i=0;
   char *p=NULL;
   char ch=0;
   DWORD dwNumWritten=0;

   if ( pd.hDC == NULL )
      return;
   if ( !documentON )
      StartDocument( );
   for (i = 0,p = sz; i < len; p++, i++)
   {
      ch = *p;
      switch ( ch )
      {
         case '\n':                             // Line-feed
            NextLine();
            break;

         case '\f' :                             // Form-feed
            NextPage();
            break;

         case '\r' :                             // Carriage-return
            column = 0;
            break;

         case '\t' :                             // Tab
            column += tabn - (column % tabn);
            if ( bLineWrapping
            && column >= LOWORD(dwCharExtent) )
               NextLine();
            break;
         default :
            if ( isprint(ch) )
            {
               if (defaultprinter)
                  TextOut(pd.hDC, column++, row, &ch, 1);
               else
                  WritePrinter( hPrinter, p, 1, &dwNumWritten );
               // Wrap line
               if ( bLineWrapping
               && column >= LOWORD(dwCharExtent) )
                  NextLine();
            }
            break;
      } // End switch
   }
}
Exemplo n.º 24
0
  /* virtual methods from class ActionListener */
  void OnAction(int id) override {
    switch (id) {
    case GOTO:
      OnGotoClicked();
      break;

    case MAGNIFY:
      OnMagnifyClicked();
      break;

    case SHRINK:
      OnShrinkClicked();
      break;

    case PREVIOUS:
      NextPage(-1);
      break;

    case NEXT:
      NextPage(1);
      break;
    }
  }
Exemplo n.º 25
0
void dlgChecklistShowModal(void){
  static bool first=true;
  if (first) {
    LoadChecklist();
    first=false;
  }

  //  WndProperty *wp;

  if (!InfoBoxLayout::landscape) {
    wf = dlgLoadFromXML(CallBackTable,
                        TEXT("dlgChecklist_L.xml"),
                        XCSoarInterface::main_window,
                        TEXT("IDR_XML_CHECKLIST_L"));
  } else {
    wf = dlgLoadFromXML(CallBackTable,
                        TEXT("dlgChecklist.xml"),
                        XCSoarInterface::main_window,
                        TEXT("IDR_XML_CHECKLIST"));
  }

  nTextLines = 0;

  if (!wf) return;

  wf->SetKeyDownNotify(FormKeyDown);

  ((WndButton *)wf->FindByName(TEXT("cmdClose")))->SetOnClickNotify(OnCloseClicked);

  wDetails = (WndListFrame*)wf->FindByName(TEXT("frmDetails"));
  assert(wDetails!=NULL);

  wDetailsEntry =
    (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmDetailsEntry"));
  assert(wDetailsEntry!=NULL);
  wDetailsEntry->SetCanFocus(true);

  wDetails->SetBorderKind(BORDERLEFT);

  page = 0;

  NextPage(0); // JMW just to turn proper pages on/off

  wf->ShowModal();

  delete wf;

  wf = NULL;

}
Exemplo n.º 26
0
DIntermissionController::DIntermissionController(FIntermissionDescriptor *Desc, bool DeleteDesc, BYTE state)
{
	mDesc = Desc;
	mDeleteDesc = DeleteDesc;
	mIndex = 0;
	mAdvance = false;
	mSentAdvance = false;
	mScreen = NULL;
	mFirst = true;
	mGameState = state;

	// If the intermission finishes straight away then cancel the wipe.
	if(!NextPage())
		wipegamestate = GS_FINALE;
}
Exemplo n.º 27
0
static bool
FormKeyDown(unsigned key_code)
{
  switch (key_code) {
  case KEY_LEFT:
#ifdef GNAV
  case '6':
#endif
    ((WndButton *)form->FindByName(_T("cmdPrev")))->SetFocus();
    NextPage(-1);
    return true;

  case KEY_RIGHT:
#ifdef GNAV
  case '7':
#endif
    ((WndButton *)form->FindByName(_T("cmdNext")))->SetFocus();
    NextPage(+1);
    return true;

  default:
    return false;
  }
}
Exemplo n.º 28
0
        // do the moving
        int Move(int count, SumatraUIAutomationTextRange* target, int* target_page, int* target_glyph) {
            this->target = target;
            this->target_page = target_page;
            this->target_glyph = target_glyph;

            int retVal = 0;
            if (count > 0) {
                for (int i=0;i<count && (NextPage() || NextEndpoint());++i)
                    ++retVal;
            } else {
                for (int i=0;i<-count && (PreviousPage() || PrevEndpoint());++i)
                    ++retVal;
            }

            return retVal;
        }
Exemplo n.º 29
0
// checklistmode: 0=notepad 1=logbook 2=...
void dlgChecklistShowModal(short checklistmode){

  InitNotepad();
  LoadChecklist(checklistmode); // check if loaded really something

  wf = dlgLoadFromXML(CallBackTable, 
                        ScreenLandscape ? TEXT("dlgChecklist_L.xml") : TEXT("dlgChecklist_P.xml"), 
                        ScreenLandscape ? IDR_XML_CHECKLIST_L : IDR_XML_CHECKLIST_P);

  aTextLine.clear();

  if (!wf) goto deinit;

  wf->SetKeyDownNotify(FormKeyDown);

  ((WndButton *)wf->FindByName(TEXT("cmdClose")))->SetOnClickNotify(OnCloseClicked);

  wDetails = (WndListFrame*)wf->FindByName(TEXT("frmDetails"));
  //ASSERT(wDetails!=NULL);
  if (wDetails==NULL) {
	StartupStore(_T("..... NOTEPAD ERROR NULL frmDetails!\n"));
	goto deinit;
  }
  wDetails->SetBorderKind(BORDERLEFT);

  wDetailsEntry = (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmDetailsEntry"));
  //ASSERT(wDetailsEntry!=NULL);
  if (wDetailsEntry==NULL) {
	StartupStore(_T("..... NOTEPAD ERROR NULL frmDetailsEntry!\n"));
	goto deinit;
  }
  wDetailsEntry->SetCanFocus(true);

  page = 0;
  NextPage(0);

  wf->ShowModal();

  delete wf;
  wf = NULL;

deinit:

  DeinitNotepad();
  return;

}
Exemplo n.º 30
0
void UIScrollText::ProcessEvent( const InputManager::INPUTKEYS evt )
{

    switch(evt)
    {
        case InputManager::CONFIRM:
            if (!NextPage())
            {
                // No more next page
                if ( (mParentLayout) && (mNextEvent) )
                    mParentLayout->SetEventHandler(mNextEvent);
            }
            break;
        default:
            break;
    }

}