unit alex; interface uses crt,objects,app,drivers,menus,views,dos,dialogs,graph; const cmwork=100; cmfon=101; cmfile_create=201; cmtabl=202; cmread_spisok=203; cmsort=204; type spisok=record naim:string[25]; opisanie:string[25]; cena:string[5]; end; type tnotebook=object(tapplication) procedure initmenubar;virtual; procedure HandleEvent(var Event: TEvent); virtual; procedure InitStatusLine;virtual; end; implementation {*********************************************************} { ??-Ū } {*********************************************************} procedure Tnotebook.initmenubar; var r:trect; begin getExtent(r); r.b.y:=succ(r.a.y); menubar:=new(pmenubar,init(r, newmenu( newsubmenu('~F~/" (c)"',hcnocontext, newmenu( {/////////////////////////////////////////////////////////////////} newitem('~1~/''(r)ý ĒŽ Ī (c)"','F2',kbF3,cmfile_create,hcnocontext, newline( {/////////////////////////////////////////////////////////////////} newitem('~2~/''ũ?ĄĒð ý --Ŧ? ũ Ī (c)"','F3',kbF2,cmtabl,hcnocontext, newline( {****************************************************************} newitem('~3~/''ôðĄ(r)ō','F4',kbF3,cmread_spisok,hcnocontext, {********************************************************************} newline( newitem('~4~/''(r) Ēð (r)ũ ĒŽ ĄôðĄ(r)ō','F5',kbF3,cmsort,hcnocontext, {**************************************************************} newline( {******************************************************************} {///////////////////////////////////////////////////////////////} newitem('~5~/''ŦĨ(r)ý','Alt+X',kbF9,cmquit,hcnocontext,nil)))))))))), {**************************************************************} newsubmenu('~E~/''ŦĨ(r)ý',hcnocontext, newmenu( newitem('~1~/...','',0,cmwork,hcnocontext, newitem('~2~/"?','',0,cmquit,hcnocontext,nil))), {**************************************************************} nil))))); end; {*********************************************************} { 'ō"Ū§?-ð?/(r)Ēō"Ū§?-ð? ōĢ Ą(r)  } {*********************************************************} PROCEDURE CURSOROFF; ASSEMBLER; ASM MOV AH,1 MOV CX,2020H {'>?'..."...??? ?"?'???} PROCEDURE CURSORON; ASSEMBLER; ASM MOV AH,1 MOV CX,0607H {'?15 then for j:=i to 14 do begin textcolor(white); gotoxy(10,8+j); write('ó ó ó ó'); end else; if k<16 then begin textcolor(white); gotoxy(10,8+i); write('ˆŠŠ?'); end else; end; readkey; fon; end; {*********************************************************} { '(r) Ēð (r)ũō } {*********************************************************} procedure sort; var i,j:integer; a:array[1..100]of string[25]; s:string[25]; f,f1:file of spisok; b:spisok; function prov:boolean; var k:integer; z:boolean; begin k:=1; z:=true; while (z<>false)and(k<=j)do begin if a[k]=b.naim then z:=false else z:=true; k:=k+1; end; if z then prov:=true else prov:=false; end; begin assign(f,'C:\spisok.spk'); reset(f); read(f,b); a[1]:=b.naim; s:=b.naim; j:=1; while not eof(f)do begin read(f,b); for i:=1 to j do if prov then begin a[j+1]:=b.naim; j:=j+1; s:=b.naim; end else; end; close(f); assign(f1,'C:\spisok1.spk'); rewrite(f1); for i:=1 to j do begin reset(f); while not eof(f)do begin read(f,b); if a[i]=b.naim then begin seek(f1,filesize(f1)); write(f1,b); end; end; end; close(f1); erase(f); rename(f1,'C:\spisok.spk'); textbackground(1); textcolor(white); gotoxy(20,12); write('‰"'); gotoxy(20,13); write('ó ôðĄ(r)ō (r)ĒĄ  Ēð (r)ũ - ! ó'); gotoxy(20,14); write('ˆ?'); textbackground(white); gotoxy(20,15); write(' ? ģŋðĒ? - "ŪöĢŪ ō" ũðĻĢ '); readkey; fon; end; {*********************************************************} { ?ö  ö(r)ǧðō } {*********************************************************} procedure tnotebook.HandleEvent(var Event: TEvent); begin inherited HandleEvent(Event); case Event.What of evCommand: case Event.Command of cmfon:fon; cmfile_create:file_create; cmtabl:tabl; cmread_spisok:read_spisok; cmsort:sort else Exit; end; else Exit; end; ClearEvent(Event); end; {*********************************************************} { 'Ē (r)ō Ą(r)ĄĒ(r)Ŋ-ðŊ } {*********************************************************} procedure tnotebook.InitStatusLine; var r:trect; begin GetExtent(r); R.A.Y:=pred(R.B.Y); StatusLine:=new(PStatusline,init(r, NewStatusDef(0,0, NewStatusKey('~F2~ (r)ý ĒŽ Ī ð"',kbF2,cmfile_create, NewStatusKey('~F3~ ũ?ĄĒð ý --Ŧ?',kbF3,cmtabl, NewStatusKey('~F4~ ôðĄ(r)ō',kbF4,cmread_spisok, NewStatusKey('~F5~ (r) Ēð (r)ũ ĒŽ',kbF5,cmsort, NewStatusKey('~F10~ ??-Ū',kbF10,cmMenu, NewStatusKey('~Alt-X~ ŦĨ(r)ý',kbAltx,cmquit,nil)))))), nil))); end; begin end.