Grupos de Google ya no admite nuevas publicaciones ni suscripciones de Usenet. El contenido anterior sigue siendo visible.

condensed X11 interface for GPC

Visto 2 veces
Saltar al primer mensaje no leído

alejandro.rivero

no leída,
7 may 2002, 10:32:327/5/02
a
I have condensed W.S.C. Gurney's interface to libX11 for
GPC in a single "include", and adjoined the mousedown
events, which Gurney does not uses. If your students,
just as mine, need to plot some data in Xwindows, this
is the best solution I have found. The format is clear
enough to add other events or functions if you need them,
or to push the students into the Xlib guides to learn
to implement the interface by themselves.

And the original interface already implemented an
independent backing mechanism, "shadowing", for updates
which is very didactic.

The file is in the webpage

http://eupt.unizar.es/asignaturas/ittse/programacion/Practica8.def

Enjoy.


Alejandro Rivero

alejandro.rivero

no leída,
7 may 2002, 13:49:117/5/02
a
riv...@sol.unizar.es (alejandro.rivero) wrote in message news:<ee8203c6.02050...@posting.google.com>...

> I have condensed W.S.C. Gurney's interface to libX11 for
If the previous link fails, other copy is available at
http://dftuz.unizar.es/~rivero/work/Practica8.def

And now I think of, perhaps you would like an example. Well
besides Gurney's "Solver" program, you could enjoy this one,
using both the minitoolkit and direct calls:


(**************************************************************************)
Program Test8;

#include "Practica8.def"

C_PROCEDURE(XGetInputFocus,'XGetInputFocus',
Display : IMMEDIATE DispPtr;
VAR Focus_return : IMMEDIATE Window;
VAR Revert_to_return : IMMEDIATE INTEGER );

C_PROCEDURE(XSetInputFocus,'XSetInputFocus',
Display : IMMEDIATE DispPtr;
Focus : IMMEDIATE Window;
Revert : IMMEDIATE INTEGER;
time : IMMEDIATE LONG );

(*Bring to front ya esta definida*)


VAR
origfocus : Window; OrigFocusMode:integer;
ventana : WinRec;
ventana2 : WinRec;
a : string;
f1,f2,f3 : PTR;
x,y,lastx,lasty : integer;
BEGIN
StartDisplay;
XGetInputFocus(sysinf.dpy,origfocus,origfocusmode);{hope to get our tty window}
LoadFont("BANNERFONT",f1);
LoadFont("TITLEFONT",f2);
LoadFont("DEFAULTFONT",f3);
OpenWindow(ventana,100,100,400,400);
OpenWindow(ventana2,400,100,400,400);
XRaiseWindow(sysinf.dpy,origfocus); {raise tty window again...}
XSetInputFocus(sysinf.dpy,origfocus,origfocusmode,0); {...and set its focus}
SetFont(ventana,f1);
OutTextXY(ventana,200,100,"para terminar");
SetFont(ventana,f2);
OutTextXY(ventana,200,150,"pulsa cualquier tecla");
SetFont(ventana,f3);
OutTextXY(ventana,200,200,"sobre esta ventana");
FlushDisplay;
SetColor(ventana,GetColorID("rgb:00/ff/00"));;
Point(ventana,20,20);
SetColor(ventana,GetColorID("rgb:00/ff/ff"));;
FillRectangle(ventana,30,30,40,70);
SetColor(ventana,GetColorID("rgb:ff/00/00"));;
Line(ventana,40,70,150,180);
while not keypressed(ventana) do
BEGIN
ReadMousePress(ventana,x,y);
writeln(x,':',y);
Line(ventana2,lastx,lasty,x,y);
Point(ventana,x,y);
lastx:=x;
lasty:=y;
Repeat
If damaged(ventana) then
copyfromshadow(ventana);
If damaged(ventana2) then
copyfromshadow(ventana2);
until ( keypressed(ventana) OR Mousepressed(ventana)) ;
END;
CloseWindow(ventana);
CloseWindow(ventana2);
CloseDisplay;
END.

0 mensajes nuevos