fb:porticula NoPaste
Demo_ClickMapGadget.bas
Uploader: | Muttonhead |
Datum/Zeit: | 07.09.2014 09:57:14 |
'Compileroption "-s console"
#include "sGUI\sGUI.bas"
#include "sGUI\ClickMapGadget.bas"
screen 16,32
InitGFX
dim as EventHandle ptr event =new EventHandle
dim as Gadget ptr BoardClickSensor
BoardClickSensor=AddClickMapGadget (event,10,10,"ClickMap.bmp")
GadgetOn BoardClickSensor
put (10,10),BoardClickSensor->Unselected,pset
line(9,9)-(9+8*40+1 , 9+8*40+1),&HFF6600,b
'Console öffnen für output
dim as integer ff=freefile
open cons for output as #ff
dim as integer field_ID
type chessfield
fieldname as string
selected as integer
posx as integer
posy as integer
end type
dim as chessfield Board (1 to 64)
for k as integer= 0 to 7
Board(1 + k*8).fieldname="a" & str(k+1)
Board(2 + k*8).fieldname="b" & str(k+1)
Board(3 + k*8).fieldname="c" & str(k+1)
Board(4 + k*8).fieldname="d" & str(k+1)
Board(5 + k*8).fieldname="e" & str(k+1)
Board(6 + k*8).fieldname="f" & str(k+1)
Board(7 + k*8).fieldname="g" & str(k+1)
Board(8 + k*8).fieldname="h" & str(k+1)
next k
do
event->xSleep(1)
if event->GADGETMESSAGE then
select case event->GADGETMESSAGE
case BoardClickSensor
field_ID=GetClickMapColor(BoardClickSensor)
print #ff,Board(field_ID).fieldname
end select
end if
loop until event->EXITEVENT
close ff
delete event