void drawButtonEnsure() { button_ensure = SDL_ButtonNew(); SDL_WidgetSetDims(button_ensure, W_WIDTH - 100, W_HEIGHT - 40, 60, 30); SDL_ButtonSetLabel(button_ensure, "Ensure"); SDL_SignalConnect(button_ensure,"clicked",(T_Signal_Callback)callback_button_ensure, NULL); SDL_WidgetShow(button_ensure); }
void drawMsgBox() { msg_box = SDL_MultiLineEditNew(); SDL_WidgetSetDims(msg_box, MARGIN, 120, 600, 400); // here, should not focus on the MsgBox because we use it only for display messages SDL_WidgetShow(msg_box); }
void drawButtonYes() { button_yes = SDL_ButtonNew(); SDL_WidgetSetDims(button_yes, W_WIDTH - 400, W_HEIGHT - 40, 60, 30); SDL_ButtonSetLabel(button_yes, "Yes"); SDL_SignalConnect(button_yes,"clicked",(T_Signal_Callback)callback_button_yes, NULL); SDL_WidgetShow(button_yes); }
static void SDL_ButtonSignalShow(SDL_Object *object,void *signaldata,void *userdata) { SDL_Button *Button=(SDL_Button*)object; if(Button->Label != NULL) SDL_WidgetShow(Button->Label); }
void drawButtonNo() { button_no = SDL_ButtonNew(); SDL_WidgetSetDims(button_no, W_WIDTH - 300, W_HEIGHT - 40, 60, 30); SDL_ButtonSetLabel(button_no, "No"); SDL_SignalConnect(button_no,"clicked",(T_Signal_Callback)callback_button_no, NULL); SDL_WidgetShow(button_no); }
void drawEdit() { input_edit = SDL_EditNew(); SDL_WidgetSetDims(input_edit, 400, 300, 240, 25); // SDL_EditSetText(input_edit, ""); SDL_SignalConnect(input_edit,"activate",(T_Signal_Callback)callback_input_edit, NULL); SDL_SignalConnect(input_edit,"changed",(T_Signal_Callback)callback_input_edit_changed, NULL); SDL_WidgetShow(input_edit); }
void drawButtonFinish() { button_finish = SDL_ButtonNew(); SDL_WidgetSetDims(button_finish, W_WIDTH - 180, W_HEIGHT - 40, 60, 30); SDL_ButtonSetLabel(button_finish, "Finish"); SDL_SignalConnect(button_finish,"clicked",(T_Signal_Callback)callback_button_finish, NULL); SDL_WidgetShow(button_finish); }
void drawButtonRetest() { button_retest = SDL_ButtonNew(); SDL_WidgetSetDims(button_retest, W_WIDTH - 180, W_HEIGHT - 40, 60, 30); SDL_ButtonSetLabel(button_retest, "Retest"); SDL_SignalConnect(button_retest,"clicked",(T_Signal_Callback)callback_button_retest, NULL); SDL_WidgetShow(button_retest); }
void drawButtonPoweroff() { button_poweroff = SDL_ButtonNew(); SDL_WidgetSetDims(button_poweroff, W_WIDTH - 100, W_HEIGHT - 40, 60, 30); SDL_ButtonSetLabel(button_poweroff, "Poweroff"); SDL_SignalConnect(button_poweroff,"clicked",(T_Signal_Callback)callback_button_poweroff, NULL); SDL_WidgetShow(button_poweroff); }
void drawLine_Style1() { line_style1 = SDL_LabelNew(); SDL_WidgetSetDims(line_style1, MARGIN, 106, 1024 - 2*MARGIN, 2); ((SDL_Label *)line_style1)->bgcolor = 0x007700ff; SDL_WidgetShow(line_style1); }
void drawButtonLeave() { button_leave = SDL_ButtonNew(); SDL_WidgetSetDims(button_leave, W_WIDTH - 100, MARGIN + 50, 60, 30); SDL_ButtonSetLabel(button_leave, "Exit"); SDL_SignalConnect(button_leave,"clicked",(T_Signal_Callback)callback_button_leave, NULL); SDL_WidgetShow(button_leave); }
SDL_Widget* drawWhite() { SDL_Widget *blue_label; blue_label = SDL_LabelNew(); SDL_WidgetSetDims(blue_label, 0, 0, W_WIDTH, W_HEIGHT); ((SDL_Label *)blue_label)->bgcolor = 0x00ffffff; SDL_WidgetShow(blue_label); return blue_label; }
SDL_Widget* drawBlack() { SDL_Widget *black_label; black_label = SDL_LabelNew(); SDL_WidgetSetDims(black_label, 0, 0, W_WIDTH, W_HEIGHT); ((SDL_Label *)black_label)->bgcolor = 0x00000000; SDL_WidgetShow(black_label); return black_label; }
SDL_Widget *printStr( char *str, int x, int y ) { SDL_Widget *label_tmp = SDL_LabelNew(); SDL_WidgetSetDims(label_tmp, x, y, strlen(str)*8, 18); ((SDL_Label *)label_tmp)->fgcolor = 0x000000ff; SDL_LabelSetText(label_tmp, str); SDL_WidgetShow(label_tmp); return label_tmp; }
SDL_Widget* drawLabel( int bgcolor) { SDL_Widget *label; label = SDL_LabelNew(); SDL_WidgetSetDims( label, 0, 0, W_WIDTH, W_HEIGHT); ((SDL_Label *)label)->bgcolor = bgcolor; SDL_WidgetShow(label); return label; }
// ==================================================================== void printItemHead( char *str ) { SDL_Widget *label_item_head; label_item_head = SDL_LabelNew(); SDL_WidgetSetDims(label_item_head, MARGIN, MARGIN, 400, 80); SDL_LabelSetAlignment(label_item_head, CENTER); ((SDL_Label *)label_item_head)->bgcolor = 0x00000000; ((SDL_Label *)label_item_head)->fgcolor = 0x00ff00ff; SDL_LabelSetText(label_item_head, str); SDL_WidgetShow(label_item_head); }
void printFail( char *str ) { SDL_Widget *label_tmp = SDL_LabelNew(); SDL_WidgetSetDims(label_tmp, MARGIN, gy + 120, strlen(str)*8, 18); ((SDL_Label *)label_tmp)->fgcolor = 0x00cc0000; SDL_LabelSetText(label_tmp, str); SDL_WidgetShow(label_tmp); gy +=20; if (gy >= W_HEIGHT - 30) { gy = 0; } }
void drawScrollBar() { SDL_Widget *scrollbar = SDL_ScrollbarNew(); SDL_WidgetSetDims(scrollbar, MARGIN, 120, 40, 400); SDL_WidgetShow(scrollbar); }