mirror of https://github.com/stella-emu/stella.git
Fix methods aliasing superclass methods without using virtual/override.
This commit is contained in:
parent
c008a9cf84
commit
bd5ec219fa
|
@ -38,8 +38,8 @@ class DataGridOpsWidget : public Widget, public CommandSender
|
||||||
DataGridOpsWidget(GuiObject* boss, const GUI::Font& font, int x, int y);
|
DataGridOpsWidget(GuiObject* boss, const GUI::Font& font, int x, int y);
|
||||||
~DataGridOpsWidget() override = default;
|
~DataGridOpsWidget() override = default;
|
||||||
|
|
||||||
void setTarget(CommandReceiver* target);
|
void setTarget(CommandReceiver* target) override;
|
||||||
void setEnabled(bool e);
|
void setEnabled(bool e) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ButtonWidget* _zeroButton{nullptr};
|
ButtonWidget* _zeroButton{nullptr};
|
||||||
|
|
|
@ -28,12 +28,6 @@ class QuadTariWidget: public ControllerWidget
|
||||||
Controller& controller);
|
Controller& controller);
|
||||||
~QuadTariWidget() override = default;
|
~QuadTariWidget() override = default;
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual string getHeader()
|
|
||||||
{
|
|
||||||
return (isLeftPort() ? "Left (" : "Right (") + string("QuadTari)");
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StaticTextWidget* myPointer{nullptr};
|
StaticTextWidget* myPointer{nullptr};
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,8 @@ class CommandSender
|
||||||
|
|
||||||
virtual ~CommandSender() = default;
|
virtual ~CommandSender() = default;
|
||||||
|
|
||||||
void setTarget(CommandReceiver* target) { _target = target; }
|
virtual void setTarget(CommandReceiver* target) { _target = target; }
|
||||||
CommandReceiver* getTarget() const { return _target; }
|
virtual CommandReceiver* getTarget() const { return _target; }
|
||||||
|
|
||||||
virtual void sendCommand(int cmd, int data, int id)
|
virtual void sendCommand(int cmd, int data, int id)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,7 +41,7 @@ class PopUpWidget : public EditableWidget
|
||||||
const string& label = "", int labelWidth = 0, int cmd = 0);
|
const string& label = "", int labelWidth = 0, int cmd = 0);
|
||||||
~PopUpWidget() override = default;
|
~PopUpWidget() override = default;
|
||||||
|
|
||||||
void setID(uInt32 id);
|
void setID(uInt32 id) override;
|
||||||
|
|
||||||
int getTop() const override { return _y + 1; }
|
int getTop() const override { return _y + 1; }
|
||||||
int getBottom() const override { return _y + 1 + getHeight(); }
|
int getBottom() const override { return _y + 1 + getHeight(); }
|
||||||
|
|
|
@ -35,10 +35,10 @@ class RadioButtonWidget : public CheckboxWidget
|
||||||
int cmd = 0);
|
int cmd = 0);
|
||||||
|
|
||||||
void handleMouseUp(int x, int y, MouseButton b, int clickCount) override;
|
void handleMouseUp(int x, int y, MouseButton b, int clickCount) override;
|
||||||
void setState(bool state, bool send = true);
|
void setState(bool state, bool send = true) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setFill(FillType type);
|
void setFill(FillType type) override;
|
||||||
void drawWidget(bool hilite) override;
|
void drawWidget(bool hilite) override;
|
||||||
static uInt32 buttonSize(const GUI::Font& font)
|
static uInt32 buttonSize(const GUI::Font& font)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,13 +50,13 @@ TimeLineWidget::TimeLineWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void TimeLineWidget::setValue(uInt32 value)
|
void TimeLineWidget::setValue(int value)
|
||||||
{
|
{
|
||||||
value = BSPF::clamp(value, _valueMin, _valueMax);
|
const uInt32 v = BSPF::clamp(static_cast<uInt32>(value), _valueMin, _valueMax);
|
||||||
|
|
||||||
if(value != _value)
|
if(v != _value)
|
||||||
{
|
{
|
||||||
_value = value;
|
_value = v;
|
||||||
setDirty();
|
setDirty();
|
||||||
sendCommand(_cmd, _value, _id);
|
sendCommand(_cmd, _value, _id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ class TimeLineWidget : public ButtonWidget
|
||||||
int x, int y, int w, int h, const string& label = "",
|
int x, int y, int w, int h, const string& label = "",
|
||||||
uInt32 labelWidth = 0, int cmd = 0);
|
uInt32 labelWidth = 0, int cmd = 0);
|
||||||
|
|
||||||
void setValue(uInt32 value);
|
void setValue(int value) override;
|
||||||
uInt32 getValue() const { return _value; }
|
uInt32 getValue() const { return _value; }
|
||||||
|
|
||||||
void setMinValue(uInt32 value);
|
void setMinValue(uInt32 value);
|
||||||
|
|
|
@ -545,8 +545,8 @@ StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y,
|
int x, int y,
|
||||||
const string& text, TextAlign align,
|
const string& text, TextAlign align,
|
||||||
ColorId shadowColor)
|
ColorId shadowColor)
|
||||||
: StaticTextWidget(boss, font, x, y, font.getStringWidth(text), font.getLineHeight(),
|
: StaticTextWidget(boss, font, x, y, font.getStringWidth(text),
|
||||||
text, align, shadowColor)
|
font.getLineHeight(), text, align, shadowColor)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ class Widget : public GuiObject
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Set/clear FLAG_ENABLED */
|
/** Set/clear FLAG_ENABLED */
|
||||||
void setEnabled(bool e);
|
virtual void setEnabled(bool e);
|
||||||
|
|
||||||
bool isEnabled() const { return _flags & FLAG_ENABLED; }
|
bool isEnabled() const { return _flags & FLAG_ENABLED; }
|
||||||
bool isVisible() const override { return !(_flags & FLAG_INVISIBLE); }
|
bool isVisible() const override { return !(_flags & FLAG_INVISIBLE); }
|
||||||
|
@ -103,7 +103,7 @@ class Widget : public GuiObject
|
||||||
bool wantsTab() const { return _flags & FLAG_WANTS_TAB; }
|
bool wantsTab() const { return _flags & FLAG_WANTS_TAB; }
|
||||||
bool wantsRaw() const { return _flags & FLAG_WANTS_RAWDATA; }
|
bool wantsRaw() const { return _flags & FLAG_WANTS_RAWDATA; }
|
||||||
|
|
||||||
void setID(uInt32 id) { _id = id; }
|
virtual void setID(uInt32 id) { _id = id; }
|
||||||
uInt32 getID() const { return _id; }
|
uInt32 getID() const { return _id; }
|
||||||
|
|
||||||
virtual const GUI::Font& font() const { return _font; }
|
virtual const GUI::Font& font() const { return _font; }
|
||||||
|
@ -222,7 +222,7 @@ class StaticTextWidget : public Widget, public CommandSender
|
||||||
|
|
||||||
void setCmd(int cmd) { _cmd = cmd; }
|
void setCmd(int cmd) { _cmd = cmd; }
|
||||||
|
|
||||||
void setValue(int value);
|
virtual void setValue(int value);
|
||||||
void setLabel(const string& label);
|
void setLabel(const string& label);
|
||||||
void setAlign(TextAlign align) { _align = align; setDirty(); }
|
void setAlign(TextAlign align) { _align = align; setDirty(); }
|
||||||
const string& getLabel() const { return _label; }
|
const string& getLabel() const { return _label; }
|
||||||
|
@ -331,9 +331,9 @@ class CheckboxWidget : public ButtonWidget
|
||||||
~CheckboxWidget() override = default;
|
~CheckboxWidget() override = default;
|
||||||
|
|
||||||
void setEditable(bool editable);
|
void setEditable(bool editable);
|
||||||
void setFill(FillType type);
|
virtual void setFill(FillType type);
|
||||||
|
|
||||||
void setState(bool state, bool changed = false);
|
virtual void setState(bool state, bool changed = false);
|
||||||
void toggleState() { setState(!_state); }
|
void toggleState() { setState(!_state); }
|
||||||
bool getState() const { return _state; }
|
bool getState() const { return _state; }
|
||||||
|
|
||||||
|
@ -390,7 +390,7 @@ class SliderWidget : public ButtonWidget
|
||||||
int valueLabelGap = 0, bool forceLabelSign = false);
|
int valueLabelGap = 0, bool forceLabelSign = false);
|
||||||
~SliderWidget() override = default;
|
~SliderWidget() override = default;
|
||||||
|
|
||||||
void setValue(int value);
|
void setValue(int value) override;
|
||||||
int getValue() const { return BSPF::clamp(_value, _valueMin, _valueMax); }
|
int getValue() const { return BSPF::clamp(_value, _valueMin, _valueMax); }
|
||||||
|
|
||||||
void setMinValue(int value);
|
void setMinValue(int value);
|
||||||
|
|
Loading…
Reference in New Issue