// // The macros below define a set of six buttons that act like radio // buttons. Each button press calls an associated macro that sets the // proper state for the button that was pressed and clears the other // buttons. The user could add application-specific commands to these // macros. // // The button define commands take advantage of the internal button // bitmaps. // #define setup // clear screen z // define latching buttons using internal bitmaps, // initial state is set to 0 // // bdc <"text0"> <"text1"> // (if bmp0 and bmp1 are omitted, the built-in bitmap images are used) // bdc 1 050 50 20 "Up1" "Dn1" bdc 2 120 50 20 "Up2" "Dn2" bdc 3 190 50 20 "Up3" "Dn3" bdc 4 050 150 20 "Up4" "Dn4" bdc 5 120 150 20 "Up5" "Dn5" bdc 6 190 150 20 "Up6" "Dn6" // // assign macros to each button xaq 1 p button_1_pressed xaq 2 p button_2_pressed xaq 3 p button_3_pressed xaq 4 p button_4_pressed xaq 5 p button_5_pressed xaq 6 p button_6_pressed #end // button_x_pressed macros: // // one of these is called when a button is pressed. // each one sets the state of the 'other' buttons // to unlatched. // #define button_1_pressed ssb 2 0 ssb 3 0 ssb 4 0 ssb 5 0 ssb 6 0 // out "Button 1\r" #end #define button_2_pressed ssb 1 0 ssb 3 0 ssb 4 0 ssb 5 0 ssb 6 0 // out "Button 2\r" #end #define button_3_pressed ssb 1 0 ssb 2 0 ssb 4 0 ssb 5 0 ssb 6 0 // out "Button 3\r" #end #define button_4_pressed ssb 1 0 ssb 2 0 ssb 3 0 ssb 5 0 ssb 6 0 // out "Button 4\r" #end #define button_5_pressed ssb 1 0 ssb 2 0 ssb 3 0 ssb 4 0 ssb 6 0 // out "Button 5\r" #end #define button_6_pressed ssb 1 0 ssb 2 0 ssb 3 0 ssb 4 0 ssb 5 0 // out "Button 6\r" #end