home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_PAS / XLIB_TP5.ZIP / DEMO / TESTMOUS.PAS < prev    next >
Pascal/Delphi Source File  |  1993-12-13  |  2KB  |  79 lines

  1. uses crt,dos,X_Const,X_main,X_Mouse,X_Text,X_Rect,x_Pal;
  2.  
  3. const y = 150;
  4.       x = 100;
  5.       Msg = 'Press any Key to Exit';
  6.  
  7. var i,x1,y1,r:Word;
  8.  
  9. procedure Show_pal2;
  10. var i,j,f:Word;
  11. begin;
  12.   for i:=0 to 5 do for j:=0 to 41 do
  13.     begin;
  14.       f:=i*42+j;
  15.       box(j*8,5+i*19,j*8+6,5+i*19+15,f);
  16.     end;
  17.   for i:=252 to 255 do Box(336,5+(i-252)*19,342,5+(i-252)*19+15,i);
  18. end;
  19.  
  20. const Test = 'This «23»is «216»a «o»test «36»for «138»me.';
  21.  
  22. var mx,my,st:Word;
  23.  
  24. begin;
  25.  
  26. WriteLn('! All Modes with 256 Color ! Some Modes only on Multisync.'#10#13);
  27.  
  28.   for st:=0 to x_Max_Modi do
  29.   begin;
  30.     x_mode_info(st,mx,my);
  31.     Write('[',st:2,']   with  ',mx,'x',my,' Pixel.    ');
  32.     if odd(st) then WriteLn;
  33.   end;
  34.  
  35.   Write('Select Mode ?');
  36.   ReadLn(i);
  37.  
  38.   x_set_Mode(i,400);
  39.   X_ClearAll;
  40.   x_Set_RGB_Pal;
  41.   x_text_init;
  42.   x_set_font(0);
  43.  
  44.   i:=50;
  45.   for x1:=1 to GetMaxX div i do Line(x1*i,0,x1*i,GetMaxY-1,Gray5);
  46.   for y1:=1 to GetMaxY div i do Line(0,y1*i,GetMaxX-1,y1*i,Gray5);
  47.  
  48.   MyMouseInit;
  49.   DefineMouseCursor(MyMouseForm,Gray5);
  50.   OldMouseTyp   := true;
  51.  
  52.   Show_Pal2;
  53.  
  54.   E_Write(GetMaxX-x_Length(Msg)-1,GetMaxY-x_font_height-1,Gray5,Gray2,Msg);
  55.  
  56.   E_WriteColor(10,GetMaxY-2*x_font_height-1,Gray5,Gray3,Test);
  57.  
  58.   ShowMouse;
  59.   MouseAction:=True;
  60.   repeat
  61.  
  62.     if MouseAction then
  63.     begin;
  64.       WaitVsyncStart;
  65.       HideMouse;
  66.       mx:=MouseX;my:=MouseY;st:=ButtonStatus;
  67.       Box(1,GetMaxY-4*x_font_height,GetMaxX,GetMaxY-3*x_font_height,0);
  68.       X_Write(1,GetMaxY-4*x_font_height,Gray5,'('+center(40,str(mx))+','+center(40,str(my))+
  69.               ') : '+center(50,str(GetPixel(mx,my)))+'  Status :'+str(st));
  70.       ShowMouse;
  71.       MouseAction:=False;
  72.     end;
  73.  
  74.   until keypressed;
  75.  
  76.   MyMouseDestroy;
  77.   TextMode(LastMode);
  78. end.
  79.