From 368f74c4970629da9a0fe4b28d3f350dc29d9a42 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sat, 22 Sep 2018 03:20:58 +0200 Subject: [PATCH] Remove virtual call from constructor in FToggleButton::FToggleButton --- src/ftogglebutton.cpp | 10 ++++++++-- src/include/final/ftogglebutton.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ftogglebutton.cpp b/src/ftogglebutton.cpp index 59b1ba8d..b75b7108 100644 --- a/src/ftogglebutton.cpp +++ b/src/ftogglebutton.cpp @@ -64,8 +64,7 @@ FToggleButton::FToggleButton (const FString& txt, FWidget* parent) , focus_inside_group(true) , text() { - init(); - setText(txt); + init(txt); if ( parent && parent->isInstanceOf("FButtonGroup") ) { @@ -612,6 +611,13 @@ void FToggleButton::setGroup (FButtonGroup* btngroup) button_group = btngroup; } +//---------------------------------------------------------------------- +void FToggleButton::init (const FString& txt) +{ + setText(txt); + init(); +} + //---------------------------------------------------------------------- void FToggleButton::init() { diff --git a/src/include/final/ftogglebutton.h b/src/include/final/ftogglebutton.h index 953b9b0e..7ad6b54f 100644 --- a/src/include/final/ftogglebutton.h +++ b/src/include/final/ftogglebutton.h @@ -153,6 +153,7 @@ class FToggleButton : public FWidget void setGroup (FButtonGroup*); // Methods + void init (const FString&); void init(); int getHotkeyPos (wchar_t[], wchar_t[], uInt); void drawText (wchar_t[], int, uInt);