1 |
|
/* |
2 |
|
* prefs_editor_beos.cpp - Preferences editor, BeOS implementation |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-1999 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2001 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
84 |
|
const uint32 MSG_RAMSIZE = 'rmsz'; // "Memory/Misc" pane |
85 |
|
const uint32 MSG_MODELID_5 = 'mi05'; |
86 |
|
const uint32 MSG_MODELID_14 = 'mi14'; |
87 |
< |
const uint32 MSG_FPU = 'fpu '; |
87 |
> |
const uint32 MSG_CPU_68020 = 'cpu2'; |
88 |
> |
const uint32 MSG_CPU_68020_FPU = 'cpf2'; |
89 |
> |
const uint32 MSG_CPU_68030 = 'cpu3'; |
90 |
> |
const uint32 MSG_CPU_68030_FPU = 'cpf3'; |
91 |
> |
const uint32 MSG_CPU_68040 = 'cpu4'; |
92 |
|
|
93 |
|
|
94 |
|
// RAM size slider class |
302 |
|
bar->AddItem(menu); |
303 |
|
AddChild(bar); |
304 |
|
SetKeyMenuBar(bar); |
305 |
< |
int mbar_height = bar->Bounds().bottom + 1; |
305 |
> |
int mbar_height = int(bar->Bounds().bottom) + 1; |
306 |
|
|
307 |
|
// Resize window to fit menu bar |
308 |
|
ResizeBy(0, mbar_height); |
425 |
|
menu->AddItem(new BMenuItem(GetString(STR_BOOT_ANY_LAB), new BMessage(MSG_BOOT_ANY))); |
426 |
|
menu->AddItem(new BMenuItem(GetString(STR_BOOT_CDROM_LAB), new BMessage(MSG_BOOT_CDROM))); |
427 |
|
pane->AddChild(menu_field); |
428 |
< |
int16 i16 = PrefsFindInt16("bootdriver"); |
428 |
> |
int32 i32 = PrefsFindInt32("bootdriver"); |
429 |
|
BMenuItem *item; |
430 |
< |
if (i16 == 0) { |
430 |
> |
if (i32 == 0) { |
431 |
|
if ((item = menu->FindItem(GetString(STR_BOOT_ANY_LAB))) != NULL) |
432 |
|
item->SetMarked(true); |
433 |
< |
} else if (i16 == CDROMRefNum) { |
433 |
> |
} else if (i32 == CDROMRefNum) { |
434 |
|
if ((item = menu->FindItem(GetString(STR_BOOT_CDROM_LAB))) != NULL) |
435 |
|
item->SetMarked(true); |
436 |
|
} |
712 |
|
item->SetMarked(true); |
713 |
|
pane->AddChild(menu_field); |
714 |
|
|
715 |
< |
rom_control = new PathControl(false, BRect(10, 82, right, 97), "rom", GetString(STR_ROM_FILE_CTRL), PrefsFindString("rom"), NULL); |
715 |
> |
int cpu = PrefsFindInt32("cpu"); |
716 |
> |
bool fpu = PrefsFindBool("fpu"); |
717 |
> |
menu = new BPopUpMenu(""); |
718 |
> |
menu_field = new BMenuField(BRect(10, 82, right, 97), "cpu", GetString(STR_CPU_CTRL), menu); |
719 |
> |
menu_field->SetDivider(120); |
720 |
> |
menu->AddItem(item = new BMenuItem(GetString(STR_CPU_68020_LAB), new BMessage(MSG_CPU_68020))); |
721 |
> |
if (cpu == 2 && !fpu) |
722 |
> |
item->SetMarked(true); |
723 |
> |
menu->AddItem(item = new BMenuItem(GetString(STR_CPU_68020_FPU_LAB), new BMessage(MSG_CPU_68020_FPU))); |
724 |
> |
if (cpu == 2 && fpu) |
725 |
> |
item->SetMarked(true); |
726 |
> |
menu->AddItem(item = new BMenuItem(GetString(STR_CPU_68030_LAB), new BMessage(MSG_CPU_68030))); |
727 |
> |
if (cpu == 3 && !fpu) |
728 |
> |
item->SetMarked(true); |
729 |
> |
menu->AddItem(item = new BMenuItem(GetString(STR_CPU_68030_FPU_LAB), new BMessage(MSG_CPU_68030_FPU))); |
730 |
> |
if (cpu == 3 && fpu) |
731 |
> |
item->SetMarked(true); |
732 |
> |
menu->AddItem(item = new BMenuItem(GetString(STR_CPU_68040_LAB), new BMessage(MSG_CPU_68040))); |
733 |
> |
if (cpu == 4) |
734 |
> |
item->SetMarked(true); |
735 |
> |
pane->AddChild(menu_field); |
736 |
> |
|
737 |
> |
rom_control = new PathControl(false, BRect(10, 104, right, 119), "rom", GetString(STR_ROM_FILE_CTRL), PrefsFindString("rom"), NULL); |
738 |
|
rom_control->SetDivider(117); |
739 |
|
pane->AddChild(rom_control); |
740 |
|
|
715 |
– |
fpu_checkbox = new BCheckBox(BRect(10, 100, right, 115), "fpu", GetString(STR_FPU_CTRL), new BMessage(MSG_FPU)); |
716 |
– |
pane->AddChild(fpu_checkbox); |
717 |
– |
fpu_checkbox->SetValue(PrefsFindBool("fpu") ? B_CONTROL_ON : B_CONTROL_OFF); |
718 |
– |
|
741 |
|
return pane; |
742 |
|
} |
743 |
|
|
875 |
|
} |
876 |
|
|
877 |
|
case MSG_BOOT_ANY: |
878 |
< |
PrefsReplaceInt16("bootdriver", 0); |
878 |
> |
PrefsReplaceInt32("bootdriver", 0); |
879 |
|
break; |
880 |
|
|
881 |
|
case MSG_BOOT_CDROM: |
882 |
< |
PrefsReplaceInt16("bootdriver", CDROMRefNum); |
882 |
> |
PrefsReplaceInt32("bootdriver", CDROMRefNum); |
883 |
|
break; |
884 |
|
|
885 |
|
case MSG_NOCDROM: |
955 |
|
PrefsReplaceInt32("modelid", 14); |
956 |
|
break; |
957 |
|
|
958 |
< |
case MSG_FPU: |
959 |
< |
PrefsReplaceBool("fpu", fpu_checkbox->Value() == B_CONTROL_ON); |
958 |
> |
case MSG_CPU_68020: |
959 |
> |
PrefsReplaceInt32("cpu", 2); |
960 |
> |
PrefsReplaceBool("fpu", false); |
961 |
> |
break; |
962 |
> |
|
963 |
> |
case MSG_CPU_68020_FPU: |
964 |
> |
PrefsReplaceInt32("cpu", 2); |
965 |
> |
PrefsReplaceBool("fpu", true); |
966 |
> |
break; |
967 |
> |
|
968 |
> |
case MSG_CPU_68030: |
969 |
> |
PrefsReplaceInt32("cpu", 3); |
970 |
> |
PrefsReplaceBool("fpu", false); |
971 |
> |
break; |
972 |
> |
|
973 |
> |
case MSG_CPU_68030_FPU: |
974 |
> |
PrefsReplaceInt32("cpu", 3); |
975 |
> |
PrefsReplaceBool("fpu", true); |
976 |
> |
break; |
977 |
> |
|
978 |
> |
case MSG_CPU_68040: |
979 |
> |
PrefsReplaceInt32("cpu", 4); |
980 |
> |
PrefsReplaceBool("fpu", true); |
981 |
|
break; |
982 |
|
|
983 |
|
default: { |