cd->use_type = TRUE;
}
+static void
+on_type_toggled (GtkToggleButton *button, gpointer data)
+{
+ struct compute_dialog *cd = data;
+
+ GtkWidget *entry =
+ get_widget_assert (cd->xml, "type-and-label-width");
+
+ if ( gtk_toggle_button_get_active (button))
+ {
+ gtk_widget_set_sensitive (entry, TRUE);
+ gtk_widget_grab_focus (entry);
+ }
+ else
+ {
+ gtk_widget_set_sensitive (entry, FALSE);
+ }
+}
static void
on_expression_toggle (GtkToggleButton *button, gpointer data)
}
else
{
- const char *label;
struct variable *target_var;
const gchar *target_name = gtk_entry_get_text
(GTK_ENTRY (get_widget_assert (cd->xml, "compute-entry1")));
target_var = psppire_dict_lookup_var (cd->dict, target_name);
if ( target_var )
{
- label = var_get_label (target_var);
+ const char *label = var_get_label (target_var);
if ( label )
gtk_entry_set_text (GTK_ENTRY (entry), label);
gtk_entry_set_text (GTK_ENTRY (entry), "");
gtk_widget_set_sensitive (entry, TRUE);
+ gtk_widget_grab_focus (entry);
}
}
GtkWidget *expression =
get_widget_assert (xml, "radio-button-expression-label");
+ GtkWidget *str_btn =
+ get_widget_assert (xml, "radio-button-string");
+
g_object_get (de->data_editor, "var-store", &vs, NULL);
g_object_get (vs, "dictionary", &scd.dict, NULL);
g_signal_connect (expression, "toggled",
G_CALLBACK(on_expression_toggle), &scd);
+ g_signal_connect (str_btn, "toggled",
+ G_CALLBACK(on_type_toggled), &scd);
+
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de));
<?xml version="1.0"?>
<interface>
- <requires lib="psppire" version="2054.17080"/>
<!-- interface-requires gtk+ 2.12 -->
+ <requires lib="psppire" version="2054.17080"/>
<!-- interface-naming-policy project-wide -->
<object class="PsppireDialog" id="compute-variable-dialog">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Target Variable:</property>
+ <property name="label" translatable="yes">Target _Variable:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">compute-entry1</property>
</object>
<packing>
<property name="expand">False</property>
</child>
<child>
<object class="GtkButton" id="compute-button1">
- <property name="label" translatable="yes">Type & Label</property>
+ <property name="label" translatable="yes">_Type & Label...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Numeric Expressions:</property>
+ <property name="label" translatable="yes">_Numeric Expressions:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">compute-textview1</property>
</object>
<packing>
<property name="expand">False</property>
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Functions:</property>
+ <property name="label" translatable="yes">_Functions:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">compute-treeview2</property>
</object>
<packing>
<property name="position">0</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<object class="GtkButton" id="button4">
- <property name="label" translatable="yes">If...</property>
+ <property name="label" translatable="yes">_If...</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Use expression as label</property>
+ <property name="label" translatable="yes">Use _expression as label</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">radio-button-expression-label</property>
</object>
<packing>
<property name="left_attach">1</property>
<object class="GtkLabel" id="label24">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="label" translatable="yes">Label:</property>
+ <property name="label" translatable="yes">_Label:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">radio-button-user-label</property>
</object>
<packing>
<property name="expand">False</property>
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">String</property>
+ <property name="label" translatable="yes">_String</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">radio-button-string</property>
</object>
<packing>
<property name="position">0</property>
<object class="GtkHBox" id="hbox21">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">5</property>
<child>
<object class="GtkLabel" id="label30">
<property name="visible">True</property>
<property name="label" translatable="yes">Width</property>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="type-and-label-width">
- <property name="adjustment">adjustment1</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="adjustment">adjustment1</property>
</object>
<packing>
<property name="position">1</property>
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Numeric</property>
+ <property name="label" translatable="yes">_Numeric</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">radio-button-numeric</property>
</object>
<packing>
<property name="left_attach">1</property>