int ssd_widget_set_left_softkey_text(SsdWidget widget, const char *value) { widget->left_softkey = value; switch (roadmap_softkeys_orientation ()) { case SOFT_KEYS_ON_BOTTOM: if (widget->right_softkey != NULL) ssd_widget_set_value (widget, "right_softkey_text", widget->right_softkey); if (value != NULL && *value) return ssd_widget_set_value (widget, "left_softkey_text", value); break; case SOFT_KEYS_ON_RIGHT: ssd_widget_set_value (widget, "left_softkey_text", ""); if (value != NULL && *value) return ssd_widget_set_value (widget, "right_softkey_text", value); break; default: return -1; } return 0; }
static BOOL keyboard_callback(int exit_code, const char* value, void* context) { SsdWidget button = (SsdWidget)context; if( dec_ok != exit_code) return TRUE; if (!strcmp(button->name, "left_button")) { ssd_widget_set_value (button->parent, UPDATE_LEFT, value); } else { ssd_widget_set_value (button->parent, UPDATE_RIGHT, value); } return TRUE; }
static int set_value (SsdWidget widget, const char *value) { if ((value != NULL) && (value[0] != 0)) ssd_widget_hide(ssd_widget_get(widget, "BgText")); else ssd_widget_show(ssd_widget_get(widget, "BgText")); return ssd_widget_set_value (widget, "Text", value); }
static int set_value (SsdWidget widget, const char *value) { struct ssd_checkbox_data *data = (struct ssd_checkbox_data *)widget->data; if ((data->callback) && !(*data->callback) (widget, value)) { return 0; } return ssd_widget_set_value (widget, "Label", value); }
void roadmap_messagebox (const char *title, const char *text) { SsdWidget dialog = ssd_dialog_activate ("message_box", NULL); title = roadmap_lang_get (title); text = roadmap_lang_get (text); if (!dialog) { create_messagebox (); dialog = ssd_dialog_activate ("message_box", NULL); } dialog->set_value (dialog, title); ssd_widget_set_value (dialog, "text", text); kill_messagebox_timer (); ssd_dialog_draw (); }
void ssd_confirm_dialog_custom (const char *title, const char *text, BOOL default_yes, ConfirmDialogCallback callback, void *context,const char *textYes, const char *textNo) { SsdWidget dialog; confirm_dialog_context *data = (confirm_dialog_context *)calloc (1, sizeof(*data)); data->default_yes = default_yes; dialog = ssd_dialog_activate ("confirm_dialog", NULL); title = roadmap_lang_get (title); text = roadmap_lang_get (text); if (!dialog) { create_confirm_dialog (default_yes,textYes,textNo); dialog = ssd_dialog_activate ("confirm_dialog", NULL); } else{ #ifdef TOUCH_SCREEN //set button text & softkeys SsdWidget buttonYes; SsdWidget buttonNo; buttonYes = ssd_widget_get(dialog, roadmap_lang_get ("Yes")); // change the buttons to custom text ssd_button_change_text(buttonYes, textYes); buttonNo = ssd_widget_get(dialog, roadmap_lang_get ("No")); ssd_button_change_text(buttonNo, textNo); #else //Non touch set_soft_keys(dialog, textYes, textNo); // change softkeys text to custom text ssd_dialog_refresh_current_softkeys(); #endif } if (title[0] == 0){ ssd_widget_hide(ssd_widget_get(dialog, "title_bar")); } else{ ssd_widget_show(ssd_widget_get(dialog, "title_bar")); } data->callback = callback; data->context = context; dialog->set_value (dialog, title); ssd_widget_set_value (dialog, "text", text); dialog->context = data; ssd_dialog_draw (); }
static int set_value (SsdWidget widget, const char *value) { if (!(widget->flags & SSD_CONTAINER_TITLE)) return -1; return ssd_widget_set_value (widget, "title_text", value); }
int ssd_dialog_set_value (const char *name, const char *value) { return ssd_widget_set_value (RoadMapDialogCurrent->container, name, value); }