static void refreshLists() { short r, i, c, a; r = row2ref(gCurRow); // application number which lines are displayed if (r < 0) r = 0; gUpdateFlag=TRUE; gtk_clist_freeze(GTK_CLIST(gSrcList)); gtk_clist_freeze(GTK_CLIST(gAppList)); gtk_clist_freeze(GTK_CLIST(gDstList)); gtk_clist_unselect_all(GTK_CLIST(gAppList)); gtk_clist_unselect_all(GTK_CLIST(gSrcList)); gtk_clist_unselect_all(GTK_CLIST(gDstList)); for (i=0, c=MidiCountAppls(); i < c; i++) { a = row2ref(i); if (a == r) gtk_clist_select_row (GTK_CLIST(gAppList), i, 0); if (MidiIsConnected(a, r)) gtk_clist_select_row (GTK_CLIST(gSrcList), i, 0); if (MidiIsConnected(r, a)) gtk_clist_select_row (GTK_CLIST(gDstList), i, 0); } gtk_clist_thaw(GTK_CLIST(gSrcList)); gtk_clist_thaw(GTK_CLIST(gAppList)); gtk_clist_thaw(GTK_CLIST(gDstList)); gUpdateFlag=FALSE; }
/* This updates the file list to show (and select) a particular node * entry. The directory tree is also updated appropriately */ void filelist_show_entry( GNode *node ) { GNode *dnode; int row; /* Corresponding directory */ if (NODE_IS_DIR(node)) dnode = node; else dnode = node->parent; if (dnode != filelist_current_dnode) { /* Scroll directory tree to proper entry */ dirtree_entry_show( dnode ); } /* Scroll file list to proper entry */ row = gtk_clist_find_row_from_data( GTK_CLIST(file_clist_w), node ); if (row >= 0) gtk_clist_select_row( GTK_CLIST(file_clist_w), row, 0 ); else gtk_clist_unselect_all( GTK_CLIST(file_clist_w) ); gui_clist_moveto_row( file_clist_w, MAX(0, row), FILELIST_SCROLL_TIME ); }
void Meaning::unselectListsExcept(GtkWidget* list) throw() { for(int i = 0;i < static_cast<int>(d_lists.size());++i) { if (d_lists[i] != list) gtk_clist_unselect_all(GTK_CLIST(d_lists[i])); } }
static void gftpui_gtk_trans_unselectall (GtkWidget * widget, gpointer data) { gftp_transfer * tdata; tdata = data; gtk_clist_unselect_all (GTK_CLIST (tdata->clist)); }
void deselectall (gpointer data) { gftp_window_data * wdata; wdata = data; wdata->show_selected = 0; gtk_clist_unselect_all (GTK_CLIST (wdata->listbox)); }
static void editlist_gui_delete (GtkWidget * igad) { int row; row = gtkutil_clist_selection (editlist_gui_list); if (row != -1) { gtk_clist_unselect_all (GTK_CLIST (editlist_gui_list)); gtk_clist_remove (GTK_CLIST (editlist_gui_list), row); } }
/* This makes entries in the file list selectable or unselectable, * depending on whether the directory they are in is expanded or not */ void filelist_reset_access( void ) { boolean enabled; enabled = dirtree_entry_expanded( filelist_current_dnode ); gtk_widget_set_sensitive( file_clist_w, enabled ); /* Extra fluff for interface niceness */ if (enabled) gui_cursor( file_clist_w, -1 ); else { gtk_clist_unselect_all( GTK_CLIST(file_clist_w) ); gui_cursor( file_clist_w, GDK_X_CURSOR ); } }
/********************************************************************\ * gnc_query_list_unselect_all * * unselect all items in the list * * * * Args: list - list to unselect all * * Returns: nothing * \********************************************************************/ void gnc_query_list_unselect_all(GNCQueryList *list) { g_return_if_fail (list != NULL); g_return_if_fail (IS_GNC_QUERY_LIST(list)); list->no_toggle = TRUE; list->always_unselect = TRUE; gtk_clist_unselect_all (GTK_CLIST(list)); list->always_unselect = FALSE; list->no_toggle = FALSE; list->current_entry = NULL; }
static void mouse_click_cb(GtkWidget *widget, GdkEventButton *event, FileView *view) { if (event->button == 1) { /* Left Button: selection */ if (curr_view != view) { switch_views(); gtk_widget_grab_focus(view->clist); } } else if (event->button == 2) { /* Middle Button: Drag and Drop */ GtkTargetList *list; GdkDragContext *context; list = gtk_target_list_new(target_table, n_targets); context = gtk_drag_begin(curr_view->clist, list, GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK, event->button, (GdkEvent *)event); gtk_drag_set_icon_default(context); } else if (event->button == 3) { /* Right Button: Menu */ if (cfg.windows_right_click && (view->tagged == NULL)) { /* if windows right click is enabled, we want to select the file */ gint xmouse,ymouse,row,column; GdkModifierType mask; gdk_window_get_pointer(GTK_CLIST(view->clist)->clist_window, &xmouse, &ymouse, &mask); gtk_clist_get_selection_info(GTK_CLIST(view->clist), xmouse, ymouse, &row, &column); /* don't screw up the current selection */ if (!clist_row_is_selected(view->clist, row)) gtk_clist_unselect_all(GTK_CLIST(view->clist)); focus_row(view, row, FALSE, FALSE, TRUE); } if (event->state & GDK_CONTROL_MASK) show_user_command_menu(event->button, event->time); else show_menu(event->button, event->time); } }
/* This function is called whenever we need to exchange curr_view and * other_view. */ static void switch_views() { gint i; gint num_cols; GtkStyle *style; FileView *temp; GList *tmp; temp = other_view; other_view = curr_view; curr_view = temp; gtk_signal_emit_by_name(GTK_OBJECT(other_view->clist), "end-selection"); if (other_view->old_selection) g_list_free(other_view->old_selection); other_view->old_selection = g_list_copy( GTK_CLIST(other_view->clist)->selection); for (tmp = other_view->old_selection; tmp != NULL; tmp = tmp->next) gtk_clist_set_background(GTK_CLIST(other_view->clist), (gint)tmp->data, &SELECT_COLOR); for (tmp = curr_view->old_selection; tmp != NULL; tmp = tmp->next) gtk_clist_set_background(GTK_CLIST(curr_view->clist), (gint)tmp->data, &CLIST_COLOR); gtk_clist_unselect_all(GTK_CLIST(other_view->clist)); style = gtk_style_copy(gtk_widget_get_style( GTK_CLIST(other_view->clist)->column[0].button)); style->bg[GTK_STATE_NORMAL] = COL_COLOR; num_cols = GTK_CLIST(curr_view->clist)->columns; for (i = 0; i < num_cols; i++) { gtk_widget_set_style(GTK_CLIST(curr_view->clist)->column[i].button, style); gtk_widget_set_style(curr_view->sort_arrows[i], style); } for (i = 0; i < num_cols; i++) { gtk_widget_restore_default_style( GTK_CLIST(other_view->clist)->column[i].button); gtk_widget_restore_default_style(other_view->sort_arrows[i]); } chdir(curr_view->dir); }
static gint mimeview_button_pressed(GtkWidget *widget, GdkEventButton *event, MimeView *mimeview) { GtkCList *clist = GTK_CLIST(widget); gint row, column; if (!event) return FALSE; if (event->button == 2 || event->button == 3) { if (!gtk_clist_get_selection_info(clist, event->x, event->y, &row, &column)) return FALSE; gtk_clist_unselect_all(clist); gtk_clist_select_row(clist, row, column); gtkut_clist_set_focus_row(clist, row); } part_button_pressed(mimeview, event, mimeview_get_selected_part(mimeview)); return TRUE; }
static void url_clicklist (GtkWidget * widget, GdkEventButton * event) { int row, col; char *text; if (event->button == 3) { if (gtk_clist_get_selection_info (GTK_CLIST (widget), event->x, event->y, &row, &col) < 0) return; gtk_clist_unselect_all (GTK_CLIST (widget)); gtk_clist_select_row (GTK_CLIST (widget), row, 0); if (gtk_clist_get_text (GTK_CLIST (widget), row, 0, &text)) { if (text && text[0]) { menu_urlmenu (event, text); } } } }
void toggle_tag_cb () { FileInfo *info = gtk_clist_get_row_data (GTK_CLIST (curr_view->clist), curr_view->row); gint row = curr_view->row; if (g_list_find (curr_view->tagged, info) != NULL) { curr_view->tagged = g_list_remove (curr_view->tagged, info); gtk_clist_set_background (GTK_CLIST (curr_view->clist), row, &CLIST_COLOR); status_bar_message("File removed from tag list"); } else { curr_view->tagged = g_list_append (curr_view->tagged, info); gtk_clist_unselect_all(GTK_CLIST(curr_view->clist)); gtk_clist_set_background (GTK_CLIST (curr_view->clist), row, &TAG_COLOR); status_bar_message("File is tagged"); } }
/* This updates the directory tree to show (and select) a particular * directory entry, repopulating the file list with the contents of the * directory if not already listed */ void dirtree_entry_show( GNode *dnode ) { int row; g_assert( NODE_IS_DIR(dnode) ); /* Repopulate file list if directory is different */ if (dnode != dirtree_current_dnode) { filelist_populate( dnode ); /* TODO: try removing this update from here */ gui_update( ); } /* Scroll directory tree to proper entry */ row = gtk_clist_find_row_from_data( GTK_CLIST(dir_ctree_w), dnode ); if (row >= 0) gtk_clist_select_row( GTK_CLIST(dir_ctree_w), row, 0 ); else gtk_clist_unselect_all( GTK_CLIST(dir_ctree_w) ); gui_clist_moveto_row( dir_ctree_w, MAX(0, row), DIRTREE_SCROLL_TIME ); dirtree_current_dnode = dnode; }
void new_person(GtkWidget *widget, Item *parents) { /* 仅仅是把当前person_notebook界面的内容清空, * 并且把“在院病人列表”设置为没有选项被选择即可, * 不需要对数据库进行更改。 */ FILE *fp; /* 移除照片 */ gtk_button_set_image( GTK_BUTTON((*parents).photo_button), NULL ); remove("photo_path.txt"); fp = fopen("photo_path.txt", "w+"); fclose(fp); gtk_widget_show((*parents).photo_button); /* 移除姓名 */ gtk_entry_set_text( GTK_ENTRY((*parents).name_entry), "" ); gtk_widget_show((*parents).name_entry); /* 设置“性别”下拉菜单为空 */ gtk_combo_box_set_active( GTK_COMBO_BOX((*parents).sex_combo), -1 ); gtk_widget_show((*parents).sex_combo); /* “生日”按钮 */ gtk_button_set_label( GTK_BUTTON((*parents).birthday_button), "选择日期" ); gtk_widget_show((*parents).birthday_button); /* “年龄”输入框 */ gtk_entry_set_text( GTK_ENTRY((*parents).age_entry), "" ); gtk_widget_show((*parents).age_entry); /* “婚姻” */ gtk_combo_box_set_active( GTK_COMBO_BOX((*parents).marriage_combo), -1 ); gtk_widget_show((*parents).marriage_combo); /* “教育” */ gtk_combo_box_set_active( GTK_COMBO_BOX((*parents).edu_combo), -1 ); gtk_widget_show((*parents).edu_combo); /* “身份证” */ gtk_entry_set_text( GTK_ENTRY((*parents).id_entry), "" ); gtk_widget_show((*parents).id_entry); /* “户籍” */ gtk_entry_set_text( GTK_ENTRY((*parents).census_entry), "" ); gtk_widget_show((*parents).census_entry); /* “发生时间” */ gtk_button_set_label( GTK_BUTTON((*parents).happened_button), "选择日期" ); gtk_widget_show((*parents).happened_button); /* “发生地点” */ gtk_combo_box_set_active( GTK_COMBO_BOX((*parents).place_combo), -1 ); gtk_widget_show((*parents).place_combo); /* “三联单” */ gtk_entry_set_text( GTK_ENTRY((*parents).bill_entry), "" ); gtk_widget_show((*parents).bill_entry); /* “住院号” */ gtk_entry_set_text( GTK_ENTRY((*parents).num_entry), "" ); gtk_widget_show((*parents).num_entry); /* “入院时间” */ gtk_button_set_label( GTK_BUTTON((*parents).into_button), "选择日期" ); gtk_widget_show((*parents).into_button); /* “入院评分” */ gtk_entry_set_text( GTK_ENTRY((*parents).inps_entry), "" ); gtk_widget_show((*parents).inps_entry); /* “出院时间” */ gtk_button_set_label( GTK_BUTTON((*parents).out_button), "选择日期" ); gtk_widget_show((*parents).out_button); /* “出院评分” */ gtk_entry_set_text( GTK_ENTRY((*parents).outps_entry), "" ); gtk_widget_show((*parents).outps_entry); /* “住院天数” */ gtk_entry_set_text( GTK_ENTRY((*parents).days_entry), "" ); gtk_widget_show((*parents).days_entry); /* “减分率” */ gtk_button_set_label( GTK_BUTTON((*parents).persent_button), "计算" ); gtk_widget_show((*parents).persent_button); /* “花费” */ gtk_entry_set_text( GTK_ENTRY((*parents).cost_entry), "" ); gtk_widget_show((*parents).cost_entry); /* “患者去向” */ gtk_combo_box_set_active( GTK_COMBO_BOX((*parents).goto_combo), -1 ); gtk_widget_show((*parents).goto_combo); /* “行为分级” */ gtk_combo_box_set_active( GTK_COMBO_BOX((*parents).level_combo), -1 ); gtk_widget_show((*parents).level_combo); /* “患者症状” */ gtk_combo_box_set_active( GTK_COMBO_BOX((*parents).symptom_combo), -1 ); gtk_widget_show((*parents).symptom_combo); /* “患者状态” */ gtk_combo_box_set_active( GTK_COMBO_BOX((*parents).status_combo), -1 ); gtk_widget_show((*parents).status_combo); /* “抗精神病药物” */ gtk_combo_box_set_active( GTK_COMBO_BOX((*parents).psy_combo), -1 ); gtk_widget_show((*parents).psy_combo); /* “抗抑郁药物” */ gtk_combo_box_set_active( GTK_COMBO_BOX((*parents).dep_combo), -1 ); gtk_widget_show((*parents).dep_combo); /* “抗焦虑药物” */ gtk_combo_box_set_active( GTK_COMBO_BOX((*parents).anxiety_combo), -1 ); gtk_widget_show((*parents).anxiety_combo); /* “心境稳定剂” */ gtk_combo_box_set_active( GTK_COMBO_BOX((*parents).heart_combo), -1 ); gtk_widget_show((*parents).heart_combo); /* “物质依赖” */ gtk_combo_box_set_active( GTK_COMBO_BOX((*parents).addicted_combo), -1 ); gtk_widget_show((*parents).addicted_combo); /* “是否吸毒” */ gtk_combo_box_set_active( GTK_COMBO_BOX((*parents).drug_combo), -1 ); gtk_widget_show((*parents).drug_combo); /* “躯体疾病” */ gtk_entry_set_text( GTK_ENTRY((*parents).body_entry), "" ); gtk_widget_show((*parents).body_entry); /* “传染病” */ gtk_entry_set_text( GTK_ENTRY((*parents).infect_entry), "" ); gtk_widget_show((*parents).infect_entry); /* “确认出院” */ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON((*parents).out_check), FALSE ); /* 对于clist的处理 */ (*parents).get_row = -1; (*parents).get_column = -1; gtk_clist_unselect_all(GTK_CLIST((*parents).hospital_list)); }
static void unselect_all_callback(GtkWidget *widget, GtkWidget *nothing) { gtk_clist_unselect_all(GTK_CLIST(clist)); }