%eden
OpenDisplay("buttonDisplay",325,150);
proc buttonDisplay_display_screen : buttonDisplay { 
DisplayScreen(&buttonDisplay, "buttonDisplay"); }

%scout

string bgcol_sudoku;
integer ydisp;
ydisp = 5;

%eden
/*

window poss_digits = {
        type: TEXT
        frame: ([{10,ydisp}, 1, 20])
        string: "Show possible digits"
        border: 1
        bgcolor: "white"
        sensitive: ON
};
*/

%scout
window load_puzzle = {
        type: TEXT
        frame: ([{10,ydisp}, 1, 20])
        string: "Load puzzle 0"
        border: 1
        bgcolor: "white"
        sensitive: ON
};


window load_colour = {
        type: TEXT
        frame: ([{10,ydisp+40}, 1, 20])
        string: "Colour sudoku"
        border: 1
        bgcolor: bgcol_sudoku
        sensitive: ON
};


%scout
window unload_colour = {
        type: TEXT
        frame: ([{10,ydisp+80}, 1, 20])
        string: "Revert to black and white"
        border: 1
        bgcolor: "white"
        sensitive: ON
};

%eden
/*

%scout
window reset_colour = {
        type: TEXT
        frame: ([{10,ydisp+80}, 1, 14])
        string: "Reset colours"
        border: 1
        bgcolor: "white"
        sensitive: ON
};

*/

%scout
window reset_puzzle = {
        type: TEXT
        frame: ([{10,ydisp+120}, 1, 20])
        string: "Reset puzzle"
        border: 1
        bgcolor: "white"
        sensitive: ON
};

%eden
/*

%scout
window check_digit = {
        type: TEXT
        frame: ([{10,ydisp+160}, 1, 13])
        string: "Whiten digit"
        border: 1
        bgcolor: "white"
        sensitive: ON
};

*/

%scout
## buttonDisplay = <poss_digits / load_colour / reset_colour / reset_puzzle / check_digit>;

## buttonDisplay = <poss_digits / load_colour / unload_colour / reset_puzzle>;

buttonDisplay = <load_puzzle / load_colour / unload_colour / reset_puzzle>;


%eden

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


proc disppossdigits : poss_digits_mouse_1 {
        writeln("entering proc");
        onlineinclude(location // "file6.txt");
        ## ydisp = ydisp-40;
        writeln("edn");
}


colour_loaded = 0;
bgcol_sudoku is (colour_loaded ? "grey" : "white");

proc loadcolour : load_colour_mouse_1 {
        if ((load_colour_mouse_1[2]==4)&&(!colour_loaded)) {
                colour_loaded = 1;
                onlineinclude(location // "file3.txt");
 ##             onlineinclude(location // "interface.e");
                colour_loaded = 0;
                ## ydisp = ydisp-40;

        };
};

proc revert : unload_colour_mouse_1 {
        if (unload_colour_mouse_1[2]==4) onlineinclude(location // "file4.txt");
};


/*

proc resetcolour : reset_colour_mouse_1 {
        if (reset_colour_mouse_1[2]==4) onlineinclude(location // 
"restorecolvalues.e");
};
*/

proc resetpuzzle : reset_puzzle_mouse_1 {
        if (reset_puzzle_mouse_1[2]==4)
        	onlineinclude(location // "puzzle_0.txt");
};

/*

proc whitendigit : check_digit_mouse_1 {
        onlineinclude(location // "whitening.e");
        buttonDisplay = [poss_digits, load_colour, reset_colour, 
reset_puzzle];

}
*/




%eden
FileLoadedOkay = 1;