-
Notifications
You must be signed in to change notification settings - Fork 5
/
CHKMOUSE.PAS
86 lines (80 loc) · 1.76 KB
/
CHKMOUSE.PAS
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
Unit ChkMouse;
INTERFACE
Procedure CheckMouse;
IMPLEMENTATION
Uses Adele,Systex,Systems,Video,Mouse,Dialex,Dials;
Procedure CheckMouse;
Var
W:Window;
K:Word;
XM,YM,BM,OB,OX,OY:Word;
X,Y:Byte;
OldShade:Boolean;
Button:Set Of (Left,Right,Center) Absolute BM;
Color:Byte;
Begin
WEInitO(W,40,20);
WEPushWn(W);
WEPutWnKrDials(W,'Souris');
WECloseIcon(W);
WEBar(W);
WEPutTxtXY(W,0,1,'Bouton:');
WEPutTxtXY(W,0,2,'X:');
WEPutTxtXY(W,0,3,'Y:');
X:=WEGetRX1(W);
Y:=WEGetRY1(W);
BarHorDials(X,Y+4,X+38,W.CurrColor);
{ Dessine la souris }
OldShade:=GetShade;
SetShade(False);
SetBorderSimple;
PutFillBorder(X+10,Y+6,X+29,Y+18,$70);
PutFillBorder(X+11,Y+7,X+16,Y+11,$70);
PutFillBorder(X+17,Y+7,X+22,Y+11,$70);
PutFillBorder(X+23,Y+7,X+28,Y+11,$70);
OB:=$FFFF;OX:=$FFFF;OY:=$FFFF;
SetShade(OldShade);
__ShowMousePtr;
_InitKbd;
Repeat
GetMouseSwitch(XM,YM,BM);
If BM>0Then Begin
If WEInCloseIcon(W,XM shr 3,YM div GetHeightChr)Then Begin
WaitMouseBut0;
Break;
End;
End;
If(OB<>BM)Then Begin
__HideMousePtr;
WEPutTxtXY(W,15,1,StrUSpc(IntToStr(BM),10));
If(Left)in(Button)Then Color:=Black
Else Color:=$70;
WEClrWn(W,12,8,15,10,Color);
If(Center)in(Button)Then Color:=Black
Else Color:=$70;
WEClrWn(W,18,8,21,10,Color);
If(Right)in(Button)Then Color:=Black
Else Color:=$70;
WEClrWn(W,24,8,27,10,Color);
__ShowMousePtr;
OB:=BM;
End;
If(OX<>XM)Then Begin
__HideMousePtr;
WEPutTxtXY(W,15,2,StrUSpc(IntToStr(XM),10));
__ShowMousePtr;
OX:=XM;
End;
If(OY<>YM)Then Begin
__HideMousePtr;
WEPutTxtXY(W,15,3,StrUSpc(IntToStr(YM),10));
__ShowMousePtr;
OY:=YM;
End;
_BackKbd;
Until KeyPress;
__HideMousePtr;
ClrKbd;
WEDone(W);
End;
END.