InputConfigDialog: Don't show "..." for complicated expressions

Just show the actual expression. We need to do a bit of mangling
here as wx has no way to turn off mnemonics parsing, so do that
as well.
This commit is contained in:
Jasper St. Pierre
2013-06-29 18:27:11 -04:00
parent eb153cfded
commit d5983b587e
4 changed files with 3 additions and 29 deletions

View File

@ -240,10 +240,9 @@ void GamepadPage::UpdateGUI()
, e = (*g)->control_buttons.end(); , e = (*g)->control_buttons.end();
for (; i!=e; ++i) { for (; i!=e; ++i) {
ControllerInterface::ControlReference *r = (*i)->control_reference; ControllerInterface::ControlReference *r = (*i)->control_reference;
if (r->IsComplicated()) wxString expr = StrToWxStr((*i)->control_reference->expression);
(*i)->SetLabel("..."); expr.Replace("&", "&&");
else (*i)->SetLabel(expr);
(*i)->SetLabel(StrToWxStr((*i)->control_reference->expression));
} }
// cboxes // cboxes

View File

@ -73,13 +73,6 @@ public:
return 0; return 0;
} }
bool IsComplicated() {
if (parsed_expression)
return parsed_expression->is_complicated;
else
return false;
}
protected: protected:
ControlReference(const bool _is_input) : range(1), is_input(_is_input), parsed_expression(NULL) {} ControlReference(const bool _is_input) : range(1), is_input(_is_input), parsed_expression(NULL) {}
ciface::ExpressionParser::Expression *parsed_expression; ciface::ExpressionParser::Expression *parsed_expression;

View File

@ -210,7 +210,6 @@ public:
virtual ControlState GetValue() { return 0; } virtual ControlState GetValue() { return 0; }
virtual void SetValue(ControlState state) {} virtual void SetValue(ControlState state) {}
virtual int CountNumControls() { return 0; } virtual int CountNumControls() { return 0; }
virtual bool IsComplicated() { return false; }
virtual operator std::string() { return ""; } virtual operator std::string() { return ""; }
}; };
@ -237,11 +236,6 @@ public:
return 1; return 1;
} }
virtual bool IsComplicated()
{
return false;
}
virtual operator std::string() virtual operator std::string()
{ {
return "`" + (std::string)qualifier + "`"; return "`" + (std::string)qualifier + "`";
@ -293,11 +287,6 @@ public:
return lhs->CountNumControls() + rhs->CountNumControls(); return lhs->CountNumControls() + rhs->CountNumControls();
} }
virtual bool IsComplicated()
{
return true;
}
virtual operator std::string() virtual operator std::string()
{ {
return OpName(op) + "(" + (std::string)(*lhs) + ", " + (std::string)(*rhs) + ")"; return OpName(op) + "(" + (std::string)(*lhs) + ", " + (std::string)(*rhs) + ")";
@ -345,11 +334,6 @@ public:
return inner->CountNumControls(); return inner->CountNumControls();
} }
virtual bool IsComplicated()
{
return true;
}
virtual operator std::string() virtual operator std::string()
{ {
return OpName(op) + "(" + (std::string)(*inner) + ")"; return OpName(op) + "(" + (std::string)(*inner) + ")";
@ -539,7 +523,6 @@ Expression::Expression(ExpressionNode *node_)
{ {
node = node_; node = node_;
num_controls = node->CountNumControls(); num_controls = node->CountNumControls();
is_complicated = node->IsComplicated();
} }
Expression::~Expression() Expression::~Expression()

View File

@ -51,7 +51,6 @@ public:
ControlState GetValue(); ControlState GetValue();
void SetValue (ControlState state); void SetValue (ControlState state);
int num_controls; int num_controls;
bool is_complicated;
ExpressionNode *node; ExpressionNode *node;
}; };