Commit f0e769ea authored by Claes Sjofors's avatar Claes Sjofors

wb dataarithm and text editor, ctrl+T addded for save and close

parent 5320883f
...@@ -107,6 +107,15 @@ void WAttTextGtk::activate_save( GtkWidget *w, gpointer data) ...@@ -107,6 +107,15 @@ void WAttTextGtk::activate_save( GtkWidget *w, gpointer data)
watttext->modified = 0; watttext->modified = 0;
} }
void WAttTextGtk::activate_saveandclose( GtkWidget *w, gpointer data)
{
WAttText *watttext = (WAttText *)data;
watttext->set_attr_value();
watttext->modified = 0;
watttext->activate_exit();
}
void WAttTextGtk::activate_copy( GtkWidget *w, gpointer data) void WAttTextGtk::activate_copy( GtkWidget *w, gpointer data)
{ {
WAttTextGtk *watttext = (WAttTextGtk *)data; WAttTextGtk *watttext = (WAttTextGtk *)data;
...@@ -306,8 +315,16 @@ WAttTextGtk::WAttTextGtk( ...@@ -306,8 +315,16 @@ WAttTextGtk::WAttTextGtk(
GtkWidget *file_save = gtk_image_menu_item_new_from_stock(GTK_STOCK_SAVE, accel_g); GtkWidget *file_save = gtk_image_menu_item_new_from_stock(GTK_STOCK_SAVE, accel_g);
g_signal_connect(file_save, "activate", G_CALLBACK(activate_save), this); g_signal_connect(file_save, "activate", G_CALLBACK(activate_save), this);
GtkWidget *file_saveandclose = gtk_menu_item_new_with_mnemonic( "S_ave and close");
g_signal_connect( file_saveandclose, "activate",
G_CALLBACK(activate_saveandclose), this);
gtk_widget_add_accelerator( file_saveandclose, "activate", accel_g,
't', GdkModifierType(GDK_CONTROL_MASK),
GTK_ACCEL_VISIBLE);
GtkMenu *file_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL); GtkMenu *file_menu = (GtkMenu *) g_object_new( GTK_TYPE_MENU, NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_save); gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_save);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_saveandclose);
gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_close); gtk_menu_shell_append(GTK_MENU_SHELL(file_menu), file_close);
GtkWidget *file = gtk_menu_item_new_with_mnemonic("_File"); GtkWidget *file = gtk_menu_item_new_with_mnemonic("_File");
......
...@@ -77,6 +77,7 @@ class WAttTextGtk : public WAttText { ...@@ -77,6 +77,7 @@ class WAttTextGtk : public WAttText {
static void activate_exit( GtkWidget *w, gpointer data); static void activate_exit( GtkWidget *w, gpointer data);
static void activate_save( GtkWidget *w, gpointer data); static void activate_save( GtkWidget *w, gpointer data);
static void activate_saveandclose( GtkWidget *w, gpointer data);
static void activate_copy( GtkWidget *w, gpointer data); static void activate_copy( GtkWidget *w, gpointer data);
static void activate_cut( GtkWidget *w, gpointer data); static void activate_cut( GtkWidget *w, gpointer data);
static void activate_paste( GtkWidget *w, gpointer data); static void activate_paste( GtkWidget *w, gpointer data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment