/* * Draw Mode * --------- * This program illustrates how drawing modes affect ouput of drawing * operations. */ #include drawing d = NULL; int button_width = 100; int button_height = 20; int spacing = 10; int drawing_width = 450; int drawing_height = 450; int mode = 0; int mode_value[] = { Zeros, DnorS, DandnotS, notS, notDandS, notD, DxorS, DnandS, DandS, DxnorS, D, DornotS, S, notDorS, DorS, Ones, }; char * mode_name[] = { "Zeros", "DnorS", "DandnotS", "notS", "notDandS", "notD", "DxorS", "DnandS", "DandS", "DxnorS", "D", "DornotS", "S", "notDorS", "DorS", "Ones", }; #define number_of_modes ( sizeof(mode_value) / sizeof(mode_value[0]) ) rgb colour = Black; rgb colour_value[] = { Black, White, Red, Green, Blue, }; char * colour_name[] = { "Black", "White", "Red", "Green", "Blue", }; #define number_of_colours ( sizeof(colour_value) / sizeof(colour_value[0]) ) void draw_pattern(drawing d, rect r) { int i, top, bottom, height; rect dest_rect; /* draw a border inside the drawing area */ setcolour(Black); drawrect(r); r = insetr(r, 5); /* draw some horizontal bars of colour down the screen */ for (i=0; i