diff --git a/src/debugger/gui/DataGridOpsWidget.hxx b/src/debugger/gui/DataGridOpsWidget.hxx index f9c382ff2..43a8a3bba 100644 --- a/src/debugger/gui/DataGridOpsWidget.hxx +++ b/src/debugger/gui/DataGridOpsWidget.hxx @@ -38,8 +38,8 @@ class DataGridOpsWidget : public Widget, public CommandSender DataGridOpsWidget(GuiObject* boss, const GUI::Font& font, int x, int y); ~DataGridOpsWidget() override = default; - void setTarget(CommandReceiver* target); - void setEnabled(bool e); + void setTarget(CommandReceiver* target) override; + void setEnabled(bool e) override; private: ButtonWidget* _zeroButton{nullptr}; diff --git a/src/debugger/gui/QuadTariWidget.hxx b/src/debugger/gui/QuadTariWidget.hxx index c0cd42c28..17a1b4860 100644 --- a/src/debugger/gui/QuadTariWidget.hxx +++ b/src/debugger/gui/QuadTariWidget.hxx @@ -28,12 +28,6 @@ class QuadTariWidget: public ControllerWidget Controller& controller); ~QuadTariWidget() override = default; - protected: - virtual string getHeader() - { - return (isLeftPort() ? "Left (" : "Right (") + string("QuadTari)"); - } - private: StaticTextWidget* myPointer{nullptr}; diff --git a/src/gui/Command.hxx b/src/gui/Command.hxx index 6c81a8827..599a05c44 100644 --- a/src/gui/Command.hxx +++ b/src/gui/Command.hxx @@ -61,8 +61,8 @@ class CommandSender virtual ~CommandSender() = default; - void setTarget(CommandReceiver* target) { _target = target; } - CommandReceiver* getTarget() const { return _target; } + virtual void setTarget(CommandReceiver* target) { _target = target; } + virtual CommandReceiver* getTarget() const { return _target; } virtual void sendCommand(int cmd, int data, int id) { diff --git a/src/gui/PopUpWidget.hxx b/src/gui/PopUpWidget.hxx index 7c6292bc6..79ad994e0 100644 --- a/src/gui/PopUpWidget.hxx +++ b/src/gui/PopUpWidget.hxx @@ -41,7 +41,7 @@ class PopUpWidget : public EditableWidget const string& label = "", int labelWidth = 0, int cmd = 0); ~PopUpWidget() override = default; - void setID(uInt32 id); + void setID(uInt32 id) override; int getTop() const override { return _y + 1; } int getBottom() const override { return _y + 1 + getHeight(); } diff --git a/src/gui/RadioButtonWidget.hxx b/src/gui/RadioButtonWidget.hxx index b003746eb..a36178f96 100644 --- a/src/gui/RadioButtonWidget.hxx +++ b/src/gui/RadioButtonWidget.hxx @@ -35,10 +35,10 @@ class RadioButtonWidget : public CheckboxWidget int cmd = 0); 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: - void setFill(FillType type); + void setFill(FillType type) override; void drawWidget(bool hilite) override; static uInt32 buttonSize(const GUI::Font& font) { diff --git a/src/gui/TimeLineWidget.cxx b/src/gui/TimeLineWidget.cxx index 740ba524e..f6cc6e947 100644 --- a/src/gui/TimeLineWidget.cxx +++ b/src/gui/TimeLineWidget.cxx @@ -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(value), _valueMin, _valueMax); - if(value != _value) + if(v != _value) { - _value = value; + _value = v; setDirty(); sendCommand(_cmd, _value, _id); } diff --git a/src/gui/TimeLineWidget.hxx b/src/gui/TimeLineWidget.hxx index 3213276b6..492663388 100644 --- a/src/gui/TimeLineWidget.hxx +++ b/src/gui/TimeLineWidget.hxx @@ -27,7 +27,7 @@ class TimeLineWidget : public ButtonWidget int x, int y, int w, int h, const string& label = "", uInt32 labelWidth = 0, int cmd = 0); - void setValue(uInt32 value); + void setValue(int value) override; uInt32 getValue() const { return _value; } void setMinValue(uInt32 value); diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 4c398363f..c6ee68604 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -545,8 +545,8 @@ StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font, int x, int y, const string& text, TextAlign align, ColorId shadowColor) - : StaticTextWidget(boss, font, x, y, font.getStringWidth(text), font.getLineHeight(), - text, align, shadowColor) + : StaticTextWidget(boss, font, x, y, font.getStringWidth(text), + font.getLineHeight(), text, align, shadowColor) { } diff --git a/src/gui/Widget.hxx b/src/gui/Widget.hxx index 0d58951fb..7be3ac0d9 100644 --- a/src/gui/Widget.hxx +++ b/src/gui/Widget.hxx @@ -93,7 +93,7 @@ class Widget : public GuiObject } /** Set/clear FLAG_ENABLED */ - void setEnabled(bool e); + virtual void setEnabled(bool e); bool isEnabled() const { return _flags & FLAG_ENABLED; } 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 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; } 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 setValue(int value); + virtual void setValue(int value); void setLabel(const string& label); void setAlign(TextAlign align) { _align = align; setDirty(); } const string& getLabel() const { return _label; } @@ -331,9 +331,9 @@ class CheckboxWidget : public ButtonWidget ~CheckboxWidget() override = default; 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); } bool getState() const { return _state; } @@ -390,7 +390,7 @@ class SliderWidget : public ButtonWidget int valueLabelGap = 0, bool forceLabelSign = false); ~SliderWidget() override = default; - void setValue(int value); + void setValue(int value) override; int getValue() const { return BSPF::clamp(_value, _valueMin, _valueMax); } void setMinValue(int value);