'pобоче поле вiкна:
kStroka = 0: kStolbets = 0
' xEkrana+5+152 (+20) (+40) yEkrana+45+ie*14
'@@@ '' xEkrana+5+92 (+20) (+40) yEkrana+45+ie*14
IF (((EditMouse.Cx >= xEkrana + 5 + 92) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 10))) THEN kStolbets = 1
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 20) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 20 + 10))) THEN kStolbets = 2
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 40) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 40 + 10))) THEN kStolbets = 3
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 60) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 60 + 10))) THEN kStolbets = 4
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 80) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 80 + 10))) THEN kStolbets = 5
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 100) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 100 + 10))) THEN kStolbets = 6
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 120) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 120 + 10))) THEN kStolbets = 7
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 140) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 140 + 10))) THEN kStolbets = 8
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 160) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 160 + 10))) THEN kStolbets = 9
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 180) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 180 + 10))) THEN kStolbets = 10
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 200) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 200 + 10))) THEN kStolbets = 11
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 220) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 220 + 10))) THEN kStolbets = 12
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 240) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 240 + 10))) THEN kStolbets = 13
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 260) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 260 + 10))) THEN kStolbets = 14
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 280) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 280 + 10))) THEN kStolbets = 15
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 300) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 300 + 10))) THEN kStolbets = 16
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 320) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 320 + 10))) THEN kStolbets = 17
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 340) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 340 + 10))) THEN kStolbets = 18
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 360) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 360 + 10))) THEN kStolbets = 19
IF (((EditMouse.Cx >= xEkrana + 5 + 92 + 380) AND (EditMouse.Cx <= xEkrana + 5 + 92 + 380 + 10))) THEN kStolbets = 20
kStroka = (EditMouse.dx - yEkrana - 45) \ 14 + kStartPosEkran
IF ((kStroka > 0) AND (kStolbets > 0) AND (kStolbets <= MaxKolichStolbcov)) THEN
UnshowMouse 'виключити мишку
CALL ReReadDBF(3, DlinaZagolovkaDBF, DlinaZapisiDBF, kStroka, z$)
GET #4, kStroka
IF MID$(z$, 15 + kStolbets, 1) = " " THEN
MID$(z$, 15 + kStolbets, 1) = "*"
MID$(Bufer4$, 14 + kStolbets, 1) = "*"
'@@@ CALL PrintPtichka(xEkrana + 5 + 152 + (kStolbets - 1) * 20, yEkrana + 45 + (kStroka - kStartPosEkran) * 14)
CALL PrintPtichka(xEkrana + 5 + 92 + (kStolbets - 1) * 20, yEkrana + 45 + (kStroka - kStartPosEkran) * 14)
ELSE
MID$(z$, 15 + kStolbets, 1) = " "
MID$(Bufer4$, 14 + kStolbets, 1) = " "
'@@@ LINE (xEkrana + 5 + 152 + 3 + (kStolbets - 1) * 20, yEkrana + 45 + (kStroka - kStartPosEkran) * 14 + 3)-(xEkrana + 5 + 152 + (kStolbets - 1) * 20 + 10, yEkrana + 45 + (kStroka - kStartPosEkran) * 14 + 10), 15, BF
LINE (xEkrana + 5 + 92 + 3 + (kStolbets - 1) * 20, yEkrana + 45 + (kStroka - kStartPosEkran) * 14 + 3)-(xEkrana + 5 + 92 + (kStolbets - 1) * 20 + 10, yEkrana + 45 + (kStroka - kStartPosEkran) * 14 + 10), 15, BF
END IF
CALL ReWriteDBF(3, DlinaZagolovkaDBF, DlinaZapisiDBF, kStroka, z$)
PUT #4, kStroka
ShowMouse 'включити мишку
END IF
END IF
END IF
END IF
IF ikod = 328 THEN 'Up
IF kStartPosEkran > 1 THEN kStartPosEkran = kStartPosEkran - 1: GOSUB ReReadEkran
END IF
IF ikod = 329 THEN 'PageUp
IF kStartPosEkran > 1 THEN
IF kStartPosEkran > kolStrokEkrana THEN
kStartPosEkran = kStartPosEkran - kolStrokEkrana
ELSE
kStartPosEkran = 1
END IF
GOSUB ReReadEkran
END IF
END IF
IF ((ikod = 327) OR (ikod = 375)) THEN 'Home, Ctrl+Home
IF kStartPosEkran > 1 THEN
kStartPosEkran = 1
GOSUB ReReadEkran
END IF
END IF
IF ikod = 336 THEN 'Down
IF (kEndPosEkran < (LOF(4) \ 80)) THEN kStartPosEkran = kStartPosEkran + 1: GOSUB ReReadEkran
END IF
IF ikod = 337 THEN 'PageDown
IF (kEndPosEkran < (LOF(4) \ 80)) THEN
IF (((LOF(4) \ 80) - kEndPosEkran) >= kolStrokEkrana) THEN
kStartPosEkran = kStartPosEkran + kolStrokEkrana - 1
ELSE
kStartPosEkran = (LOF(4) \ 80) - kolStrokEkrana + 1
END IF
GOSUB ReReadEkran
END IF
END IF
IF ((ikod = 335) OR (ikod = 373)) THEN 'End, Ctrl+End
IF (kEndPosEkran < (LOF(4) \ 80)) THEN
kStartPosEkran = (LOF(4) \ 80) - kolStrokEkrana + 1
GOSUB ReReadEkran
END IF
END IF
GOTO mw
Finish2:
Finish:
CALL PackingDBF 'пеpевipити (i виконати) Packing файлу Vipiski.dbf:
EditMouse.AX = 0
CALL Mouse(EditMouse)
IF EditMouse.AX = -1 THEN
ShowMouse
END IF
UnshowMouse 'виключити мишку
CLOSE
CLEAR
SCREEN 2
SCREEN 0
END
'█████████████████████████████████████████████████████████████████████████████
ReReadEkran:
IF kStartPosEkran < 1 THEN kStartPosEkran = 1
kEndPosEkran = kStartPosEkran + kolStrokEkrana - 1
IF kEndPosEkran > (LOF(4) \ 80) THEN
kEndPosEkran = LOF(4) \ 80
kStartPosEkran = kEndPosEkran - kolStrokEkrana + 1
END IF
IF kStartPosEkran < 1 THEN kStartPosEkran = 1
IF kStartPosEkranMemory <> kStartPosEkran THEN
kStartPosEkranMemory = kStartPosEkran
UnshowMouse 'виключити мишку
'CALL DrawWindowsWindow(xEkrana, yEkrana, dxEkrana, dyEkrana, CvetOkna, kStartPosEkran, (LOF(4) \ 80) - kolStrokEkrana + 1)
ie = 0
LINE (xEkrana + 5, yEkrana + 45)-(xEkrana + dxEkrana - 300, yEkrana + dyEkrana - 5), CvetOkna, BF
'полоса пpокpутки:
LINE (xEkrana + dxEkrana - 22, yEkrana + 22)-(xEkrana + dxEkrana - 7, yEkrana + dyEkrana - 23), 15, BF
I = 0
WHILE ((yEkrana + 22 + I * 14 + 14) < yEkrana + dyEkrana - 23)
CALL PrGraphString(CHR$(176), xEkrana + dxEkrana - 30, yEkrana + 22 + I * 14, 8)
CALL PrGraphString(CHR$(176), xEkrana + dxEkrana - 22, yEkrana + 22 + I * 14, 8)
I = I + 1
WEND
j = I - 1
I = 2
WHILE ((yEkrana + 22 + j * 14 + I + 14) < yEkrana + dyEkrana - 21)
CALL PrGraphString(CHR$(176), xEkrana + dxEkrana - 30, yEkrana + 22 + j * 14 + I, 8)
CALL PrGraphString(CHR$(176), xEkrana + dxEkrana - 22, yEkrana + 22 + j * 14 + I, 8)
I = I + 2
WEND
CALL Knopochka(xEkrana + dxEkrana - 22, (kStartPosEkran / ((LOF(4) \ 80) - kolStrokEkrana + 1)) * (dyEkrana - 43) + yEkrana + 13, 8)
FOR ke = kStartPosEkran TO kEndPosEkran
GET #4, ke
CALL PrGraphString(MID$(Bufer4$, 1, 14), xEkrana + 5, yEkrana + 45 + ie * 14, 5)
FOR kp = 1 TO MaxKolichStolbcov
'@@@ CALL PrintPtichka(xEkrana + 5 + 132 + kp * 20, yEkrana + 45 + ie * 14)
CALL PrintPtichka(xEkrana + 5 + 72 + kp * 20, yEkrana + 45 + ie * 14)
'@@@ IF MID$(Bufer4$, 14 + kp, 1) = " " THEN LINE (xEkrana + 5 + 132 + kp * 20 + 3, yEkrana + 45 + ie * 14 + 3)-(xEkrana + 5 + 132 + kp * 20 + 10, yEkrana + 45 + ie * 14 + 10), 15, BF
IF MID$(Bufer4$, 14 + kp, 1) = " " THEN LINE (xEkrana + 5 + 72 + kp * 20 + 3, yEkrana + 45 + ie * 14 + 3)-(xEkrana + 5 + 72 + kp * 20 + 10, yEkrana + 45 + ie * 14 + 10), 15, BF
NEXT
ie = ie + 1
NEXT
ShowMouse 'включити мишку
END IF
RETURN
Morda:
CALL DrawWindow(xEkrana, yEkrana, dxEkrana, dyEkrana, CvetOkna, 8, 7)
FOR j = 1 TO 30
FOR I = 1 TO 28
IF (ZnakParol(I, j) < 16) THEN
PSET (xEkrana + 20 + I, yEkrana + 10 + j), ZnakParol(I, j)
END IF
NEXT
NEXT
FOR kp = 1 TO MaxKolichStolbcov
'@@@ CALL PrGraphString(LTRIM$(STR$(kp)), xEkrana + 133 + kp * 20, yEkrana + 33, 7)
CALL PrGraphString(LTRIM$(STR$(kp)), xEkrana + 73 + kp * 20, yEkrana + 33, 7)
NEXT
RETURN
Есть матрица X на 20наQbasic(DOS).Как проявить в граф.части "птички" в ячейк. после 9
Код:
[COLOR=red]для написания кода используй теги [ code] + код большого размера оформляй как вложение[/COLOR]