bool SqliteDataset::seek(int pos) { if (ds_state == dsSelect) { Dataset::seek(pos); fill_fields(); return true; } return false; }
/** * \brief Stop editing the properties of an item. * \param item The item to remove. * \return true if something has changed. */ bool bf::item_field_edit::remove_item( item_instance* item ) { if ( m_group.erase(item) == 0 ) return false; fill_fields(); return true; } // item_field_edit::remove_item()
void SqliteDataset::next(void) { #ifdef _XBOX free_row(); #endif Dataset::next(); if (!eof()) fill_fields(); }
//добавление узла в начало NODE* add_first(NODE* list) { NODE* nta = fill_fields(); nta->next = list; if (list) list->prev = nta; nta->prev = NULL; printf_s("\n Новая запись была добавлена в начало списка\n\n "); system("pause"); return nta; }
/** * \brief Add an item for which we want the properties. * \param item The item instance concerned by this window. * \return true if something has changed. */ bool bf::item_field_edit::add_item( item_instance* item ) { if ( item == NULL ) return clear(); if ( m_group.insert(item).second ) { fill_fields(); return true; } else return false; } // item_field_edit::add_item()
/** * \brief Add several items for which we want the properties. * \param items The item instances concerned by this window. * \return true if something has changed. */ bool bf::item_field_edit::add_items( const std::vector<item_instance*>& items ) { bool result = false; for ( std::vector<item_instance*>::const_iterator it=items.begin(); it!=items.end(); ++it ) { bool inserted = m_group.insert(*it).second; result = result || inserted; } if( result ) fill_fields(); return result; } // item_field_edit::add_items()
void add_campaign::recieve(QString state) { // this function receives the signal send from main window and act acordingly if ( state == "0" ) { // we input a new profile ui->btn_save->setText("Vnesi"); ui->txt_campaign_name->setText(""); ui->txt_campaign_description->clear(); ui->txt_campaign_id->setText(""); } else { // we have to fill the old profile and make it possible to change it ui->btn_save->setText("Spremeni"); ui->txt_campaign_id->setText(state); fill_fields(); } }
//добавление узла в конец NODE* add_last(NODE* list) { if (!list) list = add_first(list); else { NODE* nta = fill_fields(); NODE* tmp = list; while (tmp->next) tmp = tmp->next; tmp->next = nta; nta->prev = tmp; nta->next = NULL; printf_s("\n Новая запись была добавлена в конец списка\n\n "); system("pause"); } return list; }
PRIVATE inline struct predef_func *get_pfunc(unsigned long arg,int *status) { struct predef_func *pfunc; *status = 0; if((pfunc = pfunc_alloc_r()) == NULL) { *status = -ENOMEM; return NULL; } if((*status = fill_fields((struct sample_packets_struct *)pfunc->data,arg)) != 0) { kmem_cache_free(sample_packets_cache,(void *)pfunc->data); kmem_cache_free(predef_func_cache,pfunc); return NULL; } return pfunc; }
//добавление узла в н-ную позицию NODE* add_n(NODE* list) { if (!list) { system("cls"); printf_s("\n Список пуст, запись будет осуществлена в начало\n\n "); system("pause"); list = add_first(list); } else { int n = get_n(amt(list), "Введите номер позиции, в которую следует добавить запись", "add"); if (n == 1) list = add_first(list); else if (n == amt(list) + 1) list = add_last(list); else { NODE* nta = fill_fields(); NODE *tmp = list; int i; for (i = 1; i < n - 1; i++) tmp = tmp->next; nta->next = tmp->next; tmp->next->prev = nta; nta->prev = tmp; tmp->next = nta; printf_s("\n Новая запись была добавлена в позицию № %d списка\n\n ", n); system("pause"); } } return list; }
void tasks_add_edit_dialog_show (gboolean tasks_edit_mode, GUI *appGUI) { GtkWidget *vbox1; GtkWidget *vbox2; GtkWidget *label; GtkWidget *select_date_button; GtkWidget *scrolledwindow; GtkWidget *hseparator; GtkWidget *hbuttonbox; GtkWidget *table; GtkWidget *cancel_button; gint win_xpos, win_ypos; gchar tmpbuf[BUFFER_SIZE]; appGUI->tsk->tasks_add_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (appGUI->tsk->tasks_add_window), 6); if(tasks_edit_mode == TRUE) { gtk_window_set_title (GTK_WINDOW (appGUI->tsk->tasks_add_window), _("Edit task")); } else { gtk_window_set_title (GTK_WINDOW (appGUI->tsk->tasks_add_window), _("Add task")); } gtk_window_set_default_size (GTK_WINDOW(appGUI->tsk->tasks_add_window), TASKS_ADD_EDIT_WINDOW_SIZE_X, TASKS_ADD_EDIT_WINDOW_SIZE_Y); gtk_window_set_position(GTK_WINDOW(appGUI->tsk->tasks_add_window), GTK_WIN_POS_CENTER_ON_PARENT); gtk_window_set_transient_for(GTK_WINDOW(appGUI->tsk->tasks_add_window), GTK_WINDOW(appGUI->main_window)); gtk_window_set_modal(GTK_WINDOW(appGUI->tsk->tasks_add_window), TRUE); g_signal_connect (G_OBJECT (appGUI->tsk->tasks_add_window), "key_press_event", G_CALLBACK (tasks_add_edit_key_press_cb), appGUI); g_signal_connect (G_OBJECT (appGUI->tsk->tasks_add_window), "delete_event", G_CALLBACK(tasks_add_edit_window_close_cb), appGUI); vbox1 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox1); gtk_container_add (GTK_CONTAINER (appGUI->tsk->tasks_add_window), vbox1); vbox2 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox2); gtk_box_pack_start (GTK_BOX (vbox1), vbox2, TRUE, TRUE, 0); table = gtk_table_new (4, 4, FALSE); gtk_widget_show (table); gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_table_set_col_spacings (GTK_TABLE (table), 4); gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, FALSE, 4); sprintf(tmpbuf, "<b>%s:</b>", _("Summary")); label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); sprintf(tmpbuf, "<b>%s:</b>", _("Due date")); label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); appGUI->tsk->summary_entry = gtk_entry_new (); gtk_widget_show (appGUI->tsk->summary_entry); gtk_table_attach (GTK_TABLE (table), appGUI->tsk->summary_entry, 1, 4, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); appGUI->tsk->due_date_entry = gtk_entry_new (); gtk_widget_show (appGUI->tsk->due_date_entry); GTK_WIDGET_UNSET_FLAGS(appGUI->tsk->due_date_entry, GTK_CAN_FOCUS); gtk_editable_set_editable (GTK_EDITABLE (appGUI->tsk->due_date_entry), FALSE); gtk_table_attach (GTK_TABLE (table), appGUI->tsk->due_date_entry, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); select_date_button = gtk_button_new_from_stock (OSMO_STOCK_BUTTON_SELECT_DATE); gtk_widget_show (select_date_button); GTK_WIDGET_UNSET_FLAGS(select_date_button, GTK_CAN_FOCUS); g_signal_connect(select_date_button, "clicked", G_CALLBACK(select_date_cb), appGUI); gtk_table_attach (GTK_TABLE (table), select_date_button, 2, 4, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); sprintf(tmpbuf, "<b>%s:</b>", _("Category")); label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); appGUI->tsk->category_combobox = gtk_combo_box_new_text (); gtk_widget_show (appGUI->tsk->category_combobox); gtk_combo_box_set_focus_on_click (GTK_COMBO_BOX (appGUI->tsk->category_combobox), FALSE); gtk_table_attach (GTK_TABLE (table), appGUI->tsk->category_combobox, 1, 2, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); create_category_combobox (GTK_COMBO_BOX (appGUI->tsk->category_combobox), appGUI->opt->tasks_category_store, TRUE); gtk_combo_box_set_active(GTK_COMBO_BOX(appGUI->tsk->category_combobox), gui_list_store_get_text_index (appGUI->opt->tasks_category_store, gtk_combo_box_get_active_text(GTK_COMBO_BOX(appGUI->tsk->cf_combobox)))); sprintf(tmpbuf, "<b>%s:</b>", _("Priority")); label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_table_attach (GTK_TABLE (table), label, 2, 3, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); appGUI->tsk->priority_combobox = gtk_combo_box_new_text (); gtk_widget_show (appGUI->tsk->priority_combobox); gtk_combo_box_append_text (GTK_COMBO_BOX (appGUI->tsk->priority_combobox), _("Low")); gtk_combo_box_append_text (GTK_COMBO_BOX (appGUI->tsk->priority_combobox), _("Medium")); gtk_combo_box_append_text (GTK_COMBO_BOX (appGUI->tsk->priority_combobox), _("High")); gtk_combo_box_set_focus_on_click (GTK_COMBO_BOX (appGUI->tsk->priority_combobox), FALSE); gtk_table_attach (GTK_TABLE (table), appGUI->tsk->priority_combobox, 3, 4, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_combo_box_set_active (GTK_COMBO_BOX (appGUI->tsk->priority_combobox), 1); sprintf(tmpbuf, "<b>%s:</b>", _("Description")); label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); scrolledwindow = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolledwindow); gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow, TRUE, TRUE, 0); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_SHADOW_IN); appGUI->tsk->desc_textview = gtk_text_view_new (); gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (appGUI->tsk->desc_textview), GTK_WRAP_WORD); gtk_text_view_set_pixels_above_lines(GTK_TEXT_VIEW(appGUI->tsk->desc_textview), 4); gtk_text_view_set_left_margin(GTK_TEXT_VIEW(appGUI->tsk->desc_textview), 4); gtk_text_view_set_right_margin(GTK_TEXT_VIEW(appGUI->tsk->desc_textview), 4); gtk_widget_show (appGUI->tsk->desc_textview); gtk_container_add (GTK_CONTAINER (scrolledwindow), appGUI->tsk->desc_textview); hseparator = gtk_hseparator_new (); gtk_widget_show (hseparator); gtk_box_pack_start (GTK_BOX (vbox1), hseparator, FALSE, TRUE, 4); hbuttonbox = gtk_hbutton_box_new (); gtk_widget_show (hbuttonbox); gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox), 2); gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox), GTK_BUTTONBOX_END); gtk_box_set_spacing (GTK_BOX (hbuttonbox), 16); if (config.default_stock_icons) { cancel_button = gtk_button_new_from_stock (GTK_STOCK_CANCEL); } else { cancel_button = gtk_button_new_from_stock (OSMO_STOCK_BUTTON_CANCEL); } gtk_widget_show (cancel_button); gtk_container_add (GTK_CONTAINER (hbuttonbox), cancel_button); g_signal_connect(cancel_button, "clicked", G_CALLBACK(button_tasks_add_edit_window_close_cb), appGUI); if (config.default_stock_icons) { appGUI->tsk->tasks_ok_button = gtk_button_new_from_stock (GTK_STOCK_OK); } else { appGUI->tsk->tasks_ok_button = gtk_button_new_from_stock (OSMO_STOCK_BUTTON_OK); } gtk_widget_show (appGUI->tsk->tasks_ok_button); gtk_container_add (GTK_CONTAINER (hbuttonbox), appGUI->tsk->tasks_ok_button); g_signal_connect(appGUI->tsk->tasks_ok_button, "clicked", G_CALLBACK(tasks_item_entered_cb), appGUI); appGUI->tsk->tasks_edit_state = tasks_edit_mode; appGUI->tsk->tasks_accept_state = FALSE; gtk_entry_set_text (GTK_ENTRY(appGUI->tsk->due_date_entry), _("No date")); if (tasks_edit_mode == TRUE) { appGUI->tsk->tasks_accept_state = TRUE; fill_fields (appGUI->tsk->due_date_entry, appGUI->tsk->summary_entry, appGUI->tsk->desc_textview, appGUI); } gtk_widget_set_sensitive(appGUI->tsk->tasks_ok_button, appGUI->tsk->tasks_accept_state); gtk_window_get_position (GTK_WINDOW(appGUI->tsk->tasks_add_window), &win_xpos, &win_ypos); gtk_window_move (GTK_WINDOW (appGUI->tsk->tasks_add_window), win_xpos-TASKS_ADD_EDIT_WINDOW_SIZE_X/2, win_ypos-10); gtk_widget_show(appGUI->tsk->tasks_add_window); }
void SqliteDataset::next(void) { Dataset::next(); if (!eof()) fill_fields(); }
void SqliteDataset::prev(void) { Dataset::prev(); fill_fields(); }
void SqliteDataset::last() { Dataset::last(); fill_fields(); }