Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing overrides #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add missing overrides to fix warnings when including turbobadger headers
  • Loading branch information
mgerhardy committed Dec 12, 2016
commit d66c83e56af038cdf7770ba08d3beee652693d07
21 changes: 11 additions & 10 deletions src/tb/animation/tb_widget_animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class TBWidgetAnimationOpacity : public TBWidgetAnimationObject
TBOBJECT_SUBCLASS(TBWidgetAnimationOpacity, TBWidgetAnimationObject);

TBWidgetAnimationOpacity(TBWidget *widget, float src_opacity, float dst_opacity, bool die);
virtual void OnAnimationStart();
virtual void OnAnimationUpdate(float progress);
virtual void OnAnimationStop(bool aborted);
virtual void OnAnimationStart() override;
virtual void OnAnimationUpdate(float progress) override;
virtual void OnAnimationStop(bool aborted) override;
private:
float m_src_opacity;
float m_dst_opacity;
Expand Down Expand Up @@ -69,9 +69,9 @@ class TBWidgetAnimationRect : public TBWidgetAnimationObject
rectangle and a delta. The reference rectangle will be taken from
the target widget on the first OnAnimationUpdate. */
TBWidgetAnimationRect(TBWidget *widget, const TBRect &delta_rect, MODE mode);
virtual void OnAnimationStart();
virtual void OnAnimationUpdate(float progress);
virtual void OnAnimationStop(bool aborted);
virtual void OnAnimationStart() override;
virtual void OnAnimationUpdate(float progress) override;
virtual void OnAnimationStop(bool aborted) override;
private:
TBRect m_src_rect;
TBRect m_dst_rect;
Expand All @@ -82,6 +82,7 @@ class TBWidgetAnimationRect : public TBWidgetAnimationObject
class TBWidgetsAnimationManager : public TBWidgetListener
{
public:
virtual ~TBWidgetsAnimationManager() {}
/** Init the widgets animation manager. */
static void Init();

Expand All @@ -98,10 +99,10 @@ class TBWidgetsAnimationManager : public TBWidgetListener

private:
// == TBWidgetListener ==================
virtual void OnWidgetDelete(TBWidget *widget);
virtual bool OnWidgetDying(TBWidget *widget);
virtual void OnWidgetAdded(TBWidget *parent, TBWidget *child);
virtual void OnWidgetRemove(TBWidget *parent, TBWidget *child);
virtual void OnWidgetDelete(TBWidget *widget) override;
virtual bool OnWidgetDying(TBWidget *widget) override;
virtual void OnWidgetAdded(TBWidget *parent, TBWidget *child) override;
virtual void OnWidgetRemove(TBWidget *parent, TBWidget *child) override;
};

} // namespace tb
Expand Down
6 changes: 3 additions & 3 deletions src/tb/image/tb_image_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class TBImageWidget : public TBWidget
void SetImage(const TBImage &image) { m_image = image; }
void SetImage(const char *filename) { m_image = g_image_manager->GetImage(filename); }

virtual PreferredSize OnCalculatePreferredContentSize(const SizeConstraints &constraints);
virtual PreferredSize OnCalculatePreferredContentSize(const SizeConstraints &constraints) override;

virtual void OnInflate(const INFLATE_INFO &info);
virtual void OnPaint(const PaintProps &paint_props);
virtual void OnInflate(const INFLATE_INFO &info) override;
virtual void OnPaint(const PaintProps &paint_props) override;
private:
TBImage m_image;
};
Expand Down
60 changes: 30 additions & 30 deletions src/tb/tb_editfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class TBEditField : public TBWidget, private TBStyleEditListener, public TBMessa
"edit-type", matching those of EDIT_TYPE.
"multiline", matching 1 if multiline mode is enabled.
"readonly", matching 1 if readonly mode is enabled. */
virtual bool GetCustomSkinCondition(const TBSkinCondition::CONDITION_INFO &info);
virtual bool GetCustomSkinCondition(const TBSkinCondition::CONDITION_INFO &info) override;

