Esempio n. 1
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();
}
Esempio n. 2
0
void dlgHelpShowModal(const TCHAR* Caption, const TCHAR* HelpText) {
  if (!Caption || !HelpText) {
    return;
  }
  InitHelp();

  wf = dlgLoadFromXML(CallBackTable, 
                        ScreenLandscape ? TEXT("dlgHelp_L.xml") : TEXT("dlgHelp_P.xml"),
                        ScreenLandscape ? IDR_XML_HELP_L : IDR_XML_HELP_P);

  LKASSERT(wf);
  if (!wf) goto _getout;

  TCHAR fullcaption[100];
  _stprintf(fullcaption,TEXT("%s: %s"), gettext(TEXT("_@M336_")), Caption); // Help
  wf->SetCaption(fullcaption);

  wHelp = (WndListFrame*)wf->FindByName(TEXT("frmDetails"));
  wHelpEntry = (WndOwnerDrawFrame *)NULL;
  DrawListIndex=0;

  LKASSERT(wHelp!=NULL);
  if (!wHelp) goto _getout;

  wHelp->SetBorderKind(BORDERLEFT);
  
  wHelpEntry = (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmDetailsEntry"));
  LKASSERT(wHelpEntry);
  if (!wHelpEntry) goto _getout;
  wHelpEntry->SetCanFocus(true);

  {
    LKWindowSurface Surface(*wHelpEntry);
    Surface.SelectObject(wHelpEntry->GetFont());
    aTextLine.update(Surface, wHelpEntry->GetWidth(), LKgethelptext(HelpText));
  }

  wHelp->ResetList();
  wHelp->Redraw();
  wf->ShowModal();
  delete wf;
  
  aTextLine.clear();
  

_getout:
  wf = NULL;

}
Esempio n. 3
0
void dlgHelpShowModal(const TCHAR* Caption, const TCHAR* HelpText) {
  if (!Caption || !HelpText) {
    return;
  }

  if (!ScreenLandscape) {
    char filename[MAX_PATH];
    LocalPathS(filename, TEXT("dlgHelp_L.xml"));
    wf = dlgLoadFromXML(CallBackTable, 
                        filename,
                        hWndMainWindow,
                        TEXT("IDR_XML_HELP_L"));
  } else {
    char filename[MAX_PATH];
    LocalPathS(filename, TEXT("dlgHelp.xml"));
    wf = dlgLoadFromXML(CallBackTable, 
                        filename, 
                        hWndMainWindow,
                        TEXT("IDR_XML_HELP"));
  }
  WndProperty* wp;

  if (wf) {

    TCHAR fullcaption[100];
    _stprintf(fullcaption,TEXT("%s: %s"), gettext(TEXT("_@M336_")), Caption); // Help

    wf->SetCaption(fullcaption);

    wp = (WndProperty*)wf->FindByName(TEXT("prpHelpText"));
    if (wp) {
      wp->SetText(LKgethelptext(HelpText));
      wp->RefreshDisplay();
    }
    wf->ShowModal();
    delete wf;
  }
  wf = NULL;

}