Eliminate all fixed size windows
authorHugo Villeneuve <hugo@hugovil.com>
Tue, 1 Oct 2013 01:28:04 +0000 (21:28 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Tue, 1 Oct 2013 02:37:05 +0000 (22:37 -0400)
src/emugtk.c
src/gtksizes.h
src/memwin.c
src/memwin.h
src/pgmwin.c
src/pgmwin.h
src/regwin.c
src/regwin.h

index d0a4582..7d05a69 100644 (file)
@@ -258,20 +258,12 @@ emugtk_window_init(void)
 
        mainwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_set_title(GTK_WINDOW(mainwin), PACKAGE);
-       gtk_window_set_default_size(GTK_WINDOW(mainwin),
-                                   MAIN_WIN_WIDTH, MAIN_WIN_HEIGHT);
        gtk_container_set_border_width(GTK_CONTAINER(mainwin), 0);
 
        /* Window DESTROY event. */
        g_signal_connect(mainwin, "destroy",
                         G_CALLBACK(WindowDestroyEvent), NULL);
 
-       /*
-        * Setting main window geometry based on command line options
-        * (if specified).
-       */
-       /*MainWindowSetGeometry();*/
-
        /*
         * main_vbox contains the menu bar and body_vbox (for all remaining
         * items).
@@ -292,18 +284,18 @@ emugtk_window_init(void)
        hbox = gtk_hbox_new(FALSE, 1);
 
        /* 8051 registers frame. */
-       fixed_frame = regwin_init(REG_WIN_WIDTH, REG_WIN_HEIGHT);
+       fixed_frame = regwin_init();
        gtk_box_pack_start(GTK_BOX(hbox), fixed_frame, true, true, 1);
 
        /* Program disassembly frame. */
-       fixed_frame = pgmwin_init(PGM_WIN_WIDTH, PGM_WIN_HEIGHT);
+       fixed_frame = pgmwin_init();
        gtk_box_pack_start(GTK_BOX(hbox), fixed_frame, true, true, 1);
 
        /* Adding hbox window to main_vbox */
        gtk_box_pack_start(GTK_BOX(main_vbox), hbox, true, true, 1);
 
        /* Memory dump frame. */
-       fixed_frame = memwin_init(MEM_WIN_WIDTH, MEM_WIN_HEIGHT);
+       fixed_frame = memwin_init();
        /* Adding memory dump window to main_vbox */
        gtk_box_pack_start(GTK_BOX(main_vbox), fixed_frame, true, true, 1);
 
index 1b36e06..69e296f 100644 (file)
 #ifndef _GTKSIZES_H_
 #define _GTKSIZES_H_
 
-/* Width, in pixels, of a fixed font symbol. */
-#define FIXED_FONT_SYMBOL_WIDTH 10
-
-/* Height, in pixels, of a fixed font symbol. */
-#define FIXED_FONT_SYMBOL_HEIGHT 22
-
-#define BUTTON_HEIGHT      60
-#define BUTTONS_BAR_HEIGHT BUTTON_HEIGHT
-
-/* 12 symbols + border. */
-#define REG_WIN_WIDTH      (FIXED_FONT_SYMBOL_WIDTH * 13)
-#define REG_WIN_HEIGHT     (FIXED_FONT_SYMBOL_HEIGHT * 24)
-
-#define MEM_WIN_WIDTH      (FIXED_FONT_SYMBOL_WIDTH * 68) /* 68 symbols. */
-#define MEM_WIN_HEIGHT     (FIXED_FONT_SYMBOL_HEIGHT * 17)
-
-#define PGM_WIN_WIDTH      (MEM_WIN_WIDTH - REG_WIN_WIDTH)
-#define PGM_WIN_HEIGHT     REG_WIN_HEIGHT
-
-#define MENU_BAR_HEIGHT    0
-
-#define MAIN_WIN_WIDTH     MEM_WIN_WIDTH
-#define MAIN_WIN_HEIGHT    (BUTTONS_BAR_HEIGHT + REG_WIN_HEIGHT + MEM_WIN_HEIGHT)
-
 #endif /* _GTKSIZES_H_ */
index baed752..042b3ec 100644 (file)
@@ -35,7 +35,7 @@
 static GtkWidget *memclist;
 
 GtkWidget *
-memwin_init(int width, int height)
+memwin_init(void)
 {
        int i;
        GtkWidget *scrollwin;
@@ -52,27 +52,14 @@ memwin_init(int width, int height)
                                       GTK_POLICY_AUTOMATIC,
                                       GTK_POLICY_AUTOMATIC);
 
-       gtk_widget_set_size_request(GTK_WIDGET(scrollwin), width, height);
-
        memclist = gtk_clist_new(18);
        gtk_clist_set_selection_mode(GTK_CLIST(memclist), GTK_SELECTION_SINGLE);
-       gtk_widget_set_size_request(GTK_WIDGET(memclist), 620, 250);
 
        for (i = 0; i < 18; i++) {
                gtk_clist_set_column_justification(
                        GTK_CLIST(memclist), i, GTK_JUSTIFY_LEFT);
        }
 
-       gtk_clist_set_column_width(GTK_CLIST(memclist), 0,
-                                  5 * FIXED_FONT_SYMBOL_WIDTH);
-
-       for (i = 1; i < 17; i++)
-               gtk_clist_set_column_width(GTK_CLIST(memclist), i,
-                                          2 * FIXED_FONT_SYMBOL_WIDTH);
-
-       gtk_clist_set_column_width(GTK_CLIST(memclist), 17,
-                                  16 * FIXED_FONT_SYMBOL_WIDTH);
-
        pango_font = pango_font_description_from_string(FIXED_FONT);
        gtk_widget_modify_font(memclist, pango_font);
 
index b2108b2..cd4700b 100644 (file)
@@ -25,7 +25,7 @@
 #include <gtk/gtk.h>
 
 GtkWidget *
-memwin_init(int width, int height);
+memwin_init(void);
 
 void
 memwin_DumpD(char *Address);
index cacc8a3..7bf0eb9 100644 (file)
@@ -80,7 +80,7 @@ pgmwin_ButtonPressEvent(GtkWidget *widget, GdkEvent *event, gpointer data)
 
 
 GtkWidget *
-pgmwin_init(int width, int height)
+pgmwin_init(void)
 {
        int i;
        GtkWidget *scrollwin;
@@ -94,14 +94,10 @@ pgmwin_init(int width, int height)
                                       GTK_POLICY_AUTOMATIC,
                                       GTK_POLICY_AUTOMATIC);
 
-       gtk_widget_set_size_request(GTK_WIDGET(scrollwin), width, height);
-
        pgmclist = gtk_clist_new(1);
        gtk_clist_set_selection_mode(GTK_CLIST(pgmclist), GTK_SELECTION_SINGLE);
-       gtk_widget_set_size_request(GTK_WIDGET(pgmclist), width, height);
        gtk_clist_set_column_justification(GTK_CLIST(pgmclist), 0,
                                           GTK_JUSTIFY_LEFT);
-       gtk_clist_set_column_width(GTK_CLIST(pgmclist), 0, width-10);
 
        PangoFontDescription *pango_font;
        pango_font = pango_font_description_from_string(FIXED_FONT);
index dca55e7..3b44466 100644 (file)
@@ -26,7 +26,7 @@
 #include "gtksizes.h"
 
 GtkWidget *
-pgmwin_init(int width, int height);
+pgmwin_init(void);
 
 void
 pgmwin_Disasm(void);
index 0e7a356..4094562 100644 (file)
@@ -33,7 +33,7 @@
 static GtkWidget *regclist;
 
 GtkWidget *
-regwin_init(int width, int height)
+regwin_init(void)
 {
        int i;
        GtkWidget *scrollwin;
@@ -49,15 +49,10 @@ regwin_init(int width, int height)
                                       GTK_POLICY_AUTOMATIC,
                                       GTK_POLICY_AUTOMATIC);
 
-       gtk_widget_set_size_request(GTK_WIDGET(scrollwin), width, height);
-
        regclist = gtk_clist_new(1);
        gtk_clist_set_selection_mode(GTK_CLIST(regclist), GTK_SELECTION_SINGLE);
-       gtk_widget_set_size_request(GTK_WIDGET(regclist), width, height);
        gtk_clist_set_column_justification(GTK_CLIST(regclist), 0,
                                           GTK_JUSTIFY_LEFT);
-       gtk_clist_set_column_width(GTK_CLIST(regclist), 0, width);
-
 
        pango_font = pango_font_description_from_string(FIXED_FONT);
        gtk_widget_modify_font(regclist, pango_font);
index 1b24e10..228a1d9 100644 (file)
@@ -26,7 +26,7 @@
 #include "gtksizes.h"
 
 GtkWidget *
-regwin_init(int width, int height);
+regwin_init(void);
 
 void
 regwin_Show(void);