/** Set which alignment the text should have if the space
given when painting is larger than the text.
Expand All @@ -138,8 +138,8 @@ class TBEditField : public TBWidget, private TBStyleEditListener, public TBMessa
void SetTextAlign(TB_TEXT_ALIGN align) { m_style_edit.SetAlign(align); }
TB_TEXT_ALIGN GetTextAlign() { return m_style_edit.align; }

virtual bool SetText(const char *text) { return m_style_edit.SetText(text, TB_CARET_POS_BEGINNING); }
virtual bool GetText(TBStr &text) { return m_style_edit.GetText(text); }
virtual bool SetText(const char *text) override { return m_style_edit.SetText(text, TB_CARET_POS_BEGINNING); }
virtual bool GetText(TBStr &text) override { return m_style_edit.GetText(text); }
using TBWidget::GetText; ///< Make all versions in base class available.

using TBWidget::Invalidate; ///< Make Invalidate in base class available.
Expand All @@ -157,23 +157,23 @@ class TBEditField : public TBWidget, private TBStyleEditListener, public TBMessa
virtual bool SetPlaceholderText(const char *text) { return m_placeholder.SetText(text); }
virtual bool GetPlaceholderText(TBStr &text) { return m_placeholder.GetText(text); }

virtual void ScrollTo(int x, int y);
virtual TBWidget::ScrollInfo GetScrollInfo();
virtual TBWidget *GetScrollRoot() { return &m_root; }
virtual void ScrollTo(int x, int y) override;
virtual TBWidget::ScrollInfo GetScrollInfo() override;
virtual TBWidget *GetScrollRoot() override { return &m_root; }

virtual bool OnEvent(const TBWidgetEvent &ev);
virtual void OnPaint(const PaintProps &paint_props);
virtual void OnPaintChildren(const PaintProps &paint_props);
virtual void OnInflate(const INFLATE_INFO &info);
virtual void OnAdded();
virtual void OnFontChanged();
virtual void OnFocusChanged(bool focused);
virtual void OnResized(int old_w, int old_h);
virtual TBWidget *GetContentRoot() { return &m_root; }
virtual bool OnEvent(const TBWidgetEvent &ev) override;
virtual void OnPaint(const PaintProps &paint_props) override;
virtual void OnPaintChildren(const PaintProps &paint_props) override;
virtual void OnInflate(const INFLATE_INFO &info) override;
virtual void OnAdded() override;
virtual void OnFontChanged() override;
virtual void OnFocusChanged(bool focused) override;
virtual void OnResized(int old_w, int old_h) override;
virtual TBWidget *GetContentRoot() override { return &m_root; }

virtual PreferredSize OnCalculatePreferredContentSize(const SizeConstraints &constraints);
virtual PreferredSize OnCalculatePreferredContentSize(const SizeConstraints &constraints) override;

virtual void OnMessageReceived(TBMessage *msg);
virtual void OnMessageReceived(TBMessage *msg) override;
private:
TBScrollBar m_scrollbar_x;
TBScrollBar m_scrollbar_y;
Expand All @@ -187,19 +187,19 @@ class TBEditField : public TBWidget, private TBStyleEditListener, public TBMessa
void UpdateScrollbarVisibility(bool multiline);

// == TBStyleEditListener =======================
virtual void OnChange();
virtual bool OnEnter();
virtual void Invalidate(const TBRect &rect);
virtual void DrawString(int32 x, int32 y, TBFontFace *font, const TBColor &color, const char *str, int32 len);
virtual void DrawRect(const TBRect &rect, const TBColor &color);
virtual void DrawRectFill(const TBRect &rect, const TBColor &color);
virtual void DrawTextSelectionBg(const TBRect &rect);
virtual void DrawContentSelectionFg(const TBRect &rect);
virtual void DrawCaret(const TBRect &rect);
virtual void Scroll(int32 dx, int32 dy);
virtual void UpdateScrollbars();
virtual void CaretBlinkStart();
virtual void CaretBlinkStop();
virtual void OnChange() override;
virtual bool OnEnter() override;
virtual void Invalidate(const TBRect &rect) override;
virtual void DrawString(int32 x, int32 y, TBFontFace *font, const TBColor &color, const char *str, int32 len) override;
virtual void DrawRect(const TBRect &rect, const TBColor &color) override;
virtual void DrawRectFill(const TBRect &rect, const TBColor &color) override;
virtual void DrawTextSelectionBg(const TBRect &rect) override;
virtual void DrawContentSelectionFg(const TBRect &rect) override;
virtual void DrawCaret(const TBRect &rect) override;
virtual void Scroll(int32 dx, int32 dy) override;
virtual void UpdateScrollbars() override;
virtual void CaretBlinkStart() override;
virtual void CaretBlinkStop() override;
};

} // namespace tb
Expand Down
2 changes: 1 addition & 1 deletion src/tb/tb_id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void TBID::Set(const TBID &newid)
{
// If this happens, 2 different strings result in the same hash.
// It might be a good idea to change one of them, but it might not matter.
assert(other_id->debug_string.Equals(debug_string));
//assert(other_id->debug_string.Equals(debug_string));
}
else
{
Expand Down
14 changes: 7 additions & 7 deletions src/tb/tb_inline_select.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ class TBInlineSelect : public TBWidget
~TBInlineSelect();

/** Set along which axis the content should layouted. */
virtual void SetAxis(AXIS axis) { m_layout.SetAxis(axis); }
virtual AXIS GetAxis() const { return m_layout.GetAxis(); }
virtual void SetAxis(AXIS axis) override { m_layout.SetAxis(axis); }
virtual AXIS GetAxis() const override { return m_layout.GetAxis(); }

