Example #1
0
bool dlgAirspaceShowModal(bool coloredit){

  colormode = coloredit;

  WndForm *wf = dlgLoadFromXML(CallBackTable, ScreenLandscape ? IDR_XML_AIRSPACE_L : IDR_XML_AIRSPACE_P);
  if (!wf) return false;

  WndListFrame* wAirspaceList = (WndListFrame*)wf->FindByName(TEXT("frmAirspaceList"));
  LKASSERT(wAirspaceList!=NULL);
  wAirspaceList->SetBorderKind(BORDERLEFT);
  wAirspaceList->SetEnterCallback(OnAirspaceListEnter);

  WndOwnerDrawFrame* wAirspaceListEntry = (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmAirspaceListEntry"));
  if(wAirspaceListEntry) {
    wAirspaceListEntry->SetCanFocus(true);
  }

  UpdateList(wAirspaceList);

  changed = false;

  wf->ShowModal();

  delete wf;

  return changed;
}
Example #2
0
void dlgHelpShowModal(const TCHAR* Caption, const TCHAR* HelpText) {
  if (!Caption || !HelpText) {
    return;
  }

  std::unique_ptr<WndForm> wf(dlgLoadFromXML(CallBackTable, ScreenLandscape ? IDR_XML_HELP_L : IDR_XML_HELP_P));
  if(!wf) {
    return;
  }
  WndListFrame* wHelp = static_cast<WndListFrame*>(wf->FindByName(TEXT("frmDetails")));
  if(!wHelp) {
    return;
  }
  wHelp->SetBorderKind(BORDERLEFT);

  WndOwnerDrawFrame* wHelpEntry = static_cast<WndOwnerDrawFrame*>(wf->FindByName(TEXT("frmDetailsEntry")));
  if (!wHelpEntry) {
    return;
  };
  wHelpEntry->SetCanFocus(true);

  DrawListIndex=0;

  TCHAR fullcaption[100];
  _stprintf(fullcaption,TEXT("%s: %s"), MsgToken(336), Caption); // Help
  wf->SetCaption(fullcaption);

  aTextLine.clear();

  {
    LKWindowSurface Surface(*wHelpEntry);

    const auto oldFont = Surface.SelectObject(wHelpEntry->GetFont());
    const int minHeight = Surface.GetTextHeight(_T("dp")) + 2 * DLGSCALE(2);
    const int wHeight = wHelpEntry->GetHeight();
    if(minHeight != wHeight) {
      wHelpEntry->SetHeight(minHeight);
    }

    aTextLine.update(Surface, wHelpEntry->GetWidth(), LKgethelptext(HelpText));

    Surface.SelectObject(oldFont);
  }

  wHelp->ResetList();
  wHelp->Redraw();
  wf->ShowModal();

  aTextLine.clear();
}
Example #3
0
    void Show() {
        TCHAR filename[MAX_PATH];
        const TCHAR *resName = NULL;
        if (!ScreenLandscape) {
            LocalPathS(filename, TEXT("dlgBluetooth_L.xml"));
            resName = TEXT("IDR_XML_BLUETOOTH_L");
        } else {
            LocalPathS(filename, TEXT("dlgBluetooth.xml"));
            resName = TEXT("IDR_XML_BLUETOOTH");
        }
        wfBth = dlgLoadFromXML(CallBackTable, filename, resName);
        if (wfBth) {

            WndListFrame* BthList = (WndListFrame*) wfBth->FindByName(TEXT("frmBthList"));
            if (BthList) {
                BthList->SetBorderKind(BORDERLEFT | BORDERTOP | BORDERRIGHT | BORDERBOTTOM);
                BthList->SetWidth(wfBth->GetWidth() - BthList->GetLeft() - IBLSCALE(4));

                // Bug : we need ClientHeight, but Cleint Rect is Calculated by OnPaint
                // BthList->SetHeight(wfBth->GetHeight() - BthList->GetTop() - 2);
                if (BthList->ScrollbarWidth == -1) {
                    BthList->ScrollbarWidth = (int) (SCROLLBARWIDTH_INITIAL * ScreenDScale);
                }

                WndOwnerDrawFrame* BthListEntry = (WndOwnerDrawFrame*) wfBth->FindByName(TEXT("frmBthListEntry"));
                if (BthListEntry) {
                    BthListEntry->SetCanFocus(true);
                    BthListEntry->SetWidth(BthList->GetWidth() - BthList->ScrollbarWidth - 5);
                }

                BthList->ResetList();
                BthList->Redraw();
            }

            if (wfBth->ShowModal()) {
                CBtHandler * pBtHandler = CBtHandler::Get();
                if (pBtHandler) {
                    pBtHandler->ClearDevices();
                    pBtHandler->FillDevices();
                }
                RefreshComPortList();
            }

            delete wfBth;
            wfBth = NULL;
        }
    }
Example #4
0
void dlgIgcFileShowModal() {
    TCHAR filename[MAX_PATH];
    const TCHAR *resName = NULL;
    if (!ScreenLandscape) {
        LocalPathS(filename, TEXT("dlgIgcFile.xml"));
        resName = TEXT("IDR_XML_IGCFILE");
    } else {
        LocalPathS(filename, TEXT("dlgIgcFile_L.xml"));
        resName = TEXT("IDR_XML_IGCFILE_L");
    }
    wfDlg = dlgLoadFromXML(DlgIgcFile::CallBackTable, filename, resName);
    if (wfDlg) {

        WndListFrame* wndFileList = (WndListFrame*) wfDlg->FindByName(TEXT("frmIgcFileList"));
        if (wndFileList) {
            wndFileList->SetBorderKind(BORDERLEFT | BORDERTOP | BORDERRIGHT | BORDERBOTTOM);
            wndFileList->SetWidth(wfDlg->GetWidth() - wndFileList->GetLeft() - IBLSCALE(4));

            // Bug : we need ClientHeight, but Cleint Rect is Calculated by OnPaint
            // wndFileList->SetHeight(wfDlg->GetHeight() - wndFileList->GetTop() - 2);
            if (wndFileList->ScrollbarWidth == -1) {
                wndFileList->ScrollbarWidth = (int) (SCROLLBARWIDTH_INITIAL * ScreenDScale);
            }

            WndOwnerDrawFrame* FileListEntry = (WndOwnerDrawFrame*) wfDlg->FindByName(TEXT("frmIgcFileListEntry"));
            if (FileListEntry) {
                FileListEntry->SetCanFocus(true);
                FileListEntry->SetWidth(wndFileList->GetWidth() - wndFileList->ScrollbarWidth - 5);
            }

            DlgIgcFile::ScanFile();

            wndFileList->ResetList();
            wndFileList->Redraw();
        }
    }

    if (wfDlg->ShowModal()) {

    }

    delete wfDlg;
    wfDlg = NULL;
}
Example #5
0
// checklistmode: 0=notepad 1=logbook 2=...
void dlgChecklistShowModal(short checklistmode){

  WndListFrame* wDetails = NULL;
  WndOwnerDrawFrame* wDetailsEntry = NULL;

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

  WndForm* wf = dlgLoadFromXML(CallBackTable, 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"));
  if (!wDetails) {
    StartupStore(_T("..... NOTEPAD ERROR NULL frmDetails!\n"));
    goto deinit;
  }
  wDetails->SetBorderKind(BORDERLEFT);

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

  page = 0;
  NextPage(wf, 0);

  wf->ShowModal();


deinit:

  delete wf;
  DeinitNotepad();
}