ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/prefs_editor_gtk.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/prefs_editor_gtk.cpp (file contents):
Revision 1.12 by cebix, 2000-07-13T16:12:32Z vs.
Revision 1.13 by cebix, 2000-07-13T17:26:17Z

# Line 45 | Line 45 | static bool start_clicked = true;      // Ret
45   static void create_volumes_pane(GtkWidget *top);
46   static void create_scsi_pane(GtkWidget *top);
47   static void create_graphics_pane(GtkWidget *top);
48 + static void create_input_pane(GtkWidget *top);
49   static void create_serial_pane(GtkWidget *top);
50   static void create_memory_pane(GtkWidget *top);
51   static void read_settings(void);
# Line 297 | Line 298 | bool PrefsEditor(void)
298          create_volumes_pane(notebook);
299          create_scsi_pane(notebook);
300          create_graphics_pane(notebook);
301 +        create_input_pane(notebook);
302          create_serial_pane(notebook);
303          create_memory_pane(notebook);
304  
# Line 753 | Line 755 | static void create_graphics_pane(GtkWidg
755          w_fbdevice_file = make_entry(box, STR_FBDEVICE_FILE_CTRL, "fbdevicefile");
756   #endif
757  
758 +        make_separator(box);
759          make_checkbox(box, STR_NOSOUND_CTRL, "nosound", GTK_SIGNAL_FUNC(tb_nosound));
760  
761          hide_show_graphics_widgets();
# Line 760 | Line 763 | static void create_graphics_pane(GtkWidg
763  
764  
765   /*
766 + *  "Input" pane
767 + */
768 +
769 + static GtkWidget *w_keycode_file;
770 + static GtkWidget *w_mouse_wheel_lines;
771 +
772 + // Set sensitivity of widgets
773 + static void set_input_sensitive(void)
774 + {
775 +        gtk_widget_set_sensitive(w_keycode_file, PrefsFindBool("keycodes"));
776 +        gtk_widget_set_sensitive(w_mouse_wheel_lines, PrefsFindInt16("mousewheelmode") == 1);
777 + }
778 +
779 + // "Use Raw Keycodes" button toggled
780 + static void tb_keycodes(GtkWidget *widget)
781 + {
782 +        PrefsReplaceBool("keycodes", GTK_TOGGLE_BUTTON(widget)->active);
783 +        set_input_sensitive();
784 + }
785 +
786 + // "Mouse Wheel Mode" selected
787 + static void mn_wheel_page(...) {PrefsReplaceInt16("mousewheelmode", 0); set_input_sensitive();}
788 + static void mn_wheel_cursor(...) {PrefsReplaceInt16("mousewheelmode", 1); set_input_sensitive();}
789 +
790 + // Read settings from widgets and set preferences
791 + static void read_input_settings(void)
792 + {
793 +        const char *str = gtk_entry_get_text(GTK_ENTRY(w_keycode_file));
794 +        if (str && strlen(str))
795 +                PrefsReplaceString("keycodefile", str);
796 +        else
797 +                PrefsRemoveItem("keycodefile");
798 +
799 +        PrefsReplaceInt16("mousewheellines", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w_mouse_wheel_lines)));
800 + }
801 +
802 + // Create "Input" pane
803 + static void create_input_pane(GtkWidget *top)
804 + {
805 +        GtkWidget *box, *hbox, *menu, *label;
806 +        GtkObject *adj;
807 +
808 +        box = make_pane(top, STR_INPUT_PANE_TITLE);
809 +
810 +        make_checkbox(box, STR_KEYCODES_CTRL, "keycodes", GTK_SIGNAL_FUNC(tb_keycodes));
811 +        w_keycode_file = make_entry(box, STR_KEYCODE_FILE_CTRL, "keycodefile");
812 +
813 +        make_separator(box);
814 +
815 +        static const opt_desc options[] = {
816 +                {STR_MOUSEWHEELMODE_PAGE_LAB, GTK_SIGNAL_FUNC(mn_wheel_page)},
817 +                {STR_MOUSEWHEELMODE_CURSOR_LAB, GTK_SIGNAL_FUNC(mn_wheel_cursor)},
818 +                {0, NULL}
819 +        };
820 +        int wheelmode = PrefsFindInt16("mousewheelmode"), active = 0;
821 +        switch (wheelmode) {
822 +                case 0: active = 0; break;
823 +                case 1: active = 1; break;
824 +        }
825 +        menu = make_option_menu(box, STR_MOUSEWHEELMODE_CTRL, options, active);
826 +
827 +        hbox = gtk_hbox_new(FALSE, 4);
828 +        gtk_widget_show(hbox);
829 +        gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
830 +
831 +        label = gtk_label_new(GetString(STR_MOUSEWHEELLINES_CTRL));
832 +        gtk_widget_show(label);
833 +        gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
834 +
835 +        adj = gtk_adjustment_new(PrefsFindInt16("mousewheellines"), 1, 1000, 1, 5, 0);
836 +        w_mouse_wheel_lines = gtk_spin_button_new(GTK_ADJUSTMENT(adj), 0.0, 0);
837 +        gtk_widget_show(w_mouse_wheel_lines);
838 +        gtk_box_pack_start(GTK_BOX(hbox), w_mouse_wheel_lines, FALSE, FALSE, 0);
839 +
840 +        set_input_sensitive();
841 + }
842 +
843 +
844 + /*
845   *  "Serial/Network" pane
846   */
847  
# Line 864 | Line 946 | static GList *add_ether_names(void)
946   // Create "Serial/Network" pane
947   static void create_serial_pane(GtkWidget *top)
948   {
949 <        GtkWidget *box, *table, *label, *combo;
949 >        GtkWidget *box, *table, *label, *combo, *sep;
950          GList *glist = add_serial_names();
951  
952          box = make_pane(top, STR_SERIAL_NETWORK_PANE_TITLE);
953 <        table = make_table(box, 2, 3);
953 >        table = make_table(box, 2, 4);
954  
955          label = gtk_label_new(GetString(STR_SERIALA_CTRL));
956          gtk_widget_show(label);
# Line 898 | Line 980 | static void create_serial_pane(GtkWidget
980          gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 1, 2, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4);
981          w_serialb = GTK_COMBO(combo)->entry;
982  
983 +        sep = gtk_hseparator_new();
984 +        gtk_widget_show(sep);
985 +        gtk_table_attach(GTK_TABLE(table), sep, 0, 2, 2, 3, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
986 +
987          label = gtk_label_new(GetString(STR_ETHERNET_IF_CTRL));
988          gtk_widget_show(label);
989 <        gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
989 >        gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, (GtkAttachOptions)0, (GtkAttachOptions)0, 4, 4);
990  
991          glist = add_ether_names();
992          combo = gtk_combo_new();
# Line 910 | Line 996 | static void create_serial_pane(GtkWidget
996          if (str == NULL)
997                  str = "";
998          gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), str);
999 <        gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 2, 3, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4);
999 >        gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 3, 4, (GtkAttachOptions)(GTK_FILL | GTK_EXPAND), (GtkAttachOptions)0, 4, 4);
1000          w_ether = GTK_COMBO(combo)->entry;
1001   }
1002  
# Line 921 | Line 1007 | static void create_serial_pane(GtkWidget
1007  
1008   static GtkObject *w_ramsize_adj;
1009   static GtkWidget *w_rom_file;
924 static GtkWidget *w_keycode_file;
1010  
1011   // Model ID selected
1012   static void mn_modelid_5(...) {PrefsReplaceInt32("modelid", 5);}
# Line 934 | Line 1019 | static void mn_cpu_68030(...) {PrefsRepl
1019   static void mn_cpu_68030_fpu(...) {PrefsReplaceInt32("cpu", 3); PrefsReplaceBool("fpu", true);}
1020   static void mn_cpu_68040(...) {PrefsReplaceInt32("cpu", 4); PrefsReplaceBool("fpu", true);}
1021  
937 // "Use Raw Keycodes" button toggled
938 static void tb_keycodes(GtkWidget *widget)
939 {
940        PrefsReplaceBool("keycodes", GTK_TOGGLE_BUTTON(widget)->active);
941 }
942
1022   // Read settings from widgets and set preferences
1023   static void read_memory_settings(void)
1024   {
# Line 951 | Line 1030 | static void read_memory_settings(void)
1030          else
1031                  PrefsRemoveItem("rom");
1032  
954        str = gtk_entry_get_text(GTK_ENTRY(w_keycode_file));
955        if (str && strlen(str))
956                PrefsReplaceString("keycodefile", str);
957        else
958                PrefsRemoveItem("keycodefile");
1033   }
1034  
1035   // Create "Memory/Misc" pane
1036   static void create_memory_pane(GtkWidget *top)
1037   {
1038 <        GtkWidget *box, *vbox, *hbox, *hbox2, *label, *scale, *menu;
1038 >        GtkWidget *box, *hbox, *vbox, *hbox2, *label, *scale, *menu;
1039  
1040          box = make_pane(top, STR_MEMORY_MISC_PANE_TITLE);
1041  
# Line 1036 | Line 1110 | static void create_memory_pane(GtkWidget
1110   #endif
1111  
1112          w_rom_file = make_entry(box, STR_ROM_FILE_CTRL, "rom");
1039
1040        make_checkbox(box, STR_KEYCODES_CTRL, "keycodes", GTK_SIGNAL_FUNC(tb_keycodes));
1041        w_keycode_file = make_entry(box, STR_KEYCODE_FILE_CTRL, "keycodefile");
1113   }
1114  
1115  
# Line 1051 | Line 1122 | static void read_settings(void)
1122          read_volumes_settings();
1123          read_scsi_settings();
1124          read_graphics_settings();
1125 +        read_input_settings();
1126          read_serial_settings();
1127          read_memory_settings();
1128   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines