Modified UI

This commit is contained in:
Gergely Polonkai 2013-08-12 17:17:03 +02:00
parent b1b99e0302
commit 284f7195e4
2 changed files with 352 additions and 322 deletions

View File

@ -58,7 +58,7 @@ const char *signName[] = {
GtkBuilder *builder; GtkBuilder *builder;
void void
about_action_activate_cb(GtkAction *action, gpointer user_data) action_about_activate_cb(GtkAction *action, gpointer user_data)
{ {
GtkDialog *about_dialog; GtkDialog *about_dialog;
@ -66,7 +66,19 @@ about_action_activate_cb(GtkAction *action, gpointer user_data)
gtk_dialog_run(about_dialog); gtk_dialog_run(about_dialog);
gtk_widget_destroy(GTK_WIDGET(about_dialog)); gtk_widget_hide(GTK_WIDGET(about_dialog));
}
void
action_new_activate_cb(GtkAction *action, gpointer user_data)
{
GtkDialog *new_dialog;
new_dialog = GTK_DIALOG(gtk_builder_get_object(builder, "dialog_new"));
g_print("%d\n", gtk_dialog_run(new_dialog));
gtk_widget_hide(GTK_WIDGET(new_dialog));
} }
int int
@ -83,7 +95,7 @@ main(int argc, char *argv[])
g_print("Juj!\n"); g_print("Juj!\n");
} }
mainWindow = GTK_WIDGET(gtk_builder_get_object(builder, "main_window")); mainWindow = GTK_WIDGET(gtk_builder_get_object(builder, "window_main"));
gtk_builder_connect_signals (builder, NULL); gtk_builder_connect_signals (builder, NULL);
gtk_widget_show(mainWindow); gtk_widget_show(mainWindow);

View File

