//--------------------------------------------------------------------- // // Reach SLCD5 SVGA macro demo file // 12-17-2010 // //--------------------------------------------------------------------- /* single line comments can be 'C' style or C++ style */ // blank lines are allowed //--------------------------------------------------------------------- // The BMPload program generates a macros.h file that provides // the index number for each named macro //--------------------------------------------------------------------- // MACRO #1 // This is the macro that invokes the self-running demo. // It is the default value for the *DEMOMAC command, so it starts // if the SLCD is powered on with its serial port looped back to itself. //--------------------------------------------------------------------- #define power_on_loopback_demo bv 255 // sound on full in case it was turned off by uesr m optional_calibration // check for touch calibration m clear // clear screen m splash // start main demo #end //--------------------------------------------------------------------- // MACROS #2 - #6 // These macros implement a number pad at relative (0,0) // It assumes button BMP 10, 11 are loaded //--------------------------------------------------------------------- #define number_pad m clear // set black and white colors, clear screen // bitmap that holds displayed number xi 12 0 0 // set font 24 for buttons f 32 // define buttons bd 1 0 64 1 "1" 9 5 10 11 bd 2 64 64 1 "2" 9 5 10 11 bd 3 128 64 1 "3" 9 5 10 11 bd 4 0 128 1 "4" 9 5 10 11 bd 5 64 128 1 "5" 9 5 10 11 bd 6 128 128 1 "6" 9 5 10 11 bd 7 0 192 1 "7" 9 5 10 11 bd 8 64 192 1 "8" 9 5 10 11 bd 9 128 192 1 "9" 9 5 10 11 bd 10 0 256 1 "*" 9 5 10 11 bd 0 64 256 1 "0" 9 5 10 11 bd 11 128 256 1 "#" 9 5 10 11 // tell user we're done beep 10 #end //--------------------------------------------------------------------- // Macro to set font and color for input box display. Foregorund color // is XOR of background color to match the buttons //--------------------------------------------------------------------- #define grey24 S 333 CCC f 32 #end //--------------------------------------------------------------------- // These macros write text to the screen //--------------------------------------------------------------------- #define button_text m grey24 t "`0`" 20 8 #end //--------------------------------------------------------------------- // This macro enables the buttons specified in number_pad macro // to write text to the screen inside a bitmap //--------------------------------------------------------------------- #define attach_buttons xa 0 p button_text 0 xa 1 p button_text 1 xa 2 p button_text 2 xa 3 p button_text 3 xa 4 p button_text 4 xa 5 p button_text 5 xa 6 p button_text 6 xa 7 p button_text 7 xa 8 p button_text 8 xa 9 p button_text 9 #end //--------------------------------------------------------------------- // This macro creates a keypad and displays the key // using previous macros //--------------------------------------------------------------------- #define keypad_demo s 0 1 m number_pad m attach_buttons #end #define rand_draw p `R1:5` m rand_color tr `R0:799` `R90:499` `R0:799` `R90:499` `R0:799` `R90:499` :repeat #end #define rand_color s `R0:16` 1 #end #define demo_end m clear #end #define clear s 0 1 z o 80 60 #end #define next_button o 160 120 f 16B bd 1 514 404 1 "Next" 35 22 1 2 xm 1 `0` o 80 60 #end #define splash m clear o 0 0 xi 5 0 0 m next_button splash2 o 0 0 // create access to other demos: set p0 `(`Xc`-85)` `(`Ym`-70)` set p1 `(`Xc`+85)` `(`Ym`-15)` p3 S 0000FF FFFFFF r `p0` `p1` f16B ta CC t "Other Demos" `p0` `p1` xs 128 `p0` `p1` xm 128 other_demos ta LT #end // -------------- macros for other demos on SD Card ------------------ #define other_demos m clear // clear screen o 0 0 f 32B sc `Xc` 20 ta CT // text align align center top t "Reach SD Card Required\n" sc `Xc` `Ys` f 16B ta CT t "(cycle power or reset to exit these demos)" m color_box_button F00 150 "GFX Demo" 128 gfx_demo m color_box_button 0F0 250 "iKB Demo" 129 ikb_demo m color_box_button 00F 350 "RT2 Demo" 130 rt2_demo m back_button splash #end #define color_box_button // arg 0 is 3 HEX Chars of RGB foreground color // arg 1 is Y center of "button" // arg 2 is text of "button" // arg 3 is index (128-254) of "button" // arg 4 is name of attached macro set p0 `(`Xc`-95)` `(`1`-32)` set p1 `(`Xc`+95)` `(`1`+32)` S `0` FFF p3 r `p0` `p1` f 24B ta CC t "`2`" `p0` `p1` xs `3` `p0` `p1` xm `3` `4` ta LT #end #define gfx_demo m show_loading `0` *sdload /gfx_demo 1 #end #define ikb_demo m show_loading `0` *sdload /ikb_demo 1 #end #define rt2_demo m show_loading `0` *sdload /rt2_demo 1 #end #define show_loading m clear f 32B sc `Xc` 20 ta CT // text align align center top t "Loading `0` ..." w 500 #end #define back_button o 160 120 f 16B bd 1 514 404 1 "Back" 35 22 1 2 xm 1 `0` o 80 60 #end // ---------------- end macros for "other demos" --------------------- #define splash2 m clear // clear screen o 0 0 xi 6 0 0 m next_button_mtHood splash_slcd #end #define splash_slcd m clear o 0 0 xi 7 0 0 m next_button splash_fonts #end #define splash_fonts m clear // clear screen f 32 t "On-board Proportional Fonts" 30 5 sc 0 0 o 120 120 f 8s t "8 point font: the quick brown fox jumped over the lazy dog 0123456789" f 10 t "\n10 point: the quick brown fox jumped over the lazy dog 0123456789" f 12 t "\n12 point: the quick brown fox jumped over the lazy dog 0123456789" f 14 t "\n14 point: the quick brown fox jumped over the 0123456789" f 14B t "\n14 point bold: the quick brown fox jumped 0123456789" f 16 t "\n16 point: the quick brown fox jumped over 0123456789\n" f 16B t "16 point bold: quick brown fox jumped 0123456789\n" f 20 t "20 point: the quick brown fox jump 0123456789\n" f 20B t "20 point bold: quick brown fox 0123456789\n" f 24 t "24 point: quick brown fox jumped 012345\n" f 24B t "24 point bold: quick brown fox 012345\n" f 32 t "32 point: quick brown fox 0123\n" f 32B t "32 point bold: quick 0123\n" m next_button splash_fixed_fonts #end #define splash_keyboard m clear // clear screen // clear string memory mpop -1 f 24B t "Easy to use buttons" 145 0 f 16B // set up stateful button with macro callback m keyboard_button_display "Off" bd 2 100 48 2 "" "" 0 0 0 0 3 4 xa 2 p keyboard_button_display "On " xa 2 r keyboard_button_display "Off" // setup demo instant button bd 3 400 45 1 "Hold" 30 20 1 2 // adjust origin for keyboard //o 0 144 o 80 204 // keyboard row one m keyboard_key 10 0 0 1 m keyboard_key 11 64 0 2 m keyboard_key 12 128 0 3 m keyboard_key 13 192 0 4 m keyboard_key 14 256 0 5 m keyboard_key 15 320 0 6 m keyboard_key 16 384 0 7 m keyboard_key 17 448 0 8 m keyboard_key 18 512 0 9 m keyboard_key 19 576 0 0 // keyboard row two m keyboard_key 20 0 64 Q m keyboard_key 21 64 64 W m keyboard_key 22 128 64 E m keyboard_key 23 192 64 R m keyboard_key 24 256 64 T m keyboard_key 25 320 64 Y m keyboard_key 26 384 64 U m keyboard_key 27 448 64 I m keyboard_key 28 512 64 O m keyboard_key 29 576 64 P // keyboard row three m keyboard_key 30 0 128 A m keyboard_key 31 64 128 S m keyboard_key 64 128 128 D m keyboard_key 33 192 128 F m keyboard_key 34 256 128 G m keyboard_key 35 320 128 H m keyboard_key 36 384 128 J m keyboard_key 37 448 128 K m keyboard_key 38 512 128 L m keyboard_key 39 576 128 " " // keyboard row four m keyboard_key 40 0 192 Z m keyboard_key 41 64 192 X m keyboard_key 42 128 192 C m keyboard_key 43 192 192 V m keyboard_key 44 256 192 B m keyboard_key 45 320 192 N m keyboard_key 46 384 192 M m keyboard_key 47 448 192 , m keyboard_key 48 512 192 - // special erase key bd 49 576 192 3 "rub" 5 9 10 11 xm 49 keyboard_erase // reset origin o 80 60 // draw cursor m keyboard_press // link to next screen m next_button splash_charts #end #define keyboard_button_display f 16B o 80 60 t "`0`" 170 68 #end #define keyboard_key bd `0` `1` `2` 1 "`3`" 22 18 10 11 xa `0` p keyboard_press "`3`" #end #define keyboard_press o 80 60 mpush "`0`" t "`M`_ " 0 114 #end #define keyboard_erase mpop 1 m keyboard_press #end #define splash_charts m clear // clear screen f 32B t "Data visualization charts" 56 0 // 5 levelbars o 166 120 m levelbar_init 0 o 272 120 m levelbar_init 1 o 378 120 m levelbar_init 2 o 484 120 m levelbar_init 3 o 590 120 m levelbar_init 4 // 1 long chart //o 20 280 o 100 340 cd 0 0 0 601 99 1 3 1 100 008 2 F00 2 0F0 2 FFF p 2 l 602 0 602 100 l 0 100 602 100 o 80 60 // link to next screen - skip triangles m next_button demo_meter1 m master_flopper #end #define levelbar_init ld `0` 0 0 40 160 0 0 1 888 100 F00 65 FF0 50 0F0 p 2 l 41 0 41 161 l 0 161 41 161 lv `0` 0 #end #define master_flopper // cycle through a prime (to slide on chart) number of relative randoms. // this thing updates REALLY fast so we need to slow it down a little. // 1 w 100 lv 0 `R10:50` lv 1 `R20:60` lv 2 `R20:60` lv 3 `R20:60` lv 4 `R10:50` cv 0 `R10:20` `R40:60` `R80:100` // 2 w 100 lv 0 `R10:50` lv 1 `R40:80` lv 2 `R40:90` lv 3 `R20:80` lv 4 `R10:50` cv 0 `R10:30` `R30:50` `R60:90` // 3 w 100 lv 0 `R20:70` lv 1 `R40:60` lv 2 `R60:100` lv 3 `R20:60` lv 4 `R20:50` cv 0 `R20:40` `R40:60` `R60:80` // 4 w 100 lv 0 `R20:50` lv 1 `R20:60` lv 2 `R60:80` lv 3 `R20:60` lv 4 `R20:50` cv 0 `R20:30` `R30:60` `R70:80` // 5 w 100 lv 0 `R30:50` lv 1 `R20:100` lv 2 `R40:100` lv 3 `R20:100` lv 4 `R30:50` cv 0 `R10:30` `R50:80` `R70:100` // 6 w 100 lv 0 `R40:80` lv 1 `R20:100` lv 2 `R40:100` lv 3 `R20:100` lv 4 `R40:80` cv 0 `R10:30` `R60:90` `R60:100` // 7 w 100 lv 0 `R20:50` lv 1 `R30:60` lv 2 `R60:80` lv 3 `R30:60` lv 4 `R20:50` cv 0 `R10:30` `R30:70` `R60:100` :repeat #end #define splash_drawing m clear o 80 30 f 18BC m center_cursor_horiz 10 ta CT // text align align center top t "Fast colorful drawing primitives!" m next_button splash_info o 0 0 m rand_draw #end #define splash_info m clear xi 8 0 0 s 0 1 // change this to "m next_button demo_end" to exit the demo instead of restarting it m next_button splash m logo_bounce #end #define logo_bounce // to the right and down //o 15 0 o 95 60 xi 9 0 0 xi 9 1 2 xi 9 2 4 xi 9 3 6 xi 9 4 8 xi 9 5 10 xi 9 6 12 xi 9 7 14 xi 9 8 16 xi 9 9 18 xi 9 10 20 xi 9 11 22 xi 9 12 24 xi 9 13 26 xi 9 14 28 xi 9 15 30 xi 9 16 32 xi 9 17 34 xi 9 18 36 xi 9 19 38 xi 9 20 40 xi 9 21 42 xi 9 22 44 xi 9 23 46 xi 9 24 48 xi 9 25 50 xi 9 26 52 xi 9 27 54 xi 9 28 56 xi 9 29 58 xi 9 30 60 xi 9 31 62 xi 9 32 64 // to the right and up xi 9 34 64 xi 9 35 62 xi 9 36 60 xi 9 37 58 xi 9 38 56 xi 9 39 54 xi 9 40 52 xi 9 41 50 xi 9 42 48 xi 9 43 46 xi 9 44 44 xi 9 45 42 xi 9 46 40 xi 9 47 38 xi 9 48 36 xi 9 49 34 xi 9 50 32 xi 9 51 30 xi 9 52 28 xi 9 53 26 xi 9 54 24 xi 9 55 22 xi 9 56 20 xi 9 57 18 xi 9 58 16 xi 9 59 14 xi 9 60 12 xi 9 61 10 xi 9 62 8 xi 9 63 6 xi 9 64 4 xi 9 65 2 xi 9 66 0 // to the left and down xi 9 65 2 xi 9 64 4 xi 9 63 6 xi 9 62 8 xi 9 61 10 xi 9 60 12 xi 9 59 14 xi 9 58 16 xi 9 57 18 xi 9 56 20 xi 9 55 22 xi 9 54 24 xi 9 53 26 xi 9 52 28 xi 9 51 30 xi 9 50 32 xi 9 49 34 xi 9 48 36 xi 9 47 38 xi 9 46 40 xi 9 45 42 xi 9 44 44 xi 9 43 46 xi 9 42 48 xi 9 41 50 xi 9 40 52 xi 9 39 54 xi 9 38 56 xi 9 37 58 xi 9 36 60 xi 9 35 62 xi 9 34 64 xi 9 33 66 // to the left and up xi 9 32 64 xi 9 31 62 xi 9 30 60 xi 9 29 58 xi 9 28 56 xi 9 27 54 xi 9 26 52 xi 9 25 50 xi 9 24 48 xi 9 23 46 xi 9 22 44 xi 9 21 42 xi 9 20 40 xi 9 19 38 xi 9 18 36 xi 9 17 34 xi 9 16 32 xi 9 15 30 xi 9 14 28 xi 9 13 26 xi 9 12 24 xi 9 11 22 xi 9 10 20 xi 9 9 18 xi 9 8 16 xi 9 7 14 xi 9 6 12 xi 9 5 10 xi 9 4 8 xi 9 3 6 xi 9 2 4 xi 9 1 2 :repeat #end // to debug the mpush/mpop buffer #define display_memory t "`M`" #end // to debug poweron macros #define pontest beep 100 w 500 :repeat #end // startup calibration option #define optional_calibration s 0 1 z f24B // whole screen touch area xs 128 0 0 `Xm` `Ym` // if touched, execute macro "tc" xm 128 tc t "Touch screen to calibrate." 20 100 w 1000 t "." w 1000 t "." w 1000 t "." w 1000 xc 128 #end // calibrate then run demo #define tc tc m clear m splash #end #define splash_fixed_fonts m clear // clear screen o 40 30 f m24B t "Fixed Width Fonts Include:" 0 0 sc 0 0 o 40 95 f m8 t "8 point: the quick brown fox 0123456789 " f m8B t "8 point bold: over the lazy dog 0123456789" t "\n" f m10 t "10 point: the quick fox 0123456789 " f m10B t "10 pt bold: over 0123456789" t "\n" f m12 t "12 pt: the quick brown fox jumped over the lazy dog 0123456789" t "\n" f m12B t "12 pt bold: quick brown fox jumped lazy dog 0123456789" t "\n" f m16 t "16 pt: the quick brown fox jumped lazy dog 0123456789" t "\n" f m16B t "16 pt bold: quick brown fox jumped lazy dog 01234567" t "\n" f m24 t "24 pt: quick brown fox 0123456789" t "\n" f m24B t "24 pt bold: quick brown fox jumped" t "\n" f m32 t "32 pt: the quick brown fox" t "\n" f m32B t "32 pt bold: quick brown fox" t "\n" f m48 t "48 pt / " f m64 t "64" m next_button splash_keyboard #end // run demo without calibrate #define demo_nocalib m clear m splash #end #define color_bars #end // demo meter 1 #define demo_meter1 //Reversed colors m clear // clear screen s 1 0 z o 80 60 f 24BC m center_cursor_horiz 10 ta CT // text align align center top t "Gauges Meter Demo" m next_button_black demo_slider //Display and move meter o 80 60 m create_meter1 m meters_move #end #define create_meter1 S FF0000 FFFFFF // red needle // md .. needle polygon points ... //SPEED md 0 15 70 60 1 10 150 10 58 234 159 157 5 15 -5 15 0 150 //RPM md 1 16 360 120 1 0 35 0 58 225 114 114 5 10 -5 10 0 100 #end #define meters_move m move_meter_slow 0 10 m move_meter_slow 1 1 m move_meter_slow 1 3 m move_meter_slow 1 5 m move_meter_slow 0 11 m move_meter_slow 0 12 m move_meter_slow 1 4 m move_meter_slow 0 13 m move_meter_slow 0 14 m move_meter_slow 0 15 m move_meter_slow 0 16 m move_meter_slow 0 17 m move_meter_slow 0 18 m move_meter_slow 0 19 m move_meter_slow 0 20 m move_meter_slow 1 7 m move_meter_slow 1 9 m move_meter_slow 1 11 m move_meter_slow 1 15 m move_meter_slow 0 21 m move_meter_slow 0 22 m move_meter_slow 1 14 m move_meter_slow 1 10 m move_meter_slow 0 23 m move_meter_slow 0 24 m move_meter_slow 0 25 m move_meter_slow 0 26 m move_meter_slow 0 27 m move_meter_slow 0 28 m move_meter_slow 0 29 m move_meter_slow 0 30 m move_meter_slow 0 31 m move_meter_slow 0 32 m move_meter_slow 0 33 m move_meter_slow 0 34 m move_meter_slow 0 35 m move_meter_slow 0 36 m move_meter_slow 0 37 m move_meter_slow 0 38 m move_meter_slow 0 39 m move_meter_slow 0 40 m move_meter_slow 0 41 m move_meter_slow 0 42 m move_meter_slow 0 43 m move_meter_slow 0 44 m move_meter_slow 0 45 m move_meter_slow 0 46 m move_meter_slow 0 47 m move_meter_slow 0 48 m move_meter_slow 0 49 m move_meter_slow 0 50 m move_meter_slow 0 51 m move_meter_slow 0 52 m move_meter_slow 0 53 m move_meter_slow 0 54 m move_meter_slow 0 55 m move_meter_slow 0 56 m move_meter_slow 0 57 m move_meter_slow 0 58 m move_meter_slow 0 59 m move_meter_slow 0 60 m move_meter_slow 0 59 m move_meter_slow 0 58 m move_meter_slow 0 57 m move_meter_slow 0 56 m move_meter_slow 0 55 m move_meter_slow 0 54 m move_meter_slow 0 53 m move_meter_slow 0 52 m move_meter_slow 0 51 m move_meter_slow 0 50 m move_meter_slow 0 45 m move_meter_slow 0 44 m move_meter_slow 0 43 m move_meter_slow 0 40 m move_meter_slow 0 35 m move_meter_slow 0 33 m move_meter_slow 0 30 m move_meter_slow 0 25 m move_meter_slow 0 22 m move_meter_slow 0 20 m move_meter_slow 0 19 m move_meter_slow 0 15 m move_meter_slow 0 12 m move_meter_slow 0 10 :repeat #end #define move_meter_slow mv `0` `1` w 50 #end #define next_button_black o 160 120 s 1 0 f 16B bd 1 514 404 1 "Next" 35 22 17 2 xm 1 `0` o 80 60 #end #define next_button_mtHood bd 1 640 500 1 "" 0 0 18 18 xm 1 `0` #end // SLCDM Demo Features added below... // demo the slider control #define demo_slider m clear // clear screen *debounce 10 // fast response for sliders f 24BC t "Slider Control Demo" 210 20 // display left slider sl 128 19 240 210 20 0 0 1 1 50 0 m slider128_update // display its value // when slider is touched, update the displayed value xm 128 slider128_update // display right slider and text sl 129 21 320 145 22 5 0 1 1 255 10 f 20 t "Move\nto\nchange\npanel\nbacklight" 445 145 // set to max sv 129 255 // implement setting m slider129_update // when slider is touched, use it to change brightness xm 129 slider129_update // link to next screen m next_button demo_sliding_compass #end #define slider128_update f 24 ta CT // text align align center top t " `L128` " 262 145 #end #define slider129_update xbbs `L129` #end // demo the sliding compass #define demo_sliding_compass m clear // clear screen m center_cursor_horiz 20 ta CT t "Sliding Compass Demo" // compass pointer indicator tr 399 211 379 156 419 156 F00 // display initial compass slide xio 23 300 211 1 200 0 m next_button macro_parms o 0 0 m compass_slide_action #end #define compass_slide_action xbbs 255 // make sure we are on full bright from last screen //move the compass around m compass_slide_offset 5 75 m compass_slide_offset 7 75 m compass_slide_offset 9 75 m compass_slide_offset 11 75 m compass_slide_offset 13 75 m compass_slide_offset 15 75 m compass_slide_offset 17 75 m compass_slide_offset 19 75 m compass_slide_offset 21 75 m compass_slide_offset 23 75 m compass_slide_offset 25 75 m compass_slide_offset 27 75 m compass_slide_offset 29 75 m compass_slide_offset 31 75 m compass_slide_offset 33 75 m compass_slide_offset 35 75 m compass_slide_offset 37 75 m compass_slide_offset 39 75 m compass_slide_offset 41 75 m compass_slide_offset 43 75 m compass_slide_offset 45 75 m compass_slide_offset 44 75 m compass_slide_offset 45 75 m compass_slide_offset 46 75 m compass_slide_offset 47 75 m compass_slide_offset 48 75 m compass_slide_offset 49 75 m compass_slide_offset 50 75 m compass_slide_offset 51 100 m compass_slide_offset 50 75 m compass_slide_offset 49 75 m compass_slide_offset 48 75 m compass_slide_offset 47 75 m compass_slide_offset 45 75 m compass_slide_offset 43 75 m compass_slide_offset 41 75 m compass_slide_offset 39 75 m compass_slide_offset 37 75 m compass_slide_offset 35 75 m compass_slide_offset 33 75 m compass_slide_offset 31 75 m compass_slide_offset 29 75 m compass_slide_offset 27 75 m compass_slide_offset 25 75 m compass_slide_offset 23 75 m compass_slide_offset 21 75 m compass_slide_offset 19 75 m compass_slide_offset 17 75 m compass_slide_offset 15 75 m compass_slide_offset 13 75 m compass_slide_offset 11 75 m compass_slide_offset 9 75 m compass_slide_offset 7 75 m compass_slide_offset 5 75 m compass_slide_offset 3 75 m compass_slide_offset 2 75 m compass_slide_offset 1 75 m compass_slide_offset 0 75 :repeat #end #define compass_slide_offset xio 23 300 211 1 200 `0` w `1` #end // This macro demonstrates the use macro parameters. // Refer to Software reference section, // "Macro Parameters (Arguments)". #define macro_parms m clear // clear screen f 24BC m center_cursor_horiz 20 ta CT // text align align center top t "Macro Parameter Demo" f 24 m center_cursor_horiz 100 ta CT t "Macros can accept up to ten parameters!" m display_parms Reach products allow you to always touch every single customer. m next_button macro_labels #end #define display_parms m center_cursor_horiz 140 ta CT // text align align center top t "Below is the macro list:" f 16 m center_cursor_horiz 185 ta CT t "#1:`0` #2:`1` #3:`2` #4:`3` #5:`4`\n" ta CT t "#6:`5` #7:`6` #8:`7` #9:`8` #10:`9`" f 24 ta CT m center_cursor_horiz 280 t "Parameters combined with text command:" f 16 m center_cursor_horiz 320 ta CT tf 0 500 "`0` `1` `2` `3` `4` `5` `6` `7` `8` `9`" #end // This macro demonstrates the use of Labels. // Refer to Software reference section, // "Special macro arguments and commands". #define macro_labels // Common Code Area m clear // clear screen f 24BC m center_cursor_horiz 20 ta CT // text align align center top t "Macro Label Demo" f 24 m center_cursor_horiz 70 ta CT // text align align center top t "Macros can contain control \":labels\"!" f 20 bdc 0 368 130 2 "ON" "OFF" 13 14 // This line assigns a macro (with a pre-defined label) to a button state xm 0 execute_labels:s0_1 execute_labels:s0_0 m next_button state_save_restore_demo #end #define execute_labels o 0 0 t "Common code in macro \"execute_labels\" executed." 160 200 :s0_1 t "Macro label \":s0_1\" executed. " 180 240 :s0_0 t "Macro label \":s0_0\" executed. " 180 240 #end //--------------------------------------------------------------------- // HORIZONTALLY CENTER CURSOR at given Y value //--------------------------------------------------------------------- #define center_cursor_horiz o 0 0 sc `Xc` `0` #end //--------------------------------------------------------------------- // STATE SAVE/RESTORE DEMO //--------------------------------------------------------------------- #define state_save_restore_demo m clear m center_cursor_horiz 12 f 24BC ta CT t "Drawing State\nSave/Restore Demo\n\n" f 24 ta CT t "Normal State\n" w 1000 m red_state w 1000 ta CT t "Normal Again" // link to next screen: m next_button more_features w 3000 :repeat #end #define red_state ss S FFF F00 f 24B ta CT t "\n\n White on Red State \n" sr #end #define more_features m clear // clear screen xi 24 0 0 // show next buttton now because macro will stop on error // if CH48 font was not downloaded m next_button panel_pattern o 80 60 // show chinese font f 13 t "(Error - CH48 font not downloaded!!)" 100 380 utf8 on // enable UTF8 test f CH48 // select downloaded font t "UNICODE:\xe4\xb8\x9c\xe4\xb8\x9a" 100 380 anic f 32B // Red text s 5 1 t "ANIMATION" 100 250 // Green text S 0f0 fff tf 0 "FLASHING TEXT" 100 120 f 8x8 ani 1 wvr 188 ani 1 xi 26 370 250 ani 1 y 50 ani 1 wvr 188 ani 1 xi 25 370 250 ani 1 wvr 188 ani 1 xi 26 470 250 ani 1 y 50 ani 1 wvr 188 ani 1 xi 25 470 250 ani 1 wvr 188 ani 1 xi 26 570 250 ani 1 y 50 ani 1 wvr 188 ani 1 xi 25 570 250 ani 1 y 50 anie 1 #end //--------------------------------------------------------------------- // This macro simply creates a pattern to check the pixel alignment. //--------------------------------------------------------------------- #define panel_pattern m clear o 0 0 f 32B m center_cursor_horiz 20 ta CT t "Panel Alignment\nPattern" f 18BC m center_cursor_horiz 120 ta CT t "Make sure that lines meet\nat panel corners." m center_cursor_horiz `Yc` ta CT t "Supports SVGA: 800 X 600" p 1 // big X l 0 0 799 599 l 799 0 0 599 // ^ l 0 299 399 0 l 399 0 799 299 // v l 0 299 399 599 l 399 599 799 299 m next_button splash_drawing #end