这篇教程C++ update_label函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中update_label函数的典型用法代码示例。如果您正苦于以下问题:C++ update_label函数的具体用法?C++ update_label怎么用?C++ update_label使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了update_label函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: g_snprintfstatic int recv_backup (CalcHandle* handle, BackupContent* content){ char varname[9] = { 0 }; g_snprintf(update_->text, sizeof(update_->text), _("Waiting for backup...")); update_label(); content->model = CALC_TI86; strcpy(content->comment, tifiles_comment_set_backup()); TRYF(ti85_recv_VAR(&(content->data_length1), &content->type, varname)); content->data_length2 = (uint8_t)varname[0] | ((uint8_t)varname[1] << 8); content->data_length3 = (uint8_t)varname[2] | ((uint8_t)varname[3] << 8); content->data_length4 = (uint8_t)varname[4] | ((uint8_t)varname[5] << 8); TRYF(ti85_send_ACK()); TRYF(ti85_send_CTS()); TRYF(ti85_recv_ACK(NULL)); strcpy(update_->text, ""); update_label(); update_->cnt2 = 0; update_->max2 = 4; update_->pbar(); content->data_part1 = tifiles_ve_alloc_data(65536); TRYF(ti85_recv_XDP(&content->data_length1, content->data_part1)); TRYF(ti85_send_ACK()); update_->cnt2++; update_->pbar(); content->data_part2 = tifiles_ve_alloc_data(65536); TRYF(ti85_recv_XDP(&content->data_length2, content->data_part2)); TRYF(ti85_send_ACK()); update_->cnt2++; update_->pbar(); if (content->data_length3) { content->data_part3 = tifiles_ve_alloc_data(65536); TRYF(ti85_recv_XDP(&content->data_length3, content->data_part3)); TRYF(ti85_send_ACK()); } else content->data_part3 = NULL; update_->cnt2++; update_->pbar(); content->data_part4 = tifiles_ve_alloc_data(65536); TRYF(ti85_recv_XDP(&content->data_length4, content->data_part4)); TRYF(ti85_send_ACK()); update_->cnt2++; update_->pbar(); return 0;}
开发者ID:tobiasBora,项目名称:emacs_ti,代码行数:56,
示例2: ticonv_varname_to_utf8static int del_var (CalcHandle* handle, VarRequest* vr){ unsigned int i; char *utf8; utf8 = ticonv_varname_to_utf8(handle->model, vr->name, vr->type); g_snprintf(update_->text, sizeof(update_->text), _("Deleting %s..."), utf8); g_free(utf8); update_label(); send_key(handle, 0x0040); // Quit send_key(handle, 0x0009); // Clear send_key(handle, 0x0009); // Clear send_key(handle, 0x003e); // Catalog send_key(handle, 0x009d); // D send_key(handle, 0x0004); // Down send_key(handle, 0x0004); // Down send_key(handle, 0x0004); // Down send_key(handle, 0x0005); // Enter for(i = 0; i < strlen(vr->name); i++) { char c = toupper(vr->name[i]); if(isdigit(c)) send_key(handle, (uint16_t)(0x008e + c - '0')); else send_key(handle, (uint16_t)(0x009a + c - 'A')); } send_key(handle, 0x0005); // Enter return 0;}
开发者ID:debrouxl,项目名称:tilp-libticalcs,代码行数:34,
示例3: nsp_session_openstatic int rename_var (CalcHandle* handle, VarRequest* oldname, VarRequest* newname){ char *utf81, *utf82; char *path1, *path2; int ret; ret = nsp_session_open(handle, NSP_SID_FILE_MGMT); if (ret) { return ret; } path1 = build_path(handle->model, oldname); path2 = build_path(handle->model, newname); utf81 = ticonv_varname_to_utf8(handle->model, path1, oldname->type); utf82 = ticonv_varname_to_utf8(handle->model, path2, newname->type); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Renaming %s to %s..."), utf81, utf82); ticonv_utf8_free(utf82); ticonv_utf8_free(utf81); update_label(); ret = nsp_cmd_s_rename_file(handle, path1, path2); g_free(path2); g_free(path1); if (!ret) { ret = nsp_cmd_r_rename_file(handle); } DO_CLOSE_SESSION(handle); return ret;}
开发者ID:TC01,项目名称:tilibs,代码行数:33,
示例4: TRYFstatic int recv_var (CalcHandle* handle, CalcMode mode, FileContent* content, VarRequest* vr){ char *path; uint8_t *data = NULL; VarEntry *ve; char *utf8; int err; const char * dot_if_any = "."; TRYF(nsp_session_open(handle, SID_FILE_MGMT)); // Don't add a dot if this file type is unknown. if (vr->type >= NSP_MAXTYPES) dot_if_any = ""; path = g_strconcat("/", vr->folder, "/", vr->name, dot_if_any, tifiles_vartype2fext(handle->model, vr->type), NULL); utf8 = ticonv_varname_to_utf8(handle->model, path, vr->type); g_snprintf(update_->text, sizeof(update_->text), "%s", utf8); g_free(utf8); update_label(); err = nsp_cmd_s_get_file(handle, path); g_free(path); if (err) { return err; } TRYF(nsp_cmd_r_get_file(handle, &(vr->size))); TRYF(nsp_cmd_s_file_ok(handle)); if (vr->size) TRYF(nsp_cmd_r_file_contents(handle, &(vr->size), &data)); TRYF(nsp_cmd_s_status(handle, ERR_OK)); content->model = handle->model; strcpy(content->comment, tifiles_comment_set_single()); content->num_entries = 1; content->entries = tifiles_ve_create_array(1); ve = content->entries[0] = tifiles_ve_create(); memcpy(ve, vr, sizeof(VarEntry)); ve->data = tifiles_ve_alloc_data(ve->size); if (data && ve->data) { memcpy(ve->data, data, ve->size); } g_free(data); // XXX don't check the result of this call, to enable reception of variables from Nspires running OS >= 1.7. // Those versions send a martian packet: // * a src port never seen before in the conversation; // * an improper dest port; // * a 1-byte payload containing 02 (i.e. an invalid address for the next packet). // * .ack = 0x00 (instead of 0x0A). nsp_session_close(handle); return 0;}
开发者ID:debrouxl,项目名称:tilp-libticalcs,代码行数:60,
示例5: new_folderstatic int new_folder (CalcHandle* handle, VarRequest* vr){ uint8_t data[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x40, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23 }; char varname[18]; char *utf8; tifiles_build_fullname(handle->model, varname, vr->folder, "a1234567"); utf8 = ticonv_varname_to_utf8(handle->model, vr->folder, -1); g_snprintf(update_->text, sizeof(update_->text), _("Creating %s..."), utf8); g_free(utf8); update_label(); // send empty expression TRYF(ti92_send_RTS(0x10, 0x00, varname)); TRYF(ti92_recv_ACK(NULL)); TRYF(ti92_recv_CTS()); TRYF(ti92_send_ACK()); TRYF(ti92_send_XDP(0x10, data)); TRYF(ti92_recv_ACK(NULL)); TRYF(ti92_send_EOT()); TRYF(ti92_recv_ACK(NULL)); // delete 'a1234567' variable strcpy(vr->name, "a1234567"); TRYF(del_var(handle, vr)); return 0;}
开发者ID:tobiasBora,项目名称:emacs_ti,代码行数:31,
示例6: new_folderstatic int new_folder (CalcHandle* handle, VarRequest* vr){ char *utf8; char *path; int err; TRYF(nsp_session_open(handle, SID_FILE_MGMT)); path = g_strconcat("/", vr->folder, NULL); utf8 = ticonv_varname_to_utf8(handle->model, path, -1); g_snprintf(update_->text, sizeof(update_->text), _("Creating %s..."), utf8); g_free(utf8); update_label(); err = nsp_cmd_s_new_folder(handle, path); g_free(path); if (err) { return err; } TRYF(nsp_cmd_r_new_folder(handle)); TRYF(nsp_session_close(handle)); return 0;}
开发者ID:debrouxl,项目名称:tilp-libticalcs,代码行数:26,
示例7: assertvoid multimenu_button::select_options(boost::dynamic_bitset<> states){ assert(states.size() == values_.size()); toggle_states_ = states; update_config_from_toggle_states(); update_label();}
开发者ID:fluffbeast,项目名称:wesnoth-old,代码行数:7,
示例8: new_folderstatic int new_folder (CalcHandle* handle, VarRequest* vr){ char *utf8; char *path; int ret; ret = nsp_session_open(handle, NSP_SID_FILE_MGMT); if (ret) { return ret; } path = g_strconcat("/", vr->folder, NULL); utf8 = ticonv_varname_to_utf8(handle->model, path, -1); ticalcs_slprintf(update_->text, sizeof(update_->text), _("Creating %s..."), utf8); ticonv_utf8_free(utf8); update_label(); ret = nsp_cmd_s_new_folder(handle, path); g_free(path); if (!ret) { ret = nsp_cmd_r_new_folder(handle); } DO_CLOSE_SESSION(handle); return ret;}
开发者ID:TC01,项目名称:tilibs,代码行数:29,
示例9: ticalcs_criticalstatic int send_var (CalcHandle* handle, CalcMode mode, FileContent* content){ uint8_t status; gchar *path; int ret; VarEntry * entry; update_->cnt2 = 0; update_->max2 = 1; update_->pbar(); entry = content->entries[0]; if (!ticalcs_validate_varentry(entry)) { ticalcs_critical("%s: skipping invalid content entry #0", __FUNCTION__); return ERR_INVALID_PARAMETER; } if (entry->action == ACT_SKIP) { return 0; } //if (!strlen(entry->folder)) //{ // return ERR_ABORT; //} ret = nsp_session_open(handle, NSP_SID_FILE_MGMT); if (ret) { return ret; } path = build_path(handle->model, entry); ticonv_varname_to_utf8_sn(handle->model, path, update_->text, sizeof(update_->text), entry->type); update_label(); ret = nsp_cmd_s_put_file(handle, path, entry->size); g_free(path); if (!ret) { ret = nsp_cmd_r_put_file(handle); if (!ret) { ret = nsp_cmd_s_file_contents(handle, entry->size, entry->data); if (!ret) { ret = nsp_cmd_r_status(handle, &status); } } } DO_CLOSE_SESSION(handle); return ret;}
开发者ID:TC01,项目名称:tilibs,代码行数:59,
示例10: setup_interfacestatic intsetup_interface( void ){ GtkWidget *window, *treeview, *select_entry, *spawn_dialog, *spawn_label; GtkCellRenderer *renderer; gtk_window_set_default_icon_name( "gnome-dev-keyboard" ); wl = window_list_new(); xml = glade_xml_new( PREFIX "/share/keyboardcast/keyboardcast.glade", NULL, NULL ); if( xml == NULL ) return 1; select_entry = glade_xml_get_widget( xml, "select-entry" ); treeview = glade_xml_get_widget( xml, "treeview" ); window = glade_xml_get_widget( xml, "window" ); spawn_dialog = glade_xml_get_widget( xml, "spawn-dialog" ); spawn_label = glade_xml_get_widget( xml, "spawn-label" ); if( select_entry == NULL || treeview == NULL || window == NULL || spawn_dialog == NULL || spawn_label == NULL ) return 1; gtk_tree_view_set_model( GTK_TREE_VIEW( treeview ), GTK_TREE_MODEL( wl ) ); renderer = window_list_toggle_renderer( wl ); gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW( treeview ), -1, " C++ update_menu函数代码示例 C++ update_irq函数代码示例
|