void wxComboBox::Copy() { wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; gtk_editable_copy_clipboard( GTK_EDITABLE(entry) DUMMY_CLIPBOARD_ARG ); }
static void edit_copy_activated (GtkAction * action, CMainWindow* self) { if (GTK_IS_EDITABLE (gtk_window_get_focus (GTK_WINDOW (self)))) { gtk_editable_copy_clipboard (GTK_EDITABLE (gtk_window_get_focus (GTK_WINDOW (self)))); } else if (C_IS_TASK_WIDGET (gtk_window_get_focus (GTK_WINDOW (self)))) { c_task_widget_copy_clipboard (C_TASK_WIDGET (gtk_window_get_focus (GTK_WINDOW (self)))); } }
static void ide_editor_frame_actions_copy_clipboard (GSimpleAction *action, GVariant *state, gpointer user_data) { IdeEditorFrame *self = user_data; g_assert (IDE_IS_EDITOR_FRAME (self)); gtk_editable_copy_clipboard (GTK_EDITABLE (self->search_entry)); }
void wxComboBox::Copy() { wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); GtkEntry *entry = NULL; #ifdef __WXGTK24__ if (!gtk_check_version(2,4,0)) entry = GTK_ENTRY( GTK_BIN(m_widget)->child ); else #endif entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry ); gtk_editable_copy_clipboard(GTK_EDITABLE(entry)); }
void on_copy1_activate(GtkMenuItem *menuitem, gpointer user_data) { GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window)); if (GTK_IS_EDITABLE(focusw)) gtk_editable_copy_clipboard(GTK_EDITABLE(focusw)); else if (IS_SCINTILLA(focusw)) sci_copy(SCINTILLA(focusw)); else if (GTK_IS_TEXT_VIEW(focusw)) { GtkTextBuffer *buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(focusw)); gtk_text_buffer_copy_clipboard(buffer, gtk_clipboard_get(GDK_NONE)); } }
void on_copy(GtkAction* act, FmMainWin* win) { GtkWidget* focus = gtk_window_get_focus((GtkWindow*)win); if(GTK_IS_EDITABLE(focus) && gtk_editable_get_selection_bounds((GtkEditable*)focus, NULL, NULL) ) { gtk_editable_copy_clipboard((GtkEditable*)focus); } else { FmPathList* files = fm_folder_view_get_selected_file_paths(FM_FOLDER_VIEW(win->folder_view)); if(files) { fm_clipboard_copy_files(win, files); fm_list_unref(files); } } }
/* compose_paste */ void compose_paste(Compose * compose) { GtkWidget * focus; GtkTextBuffer * buffer; GtkClipboard * clipboard; if((focus = gtk_window_get_focus(GTK_WINDOW(compose->window))) == compose->view) { buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(compose->view)); clipboard = gtk_widget_get_clipboard(compose->view, GDK_SELECTION_CLIPBOARD); gtk_text_buffer_paste_clipboard(buffer, clipboard, NULL, TRUE); } else if(focus == gtk_bin_get_child(GTK_BIN(compose->from)) || focus == compose->subject) gtk_editable_copy_clipboard(GTK_EDITABLE(focus)); /* FIXME also implement the headers */ }
static int gtkListSetClipboardAttrib(Ihandle *ih, const char *value) { GtkEntry* entry; if (!ih->data->has_editbox) return 0; /* disable callbacks */ iupAttribSetStr(ih, "_IUPGTK_DISABLE_TEXT_CB", "1"); entry = (GtkEntry*)iupAttribGet(ih, "_IUPGTK_ENTRY"); if (iupStrEqualNoCase(value, "COPY")) gtk_editable_copy_clipboard(GTK_EDITABLE(entry)); else if (iupStrEqualNoCase(value, "CUT")) gtk_editable_cut_clipboard(GTK_EDITABLE(entry)); else if (iupStrEqualNoCase(value, "PASTE")) gtk_editable_paste_clipboard(GTK_EDITABLE(entry)); else if (iupStrEqualNoCase(value, "CLEAR")) gtk_editable_delete_selection(GTK_EDITABLE(entry)); iupAttribSetStr(ih, "_IUPGTK_DISABLE_TEXT_CB", NULL); return 0; }
void wxTextEntry::Copy() { gtk_editable_copy_clipboard(GetEditable()); }
void gnc_item_edit_copy_clipboard (GncItemEdit *item_edit) { gtk_editable_copy_clipboard(GTK_EDITABLE(item_edit->editor)); }
void wxTextCtrl::Copy() { wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); gtk_editable_copy_clipboard(GTK_EDITABLE(m_text) DUMMY_CLIPBOARD_ARG); }
void menu_items_treatment (GtkWidget *Widget, guint Op) { gint CurrentPage, i; CurrentPage = gtk_notebook_get_current_page (GTK_NOTEBOOK(MainNotebook)); switch(Op) { case NEW : new_file (); break; case OPEN : open_file (); break; case SAVE : save_file (); break; case SAVE_ALL : save_all (); break; case SAVE_AS : save_file_as (); break; case PRINT : print_buffer (); break; case CLOSE : close_file (); break; case CLOSE_ALL : close_all (); break; case QUIT : quit (); break; case UNDO : if (OpenedFilesCnt) { proceed_undo (); break; } case REDO : if (OpenedFilesCnt) { proceed_redo (); break; } case CUT : if ((OpenedFilesCnt) && !FPROPS(CurrentPage, ReadOnly)) { gtk_editable_cut_clipboard (GTK_EDITABLE(FPROPS(CurrentPage, Text))); print_msg ("Selection cut to Clipboard..."); } break; case COPY : if (OpenedFilesCnt) { gtk_editable_copy_clipboard (GTK_EDITABLE(FPROPS(CurrentPage, Text))); print_msg ("Selection copied to Clipboard..."); } break; case PASTE : if ((OpenedFilesCnt) && !FPROPS(CurrentPage, ReadOnly)) { gtk_editable_paste_clipboard (GTK_EDITABLE(FPROPS(CurrentPage, Text))); print_msg ("Text pasted from Clipboard..."); } break; case CLEAR : if ((OpenedFilesCnt) && !FPROPS(CurrentPage, ReadOnly)) { gtk_editable_delete_text (GTK_EDITABLE(FPROPS(CurrentPage, Text)), 0, -1); print_msg ("Buffer cleared..."); } break; case SELECT_ALL : if (OpenedFilesCnt) { gtk_editable_select_region (GTK_EDITABLE(FPROPS(CurrentPage, Text)), 0, -1); print_msg ("All Text selected..."); } break; case COMPLETE : if (OpenedFilesCnt) auto_completion (GTK_TEXT(FPROPS(CurrentPage, Text))); break; case FIND : if (OpenedFilesCnt) search (FALSE); break; case REPLACE : if (OpenedFilesCnt) search (TRUE); break; case LINE : if (OpenedFilesCnt) goto_line (); break; case READONLY : toggle_readonly (); break; case CONVERTER : converter (); break; case COLOR : color_picker (); break; case INSERT_TIME : insert_time (CurrentPage); break; case TO_UPPER : if ((OpenedFilesCnt) && !FPROPS(CurrentPage, ReadOnly)) { change_case (1); print_msg ("Selection converted to upper Case..."); } break; case TO_LOWER : if ((OpenedFilesCnt) && !FPROPS(CurrentPage, ReadOnly)) { change_case (2); print_msg ("Selection converted to Lower Case..."); } break; case CAPITALIZE : if ((OpenedFilesCnt) && !FPROPS(CurrentPage, ReadOnly)) { change_case (3); print_msg ("Selection Capitalized..."); } break; case INVERT_CASE : if ((OpenedFilesCnt) && !FPROPS(CurrentPage, ReadOnly)) { change_case (4); print_msg ("Case inverted..."); } break; case UNIX_DOS : if ((OpenedFilesCnt) && !FPROPS(CurrentPage, ReadOnly)) { conv_unix_to_dos (); } break; case UNIX_MAC : if ((OpenedFilesCnt) && !FPROPS(CurrentPage, ReadOnly)) { conv_unix_to_mac (); } break; case DOS_UNIX : if ((OpenedFilesCnt) && !FPROPS(CurrentPage, ReadOnly)) { conv_dos_to_unix (); } break; case DOS_MAC : if ((OpenedFilesCnt) && !FPROPS(CurrentPage, ReadOnly)) { conv_dos_to_mac (); } break; case MAC_DOS : if ((OpenedFilesCnt) && !FPROPS(CurrentPage, ReadOnly)) { conv_mac_to_dos (); } break; case MAC_UNIX : if ((OpenedFilesCnt) && !FPROPS(CurrentPage, ReadOnly)) { conv_mac_to_unix (); } break; case UNIX_DOS_ALL : convert_all(conv_unix_to_dos); break; case UNIX_MAC_ALL : convert_all(conv_unix_to_mac); break; case DOS_UNIX_ALL : convert_all(conv_dos_to_unix); break; case DOS_MAC_ALL : convert_all(conv_dos_to_mac); break; case MAC_DOS_ALL : convert_all(conv_mac_to_dos); break; case MAC_UNIX_ALL : convert_all(conv_mac_to_unix); break; case FILE_INFO : file_info (CurrentPage); break; case TOOLBAR : if ((!ToolBarToggleDisplay) && (TOOLBAR_DISPLAY)) ToolBarToggleDisplay = TRUE; else { if (TOOLBAR_DISPLAY) { TOOLBAR_DISPLAY = FALSE; hide_toolbar (); print_msg ("Hide Tool Bar..."); } else { TOOLBAR_DISPLAY = TRUE; show_toolbar (); if (!ToolBarToggleDisplay) ToolBarToggleDisplay = TRUE; print_msg ("Display Tool Bar..."); } } break; case MSGBAR : if ((!MsgBarToggleDisplay) && (MSGBAR_DISPLAY)) MsgBarToggleDisplay = TRUE; else { if (MSGBAR_DISPLAY) { MSGBAR_DISPLAY = FALSE; hide_msgbar (); } else { MSGBAR_DISPLAY = TRUE; show_msgbar (); if (!MsgBarToggleDisplay) MsgBarToggleDisplay = TRUE; print_msg ("Display Msg Bar..."); } } break; case WORDWRAP : if ((!ToggleWordwrap) && (TOGGLE_WORDWRAP)) ToggleWordwrap = TRUE; else { if (TOGGLE_WORDWRAP) { TOGGLE_WORDWRAP = FALSE; for (i = 0; i < OpenedFilesCnt; i++) gtk_text_set_word_wrap (GTK_TEXT(FPROPS(CurrentPage, Text)), FALSE); print_msg ("Wordwrap disabled..."); } else { TOGGLE_WORDWRAP = TRUE; for (i = 0; i < OpenedFilesCnt; i++) gtk_text_set_word_wrap (GTK_TEXT(FPROPS(CurrentPage, Text)), TRUE); if (!ToggleWordwrap) ToggleWordwrap = TRUE; print_msg ("Wordwrap enabled..."); } } break; case TAB_POS_TOP : TAB_POSITION = 1; gtk_notebook_set_tab_pos (GTK_NOTEBOOK(MainNotebook), GTK_POS_TOP); break; case TAB_POS_BOTTOM : TAB_POSITION = 2; gtk_notebook_set_tab_pos (GTK_NOTEBOOK(MainNotebook), GTK_POS_BOTTOM); break; case TAB_POS_LEFT : TAB_POSITION = 3; gtk_notebook_set_tab_pos (GTK_NOTEBOOK(MainNotebook), GTK_POS_LEFT); break; case TAB_POS_RIGHT : TAB_POSITION = 4; gtk_notebook_set_tab_pos (GTK_NOTEBOOK(MainNotebook), GTK_POS_RIGHT); break; case SCROLLBAR_POS_LEFT : SCROLLBAR_POSITION = 1; for (i = 0; i < OpenedFilesCnt; i++) gtk_scrolled_window_set_placement (GTK_SCROLLED_WINDOW (gtk_notebook_get_nth_page (GTK_NOTEBOOK(MainNotebook), i)), GTK_CORNER_TOP_RIGHT); break; case SCROLLBAR_POS_RIGHT : SCROLLBAR_POSITION = 2; for (i = 0; i < OpenedFilesCnt; i++) gtk_scrolled_window_set_placement (GTK_SCROLLED_WINDOW (gtk_notebook_get_nth_page (GTK_NOTEBOOK(MainNotebook), i)), GTK_CORNER_TOP_LEFT); break; case PREFS : display_prefs (&Settings); break; case HELP : print_msg ("No help available yet..."); break; case ABOUT : about (); break; } (void)Widget; /* avoid the "unused parameter" warning */ }
static void on_menuitem_copy_activate(void) { GtkEditable *widget = GTK_EDITABLE(gtk_window_get_focus(gui.window)); gtk_editable_copy_clipboard(widget); }