CTask *tour_put,*tour_task; Bool tour_okay_pressed; U0 TourPutTask() { CDoc *doc; I64 ch; DocTermNew; WinHorz(TEXT_COLS/2,TEXT_COLS-2); WinVert(TEXT_ROWS/2+5,TEXT_ROWS-7); LBts(&Fs->display_flags,DISPLAYf_WIN_ON_TOP); WinToTop; Fs->border_src=BDS_CONST; Fs->border_attr=LTGRAY<<4+DrvTextAttrGet(':')&15; Fs->text_attr =LTGRAY<<4+BLUE; Fs->win_inhibit=WIG_NO_FOCUS_TASK_DFT; doc=DocPut; doc->flags|=DOCF_FORM; DocCursor(FALSE,doc); "$WW+H,1$"; while (TRUE) { Refresh; if (ScanMsg(&ch,,1<<MSG_KEY_DOWN) && (ch==CH_ESC||ch==CH_SHIFT_ESC)) { Kill(tour_task->parent_task,FALSE); break; } DocLock(doc); if (ch==CH_SPACE && doc->cur_entry!=doc) { if (doc->cur_entry->de_flags & DOCEF_LINK) '' CH_SPACE; else if (doc->cur_entry->type_u8==DOCT_BTTN) tour_okay_pressed=TRUE; } DocUnlock(doc); if (tour_okay_pressed) { Fs->win_inhibit=WIG_NO_FOCUS_TASK_DFT; if (sys_focus_task==Fs) WinRefocus; } else { Fs->win_inhibit=0; WinFocus; } } tour_put=NULL; } U0 TourPut(U8 *st,Bool wait_okay=FALSE) { CDoc *doc; CTask *old_focus_task; if (TaskValidate(tour_put)) { doc=DocPut(tour_put); DocClear(doc); DocPrint(doc,"%s",st); if (!wait_okay) tour_okay_pressed=TRUE; else { DocPrint(doc,"\n\n$CM-RE+CX,LE=-2$$BT,\"Okay\",LM=\"b\"$\n\n"); DocFormBwd(doc); old_focus_task=sys_focus_task; tour_okay_pressed=FALSE; do Refresh; while (!tour_okay_pressed); WinFocus(old_focus_task); DocClear(doc); } } else Kill(tour_task,,TRUE); } public I64 PopUpTourPart() { I64 i; CDoc *doc=DocNew; DocPrint(doc,"$PURPLE$TempleOS/TinkerOS Tours$FG$\n\n" "$CM+LX,4,4$$BT,\"Part 1: TempleOS Tours (start here)\",LE=1$" "$CM+LX,4,4$$BT,\"Part 2: TinkerOS Tours\",LE=2$" "$CM+LX,4,4$$BT,\"Part 3: HolyC Language\",LE=3$" "$CM+LX,4,4$$BT,\"Done\",LE=DOCM_CANCEL$\n"); doc->flags|=DOCF_FORM; i=PopUpPrint("WinMax;DocMenu(0x%X,0);",doc); DocDel(doc); return i; } U0 TourMenu() { U8 buf[STR_LEN]; I64 i; // tour_task=Fs; // tour_okay_pressed=TRUE; // tour_put=Spawn(&TourPutTask,NULL,"TourPut",,Fs); // TaskWait(tour_put); while (TRUE) { Cd(__DIR__); AutoComplete; // if (LBtr(&tour_put->display_flags,DISPLAYf_SHOW)) // WinZBufUpdate; i=PopUpTourPart; if (i>0) { // if (!LBts(&tour_put->display_flags,DISPLAYf_SHOW)) // WinZBufUpdate; if (i==1) { ExeFile("TempleOS.IN"); } else if (i==2) { ExeFile("TinkerOS.IN"); } else if (i==3) { ExeFile("HolyC.IN"); } } else break; } Kill(tour_put); } "DocClear;WinMax;\n"; Refresh(2); TourMenu; Msg(MSG_KEY_DOWN,0,SC_CURSOR_DOWN|SCF_CTRL); "Cd;Dir;\n"; "Cdd(\"/Misc/Tour\");\n";