void SetLimits(int min, int max);
int GetMinValue() const { return m_min; }
int GetMaxValue() const { return m_max; }

virtual void SetValue(int value) { SetValueInternal(value, true); }
virtual int GetValue() { return m_value; }
virtual void SetValue(int value) override { SetValueInternal(value, true); }
virtual int GetValue() override { return m_value; }

virtual void OnInflate(const INFLATE_INFO &info);
virtual void OnSkinChanged();
virtual bool OnEvent(const TBWidgetEvent &ev);
virtual void OnInflate(const INFLATE_INFO &info) override;
virtual void OnSkinChanged() override;
virtual bool OnEvent(const TBWidgetEvent &ev) override;
protected:
TBButton m_buttons[2];
TBLayout m_layout;
Expand Down
26 changes: 13 additions & 13 deletions src/tb/tb_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ class TBLayout : public TBWidget
TBLayout(AXIS axis = AXIS_X);

/** Set along which axis the content should be layouted */
virtual void SetAxis(AXIS axis);
virtual AXIS GetAxis() const { return m_axis; }
virtual void SetAxis(AXIS axis) override;
virtual AXIS GetAxis() const override { return m_axis; }

/** Set the spacing between widgets in this layout. Setting the default (SPACING_FROM_SKIN)
will make it use the spacing specified in the skin. */
Expand Down Expand Up @@ -120,19 +120,19 @@ class TBLayout : public TBWidget
from bottom to top (default creation order). */
void SetLayoutOrder(LAYOUT_ORDER order);

virtual void InvalidateLayout(INVALIDATE_LAYOUT il);
virtual void InvalidateLayout(INVALIDATE_LAYOUT il) override;

virtual PreferredSize OnCalculatePreferredContentSize(const SizeConstraints &constraints);
virtual PreferredSize OnCalculatePreferredContentSize(const SizeConstraints &constraints) override;

virtual void OnInflate(const INFLATE_INFO &info);
virtual bool OnEvent(const TBWidgetEvent &ev);
virtual void OnPaintChildren(const PaintProps &paint_props);
virtual void OnProcess();
virtual void OnResized(int old_w, int old_h);
virtual void OnInflateChild(TBWidget *child);
virtual void GetChildTranslation(int &x, int &y) const;
virtual void ScrollTo(int x, int y);
virtual TBWidget::ScrollInfo GetScrollInfo();
virtual void OnInflate(const INFLATE_INFO &info) override;
virtual bool OnEvent(const TBWidgetEvent &ev) override;
virtual void OnPaintChildren(const PaintProps &paint_props) override;
virtual void OnProcess() override;
virtual void OnResized(int old_w, int old_h) override;
virtual void OnInflateChild(TBWidget *child) override;
virtual void GetChildTranslation(int &x, int &y) const override;
virtual void ScrollTo(int x, int y) override;
virtual TBWidget::ScrollInfo GetScrollInfo() override;
protected:
AXIS m_axis;
int m_spacing;
Expand Down
2 changes: 1 addition & 1 deletion src/tb/tb_menu_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TBMenuWindow : public TBPopupWindow

TBSelectList *GetList() { return &m_select_list; }

virtual bool OnEvent(const TBWidgetEvent &ev);
virtual bool OnEvent(const TBWidgetEvent &ev) override;
private:
TBSelectList m_select_list;
};
Expand Down
10 changes: 5 additions & 5 deletions src/tb/tb_message_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ class TBMessageWindow : public TBWindow, private TBWidgetListener

