void ask_buttons(void) { int i, j; /* all high */ DDRLED_BUTTON_SEL_PORT = 0xFF; PORTLED_BUTTON_SEL_PORT = 0xFF; for (i = 0; i < BUTTON_ROWS; i++) for (j = 0; j < 8; j++) ask_button(i, j); }
//------- Begin of function Box::ask ----------// // // Popup a message box and ask user 'Ok' or 'Cancel' // // Syntax :: ask( <char*> ) // // <char*> msgStr = pointer to the message, use '\n' to seperate lines // [char*] buttonDes1 = the description of button 1 (default : "Ok") // [char*] buttonDes2 = the description of button 2 (default : "Cancel") // [int] x1, y1 = the left corner of the box, if not given // center the box on the screen // // Return : 1 - if user select "Ok" button // 0 - if user select "Cancel" button // // int Box::ask(char* msgStr, char* buttonDes1, char* buttonDes2, int x1, int y1) { int rc; calc_size(msgStr,BOX_TOP_MARGIN+BOX_BOTTOM_MARGIN,x1,y1); // calculate x1, y1, x2, y2 depended on the msgStr opened_flag = 1; rc = ask_button(msgStr, buttonDes1, buttonDes2); close(); return rc; }