Модуль Groutput
unit GrOutPut;
{$N+}Graph;=string [64];=Procedure;=record: char;: StrParam;;=record,y1,x2,y2: word;;
{Output controls}=30;=20;=600;=60;
{***************}
{All ordinal operations}= ['+','-','*','/','c','s','t','k','√','x'];
{**********************}= ['0'. '9','. '];
{*****************************************}= [2,3,4,9,10,11,16,17,18,23,30.35];= [30.35];
{***********************************}=13;=36;CheckOutPut (var Out: StrParam);ClearOutPut;ClrResOut;SetFActive (param: boolean);TextToOut (Out: StrParam);AddToOutPut (Param: string);SetPlusMines;ResultToScreen;BackSpaceSymbol;CEClick;CurrentFuncToScr;ClearCurrentFunc;,FParam,SParam: StrParam;: TMem;: set of char;: set of byte;: char;,Operation, i,j,Middle,Key: word;,SActive,Calculated: boolean;CheckOutPut (var Out: StrParam);: boolean;: =1;: =false;Pos ('-',Out) <>0 then(Out,1,1);: =true;;Pos (' ',Out) <>0 do delete (Out,Pos (' ',Out),1);i<=Length (Out) doOut [i] ='. ' theni<>Pos ('. ',Out) then(Out, i,1);: =i-1;;(i);;Out [2] <>'. ' then(Out [1] ='0') or (Out [1] ='. ') doLength (Out) >1 then Delete (Out,1,1) else;Out [1] ='. ' then Out: ='0'+Out;Out [Length (Out)] ='. ' then Out: =Out+'0';Length (Out) =0 then Out: ='0';MinesState thenPos ('-',Out) =0 then: ='-'+Out;;SetFActive (param: boolean);: =Param;: =not Param;;BackSpaceSymbol;: =false;FActive of:FParam<>'0' then(FParam,Length (FParam),1);(FParam);;:SParam<>'0' then(SParam,Length (SParam),1);(SParam);;;;ClrResOut;(OutXs+1,OutYs+FParamOfs+8,OutXf-1,OutYf-3,true);;(0,0,GetMaxX,GetMaxY,true);;TextToOut (Out: StrParam);FActive of: SetViewPort (OutXs+1,OutYs+3,OutXf-1,OutYs+FParamOfs-1,true);: SetViewPort (OutXs+1,OutYs+FParamOfs,OutXf-1,OutYf-3,true);;;(Out);;FActive of: begin OutTextXY (OutXf-40-TextWidth (Out) div 2,4,Out); ClrResOut; end;: OutTextXY (OutXf-40-TextWidth (Out) div 2,4,Out);;(0,0,GetMaxX,GetMaxY,true);;ResultToScreen;(OutXs+1,OutYs+23,OutXf-1,OutYf-1,true);;(OutXf-40-TextWidth (Result),2,OutXf-40,2);(OutXf-40-TextWidth (Result) div 2,9,Result);: =true;(0,0,GetMaxX,GetMaxY,true);;CEClick;: =0;;: =false;FActive of: begin FParam: ='0'; TextToOut ('0');(false); TextToOut (SParam);(true); end;: begin SParam: ='0'; TextToOut ('0');(true); TextToOut (FParam);(false); end;;('0');(true);;AddToOutPut (Param: string);: string;;FActive of: beginSysCount=Dec thenPos ('E',FParam) <>0 then FParam: ='0';: =FParam+Param;(FParam);;: beginSysCount=Dec thenPos ('E',SParam) <>0 then SParam: ='0';: =SParam+Param;(SParam);;;;;AddDelMines (var Param: StrParam);(Length (Param) >=1) and
(Param<>'0') and (Param<>'0.0') thenPos ('-',Param) =0 then: ='-'+Param;(Param);(Param);else(Param,1,1);(Param);(Param);;;SetPlusMines;FActive of: AddDelMines (FParam);: AddDelMines (SParam);;;ClearCurrentFunc;: ViewPortType;(ViewPort);(OutXs+1,OutYs+6,OutXf-20-Middle,OutYs+14,true);;ViewPort do(x1,y1,x2,y2,Clip);;CurrentFuncToScr;: ViewPortType;
{if CurrentFunc=#0 then exit; }(ViewPort);
{**************}TextWidth (FParam) >TextWidth (SParam) then: =TextWidth (FParam)Middle: =TextWidth (SParam);
{**************}(OutXs+1,OutYs+6,OutXf-30-Middle,OutYs+14,true);;
{**************}(OutXf-OutXs-40-Middle,5,CurrentFunc);
{**************}ViewPort do(x1,y1,x2,y2,Clip);;ClearOutPut;(OutXs+1,OutYs+1,OutXf-1,OutYf-1,true);;(0,0,GetMaxX,GetMaxY,true);;: =true;: =false;: =#0;: =DEC;: =false;: ='0';: ='0';: ='';
en
Приложение 2
Графический интерфейс программы
Рис.1. Графический интерфейс программы
Рис.2. Программа во время работы
Достарыңызбен бөлісу: |