Index: gtk.c
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/gtk.c,v
retrieving revision 1.55
diff -u -p -r1.55 gtk.c
--- gtk.c	25 Jan 2003 23:46:35 -0000	1.55
+++ gtk.c	27 Jan 2003 17:04:23 -0000
@@ -59,6 +59,11 @@
 #define BUT_PNT   X->bas_buttons[25]       /* . */
 #define BUT_EQ    X->bas_buttons[26]       /* = */
 
+#define BASIC_RADIO_MENU      "/View/Basic Mode"
+#define FINANCIAL_RADIO_MENU  "/View/Financial Mode"
+#define SCIENTIFIC_RADIO_MENU "/View/Scientific Mode"
+#define MEM_REG_TOGGLE_MENU   "/View/Memory Registers"
+
 typedef struct Xobject {               /* Gtk+/Xlib graphics object. */
     GtkAccelGroup *kbd_accel;
     GdkAtom clipboard_atom;
@@ -558,6 +563,7 @@ create_aframe()  /* Create auxiliary fra
     X->aframe = gtk_window_new(GTK_WINDOW_TOPLEVEL);
     gtk_window_set_title(GTK_WINDOW(X->aframe), _("Insert ASCII Value"));
     gtk_window_set_resizable(GTK_WINDOW(X->aframe), FALSE);
+    gtk_window_set_transient_for(GTK_WINDOW(X->aframe), GTK_WINDOW(X->kframe));
     gtk_window_set_type_hint(GTK_WINDOW(X->aframe), 
                              GDK_WINDOW_TYPE_HINT_DIALOG);
 
@@ -709,6 +715,7 @@ create_kframe()
     char *hn;
     int count;
     GtkWidget *event_box;
+    GtkWidget *view_widget;
 
     v->tool_label = NULL;
     if (v->titleline == NULL) {
@@ -779,6 +786,19 @@ create_kframe()
     setup_default_icon();
 
     g_signal_connect(G_OBJECT(X->kframe), "event", G_CALLBACK(event_cb), NULL);
+
+    switch (v->modetype) {
+        case FINANCIAL:
+            view_widget = gtk_item_factory_get_widget(X->mb_fact, FINANCIAL_RADIO_MENU);
+            break;
+        case SCIENTIFIC:
+            view_widget = gtk_item_factory_get_widget(X->mb_fact, SCIENTIFIC_RADIO_MENU);
+            break;
+        default:
+            view_widget = gtk_item_factory_get_widget(X->mb_fact, BASIC_RADIO_MENU);
+            break;
+    }
+    gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(view_widget), TRUE);
 }
 
 
@@ -971,6 +991,11 @@ dismiss_cfframe(GtkWidget *widget, GdkEv
 static gboolean
 dismiss_rframe(GtkWidget *widget, GdkEvent *event, gpointer user_data)
 {
+    GtkWidget *register_widget;
+
+    register_widget = gtk_item_factory_get_widget(X->mb_fact, MEM_REG_TOGGLE_MENU);
+    gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(register_widget), FALSE);
+
     v->rstate = 0;
     gtk_widget_hide(X->rframe);
 
@@ -1768,6 +1793,7 @@ show_ascii_frame()      /* Display ASCII
     if (gdk_window_is_visible(X->aframe->window) == FALSE) {
         ds_position_popup(X->kframe, X->aframe, DS_POPUP_LEFT);
     }
+    gtk_window_set_focus(GTK_WINDOW(X->kframe), GTK_WIDGET(X->aframe_ch));
     gtk_widget_show(X->aframe);
 }
 
@@ -1805,6 +1831,12 @@ win_display(enum fcp_type fcptype, int s
     }
     if (state) {
         if (fcptype == FCP_REG) {
+            GtkWidget *register_widget;
+
+            register_widget = gtk_item_factory_get_widget(X->mb_fact, MEM_REG_TOGGLE_MENU);
+            gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(register_widget), TRUE);
+
+            v->rstate = 1;
             ds_position_popup(X->kframe, f, DS_POPUP_ABOVE);
         }
     }
