Skip to content
Snippets Groups Projects
Commit 76ade4aa authored by Aaron Cuevas Lopez's avatar Aaron Cuevas Lopez
Browse files

Make ElectrodeButton more generic

parent cbea527f
Branches
No related tags found
No related merge requests found
......@@ -33,6 +33,9 @@ void ElectrodeButton::paintButton(Graphics& g, bool isMouseOver, bool isButtonDo
if (isMouseOver)
g.setColour(Colours::white);
if (!isEnabled())
g.setColour(Colours::black);
g.fillRect(0,0,getWidth(),getHeight());
// g.setFont(buttonFont);
......@@ -40,8 +43,28 @@ void ElectrodeButton::paintButton(Graphics& g, bool isMouseOver, bool isButtonDo
g.drawRect(0,0,getWidth(),getHeight(),1.0);
if (!isEnabled())
{
g.setColour(Colours::grey);
}
if (chan >= 0)
g.drawText(String(chan),0,0,getWidth(),getHeight(),Justification::centred,true);
g.drawText(getButtonText(),0,0,getWidth(),getHeight(),Justification::centred,true);
}
void ElectrodeButton::setChannelNum(int i)
{
setChannelNum(i,true);
}
void ElectrodeButton::setChannelNum(int i, bool changeButtonText)
{
chan = i;
if (changeButtonText)
{
setButtonText(String(chan));
}
}
......
......@@ -42,6 +42,7 @@ public:
setClickingTogglesState(true);
//setRadioGroupId(299);
setToggleState(true, false);
setButtonText(String(chan_));
}
~ElectrodeButton() {}
......@@ -49,10 +50,8 @@ public:
{
return chan;
}
void setChannelNum(int i)
{
chan = i;
}
void setChannelNum(int i);
void setChannelNum(int i, bool changeButtonText);
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment