- exclude devices without a prefix in the advanced log options dialog
This commit is contained in:
parent
8312d149eb
commit
04d0b0a892
@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
// $Id: wxdialog.cc,v 1.100 2006-05-30 17:41:43 vruppert Exp $
|
// $Id: wxdialog.cc,v 1.101 2006-10-21 15:36:07 vruppert Exp $
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Define BX_PLUGGABLE in files that can be compiled into plugins. For
|
// Define BX_PLUGGABLE in files that can be compiled into plugins. For
|
||||||
@ -130,7 +130,7 @@ void LogMsgAskDialog::Init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Event handler for dialog buttons. Just translate the wx ids into
|
// Event handler for dialog buttons. Just translate the wx ids into
|
||||||
// enum values and return them with EndModel() to make the dialog
|
// enum values and return them with EndModal() to make the dialog
|
||||||
// go away.
|
// go away.
|
||||||
void LogMsgAskDialog::OnEvent(wxCommandEvent& event)
|
void LogMsgAskDialog::OnEvent(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
@ -469,6 +469,7 @@ AdvancedLogOptionsDialog::AdvancedLogOptionsDialog(
|
|||||||
int devmax = SIM->get_n_log_modules();
|
int devmax = SIM->get_n_log_modules();
|
||||||
action = new wxChoice** [devmax]; // array of pointers
|
action = new wxChoice** [devmax]; // array of pointers
|
||||||
for (int dev=0; dev<devmax; dev++) {
|
for (int dev=0; dev<devmax; dev++) {
|
||||||
|
if (strcmp(SIM->get_prefix(dev), "[ ]")) {
|
||||||
action[dev] = new wxChoice* [ADVLOG_OPTS_N_TYPES];
|
action[dev] = new wxChoice* [ADVLOG_OPTS_N_TYPES];
|
||||||
// name of device in first column
|
// name of device in first column
|
||||||
gridSizer->Add(new wxStaticText(scrollPanel, -1, wxString(SIM->get_prefix(dev), wxConvUTF8)));
|
gridSizer->Add(new wxStaticText(scrollPanel, -1, wxString(SIM->get_prefix(dev), wxConvUTF8)));
|
||||||
@ -477,6 +478,9 @@ AdvancedLogOptionsDialog::AdvancedLogOptionsDialog(
|
|||||||
action[dev][type] = makeLogOptionChoiceBox(scrollPanel, -1, type);
|
action[dev][type] = makeLogOptionChoiceBox(scrollPanel, -1, type);
|
||||||
gridSizer->Add(action[dev][type], 1, wxALL|wxGROW|wxADJUST_MINSIZE, 2);
|
gridSizer->Add(action[dev][type], 1, wxALL|wxGROW|wxADJUST_MINSIZE, 2);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
action[dev] = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
headerSizer->Fit(this);
|
headerSizer->Fit(this);
|
||||||
headerSizer->SetSizeHints(this);
|
headerSizer->SetSizeHints(this);
|
||||||
@ -565,6 +569,7 @@ void AdvancedLogOptionsDialog::CopyGuiToParam() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AdvancedLogOptionsDialog::SetAction(int dev, int evtype, int act) {
|
void AdvancedLogOptionsDialog::SetAction(int dev, int evtype, int act) {
|
||||||
|
if (action[dev] == NULL) return;
|
||||||
// find the choice whose client data matches "act".
|
// find the choice whose client data matches "act".
|
||||||
int *ptr;
|
int *ptr;
|
||||||
// wxLogDebug(wxT("SetAction dev=%d type=%d act=%d"), dev, evtype, act);
|
// wxLogDebug(wxT("SetAction dev=%d type=%d act=%d"), dev, evtype, act);
|
||||||
@ -584,6 +589,7 @@ void AdvancedLogOptionsDialog::SetAction(int dev, int evtype, int act) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int AdvancedLogOptionsDialog::GetAction(int dev, int evtype) {
|
int AdvancedLogOptionsDialog::GetAction(int dev, int evtype) {
|
||||||
|
if (action[dev] == NULL) return LOG_OPTS_NO_CHANGE;
|
||||||
int sel = action[dev][evtype]->GetSelection();
|
int sel = action[dev][evtype]->GetSelection();
|
||||||
int *ptrToChoice = (int*)action[dev][evtype]->GetClientData(sel);
|
int *ptrToChoice = (int*)action[dev][evtype]->GetClientData(sel);
|
||||||
wxASSERT(ptrToChoice != NULL);
|
wxASSERT(ptrToChoice != NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user