本文整理汇总了C++中SsdWidget::set_value方法的典型用法代码示例。如果您正苦于以下问题:C++ SsdWidget::set_value方法的具体用法?C++ SsdWidget::set_value怎么用?C++ SsdWidget::set_value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SsdWidget
的用法示例。
在下文中一共展示了SsdWidget::set_value方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ssd_generic_icon_list_dialog_show
void ssd_generic_icon_list_dialog_show(
const char* title,
int count,
const char** labels,
const void** values,
const char** icons,
const int* flags,
PFN_ON_ITEM_SELECTED on_item_selected,
PFN_ON_ITEM_SELECTED on_item_deleted,
void* context,
const char* left_softkey_text,
SsdSoftKeyCallback left_softkey_callback,
int list_height,
int dialog_flags,
BOOL add_next_button)
{
static SsdListContext list_context;
SsdWidget list;
int list_flags = 0;
#if defined (OPENGL)
/*
* Borders are fast in OPENGL
*/
list_flags |= SSD_ALIGN_CENTER|SSD_CONTAINER_BORDER|SSD_ROUNDED_CORNERS|SSD_ROUNDED_WHITE;
#endif // OPENGL
list_context.on_item_selected= on_item_selected;
list_context.on_item_deleted = on_item_deleted;
list_context.context = context;
list_context.left_softkey_callback = left_softkey_callback;
if ( !ssd_dialog_exists( SSD_GEN_LIST_DLG_NAME ) )
{
GenericList = ssd_dialog_new ( SSD_GEN_LIST_DLG_NAME, "", on_dialog_closed, SSD_CONTAINER_TITLE|dialog_flags);
list = ssd_list_new ("list", SSD_MAX_SIZE, SSD_MAX_SIZE, inputtype_none, 0, NULL);
ssd_widget_add (GenericList, list);
}
else{
GenericList->flags &= ~SSD_HEADER_BLACK;
GenericList->flags |= dialog_flags;
}
ssd_widget_set_offset(GenericList,0,0);
list = ssd_widget_get (GenericList, "list");
GenericList->set_value (GenericList->parent, title);
ssd_widget_set_context (GenericList, &list_context);
ssd_widget_reset_cache (list->parent);
ssd_widget_reset_position(GenericList);
ssd_list_resize ( list, list_height );
ssd_list_populate (list, count, labels, values,icons,flags, list_callback, del_callback, add_next_button);
ssd_widget_set_left_softkey_text(GenericList, left_softkey_text);
if (left_softkey_callback != NULL)
ssd_widget_set_left_softkey_callback(GenericList, list_left_softkey_callback);
ssd_dialog_activate (SSD_GEN_LIST_DLG_NAME, NULL);
ssd_dialog_draw();
}
示例2: ssd_widget_set_value
int ssd_widget_set_value (const SsdWidget widget, const char *name,
const char *value) {
SsdWidget w = ssd_widget_get (widget, name);
if (!w || !w->set_value) return -1;
return w->set_value(w, value);
}
示例3: ssd_generic_list_dialog_show
void ssd_generic_list_dialog_show(const char* title,
int count,
const char** labels,
const void** values,
PFN_ON_ITEM_SELECTED on_item_selected,
PFN_ON_ITEM_SELECTED on_item_deleted,
void* context,
int list_height )
{
static SsdListContext list_context;
SsdWidget list;
int flags = 0;
#if defined (OPENGL)
/*
* Borders are fast in OPENGL
*/
flags |= SSD_ALIGN_CENTER|SSD_CONTAINER_BORDER|SSD_ROUNDED_CORNERS|SSD_ROUNDED_WHITE;
#endif // OPENGL
list_context.on_item_selected= on_item_selected;
list_context.on_item_deleted = on_item_deleted;
list_context.context = context;
list_context.left_softkey_callback = NULL;
if (!GenericList)
{
GenericList = ssd_dialog_new ( SSD_GEN_LIST_DLG_NAME, "", on_dialog_closed,
SSD_CONTAINER_TITLE);
ssd_dialog_add_vspace (GenericList, 5, 0);
list = ssd_list_new ("list", ssd_container_get_width(), SSD_MAX_SIZE, inputtype_none, flags, NULL);
ssd_widget_add (GenericList, list);
}
list = ssd_widget_get (GenericList, "list");
ssd_widget_set_offset(GenericList,0,0);
ssd_widget_set_left_softkey_text(GenericList, roadmap_lang_get("Exit_key"));
ssd_widget_set_left_softkey_callback(GenericList, NULL);
GenericList->set_value (GenericList->parent, title);
ssd_widget_set_context (GenericList, &list_context);
ssd_widget_reset_cache (list->parent);
ssd_widget_reset_position(GenericList);
ssd_list_resize ( list, list_height );
ssd_list_populate (list, count, labels, values, NULL, NULL, list_callback, del_callback, FALSE);
ssd_dialog_activate ( SSD_GEN_LIST_DLG_NAME, NULL );
ssd_dialog_draw();
}
示例4: roadmap_messagebox
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 ();
}
示例5: ssd_confirm_dialog_custom
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 ();
}