%eden
autocalc=0;

DFfont="{courier 20}";

## set up this display just once!
/*
if (buttonMenu==@) 
{
	OpenDisplay("buttonMenu",325,300);
	## need to set these parameters appropriately on start up
}
*/

OpenDisplay("buttonMenu",445,150);
## need to set these parameters appropriately on start up


proc buttonMenu_display_screen : buttonMenu { 
	DisplayScreen(&buttonMenu, "buttonMenu");
};


## location ="http://www.dcs.warwick.ac.uk/~wmb/sudokuExperience/workshops/workshop2B/";

## location = "/dcs/acad/wmb/public_html/sudokuExperience/workshops/workshop2B/";
location = "/dcs/emp/empublic/projects/sudokuExperience/workshops/workshop2B/";

## where the files to be input are located

%scout

## global settings here

integer ydisp, buttontextlen;
ydisp = 14; buttontextlen = 28;

%eden
## writeln("buttontextlen ", buttontextlen);


%scout

## where to put local modifications to the button specification

string bgcol1, bgcol3, bgcol6;
bgcol1 = ""; bgcol3 = ""; bgcol6 = "";

%eden

parttask = 0;
currentsquare = ["A",1];
button1_loaded = 0;
## button3_loaded = 0;
## button6_loaded = 0;

bgcol1 is (button1_loaded==0) ? "grey" : "white";
## bgcol3 is (button3_loaded==0) ? "grey" : "white";
## bgcol6 is (button6_loaded==0) ? "grey" : "white";


bgcol1 is (parttask!=1) ? "grey" : "white";

## definition of the actual buttons

%scout

string button1text, filename1;
button1text="Making the electronic blackboard"; filename1 = "DUMMY.e";

window button1 = {
        type: TEXT
        frame: ([{10,ydisp}, 1, buttontextlen])
        string: button1text
        border: 1
        bgcolor: bgcol1
        sensitive: ON
};

%eden

proc button1action : button1_mouse_1 {
        ## writeln("init button1act");
        if (button1_mouse_1[2]==4)
		{
 	  	    parttask = 1;
	    	    ## screen is grid;
		    screen is [B1, C1, B2, C2, A3, B3, C3];
		}
        ## writeln("act1end");
}


%scout

string button3text, filename3;
button3text = "From row-col to region coordinates"; filename3 = "rowcoltoreg.e";

window button3 = {
        type: TEXT
        frame: ([{10,ydisp+40}, 1, buttontextlen])
        string: button3text
        border: 1
        bgcolor: bgcol3
        sensitive: ON
};

%eden

button3_loaded =0;
bgcol3 is (button3_loaded) ? "grey" : "white";

bgcol3 is (parttask!=2) ? "grey" : "white";


proc button3action : button3_mouse_1 {
        ## writeln("init button3act");
        if (button3_mouse_1[2]==4) {
        	parttask = 2;
		onlineinclude(location // filename3);
	}
        ## writeln("act3end");
}

%scout

string button6text, filename6;
button6text="From region to row-col coordinates"; filename6 = "regtorowcol.e";

window button6 = {
        type: TEXT
        frame: ([{10,ydisp+80}, 1, buttontextlen])
        string: button6text
        border: 1
        bgcolor: bgcol6
        sensitive: ON
};

%eden

button6_loaded =0;
bgcol6 is (button6_loaded) ? "grey" : "white";

bgcol6 is (parttask!=3) ? "grey" : "white";

proc button6action : button6_mouse_1 {
        ## writeln("init button6act");
        if (button6_mouse_1[2]==4) {
		parttask=3;
		onlineinclude(location // filename6);
	}
        ## writeln("act6end");
}

%scout
## buttonMenu = <button1 / button2 /button3 /button4 /button5 /button6 /button7 /button8 /button9 >;
buttonMenu = <button1 / button3 / button6 >;



%eden
autocalc=1;


%eden
FileLoadedOkay = 1;