@ -1,23 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<interface> <interface>
<!-- interface-requires gtk+ 3.6 --> <!-- interface-requires gtk+ 3.6 -->
<object class="GtkAccelGroup" id="accelgroup1"/> <object class="GtkAccelGroup" id="accels"/>
<object class="GtkActionGroup" id="actiongroup1"> <object class="GtkActionGroup" id="actions">
<property name="accel_group">accelgroup1</property> <property name="accel_group">accels</property>
<child> <child>
<object class="GtkAction" id="action1"> <object class="GtkAction" id="action_new">
<property name="stock_id">gtk-new</property> <property name="stock_id">gtk-new</property>
<signal name="activate" handler="action_new_activate_cb" swapped="no"/>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkAction" id="about_action"> <object class="GtkAction" id="action_about">
<property name="stock_id">gtk-about</property> <property name="stock_id">gtk-about</property>
<property name="icon_name">help-about</property> <property name="icon_name">help-about</property>
<signal name="activate" handler="about_action_activate_cb" swapped="no"/> <signal name="activate" handler="action_about_activate_cb" swapped="no"/>
</object> </object>
</child> </child>
</object> </object>
<object class="GtkDialog" id="dialog1"> <object class="GtkAboutDialog" id="dialog_about">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="type_hint">dialog</property>
<property name="program_name">GRadix</property>
<property name="version">1.0</property>
<property name="copyright" translatable="yes">2013 Gergely Polonkai</property>
<property name="website">http://gergely.polonkai.eu/gradix/</property>
<property name="authors">Gergely POLONKAI &lt;gergely@polonkai.eu&gt;</property>
<property name="license_type">gpl-3-0</property>
<child internal-child="vbox">
<object class="GtkBox" id="aboutdialog-vbox1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="aboutdialog-action_area1">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<object class="GtkDialog" id="dialog_new">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">5</property> <property name="border_width">5</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
@ -86,7 +120,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="entry1"> <object class="GtkEntry" id="entry_new_name">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">●</property> <property name="invisible_char">●</property>
@ -94,178 +128,25 @@
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="width">5</property> <property name="width">2</property>
<property name="height">1</property> <property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label2"> <object class="GtkFrame" id="frame1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes" context="Birth year" comments="Label for year of birth">Year</property> <property name="label_xalign">0</property>
</object> <property name="shadow_type">none</property>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child> <child>
<object class="GtkLabel" id="label3"> <object class="GtkAlignment" id="alignment1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes" context="Birth month" comments="Label for month of birth">Month</property> <property name="left_padding">12</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child> <child>
<object class="GtkLabel" id="label4"> <object class="GtkGrid" id="grid2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes" context="Birth day" comments="Label for day of birth">Day</property>
</object>
<packing>
<property name="left_attach">4</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="width_chars">4</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="width_chars">2</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="width_chars">2</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">5</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="Birth hour" comments="Label for hour of birth">Hour</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="Minute of birth" comments="Label for minute of birth">Minute</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="Second of birth" comments="Label for second of birth">Second</property>
</object>
<packing>
<property name="left_attach">4</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton4">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="width_chars">2</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton5">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="width_chars">2</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton6">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="width_chars">2</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">5</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child> <child>
<object class="GtkLabel" id="label8"> <object class="GtkLabel" id="label8">
<property name="visible">True</property> <property name="visible">True</property>
@ -274,54 +155,7 @@
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">3</property> <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="Longitude of birth">Longitude</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton7">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="width_chars">6</property>
<property name="caps_lock_warning">False</property>
<property name="digits">4</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton8">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="width_chars">6</property>
<property name="caps_lock_warning">False</property>
<property name="digits">4</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">5</property>
<property name="top_attach">3</property>
<property name="width">1</property> <property name="width">1</property>
<property name="height">2</property> <property name="height">2</property>
</packing> </packing>
@ -333,13 +167,11 @@
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">radiobutton2</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">3</property> <property name="top_attach">0</property>
<property name="width">1</property> <property name="width">1</property>
<property name="height">1</property> <property name="height">1</property>
</packing> </packing>
@ -353,14 +185,46 @@
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="active">True</property> <property name="active">True</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">radiobutton1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">4</property> <property name="top_attach">1</property>
<property name="width">1</property> <property name="width">1</property>
<property name="height">1</property> <property name="height">1</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkSpinButton" id="spinbutton7">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="width_chars">6</property>
<property name="invisible_char_set">True</property>
<property name="caps_lock_warning">False</property>
<property name="digits">4</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="Longitude of birth">Longitude</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">2</property>
</packing>
</child>
<child> <child>
<object class="GtkRadioButton" id="radiobutton3"> <object class="GtkRadioButton" id="radiobutton3">
<property name="label" translatable="yes" context="Eastern hemisphere">East</property> <property name="label" translatable="yes" context="Eastern hemisphere">East</property>
@ -368,13 +232,11 @@
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">radiobutton4</property>
</object> </object>
<packing> <packing>
<property name="left_attach">4</property> <property name="left_attach">4</property>
<property name="top_attach">3</property> <property name="top_attach">0</property>
<property name="width">1</property> <property name="width">1</property>
<property name="height">1</property> <property name="height">1</property>
</packing> </packing>
@ -388,14 +250,202 @@
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="active">True</property> <property name="active">True</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
<property name="group">radiobutton3</property>
</object> </object>
<packing> <packing>
<property name="left_attach">4</property> <property name="left_attach">4</property>
<property name="top_attach">4</property> <property name="top_attach">1</property>
<property name="width">1</property> <property name="width">1</property>
<property name="height">1</property> <property name="height">1</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkSpinButton" id="spinbutton8">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="width_chars">6</property>
<property name="invisible_char_set">True</property>
<property name="caps_lock_warning">False</property>
<property name="digits">4</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">5</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">2</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="Birth place coordinates">Coordinates</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">2</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkGrid" id="grid3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCalendar" id="calendar1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="year">2013</property>
<property name="month">6</property>
<property name="day">29</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">6</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton6">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="width_chars">2</property>
<property name="invisible_char_set">True</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">5</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="Second of birth" comments="Label for second of birth">Second</property>
</object>
<packing>
<property name="left_attach">4</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton5">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="width_chars">2</property>
<property name="invisible_char_set">True</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="Minute of birth" comments="Label for minute of birth">Minute</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton4">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="width_chars">2</property>
<property name="invisible_char_set">True</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="Birth hour" comments="Label for hour of birth">Hour</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="Birth date and time">Birth date and time</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">3</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -406,44 +456,11 @@
</object> </object>
</child> </child>
<action-widgets> <action-widgets>
<action-widget response="0">button1</action-widget> <action-widget response="2">button1</action-widget>
<action-widget response="0">button2</action-widget> <action-widget response="1">button2</action-widget>
</action-widgets> </action-widgets>
</object> </object>
<object class="GtkAboutDialog" id="dialog_about"> <object class="GtkWindow" id="window_main">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="type_hint">dialog</property>
<property name="program_name">GRadix</property>
<property name="version">1.0</property>
<property name="copyright" translatable="yes">2013 Gergely Polonkai</property>
<property name="website">http://gergely.polonkai.eu/gradix/</property>
<property name="authors">Gergely POLONKAI &lt;gergely@polonkai.eu&gt;</property>
<property name="license_type">gpl-3-0</property>
<child internal-child="vbox">
<object class="GtkBox" id="aboutdialog-vbox1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="aboutdialog-action_area1">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<object class="GtkWindow" id="main_window">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<signal name="delete-event" handler="gtk_main_quit" swapped="no"/> <signal name="delete-event" handler="gtk_main_quit" swapped="no"/>
<child> <child>
@ -467,7 +484,7 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
<object class="GtkImageMenuItem" id="imagemenuitem1"> <object class="GtkImageMenuItem" id="imagemenuitem1">
<property name="related_action">action1</property> <property name="related_action">action_new</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
@ -590,9 +607,10 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
<object class="GtkImageMenuItem" id="menu_item_about"> <object class="GtkImageMenuItem" id="menu_item_about">
<property name="related_action">about_action</property> <property name="related_action">action_about</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
</child> </child>
@ -613,7 +631,7 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
<object class="GtkToolButton" id="toolbutton1"> <object class="GtkToolButton" id="toolbutton1">
<property name="related_action">action1</property> <property name="related_action">action_new</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">toolbutton1</property> <property name="label" translatable="yes">toolbutton1</property>