// 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; }
// checklistmode: 0=notepad 1=logbook 2=... void dlgChecklistShowModal(short checklistmode){ InitNotepad(); LoadChecklist(checklistmode); // check if loaded really something 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) 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); wDetails->SetWidth(wf->GetWidth() - wDetails->GetLeft()-2); wDetailsEntry = (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmDetailsEntry")); //ASSERT(wDetailsEntry!=NULL); if (wDetailsEntry==NULL) { StartupStore(_T("..... NOTEPAD ERROR NULL frmDetailsEntry!\n")); goto deinit; } wDetailsEntry->SetCanFocus(true); // ScrollbarWidth is initialised from DrawScrollBar in WindowControls, so it might not be ready here if ( wDetails->ScrollbarWidth == -1) { #if defined (PNA) #define SHRINKSBFACTOR 1.0 // shrink width factor. Range .1 to 1 where 1 is very "fat" #else #define SHRINKSBFACTOR 0.75 // shrink width factor. Range .1 to 1 where 1 is very "fat" #endif wDetails->ScrollbarWidth = (int) (SCROLLBARWIDTH_INITIAL * ScreenDScale * SHRINKSBFACTOR); } wDetailsEntry->SetWidth(wDetails->GetWidth() - wDetails->ScrollbarWidth - 5); page = 0; NextPage(0); wf->ShowModal(); delete wf; wf = NULL; deinit: DeinitNotepad(); return; }