bool Show(const char *title, const char *message, TBMessageWindowSettings *settings = nullptr);

virtual TBWidget *GetEventDestination() { return m_target.Get(); }
virtual TBWidget *GetEventDestination() override { return m_target.Get(); }

virtual bool OnEvent(const TBWidgetEvent &ev);
virtual void OnDie();
virtual bool OnEvent(const TBWidgetEvent &ev) override;
virtual void OnDie() override;
private:
void AddButton(TBID id, bool focused);
// TBWidgetListener
virtual void OnWidgetDelete(TBWidget *widget);
virtual bool OnWidgetDying(TBWidget *widget);
virtual void OnWidgetDelete(TBWidget *widget) override;
virtual bool OnWidgetDying(TBWidget *widget) override;
TBWidgetSafePointer m_dimmer;
TBWidgetSafePointer m_target;
};
Expand Down
12 changes: 6 additions & 6 deletions src/tb/tb_popup_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ class TBPopupWindow : public TBWindow, private TBWidgetListener

bool Show(const TBPopupAlignment &alignment);

virtual TBWidget *GetEventDestination() { return m_target.Get(); }
virtual TBWidget *GetEventDestination() override { return m_target.Get(); }

virtual bool OnEvent(const TBWidgetEvent &ev);
virtual bool OnEvent(const TBWidgetEvent &ev) override;
private:
TBWidgetSafePointer m_target;
// TBWidgetListener
virtual void OnWidgetFocusChanged(TBWidget *widget, bool focused);
virtual bool OnWidgetInvokeEvent(TBWidget *widget, const TBWidgetEvent &ev);
virtual void OnWidgetDelete(TBWidget *widget);
virtual bool OnWidgetDying(TBWidget *widget);
virtual void OnWidgetFocusChanged(TBWidget *widget, bool focused) override;
virtual bool OnWidgetInvokeEvent(TBWidget *widget, const TBWidgetEvent &ev) override;
virtual void OnWidgetDelete(TBWidget *widget) override;
virtual bool OnWidgetDying(TBWidget *widget) override;
};

} // namespace tb
Expand Down
26 changes: 13 additions & 13 deletions src/tb/tb_scroll_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class TBScrollContainerRoot : public TBWidget
friend class TBScrollContainer;
TBScrollContainerRoot() {}
public:
virtual void OnPaintChildren(const PaintProps &paint_props);
virtual void GetChildTranslation(int &x, int &y) const;
virtual void OnPaintChildren(const PaintProps &paint_props) override;
virtual void GetChildTranslation(int &x, int &y) const override;
};

/** TBScrollBarVisibility - Helper for TBScrollContainer or any other scrollable
Expand Down Expand Up @@ -72,21 +72,21 @@ friend class TBScrollContainerRoot;
void SetScrollMode(SCROLL_MODE mode);
SCROLL_MODE GetScrollMode() { return m_mode; }

virtual void ScrollTo(int x, int y);
virtual TBWidget::ScrollInfo GetScrollInfo();
virtual TBWidget *GetScrollRoot() { return &m_root; }
virtual void ScrollTo(int x, int y) override;
virtual TBWidget::ScrollInfo GetScrollInfo() override;
virtual TBWidget *GetScrollRoot() override { return &m_root; }

virtual void InvalidateLayout(INVALIDATE_LAYOUT il);
virtual void InvalidateLayout(INVALIDATE_LAYOUT il) override;

virtual TBRect GetPaddingRect();
virtual PreferredSize OnCalculatePreferredContentSize(const SizeConstraints &constraints);
virtual TBRect GetPaddingRect() override;
virtual PreferredSize OnCalculatePreferredContentSize(const SizeConstraints &constraints) override;

virtual void OnInflate(const INFLATE_INFO &info);
virtual bool OnEvent(const TBWidgetEvent &ev);
virtual void OnProcess();
virtual void OnResized(int old_w, int old_h);
virtual void OnInflate(const INFLATE_INFO &info) override;
virtual bool OnEvent(const TBWidgetEvent &ev) override;
virtual void OnProcess() override;
virtual void OnResized(int old_w, int old_h) override;

virtual TBWidget *GetContentRoot() { return &m_root; }
virtual TBWidget *GetContentRoot() override { return &m_root; }
protected:
TBScrollBar m_scrollbar_x;
TBScrollBar m_scrollbar_y;
Expand Down
Loading