- new methods set_label() and get_label() for text menus and gui dialogs

- ParamDialog now uses get_label() instead of get_ask_format()
This commit is contained in:
Volker Ruppert 2003-08-30 11:21:56 +00:00
parent 29a1f1a0f8
commit 3d28df0b78
3 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: siminterface.cc,v 1.102 2003-08-26 20:24:34 cbothamy Exp $
// $Id: siminterface.cc,v 1.103 2003-08-30 11:21:56 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// See siminterface.h for description of the siminterface concept.
@ -800,6 +800,7 @@ bx_param_c::bx_param_c (bx_id id, char *name, char *description)
this->description = description;
this->text_format = default_text_format;
this->ask_format = NULL;
this->label = NULL;
this->runtime_param = 0;
this->enabled = 1;
SIM->register_param (id, this);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: siminterface.h,v 1.109 2003-08-26 20:24:35 cbothamy Exp $
// $Id: siminterface.h,v 1.110 2003-08-30 11:21:56 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Before I can describe what this file is for, I have to make the
@ -838,6 +838,7 @@ class BOCHSAPI bx_param_c : public bx_object_c {
protected:
char *name;
char *description;
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
int runtime_param;
@ -848,6 +849,8 @@ public:
const char *get_format () {return text_format;}
void set_ask_format (char *format) {ask_format = format; }
char *get_ask_format () {return ask_format;}
void set_label (char *text) {label = text;}
char *get_label () {return label;}
void set_runtime_param (int val) { runtime_param = val; }
char *get_name () { return name; }
char *get_description () { return description; }

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////
// $Id: wxdialog.cc,v 1.61 2003-08-28 20:04:22 vruppert Exp $
// $Id: wxdialog.cc,v 1.62 2003-08-30 11:21:56 vruppert Exp $
/////////////////////////////////////////////////////////////////
// Define BX_PLUGGABLE in files that can be compiled into plugins. For
@ -1283,7 +1283,7 @@ void ParamDialog::AddParam (
pstr->u.window = NULL;
pstr->browseButton = NULL;
int type = param_generic->get_type ();
char *prompt = pstr->param->get_ask_format ();
char *prompt = pstr->param->get_label ();
if (!prompt) prompt = pstr->param->get_name ();
wxASSERT (prompt != NULL);
#define ADD_LABEL(x) sizer->Add (pstr->label = new wxStaticText (context->parent, -1, wxString (x)), 0, wxALIGN_RIGHT|wxALL, 3)