- sb16 options dmatimer and loglevel now present in the textconfig runtime options

- textconfig runtime menu: some options moved to submenu "Misc runtime options"
- bx_param_c: variable group_name and methods set_group() / get_group() added
- bx_list_c: new flag SHOW_GROUP_NAME added (used for SB16 options in runtime menu)
This commit is contained in:
Volker Ruppert 2004-05-30 08:28:52 +00:00
parent 1ef2fe4764
commit 8ba66c78a3
4 changed files with 38 additions and 21 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: siminterface.cc,v 1.105 2004-01-05 22:18:01 cbothamy Exp $
// $Id: siminterface.cc,v 1.106 2004-05-30 08:28:51 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// See siminterface.h for description of the siminterface concept.
@ -802,6 +802,7 @@ bx_param_c::bx_param_c (bx_id id, char *name, char *description)
this->text_format = default_text_format;
this->ask_format = NULL;
this->label = NULL;
this->group_name = NULL;
this->runtime_param = 0;
this->enabled = 1;
SIM->register_param (id, this);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: siminterface.h,v 1.119 2004-02-22 18:51:37 vruppert Exp $
// $Id: siminterface.h,v 1.120 2004-05-30 08:28:51 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Before I can describe what this file is for, I have to make the
@ -852,6 +852,7 @@ protected:
char *label; // label string for text menus and gui dialogs
const char *text_format; // printf format string. %d for ints, %s for strings, etc.
char *ask_format; // format string for asking for a new value
char *group_name; // name of the group the param belongs to
int runtime_param;
int enabled;
public:
@ -864,6 +865,8 @@ public:
char *get_label () {return label;}
void set_runtime_param (int val) { runtime_param = val; }
int get_runtime_param () { return runtime_param; }
void set_group (char *group) {group_name = group;}
char *get_group () {return group_name;}
char *get_name () { return name; }
char *get_description () { return description; }
int get_enabled () { return enabled; }
@ -1141,7 +1144,11 @@ public:
// 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)
USE_BOX_TITLE = (1<<3),
// When a bx_list_c is displayed as a menu, SHOW_GROUP_NAME controls whether
// or not the name of group the item belongs to is added to the name of the
// item (used in the runtime menu).
SHOW_GROUP_NAME = (1<<4)
} 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: textconfig.cc,v 1.22 2004-02-03 22:40:33 vruppert Exp $
// $Id: textconfig.cc,v 1.23 2004-05-30 08:28:52 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// This is code for a text-mode configuration interface. Note that this file
@ -287,15 +287,12 @@ static char *runtime_menu_prompt =
"7. (not implemented)\n"
"8. Log options for all devices\n"
"9. Log options for individual devices\n"
"10. VGA Update Interval: %d\n"
"11. Mouse: %s\n"
"12. Keyboard paste delay: %d\n"
"13. Userbutton shortcut: %s\n"
"14. Instruction tracing: off (doesn't exist yet)\n"
"15. Continue simulation\n"
"16. Quit now\n"
"10. Instruction tracing: off (doesn't exist yet)\n"
"11. Misc runtime options\n"
"12. Continue simulation\n"
"13. Quit now\n"
"\n"
"Please choose one: [15] ";
"Please choose one: [12] ";
#endif
#define NOT_IMPLEMENTED(choice) \
@ -468,7 +465,7 @@ int bx_config_interface (int menu)
choice = RuntimeOptionsDialog();
#else
build_runtime_options_prompt (runtime_menu_prompt, prompt, 1024);
if (ask_uint (prompt, 1, 16, 15, &choice, 10) < 0) return -1;
if (ask_uint (prompt, 1, 13, 12, &choice, 10) < 0) return -1;
#endif
switch (choice) {
case 1:
@ -498,13 +495,10 @@ int bx_config_interface (int menu)
break;
case 8: bx_log_options (0); break;
case 9: bx_log_options (1); break;
case 10: askparam (BXP_VGA_UPDATE_INTERVAL); break;
case 11: askparam (BXP_MOUSE_ENABLED); break;
case 12: askparam (BXP_KBD_PASTE_DELAY); break;
case 13: askparam (BXP_USER_SHORTCUT); break;
case 14: NOT_IMPLEMENTED (choice); break;
case 15: fprintf (stderr, "Continuing simulation\n"); return 0;
case 16:
case 10: NOT_IMPLEMENTED (choice); break;
case 11: askparam (BXP_MENU_RUNTIME); break;
case 12: fprintf (stderr, "Continuing simulation\n"); return 0;
case 13:
fprintf (stderr, "You chose quit on the configuration interface.\n");
bx_user_quit = 1;
SIM->quit_sim (1);
@ -962,6 +956,8 @@ bx_list_c::text_ask (FILE *fpin, FILE *fpout)
assert (list[i] != NULL);
fprintf (fpout, "%d. ", i+1);
if (list[i]->get_enabled ()) {
if ((options->get () & SHOW_GROUP_NAME) && (list[i]->get_group () != NULL))
fprintf (fpout, "%s ", list[i]->get_group ());
list[i]->text_print (fpout);
fprintf (fpout, "\n");
} else

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: main.cc,v 1.275 2004-05-23 10:46:59 vruppert Exp $
// $Id: main.cc,v 1.276 2004-05-30 08:28:51 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -1421,7 +1421,9 @@ void bx_init_options ()
bx_options.sb16.Ologlevel->set_options (bx_param_num_c::USE_SPIN_CONTROL);
#endif
bx_options.sb16.Odmatimer->set_runtime_param (1);
bx_options.sb16.Odmatimer->set_group ("SB16");
bx_options.sb16.Ologlevel->set_runtime_param (1);
bx_options.sb16.Ologlevel->set_group ("SB16");
bx_param_c *sb16_init_list[] = {
bx_options.sb16.Opresent,
bx_options.sb16.Omidimode,
@ -1642,6 +1644,17 @@ void bx_init_options ()
};
menu = new bx_list_c (BXP_MENU_MISC_2, "Other options", "", other_init_list2);
#endif
bx_param_c *runtime_init_list[] = {
bx_options.Ovga_update_interval,
bx_options.Omouse_enabled,
bx_options.Okeyboard_paste_delay,
bx_options.Ouser_shortcut,
bx_options.sb16.Odmatimer,
bx_options.sb16.Ologlevel,
NULL
};
menu = new bx_list_c (BXP_MENU_RUNTIME, "Misc runtime options", "", runtime_init_list);
menu->get_options ()->set (menu->SHOW_PARENT | menu->SHOW_GROUP_NAME);
}
void bx_reset_options ()