Pascal/Turbo Pascal - Message Boxes en Free Pascal

 
Vista:

Message Boxes en Free Pascal

Publicado por soulblazer (19 intervenciones) el 24/05/2012 04:20:42
Me pidieron un programa que en vez de mostrar mensajes por writeln o write, los muestre en cuadritos de texto con botón de aceptar. Hay algún tipo de librería o función en específico? Urge, pongan código fuente de ejemplo para darme una idea de cómo poner los cuadritos :S
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Message Boxes en Free Pascal

Publicado por ramon (2158 intervenciones) el 24/05/2012 14:15:12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{Mira estamos en el camino que quieres o no esto es un botón en modo texto si es en grafico
dímelo}
 
program botones;
 uses
    crt;
  var
     y, x : integer;
     nnp, opcion : integer;
     tecla : char;
     sisale : boolean;
 
 
  procedure boton(xb, yb : integer; esta : boolean; tex : char);
  begin
      if esta = true then
      begin
      textcolor(15);
      gotoxy(xb, yb);write('ÚÄ');
      gotoxy(xb + 2,yb);write('¿');
      gotoxy(xb,yb + 1);write('³');
      gotoxy(xb + 2,yb + 1);write('³');
      gotoxy(xb,yb + 2);write('ÀÄÙ');
      gotoxy(xb + 1,yb + 1);write(tex);
      gotoxy(1,1);
      end;
      if esta = false then
      begin
      textcolor(7);
      gotoxy(xb, yb);write('ÚÄ');
      gotoxy(xb + 2,yb);write('¿');
      gotoxy(xb,yb + 1);write('³');
      gotoxy(xb + 2,yb + 1);write('³');
      gotoxy(xb,yb + 2);write('ÀÄÙ');
      gotoxy(xb + 1,yb + 1);write(tex);
      gotoxy(1,1);
      end;
  end;
 
   procedure ponbotones(n : integer; esta : boolean);
   begin
     case n of
    1 : begin
           boton(4,3,esta,'N');
           boton(7,3,false,'S');
           boton(10,3,false,'P');
        end;
    2 : begin
           boton(7,3,esta,'S');
           boton(4,3,false,'N');
           boton(10,3,false,'P');
        end;
    3 : begin
          boton(4,3,false,'N');
          boton(7,3,false,'S');
          boton(10,3,esta,'P');
        end;
      end;
   end;
 
  begin
      clrscr;
      opcion := 1;
      gotoxy(2,2);write('Pulse Teclas [ ',chr(26),chr(27),' ] Y [Enter]');
      sisale := false;
      nnp := 3;
    repeat
      ponbotones(opcion,true);
      tecla := readkey;
      if tecla = #77 then
      begin
      opcion := opcion + 1;
      if opcion > nnp then
      opcion := nnp;
      end;
      if tecla = #75 then
      begin
         opcion := opcion - 1;
         if opcion < 1 then
         opcion := 1;
      end;
      if tecla = #13 then
      begin
         sisale := true;
      end;
    until sisale = true;
    gotoxy(2,6);write('Su Eleccion A Sido La ',opcion);
    gotoxy(2,7);write('Pulse [Enter]');
    readln;
  end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar