gap between screens modified (works now horiz. and vert.)

This commit is contained in:
damdoum 2007-01-07 00:20:12 +00:00
parent 95b6ea0b27
commit b01c65aea9
4 changed files with 45 additions and 42 deletions

View File

@ -2,10 +2,27 @@
/* globals */
uint Frameskip = 0;
gboolean ScreenRight=FALSE;
gboolean ScreenGap=FALSE;
/* inline & protos */
void inline MAINWINDOW_RESIZE() {
void MAINWINDOW_RESIZE() {
GtkWidget * spacer1 = glade_xml_get_widget(xml, "misc_sep3");
GtkWidget * spacer2 = glade_xml_get_widget(xml, "misc_sep4");
int dim = 66 * ScreenCoeff_Size;
/* sees whether we want a gap */
if (!ScreenGap) dim = -1;
if (ScreenRight && ScreenRotate) {
gtk_widget_set_usize(spacer1, dim, -1);
} else if (!ScreenRight && !ScreenRotate) {
gtk_widget_set_usize(spacer2, -1, dim);
} else {
gtk_widget_set_usize(spacer1, -1, -1);
gtk_widget_set_usize(spacer2, -1, -1);
}
gtk_window_resize ((GtkWindow*)pWindow,1,1);
}
@ -155,14 +172,23 @@ void on_menu_audio_on_activate (GtkMenuItem *menuitem, gpointer user_data) {
}
}
void on_menu_gapscreen_activate (GtkMenuItem *menuitem, gpointer user_data) {
/* we want to add a gap between screens */
ScreenGap = gtk_check_menu_item_get_active((GtkCheckMenuItem*)menuitem);
/* pack the window */
MAINWINDOW_RESIZE();
}
void on_menu_rightscreen_activate (GtkMenuItem *menuitem, gpointer user_data) {
GtkBox * sbox = (GtkBox*)glade_xml_get_widget(xml, "whb_Sub");
GtkWidget * mbox = glade_xml_get_widget(xml, "whb_Main");
GtkWidget * vbox = glade_xml_get_widget(xml, "wvb_Layout");
GtkWidget * w = glade_xml_get_widget(xml, "wvb_2_Sub");
ScreenRight=gtk_check_menu_item_get_active((GtkCheckMenuItem*)menuitem);
/* we want to change the layout, lower screen goes left */
if (gtk_check_menu_item_get_active((GtkCheckMenuItem*)menuitem)==TRUE) {
if (ScreenRight) {
gtk_box_reorder_child(sbox,w,-1);
gtk_widget_reparent((GtkWidget*)sbox,mbox);
} else {
@ -185,33 +211,6 @@ void on_menu_rotatescreen_activate (GtkMenuItem *menuitem, gpointer user_data)
resize(ScreenCoeff_Size);
}
void on_menu_gapscreen_activate (GtkMenuItem *menuitem, gpointer user_data) {
/* we want to add a gap between screens */
gboolean ScreenGap = gtk_check_menu_item_get_active((GtkCheckMenuItem*)menuitem);
GtkWidget * spacer = glade_xml_get_widget(xml, "misc_sep4");
GtkWidget * layoutvbox = glade_xml_get_widget(xml, "wvb_Layout");
if (ScreenGap) {
gtk_box_set_child_packing(
layoutvbox,
spacer,
FALSE,
FALSE,
33,
GTK_PACK_START);
} else {
gtk_box_set_child_packing(
layoutvbox,
spacer,
FALSE,
FALSE,
0,
GTK_PACK_START);
}
/* Resize so we don't end up with unwanted space at the bottom */
resize(ScreenCoeff_Size);
}
/* MENU TOOLS ***** ***** ***** ***** */
void on_menu_IO_regs_activate (GtkMenuItem *menuitem, gpointer user_data) {
GtkWidget * dlg = glade_xml_get_widget(xml_tools, "wtools_1_IOregs");

View File

@ -31,9 +31,9 @@ void on_size3x_activate (GtkMenuItem *menuitem, gpointer user_data);
/* MENU CONFIG */
void on_menu_controls_activate (GtkMenuItem *menuitem, gpointer user_data);
void on_menu_audio_on_activate (GtkMenuItem *menuitem, gpointer user_data);
void on_menu_gapscreen_activate (GtkMenuItem *menuitem, gpointer user_data);
void on_menu_rightscreen_activate (GtkMenuItem *menuitem, gpointer user_data);
void on_menu_rotatescreen_activate (GtkMenuItem *menuitem, gpointer user_data);
void on_menu_gapscreen_activate (GtkMenuItem *menuitem, gpointer user_data);
/* MENU TOOLS */
void on_menu_IO_regs_activate (GtkMenuItem *menuitem, gpointer user_data);
/* MENU ? */

View File

@ -117,7 +117,7 @@
<signal name="activate" handler="on_menu_reset_activate" last_modification_time="Mon, 01 Jan 2007 16:40:47 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image19">
<widget class="GtkImage" id="image45">
<property name="visible">True</property>
<property name="stock">gtk-refresh</property>
<property name="icon_size">1</property>
@ -328,7 +328,7 @@
<signal name="activate" handler="on_menu_controls_activate" last_modification_time="Mon, 01 Jan 2007 16:53:11 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image20">
<widget class="GtkImage" id="image46">
<property name="visible">True</property>
<property name="stock">gtk-preferences</property>
<property name="icon_size">1</property>
@ -351,6 +351,16 @@
</widget>
</child>
<child>
<widget class="GtkCheckMenuItem" id="menu_gapscreen">
<property name="visible">True</property>
<property name="label" translatable="yes">True Gap</property>
<property name="use_underline">True</property>
<property name="active">False</property>
<signal name="activate" handler="on_menu_gapscreen_activate" last_modification_time="Sat, 06 Jan 2007 23:32:56 GMT"/>
</widget>
</child>
<child>
<widget class="GtkCheckMenuItem" id="menu_rightscreen">
<property name="visible">True</property>
@ -370,15 +380,6 @@
<signal name="activate" handler="on_menu_rotatescreen_activate" last_modification_time="Sat, 06 Jan 2007 08:36:59 GMT"/>
</widget>
</child>
<child>
<widget class="GtkCheckMenuItem" id="menu_gapscreen">
<property name="visible">True</property>
<property name="label" translatable="yes">Gap between screens</property>
<property name="use_underline">True</property>
<property name="active">False</property>
<signal name="activate" handler="on_menu_gapscreen_activate" last_modification_time="Sat, 06 Jan 2007 16:35:59 GMT"/>
</widget>
</child>
</widget>
</child>
</widget>
@ -401,7 +402,7 @@
<signal name="activate" handler="on_menu_IO_regs_activate" last_modification_time="Mon, 01 Jan 2007 16:53:11 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image21">
<widget class="GtkImage" id="image47">
<property name="visible">True</property>
<property name="stock">gtk-properties</property>
<property name="icon_size">1</property>

View File

@ -34,6 +34,9 @@ GladeXML * xml, * xml_tools;
/* callbacks_IO.c */
int ScreenCoeff_Size;
gboolean ScreenRotate;
gboolean ScreenRight;
gboolean ScreenGap;
void black_screen ();
void edit_controls();