diff --git a/ui/UIButton.cpp b/ui/UIButton.cpp index d724d14f..a309343d 100644 --- a/ui/UIButton.cpp +++ b/ui/UIButton.cpp @@ -135,10 +135,6 @@ int UIButton::m_ButtonFont; // This is a simple 2 state button (push down or push up) // Buttons have properties of gadgets, plus bitmap information per state. -UIButton::UIButton() {} - -UIButton::~UIButton() {} - // if text = NULL, no text printed out. void UIButton::Create(UIWindow *parent, int id, UIItem *item, int x, int y, int w, int h, int flags) { if (item) { diff --git a/ui/UICombo.cpp b/ui/UICombo.cpp index 9c283222..a62c7ecc 100644 --- a/ui/UICombo.cpp +++ b/ui/UICombo.cpp @@ -45,10 +45,6 @@ // A listbox may contain text items, BUT only one will be visible // Allows the user to scroll through them too. -UIComboBox::UIComboBox() {} - -UIComboBox::~UIComboBox() {} - // creates a combo box void UIComboBox::Create(UIWindow *parent, int id, int x, int y, int w, int h, int flags) { m_ItemList = NULL; diff --git a/ui/UIConsole.cpp b/ui/UIConsole.cpp index 13e95cc8..bd0fe29b 100644 --- a/ui/UIConsole.cpp +++ b/ui/UIConsole.cpp @@ -70,10 +70,6 @@ // int m_ConsoleFont; // standard font for text in console // char *m_ConsoleBuffer; // text buffer of console. -UIConsoleGadget::UIConsoleGadget() {} - -UIConsoleGadget::~UIConsoleGadget() {} - // font = console font, NOT GADGET FONT. This font is used to proportion window void UIConsoleGadget::Create(UIWindow *parent, int id, int x, int y, int font, int cols, int rows, int flags) { int cw, ch, w, h; @@ -266,10 +262,6 @@ void UIConsoleGadget::Scroll() { // int m_ConsoleFont; // standard font for text in console // char *m_ConsoleBuffer; // text buffer of console. -UIConsole::UIConsole() {} - -UIConsole::~UIConsole() {} - // font = console font, NOT GADGET FONT. This font is used to proportion window void UIConsole::Create(int x, int y, int font, int cols, int rows) { UIWindow::Create(x, y, 10, 10); diff --git a/ui/UIEdit.cpp b/ui/UIEdit.cpp index d34ecfc6..85321b89 100644 --- a/ui/UIEdit.cpp +++ b/ui/UIEdit.cpp @@ -149,10 +149,6 @@ static UIEdit *UI_current_editbox = NULL; // UIEdit // A single line edit control. -UIEdit::UIEdit() {} - -UIEdit::~UIEdit() {} - void UIEdit::Create(UIWindow *parent, int id, int x, int y, int w, int h, int flags) { m_BufSize = 32; m_TextBuf = (char *)mem_malloc(m_BufSize + 1); diff --git a/ui/UIGadget.cpp b/ui/UIGadget.cpp index ff896785..82a54d14 100644 --- a/ui/UIGadget.cpp +++ b/ui/UIGadget.cpp @@ -127,10 +127,6 @@ int UIGadget::m_LastKey = 0; int UIGadget::m_LastKeyCount = 0; float UIGadget::m_LastKeyTime = 0.0f; -UIGadget::UIGadget() : UIObject() {} - -UIGadget::~UIGadget() {} - // ALL Gadgets must have a parent. void UIGadget::Create(UIWindow *wnd, int id, int x, int y, int w, int h, int flags) { ASSERT(!IsCreated()); diff --git a/ui/UIGroup.cpp b/ui/UIGroup.cpp index 83c6d856..1ca21c52 100644 --- a/ui/UIGroup.cpp +++ b/ui/UIGroup.cpp @@ -55,10 +55,6 @@ // UIGroup // Draws a group box on to the window -UIGroup::UIGroup() {} - -UIGroup::~UIGroup() {} - void UIGroup::Create(UIWindow *parent, char *label, int x, int y, int w, int h, ddgr_color label_color, ddgr_color box_color, int flags) { ASSERT(parent); diff --git a/ui/UIHotspot.cpp b/ui/UIHotspot.cpp index 00432ca3..80e7d1da 100644 --- a/ui/UIHotspot.cpp +++ b/ui/UIHotspot.cpp @@ -85,10 +85,6 @@ // This is simply a region within the parent window that when clicked on // or key pressed, does something. -UIHotspot::UIHotspot() {} - -UIHotspot::~UIHotspot() {} - // optional key, when pressed, triggers hotspot. void UIHotspot::Create(UIWindow *wnd, int id, int key, UIItem *itemoff, UIItem *itemon, int x, int y, int w, int h, int flags) { diff --git a/ui/UIListBox.cpp b/ui/UIListBox.cpp index f78f189f..6db8e369 100644 --- a/ui/UIListBox.cpp +++ b/ui/UIListBox.cpp @@ -168,10 +168,6 @@ // Construction and destruction -UIListBox::UIListBox() {} - -UIListBox::~UIListBox() {} - void UIListBox::Create(UIWindow *parent, int id, int x, int y, int w, int h, int flags) { m_NumItems = 0; m_ItemList = NULL; diff --git a/ui/UIObject.cpp b/ui/UIObject.cpp index 30532f03..524a932c 100644 --- a/ui/UIObject.cpp +++ b/ui/UIObject.cpp @@ -42,10 +42,6 @@ #include "log.h" #include "pserror.h" -UIObject::UIObject() {} - -UIObject::~UIObject() {} - // obj = NULL, then this object has no parent: it is an independent entity. void UIObject::Create(int x, int y, int w, int h) { ASSERT(!m_Created); diff --git a/ui/UISlider.cpp b/ui/UISlider.cpp index 8b1b7a4d..0fb527a5 100644 --- a/ui/UISlider.cpp +++ b/ui/UISlider.cpp @@ -66,10 +66,6 @@ // Construction and destruction -UISlider::UISlider() {} - -UISlider::~UISlider() {} - #define SLIDER_BUTTON_WIDTH (switch_item->width() ? switch_item->width() : 16) #define SLIDER_BUTTON_HEIGHT (switch_item->height() ? switch_item->height() : 16) diff --git a/ui/UIStatic.cpp b/ui/UIStatic.cpp index 0162c697..65a22425 100644 --- a/ui/UIStatic.cpp +++ b/ui/UIStatic.cpp @@ -87,10 +87,6 @@ void UIText::OnFormat() { UIGadget::OnFormat(); } -UIStatic::UIStatic() {} - -UIStatic::~UIStatic() {} - void UIStatic::Create(UIWindow *parent, UIItem *item, int x, int y, int w, int h, int flags) { m_Background = NULL; if (item) diff --git a/ui/UIWindow.cpp b/ui/UIWindow.cpp index f67611ae..e147916e 100644 --- a/ui/UIWindow.cpp +++ b/ui/UIWindow.cpp @@ -686,10 +686,6 @@ void UIWindow::ResetAcceleratorKey() { m_naccels = 0; } // ---------------------------------------------------------------------------- // UITitledWindow class -UITitledWindow::UITitledWindow() {} - -UITitledWindow::~UITitledWindow() {} - void UITitledWindow::Create(UITextItem &title, int x, int y, int w, int h) { m_Title = title; m_BorderThickness = 2; diff --git a/ui/ui.h b/ui/ui.h index c7573532..b4a5158f 100644 --- a/ui/ui.h +++ b/ui/ui.h @@ -303,8 +303,7 @@ protected: int m_W = 0, m_H = 0; // Dimensions of the UIObject public: - UIObject(); - virtual ~UIObject(); + virtual ~UIObject() = default; void Create(int x, int y, int w, int h); // define the ui object. void Destroy() { m_Created = false; }; @@ -449,9 +448,6 @@ public: virtual void OnNotify(UIGadget *){}; // usually called by a child gadget of a gadget. public: - UIGadget(); - virtual ~UIGadget(); - UIWindow *GetWindow() { // returns the parent window for a gadget. return m_Wnd; }; @@ -512,9 +508,6 @@ protected: virtual void OnDestroy(); // override: behavior when gadget is destroyed. public: - UIHotspot(); - virtual ~UIHotspot(); - // optional key, when pressed, triggers hotspot. void Create(UIWindow *wnd, int id, int key, UIItem *itemoff, UIItem *itemon, int x, int y, int w, int h, int flags = 0); @@ -563,9 +556,6 @@ public: }; public: - UIButton(); - virtual ~UIButton(); - void Create(UIWindow *parent, int id, UIItem *title, int x, int y, int w, int h, int flags = 0); virtual tUIClass Class() const { // Overide this function to name the class @@ -668,9 +658,6 @@ protected: UIItem *m_Title = nullptr; public: - UIStatic(); - virtual ~UIStatic(); - void Create(UIWindow *parent, UIItem *item, int x, int y, int w, int h, int flags = 0); void SetBackground(UIPrimativeItem *prim); void SetTitle(UIItem *item); @@ -718,8 +705,6 @@ protected: class UIGroup final : public UIStatic { public: - UIGroup(); - ~UIGroup(); void Create(UIWindow *parent, char *label, int x, int y, int w, int h, ddgr_color label_color = GR_WHITE, ddgr_color box_color = GR_WHITE, int flags = 0); @@ -776,9 +761,6 @@ protected: virtual void OnDestroy(); // override: behavior when gadget is destroyed. public: - UIEdit(); - virtual ~UIEdit(); - void Create(UIWindow *parent, int id, int x, int y, int w, int h, int flags = 0); // settings @@ -813,9 +795,6 @@ class UISlider : public UIGadget { UIItem *slider_item = nullptr; // slider item public: - UISlider(); - virtual ~UISlider(); - void Create(UIWindow *parent, int id, int x, int y, int w, int h, int flags = 0); // sets visual characteristics of slider. @@ -884,9 +863,6 @@ protected: int m_CX, m_CY, m_CX2, m_CY2; // clipping text. public: - UIListBox(); - virtual ~UIListBox(); - void Create(UIWindow *parent, int id, int x, int y, int w, int h, int flags = 0); virtual tUIClass Class() const { // Overide this function to name the class @@ -951,9 +927,6 @@ public: class UIComboBox : public UIGadget { public: - UIComboBox(); - virtual ~UIComboBox(); - void Create(UIWindow *parent, int id, int x, int y, int w, int h, int flags = 0); private: @@ -1022,9 +995,6 @@ protected: virtual void OnDestroy(); // behavior when gadget is destroyed. public: - UIConsoleGadget(); - virtual ~UIConsoleGadget(); - // font = console font, NOT GADGET FONT. This font is used to proportion window void Create(UIWindow *parent, int id, int x, int y, int font, int cols, int rows, int flags = UIF_BORDER); @@ -1149,9 +1119,6 @@ class UITitledWindow final : public UIWindow { int m_BorderThickness; // border thickness. public: - UITitledWindow(); - virtual ~UITitledWindow(); - void Create(UITextItem &title, int x, int y, int w, int h); // class id @@ -1187,9 +1154,6 @@ protected: virtual void OnDraw(); public: - UIConsole(); - virtual ~UIConsole(); - // font = console font, NOT GADGET FONT. This font is used to proportion window void Create(int x, int y, int font, int cols, int rows); void Destroy(); diff --git a/ui/uires.h b/ui/uires.h index 8f6af0a1..bd5372ea 100644 --- a/ui/uires.h +++ b/ui/uires.h @@ -99,8 +99,7 @@ enum tUIDrawClass { uiDrawNormal, uiDrawAlphaSaturate, uiDrawFaded }; class UIItem { public: - UIItem(){}; - virtual ~UIItem(){}; + virtual ~UIItem() = default; // if returns false, then it didn't draw. virtual bool draw(int x, int y, tUIDrawClass draw_class = uiDrawNormal) { return false; }; @@ -235,7 +234,7 @@ public: m_IsChunked = false; m_Bitmap.handle = bm_handle; }; - virtual ~UIBitmapItem(){}; + virtual ~UIBitmapItem() = default; // if returns false, then it didn't draw. virtual bool draw(int x, int y, tUIDrawClass draw_class = uiDrawNormal);