- wx: most of the config dialogs are now generated from a parameter list

- new bx_list_c for keyboard options (used in wx, TODO in textconfig)
- new flag USE_BOX_TITLE controls the usage of the list name for the group box label
- wxdialog.cc: unused variable removed
This commit is contained in:
Volker Ruppert 2003-08-23 15:28:06 +00:00
parent 855af72c8a
commit be5bd5dca4
4 changed files with 37 additions and 23 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: siminterface.h,v 1.105 2003-08-22 01:00:58 cbothamy Exp $
// $Id: siminterface.h,v 1.106 2003-08-23 15:28:06 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Before I can describe what this file is for, I have to make the
@ -354,6 +354,7 @@ typedef enum {
BXP_MENU_DISK,
BXP_MENU_SERIAL_PARALLEL,
BXP_MENU_SOUND,
BXP_MENU_KEYBOARD,
BXP_MENU_MISC,
BXP_MENU_RUNTIME,
BXP_MAX_IPS,
@ -1102,11 +1103,15 @@ public:
// related questions. This bit suggests to the CI that the series of
// questions format is preferred.
SERIES_ASK = (1<<1),
// When a bx_list_c is displayed in a dialog, BX_USE_TAB_WINDOW suggests
// When a bx_list_c is displayed in a dialog, USE_TAB_WINDOW suggests
// to the CI that each item in the list should be shown as a separate
// tab. This would be most appropriate when each item is another list
// of parameters.
USE_TAB_WINDOW = (1<<2)
USE_TAB_WINDOW = (1<<2),
// When a bx_list_c is displayed in a dialog, the list name is used as the
// label of the group box if USE_BOX_TITLE is set. This is only necessary if
// more than one list appears in a dialog box.
USE_BOX_TITLE = (1<<3)
} bx_listopt_bits;
bx_list_c (bx_id id, int maxsize);
bx_list_c (bx_id id, char *name, char *description, bx_param_c **init_list);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////
// $Id: wxdialog.cc,v 1.54 2003-01-04 11:46:59 vruppert Exp $
// $Id: wxdialog.cc,v 1.55 2003-08-23 15:28:06 vruppert Exp $
/////////////////////////////////////////////////////////////////
// Define BX_PLUGGABLE in files that can be compiled into plugins. For
@ -2001,7 +2001,13 @@ void ParamDialog::AddParam (
idHash->Put (pstr->id, pstr);
paramHash->Put (pstr->param->get_id (), pstr);
} else {
wxStaticBox *box = new wxStaticBox (context->parent, -1, prompt);
wxString boxTitle;
if (list->get_options()->get () & bx_list_c::USE_BOX_TITLE) {
boxTitle = prompt;
} else {
boxTitle = "";
}
wxStaticBox *box = new wxStaticBox (context->parent, -1, boxTitle);
wxStaticBoxSizer *boxsz = new wxStaticBoxSizer (box, wxVERTICAL);
AddParamContext newcontext;
newcontext.depth = 1 + context->depth;
@ -2613,7 +2619,6 @@ wxChoice *makeLogOptionChoiceBox (wxWindow *parent,
{
static char *choices[] = LOG_OPTS_CHOICES;
static int integers[LOG_OPTS_N_CHOICES] = {0, 1, 2, 3, 4};
static const wxString stupid[2] = { "little1", "little2" };
wxChoice *control = new wxChoice (parent, id, wxDefaultPosition, wxDefaultSize);
int lastChoice = 0; // remember index of last choice
int nchoice = includeNoChange? LOG_OPTS_N_CHOICES : LOG_OPTS_N_CHOICES_NORMAL;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////
// $Id: wxmain.cc,v 1.92 2003-08-23 09:52:26 vruppert Exp $
// $Id: wxmain.cc,v 1.93 2003-08-23 15:28:06 vruppert Exp $
/////////////////////////////////////////////////////////////////
//
// wxmain.cc implements the wxWindows frame, toolbar, menus, and dialogs.
@ -644,8 +644,7 @@ void MyFrame::OnEditSound(wxCommandEvent& WXUNUSED(event))
ParamDialog dlg (this, -1);
bx_list_c *list = (bx_list_c*) SIM->get_param (BXP_SB16);
dlg.SetTitle (list->get_name ());
for (int i=0; i<list->get_size (); i++)
dlg.AddParam (list->get (i));
dlg.AddParam (list);
dlg.ShowModal ();
}
@ -664,8 +663,7 @@ void MyFrame::OnEditTiming(wxCommandEvent& WXUNUSED(event))
dlg.AddParam (SIM->get_param (BXP_IPS));
bx_list_c *list = (bx_list_c*) SIM->get_param (BXP_CLOCK);
dlg.SetTitle (list->get_name ());
for (int i=0; i<list->get_size (); i++)
dlg.AddParam (list->get (i));
dlg.AddParam (list);
dlg.ShowModal ();
}
@ -731,12 +729,9 @@ void MyFrame::OnEditNet(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnEditKeyboard(wxCommandEvent& WXUNUSED(event))
{
ParamDialog dlg(this, -1);
dlg.SetTitle ("Configure Keyboard");
dlg.AddParam (SIM->get_param (BXP_KBD_TYPE));
dlg.AddParam (SIM->get_param (BXP_KBD_SERIAL_DELAY));
dlg.AddParam (SIM->get_param (BXP_KBD_PASTE_DELAY));
dlg.AddParam (SIM->get_param (BXP_KEYBOARD_USEMAPPING));
dlg.AddParam (SIM->get_param (BXP_KEYBOARD_MAP));
bx_list_c *list = (bx_list_c*) SIM->get_param (BXP_MENU_KEYBOARD);
dlg.SetTitle (list->get_name ());
dlg.AddParam (list);
dlg.ShowModal ();
}
@ -745,8 +740,7 @@ void MyFrame::OnEditSerialParallel(wxCommandEvent& WXUNUSED(event))
ParamDialog dlg(this, -1);
bx_list_c *list = (bx_list_c*) SIM->get_param (BXP_MENU_SERIAL_PARALLEL);
dlg.SetTitle (list->get_name ());
for (int i=0; i<list->get_size (); i++)
dlg.AddParam (list->get (i));
dlg.AddParam (list);
dlg.ShowModal ();
}
@ -755,8 +749,7 @@ void MyFrame::OnEditLoadHack(wxCommandEvent& WXUNUSED(event))
ParamDialog dlg(this, -1);
bx_list_c *list = (bx_list_c*) SIM->get_param (BXP_LOAD32BITOS);
dlg.SetTitle (list->get_name ());
for (int i=0; i<list->get_size (); i++)
dlg.AddParam (list->get (i));
dlg.AddParam (list);
dlg.ShowModal ();
}
@ -769,7 +762,6 @@ void MyFrame::OnEditOther(wxCommandEvent& WXUNUSED(event))
dlg.AddParam (SIM->get_param (BXP_VGA_UPDATE_INTERVAL));
dlg.AddParam (SIM->get_param (BXP_LOG_PREFIX));
dlg.AddParam (SIM->get_param (BXP_MOUSE_ENABLED));
dlg.AddParam (SIM->get_param (BXP_USER_SHORTCUT));
dlg.AddParam (SIM->get_param (BXP_FLOPPYSIGCHECK));
dlg.AddParam (SIM->get_param (BXP_FLOPPY_CMD_DELAY));
dlg.AddParam (SIM->get_param (BXP_NEWHARDDRIVESUPPORT));

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: main.cc,v 1.238 2003-08-23 09:52:26 vruppert Exp $
// $Id: main.cc,v 1.239 2003-08-23 15:28:05 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -1421,6 +1421,18 @@ void bx_init_options ()
bx_options.gdbstub.data_base = 0;
bx_options.gdbstub.bss_base = 0;
bx_param_c *keyboard_init_list[] = {
bx_options.Okeyboard_serial_delay,
bx_options.Okeyboard_paste_delay,
bx_options.keyboard.OuseMapping,
bx_options.keyboard.Okeymap,
bx_options.Okeyboard_type,
bx_options.Ouser_shortcut,
NULL
};
menu = new bx_list_c (BXP_MENU_KEYBOARD, "Configure Keyboard", "", keyboard_init_list);
menu->get_options ()->set (menu->SHOW_PARENT);
bx_param_c *other_init_list[] = {
bx_options.Okeyboard_serial_delay,
bx_options.Okeyboard_paste_delay,