Final updates for default initialization.

The debugger is crashing, so now the debugging begins :)
This commit is contained in:
Stephen Anthony 2019-12-29 20:12:37 -03:30
parent 54de3415ea
commit 3e3b9b3d50
86 changed files with 534 additions and 693 deletions

View File

@ -25,10 +25,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AboutDialog::AboutDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font)
: Dialog(osystem, parent, font, "About Stella"),
myPage(1),
myNumPages(4),
myLinesPerPage(13)
: Dialog(osystem, parent, font, "About Stella")
{
const int lineHeight = font.getLineHeight(),
fontWidth = font.getMaxCharWidth(),

View File

@ -41,16 +41,16 @@ class AboutDialog : public Dialog
void loadConfig() override { displayInfo(); }
private:
ButtonWidget* myNextButton;
ButtonWidget* myPrevButton;
ButtonWidget* myNextButton{nullptr};
ButtonWidget* myPrevButton{nullptr};
StaticTextWidget* myTitle;
vector<StaticTextWidget*> myDesc;
StaticTextWidget* myTitle{nullptr};
vector<StaticTextWidget*> myDesc{nullptr};
vector<string> myDescStr;
int myPage;
int myNumPages;
int myLinesPerPage;
int myPage{1};
int myNumPages{4};
int myLinesPerPage{13};
private:
// Following constructors and assignment operators not supported

View File

@ -54,16 +54,16 @@ class AudioDialog : public Dialog
kBufferSizeChanged = 'ADbc'
};
CheckboxWidget* mySoundEnableCheckbox;
SliderWidget* myVolumeSlider;
CheckboxWidget* myStereoSoundCheckbox;
PopUpWidget* myModePopup;
PopUpWidget* myFragsizePopup;
PopUpWidget* myFreqPopup;
PopUpWidget* myResamplingPopup;
SliderWidget* myHeadroomSlider;
SliderWidget* myBufferSizeSlider;
SliderWidget* myDpcPitch;
CheckboxWidget* mySoundEnableCheckbox{nullptr};
SliderWidget* myVolumeSlider{nullptr};
CheckboxWidget* myStereoSoundCheckbox{nullptr};
PopUpWidget* myModePopup{nullptr};
PopUpWidget* myFragsizePopup{nullptr};
PopUpWidget* myFreqPopup{nullptr};
PopUpWidget* myResamplingPopup{nullptr};
SliderWidget* myHeadroomSlider{nullptr};
SliderWidget* myBufferSizeSlider{nullptr};
SliderWidget* myDpcPitch{nullptr};
private:
// Following constructors and assignment operators not supported

View File

@ -35,9 +35,7 @@
BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font,
int max_w, int max_h, const string& title)
: Dialog(boss->instance(), boss->parent(), font, title),
CommandSender(boss),
_cmd(0),
_mode(FileSave)
CommandSender(boss)
{
// Set real dimensions
_w = max_w;

View File

@ -61,16 +61,16 @@ class BrowserDialog : public Dialog, public CommandSender
kBaseDirCmd = 'BADR'
};
int _cmd;
int _cmd{0};
FileListWidget* _fileList;
EditTextWidget* _currentPath;
StaticTextWidget* _type;
EditTextWidget* _selected;
ButtonWidget* _goUpButton;
ButtonWidget* _basedirButton;
FileListWidget* _fileList{nullptr};
EditTextWidget* _currentPath{nullptr};
StaticTextWidget* _type{nullptr};
EditTextWidget* _selected{nullptr};
ButtonWidget* _goUpButton{nullptr};
ButtonWidget* _basedirButton{nullptr};
BrowserDialog::ListMode _mode;
BrowserDialog::ListMode _mode{Directories};
private:
// Following constructors and assignment operators not supported

View File

@ -28,9 +28,7 @@ ColorWidget::ColorWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, int cmd)
: Widget(boss, font, x, y, w, h),
CommandSender(boss),
_color(kNone),
_cmd(cmd),
_crossGrid(false)
_cmd(cmd)
{
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS;
}

View File

@ -48,10 +48,10 @@ class ColorWidget : public Widget, public CommandSender
void drawWidget(bool hilite) override;
protected:
ColorId _color;
int _cmd;
ColorId _color{kNone};
int _cmd{0};
bool _crossGrid;
bool _crossGrid{false};
private:
// Following constructors and assignment operators not supported

View File

@ -29,8 +29,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font,
const VariantList& combolist)
: Dialog(boss->instance(), boss->parent(), font, "Add..."),
myComboEvent(Event::NoType)
: Dialog(boss->instance(), boss->parent(), font, "Add...")
{
const int lineHeight = font.getLineHeight(),
fontWidth = font.getMaxCharWidth();

View File

@ -43,8 +43,8 @@ class ComboDialog : public Dialog
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
private:
Event::Type myComboEvent;
std::array<PopUpWidget*, 8> myEvents;
Event::Type myComboEvent{Event::NoType};
std::array<PopUpWidget*, 8> myEvents{nullptr};
private:
// Following constructors and assignment operators not supported

View File

@ -62,7 +62,7 @@ class CommandSender
}
protected:
CommandReceiver* _target;
CommandReceiver* _target{nullptr};
};
#endif

View File

@ -40,19 +40,19 @@ class CommandDialog : public Dialog
void processCancel() override;
// column 0
ButtonWidget* myColorButton;
ButtonWidget* myLeftDiffButton;
ButtonWidget* myRightDiffButton;
ButtonWidget* myColorButton{nullptr};
ButtonWidget* myLeftDiffButton{nullptr};
ButtonWidget* myRightDiffButton{nullptr};
// column 1
ButtonWidget* mySaveStateButton;
ButtonWidget* myStateSlotButton;
ButtonWidget* myLoadStateButton;
ButtonWidget* myTimeMachineButton;
ButtonWidget* mySaveStateButton{nullptr};
ButtonWidget* myStateSlotButton{nullptr};
ButtonWidget* myLoadStateButton{nullptr};
ButtonWidget* myTimeMachineButton{nullptr};
// column 2
ButtonWidget* myTVFormatButton;
ButtonWidget* myPaletteButton;
ButtonWidget* myPhosphorButton;
ButtonWidget* mySoundButton;
ButtonWidget* myTVFormatButton{nullptr};
ButtonWidget* myPaletteButton{nullptr};
ButtonWidget* myPhosphorButton{nullptr};
ButtonWidget* mySoundButton{nullptr};
enum {
kSelectCmd = 'Csel',

View File

@ -22,8 +22,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandMenu::CommandMenu(OSystem& osystem)
: DialogContainer(osystem),
myBaseDialog(nullptr)
: DialogContainer(osystem)
{
if (osystem.settings().getBool("minimal_ui"))
myBaseDialog = new MinUICommandDialog(myOSystem, *this);

View File

@ -43,7 +43,7 @@ class CommandMenu : public DialogContainer
Dialog* baseDialog() override;
private:
Dialog* myBaseDialog;
Dialog* myBaseDialog{nullptr};
private:
// Following constructors and assignment operators not supported

View File

@ -31,17 +31,7 @@ ContextMenu::ContextMenu(GuiObject* boss, const GUI::Font& font,
: Dialog(boss->instance(), boss->parent(), font),
CommandSender(boss),
_rowHeight(font.getLineHeight()),
_firstEntry(0),
_numEntries(0),
_selectedOffset(0),
_selectedItem(-1),
_showScroll(false),
_isScrolling(false),
_scrollUpColor(kColor),
_scrollDnColor(kColor),
_cmd(cmd),
_xorig(0),
_yorig(0),
_maxWidth(width)
{
addItems(items);

View File

@ -113,17 +113,17 @@ class ContextMenu : public Dialog, public CommandSender
private:
VariantList _entries;
int _rowHeight;
int _firstEntry, _numEntries;
int _selectedOffset, _selectedItem;
bool _showScroll;
bool _isScrolling;
ColorId _scrollUpColor, _scrollDnColor;
int _rowHeight{0};
int _firstEntry{0}, _numEntries{0};
int _selectedOffset{0}, _selectedItem{-1};
bool _showScroll{false};
bool _isScrolling{false};
ColorId _scrollUpColor{kColor}, _scrollDnColor{kColor};
int _cmd;
int _cmd{0};
uInt32 _xorig, _yorig;
uInt32 _maxWidth;
uInt32 _xorig{0}, _yorig{0};
uInt32 _maxWidth{0};
private:
// Following constructors and assignment operators not supported

View File

@ -86,64 +86,64 @@ class DeveloperDialog : public Dialog
static const int DEBUG_COLORS = 6;
TabWidget* myTab;
TabWidget* myTab{nullptr};
// Emulator widgets
RadioButtonGroup* mySettingsGroupEmulation;
CheckboxWidget* myFrameStatsWidget;
PopUpWidget* myConsoleWidget;
StaticTextWidget* myLoadingROMLabel;
CheckboxWidget* myRandomBankWidget;
CheckboxWidget* myRandomizeRAMWidget;
StaticTextWidget* myRandomizeCPULabel;
CheckboxWidget* myUndrivenPinsWidget;
std::array<CheckboxWidget*, 5> myRandomizeCPUWidget;
RadioButtonGroup* mySettingsGroupEmulation{nullptr};
CheckboxWidget* myFrameStatsWidget{nullptr};
PopUpWidget* myConsoleWidget{nullptr};
StaticTextWidget* myLoadingROMLabel{nullptr};
CheckboxWidget* myRandomBankWidget{nullptr};
CheckboxWidget* myRandomizeRAMWidget{nullptr};
StaticTextWidget* myRandomizeCPULabel{nullptr};
CheckboxWidget* myUndrivenPinsWidget{nullptr};
std::array<CheckboxWidget*, 5> myRandomizeCPUWidget{nullptr};
#ifdef DEBUGGER_SUPPORT
CheckboxWidget* myRWPortBreakWidget;
CheckboxWidget* myWRPortBreakWidget;
CheckboxWidget* myRWPortBreakWidget{nullptr};
CheckboxWidget* myWRPortBreakWidget{nullptr};
#endif
CheckboxWidget* myThumbExceptionWidget;
CheckboxWidget* myEEPROMAccessWidget;
CheckboxWidget* myThumbExceptionWidget{nullptr};
CheckboxWidget* myEEPROMAccessWidget{nullptr};
// TIA widgets
RadioButtonGroup* mySettingsGroupTia;
PopUpWidget* myTIATypeWidget;
StaticTextWidget* myInvPhaseLabel;
CheckboxWidget* myPlInvPhaseWidget;
CheckboxWidget* myMsInvPhaseWidget;
CheckboxWidget* myBlInvPhaseWidget;
StaticTextWidget* myPlayfieldLabel;
CheckboxWidget* myPFBitsWidget;
CheckboxWidget* myPFColorWidget;
StaticTextWidget* mySwapLabel;
CheckboxWidget* myPlSwapWidget;
CheckboxWidget* myBlSwapWidget;
RadioButtonGroup* mySettingsGroupTia{nullptr};
PopUpWidget* myTIATypeWidget{nullptr};
StaticTextWidget* myInvPhaseLabel{nullptr};
CheckboxWidget* myPlInvPhaseWidget{nullptr};
CheckboxWidget* myMsInvPhaseWidget{nullptr};
CheckboxWidget* myBlInvPhaseWidget{nullptr};
StaticTextWidget* myPlayfieldLabel{nullptr};
CheckboxWidget* myPFBitsWidget{nullptr};
CheckboxWidget* myPFColorWidget{nullptr};
StaticTextWidget* mySwapLabel{nullptr};
CheckboxWidget* myPlSwapWidget{nullptr};
CheckboxWidget* myBlSwapWidget{nullptr};
// Video widgets
RadioButtonGroup* mySettingsGroupVideo;
CheckboxWidget* myTVJitterWidget;
SliderWidget* myTVJitterRecWidget;
StaticTextWidget* myTVJitterRecLabelWidget;
CheckboxWidget* myColorLossWidget;
CheckboxWidget* myDebugColorsWidget;
std::array<PopUpWidget*, DEBUG_COLORS> myDbgColour;
std::array<ColorWidget*, DEBUG_COLORS> myDbgColourSwatch;
RadioButtonGroup* mySettingsGroupVideo{nullptr};
CheckboxWidget* myTVJitterWidget{nullptr};
SliderWidget* myTVJitterRecWidget{nullptr};
StaticTextWidget* myTVJitterRecLabelWidget{nullptr};
CheckboxWidget* myColorLossWidget{nullptr};
CheckboxWidget* myDebugColorsWidget{nullptr};
std::array<PopUpWidget*, DEBUG_COLORS> myDbgColour{nullptr};
std::array<ColorWidget*, DEBUG_COLORS> myDbgColourSwatch{nullptr};
// States widgets
RadioButtonGroup* mySettingsGroupTM;
CheckboxWidget* myTimeMachineWidget;
SliderWidget* myStateSizeWidget;
SliderWidget* myUncompressedWidget;
PopUpWidget* myStateIntervalWidget;
PopUpWidget* myStateHorizonWidget;
RadioButtonGroup* mySaveOnExitGroup;
RadioButtonGroup* mySettingsGroupTM{nullptr};
CheckboxWidget* myTimeMachineWidget{nullptr};
SliderWidget* myStateSizeWidget{nullptr};
SliderWidget* myUncompressedWidget{nullptr};
PopUpWidget* myStateIntervalWidget{nullptr};
PopUpWidget* myStateHorizonWidget{nullptr};
RadioButtonGroup* mySaveOnExitGroup{nullptr};
#ifdef DEBUGGER_SUPPORT
// Debugger UI widgets
SliderWidget* myDebuggerWidthSlider;
SliderWidget* myDebuggerHeightSlider;
PopUpWidget* myDebuggerFontSize;
PopUpWidget* myDebuggerFontStyle;
CheckboxWidget* myGhostReadsTrapWidget;
SliderWidget* myDebuggerWidthSlider{nullptr};
SliderWidget* myDebuggerHeightSlider{nullptr};
PopUpWidget* myDebuggerFontSize{nullptr};
PopUpWidget* myDebuggerFontStyle{nullptr};
CheckboxWidget* myGhostReadsTrapWidget{nullptr};
#endif
bool mySettings;

View File

@ -27,13 +27,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DialogContainer::DialogContainer(OSystem& osystem)
: myOSystem(osystem),
myTime(0),
myClickRepeatTime(0),
myButtonRepeatTime(0),
myButtonLongPressTime(0),
myAxisRepeatTime(0),
myHatRepeatTime(0)
: myOSystem(osystem)
{
_DOUBLE_CLICK_DELAY = osystem.settings().getInt("mdouble");
_REPEAT_INITIAL_DELAY = osystem.settings().getInt("ctrldelay");
@ -374,15 +368,12 @@ void DialogContainer::handleJoyHatEvent(int stick, int hat, JoyHatDir hdir, int
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DialogContainer::reset()
{
myCurrentMouseDown.b = MouseButton::NONE;
myLastClick.x = myLastClick.y = 0;
myLastClick.time = 0;
myLastClick.count = 0;
myCurrentMouseDown = { 0, 0, MouseButton::NONE };
myCurrentButtonDown = { -1, -1 };
myCurrentAxisDown = { -1, JoyAxis::NONE, JoyDir::NONE };
myCurrentHatDown = { -1, -1, JoyHatDir::CENTER };
myCurrentButtonDown.stick = myCurrentButtonDown.button = -1;
myCurrentAxisDown.stick = -1;
myCurrentAxisDown.axis = JoyAxis::NONE;
myCurrentHatDown.stick = myCurrentHatDown.hat = -1;
myLastClick = { 0, 0, 0, 0 };
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -183,7 +183,7 @@ class DialogContainer
private:
// Indicates the most current time (in milliseconds) as set by updateTime()
uInt64 myTime;
uInt64 myTime{0};
static uInt64 _DOUBLE_CLICK_DELAY;
static uInt64 _REPEAT_INITIAL_DELAY;
@ -193,41 +193,41 @@ class DialogContainer
// For continuous 'mouse down' events
struct {
int x;
int y;
MouseButton b;
int x{0};
int y{0};
MouseButton b{MouseButton::NONE};
} myCurrentMouseDown;
uInt64 myClickRepeatTime;
uInt64 myClickRepeatTime{0};
// For continuous 'joy button down' events
struct {
int stick;
int button;
int stick{-1};
int button{-1};
} myCurrentButtonDown;
uInt64 myButtonRepeatTime;
uInt64 myButtonLongPressTime;
uInt64 myButtonRepeatTime{0};
uInt64 myButtonLongPressTime{0};
// For continuous 'joy axis down' events
struct {
int stick;
JoyAxis axis;
JoyDir adir;
int stick{-1};
JoyAxis axis{JoyAxis::NONE};
JoyDir adir{JoyDir::NONE};
} myCurrentAxisDown;
uInt64 myAxisRepeatTime;
uInt64 myAxisRepeatTime{0};
// For continuous 'joy hat' events
struct {
int stick;
int hat;
JoyHatDir hdir;
int stick{-1};
int hat{-1};
JoyHatDir hdir{JoyHatDir::CENTER};
} myCurrentHatDown;
uInt64 myHatRepeatTime;
uInt64 myHatRepeatTime{0};
// Position and time of last mouse click (used to detect double clicks)
struct {
int x, y; // Position of mouse when the click occurred
int count; // How often was it already pressed?
uInt64 time; // Time
int x{0}, y{0}; // Position of mouse when the click occurred
int count{0}; // How often was it already pressed?
uInt64 time{0}; // Time
} myLastClick;
private:

View File

@ -24,8 +24,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EditTextWidget::EditTextWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, const string& text)
: EditableWidget(boss, font, x, y, w, h + 2, text),
_changed(false)
: EditableWidget(boss, font, x, y, w, h + 2, text)
{
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS;

View File

@ -48,7 +48,7 @@ class EditTextWidget : public EditableWidget
protected:
string _backupString;
bool _changed;
bool _changed{false};
private:
// Following constructors and assignment operators not supported

View File

@ -21,30 +21,23 @@
#include "Font.hxx"
#include "EditableWidget.hxx"
// Uncomment the following to give full-line copy/paste
// Note that this will be removed eventually, when we implement proper copy/paste
//#define PSEUDO_COPY_PASTE
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EditableWidget::EditableWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, const string& str)
: Widget(boss, font, x, y, w, h),
CommandSender(boss),
_editable(true),
_editString(str)
_editString(str),
_filter([](char c) { return isprint(c) && c != '\"'; })
{
_caretVisible = false;
_caretTime = 0;
_caretPos = 0;
_caretInverse = false;
_editScrollOffset = 0;
_bgcolor = kWidColor;
_bgcolorhi = kWidColor;
_bgcolorlo = kDlgColor;
_textcolor = kTextColor;
_textcolorhi = kTextColor;
// By default, include all printable chars except quotes
_filter = [](char c) { return isprint(c) && c != '\"'; };
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -455,13 +448,17 @@ bool EditableWidget::moveWord(int direction)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EditableWidget::copySelectedText()
{
// _clippedText = _editString;
#if defined(PSEUDO_COPY_PASTE)
_clippedText = _editString;
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EditableWidget::pasteSelectedText()
{
// _editString = _clippedText;
#if defined(PSEUDO_COPY_PASTE)
_editString = _clippedText;
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -95,17 +95,17 @@ class EditableWidget : public Widget, public CommandSender
bool tryInsertChar(char c, int pos);
private:
bool _editable;
bool _editable{true};
string _editString;
bool _caretVisible;
int _caretTime;
int _caretPos;
// bool _caretVisible{false};
// int _caretTime{0};
int _caretPos{0};
protected:
bool _caretInverse;
bool _caretInverse{false};
int _editScrollOffset;
int _editScrollOffset{0};
static string _clippedText;

View File

@ -40,21 +40,7 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font,
EventMode mode)
: Widget(boss, font, x, y, w, h),
CommandSender(boss),
myFilterPopup(nullptr),
myComboDialog(nullptr),
myEventMode(mode),
myEventGroup(Event::Group::Emulation),
myActionSelected(-1),
myRemapStatus(false),
myLastStick(0),
myLastHat(0),
myLastAxis(JoyAxis::NONE),
myLastDir(JoyDir::NONE),
myLastHatDir(JoyHatDir::CENTER),
myMod(0),
myLastKey(0),
myLastButton(JOY_CTRL_NONE),
myFirstTime(true)
myEventMode(mode)
{
const int fontHeight = font.getFontHeight(),
lineHeight = font.getLineHeight(),
@ -139,8 +125,6 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font,
VariantList combolist = instance().eventHandler().getComboList(mode);
myComboDialog = new ComboDialog(boss, font, combolist);
}
else
myComboButton = nullptr;
// Show message for currently selected event
xpos = HBORDER;

View File

@ -81,49 +81,49 @@ class EventMappingWidget : public Widget, public CommandSender
void enableButtons(bool state);
private:
ButtonWidget* myMapButton;
ButtonWidget* myCancelMapButton;
ButtonWidget* myEraseButton;
ButtonWidget* myResetButton;
ButtonWidget* myComboButton;
PopUpWidget* myFilterPopup;
StringListWidget* myActionsList;
EditTextWidget* myKeyMapping;
ButtonWidget* myMapButton{nullptr};
ButtonWidget* myCancelMapButton{nullptr};
ButtonWidget* myEraseButton{nullptr};
ButtonWidget* myResetButton{nullptr};
ButtonWidget* myComboButton{nullptr};
PopUpWidget* myFilterPopup{nullptr};
StringListWidget* myActionsList{nullptr};
EditTextWidget* myKeyMapping{nullptr};
ComboDialog* myComboDialog;
ComboDialog* myComboDialog{nullptr};
// Since this widget can be used for different collections of events,
// we need to specify exactly which group of events we are remapping
EventMode myEventMode;
EventMode myEventMode{EventMode::kEmulationMode};
// Since we can filter events, the event mode is not specific enough
Event::Group myEventGroup;
Event::Group myEventGroup{Event::Group::Emulation};
// Indicates the event that is currently selected
int myActionSelected;
int myActionSelected{-1};
// Indicates if we're currently in remap mode
// In this mode, the next event received is remapped to some action
bool myRemapStatus;
bool myRemapStatus{false};
// Joystick axes and hats can be more problematic than ordinary buttons
// or keys, in that there can be 'drift' in the values
// Therefore, we map these events when they've been 'released', rather
// than on their first occurrence (aka, when they're 'pressed')
// As a result, we need to keep track of their old values
int myLastStick, myLastHat;
JoyAxis myLastAxis;
JoyDir myLastDir;
JoyHatDir myLastHatDir;
int myLastStick{0}, myLastHat{0};
JoyAxis myLastAxis{JoyAxis::NONE};
JoyDir myLastDir{JoyDir::NONE};
JoyHatDir myLastHatDir{JoyHatDir::CENTER};
// Aggregates the modifier flags of the mapping
int myMod;
int myMod{0};
// Saves the last *pressed* key
int myLastKey;
int myLastKey{0};
// Saves the last *pressed* button
int myLastButton;
int myLastButton{JOY_CTRL_NONE};
bool myFirstTime;
bool myFirstTime{true};
private:
// Following constructors and assignment operators not supported

View File

@ -27,15 +27,10 @@
FileListWidget::FileListWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h)
: StringListWidget(boss, font, x, y, w, h),
_fsmode(FilesystemNode::ListMode::All),
_selected(0),
_quickSelectTime(0)
_filter([](const FilesystemNode& node) { return true; })
{
// This widget is special, in that it catches signals and redirects them
setTarget(this);
// By default, all filenames are valid
_filter = [](const FilesystemNode& node) { return true; };
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -92,16 +92,16 @@ class FileListWidget : public StringListWidget
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
private:
FilesystemNode::ListMode _fsmode;
FilesystemNode::ListMode _fsmode{FilesystemNode::ListMode::All};
FilesystemNode::NameFilter _filter;
FilesystemNode _node;
FSList _fileList;
Common::FixedStack<string> _history;
uInt32 _selected;
uInt32 _selected{0};
string _quickSelectStr;
uInt64 _quickSelectTime;
uInt64 _quickSelectTime{0};
static uInt64 _QUICK_SELECT_DELAY;
private:

View File

@ -58,49 +58,49 @@ class GameInfoDialog : public Dialog, public CommandSender
void eraseEEPROM();
private:
TabWidget* myTab;
TabWidget* myTab{nullptr};
// Emulation properties
PopUpWidget* myBSType;
StaticTextWidget* myTypeDetected;
StaticTextWidget* myStartBankLabel;
PopUpWidget* myStartBank;
PopUpWidget* myFormat;
StaticTextWidget* myFormatDetected;
SliderWidget* myVCenter;
CheckboxWidget* myPhosphor;
SliderWidget* myPPBlend;
CheckboxWidget* mySound;
PopUpWidget* myBSType{nullptr};
StaticTextWidget* myTypeDetected{nullptr};
StaticTextWidget* myStartBankLabel{nullptr};
PopUpWidget* myStartBank{nullptr};
PopUpWidget* myFormat{nullptr};
StaticTextWidget* myFormatDetected{nullptr};
SliderWidget* myVCenter{nullptr};
CheckboxWidget* myPhosphor{nullptr};
SliderWidget* myPPBlend{nullptr};
CheckboxWidget* mySound{nullptr};
// Console properties
RadioButtonGroup* myLeftDiffGroup;
RadioButtonGroup* myRightDiffGroup;
RadioButtonGroup* myTVTypeGroup;
RadioButtonGroup* myLeftDiffGroup{nullptr};
RadioButtonGroup* myRightDiffGroup{nullptr};
RadioButtonGroup* myTVTypeGroup{nullptr};
// Controller properties
StaticTextWidget* myLeftPortLabel;
StaticTextWidget* myRightPortLabel;
PopUpWidget* myLeftPort;
StaticTextWidget* myLeftPortDetected;
PopUpWidget* myRightPort;
StaticTextWidget* myRightPortDetected;
CheckboxWidget* mySwapPorts;
CheckboxWidget* mySwapPaddles;
StaticTextWidget* myEraseEEPROMLabel;
ButtonWidget* myEraseEEPROMButton;
StaticTextWidget* myEraseEEPROMInfo;
CheckboxWidget* myMouseControl;
PopUpWidget* myMouseX;
PopUpWidget* myMouseY;
SliderWidget* myMouseRange;
StaticTextWidget* myLeftPortLabel{nullptr};
StaticTextWidget* myRightPortLabel{nullptr};
PopUpWidget* myLeftPort{nullptr};
StaticTextWidget* myLeftPortDetected{nullptr};
PopUpWidget* myRightPort{nullptr};
StaticTextWidget* myRightPortDetected{nullptr};
CheckboxWidget* mySwapPorts{nullptr};
CheckboxWidget* mySwapPaddles{nullptr};
StaticTextWidget* myEraseEEPROMLabel{nullptr};
ButtonWidget* myEraseEEPROMButton{nullptr};
StaticTextWidget* myEraseEEPROMInfo{nullptr};
CheckboxWidget* myMouseControl{nullptr};
PopUpWidget* myMouseX{nullptr};
PopUpWidget* myMouseY{nullptr};
SliderWidget* myMouseRange{nullptr};
// Cartridge properties
EditTextWidget* myName;
EditTextWidget* myMD5;
EditTextWidget* myManufacturer;
EditTextWidget* myModelNo;
EditTextWidget* myRarity;
EditTextWidget* myNote;
EditTextWidget* myName{nullptr};
EditTextWidget* myMD5{nullptr};
EditTextWidget* myManufacturer{nullptr};
EditTextWidget* myModelNo{nullptr};
EditTextWidget* myRarity{nullptr};
EditTextWidget* myNote{nullptr};
enum {
kVCenterChanged = 'Vcch',

View File

@ -48,15 +48,15 @@ class GlobalPropsDialog : public Dialog, public CommandSender
kJ1Up, kJ1Down, kJ1Left, kJ1Right, kJ1Fire
};
PopUpWidget* myBSType;
PopUpWidget* myLeftDiff;
PopUpWidget* myRightDiff;
PopUpWidget* myTVType;
PopUpWidget* myDebug;
PopUpWidget* myBSType{nullptr};
PopUpWidget* myLeftDiff{nullptr};
PopUpWidget* myRightDiff{nullptr};
PopUpWidget* myTVType{nullptr};
PopUpWidget* myDebug{nullptr};
std::array<CheckboxWidget*, 10> myJoy;
CheckboxWidget* myHoldSelect;
CheckboxWidget* myHoldReset;
std::array<CheckboxWidget*, 10> myJoy{nullptr};
CheckboxWidget* myHoldSelect{nullptr};
CheckboxWidget* myHoldReset{nullptr};
static const std::array<string, 10> ourJoyState;

View File

@ -59,8 +59,7 @@ class GuiObject : public CommandReceiver
: myOSystem(osystem),
myParent(parent),
myDialog(dialog),
_x(x), _y(y), _w(w), _h(h),
_firstWidget(nullptr) { }
_x(x), _y(y), _w(w), _h(h) { }
virtual ~GuiObject() = default;
@ -104,9 +103,9 @@ class GuiObject : public CommandReceiver
Dialog& myDialog;
protected:
int _x, _y, _w, _h;
int _x{0}, _y{0}, _w{0}, _h{0};
Widget* _firstWidget;
Widget* _firstWidget{nullptr};
WidgetArray _focusList;
private:

View File

@ -26,9 +26,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font)
: Dialog(osystem, parent, font, "Help"),
myPage(1),
myNumPages(5)
: Dialog(osystem, parent, font, "Help")
{
const int lineHeight = font.getLineHeight(),
fontWidth = font.getMaxCharWidth(),

View File

@ -41,17 +41,17 @@ class HelpDialog : public Dialog
private:
static constexpr uInt32 LINES_PER_PAGE = 10;
ButtonWidget* myNextButton;
ButtonWidget* myPrevButton;
ButtonWidget* myNextButton{nullptr};
ButtonWidget* myPrevButton{nullptr};
StaticTextWidget* myTitle;
std::array<StaticTextWidget*, LINES_PER_PAGE> myKey;
std::array<StaticTextWidget*, LINES_PER_PAGE> myDesc;
std::array<StaticTextWidget*, LINES_PER_PAGE> myKey{nullptr};
std::array<StaticTextWidget*, LINES_PER_PAGE> myDesc{nullptr};
std::array<string, LINES_PER_PAGE> myKeyStr;
std::array<string, LINES_PER_PAGE> myDescStr;
uInt8 myPage;
uInt8 myNumPages;
uInt8 myPage{1};
uInt8 myNumPages{5};
private:
// Following constructors and assignment operators not supported

View File

@ -39,7 +39,6 @@
InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h)
: Dialog(osystem, parent, font, "Input settings"),
myConfirmMsg(nullptr),
myMaxWidth(max_w),
myMaxHeight(max_h)
{

View File

@ -76,34 +76,34 @@ class InputDialog : public Dialog
kConfirmEEEraseCmd = 'EEcf'
};
TabWidget* myTab;
TabWidget* myTab{nullptr};
EventMappingWidget* myEmulEventMapper;
EventMappingWidget* myMenuEventMapper;
EventMappingWidget* myEmulEventMapper{nullptr};
EventMappingWidget* myMenuEventMapper{nullptr};
CheckboxWidget* mySAPort;
PopUpWidget* myMouseControl;
PopUpWidget* myCursorState;
CheckboxWidget* mySAPort{nullptr};
PopUpWidget* myMouseControl{nullptr};
PopUpWidget* myCursorState{nullptr};
EditTextWidget* myAVoxPort;
EditTextWidget* myAVoxPort{nullptr};
SliderWidget* myDeadzone;
StaticTextWidget* myDeadzoneLabel;
SliderWidget* myDejitterBase;
SliderWidget* myDejitterDiff;
SliderWidget* myDPaddleSpeed;
SliderWidget* myMPaddleSpeed;
SliderWidget* myTrackBallSpeed;
StaticTextWidget* myDejitterLabel;
StaticTextWidget* myDPaddleLabel;
StaticTextWidget* myMPaddleLabel;
StaticTextWidget* myTrackBallLabel;
CheckboxWidget* myAllowAll4;
CheckboxWidget* myGrabMouse;
CheckboxWidget* myModCombo;
SliderWidget* myDeadzone{nullptr};
StaticTextWidget* myDeadzoneLabel{nullptr};
SliderWidget* myDejitterBase{nullptr};
SliderWidget* myDejitterDiff{nullptr};
SliderWidget* myDPaddleSpeed{nullptr};
SliderWidget* myMPaddleSpeed{nullptr};
SliderWidget* myTrackBallSpeed{nullptr};
StaticTextWidget* myDejitterLabel{nullptr};
StaticTextWidget* myDPaddleLabel{nullptr};
StaticTextWidget* myMPaddleLabel{nullptr};
StaticTextWidget* myTrackBallLabel{nullptr};
CheckboxWidget* myAllowAll4{nullptr};
CheckboxWidget* myGrabMouse{nullptr};
CheckboxWidget* myModCombo{nullptr};
ButtonWidget* myJoyDlgButton;
ButtonWidget* myEraseEEPROMButton;
ButtonWidget* myJoyDlgButton{nullptr};
ButtonWidget* myEraseEEPROMButton{nullptr};
// Show the list of joysticks that the eventhandler knows about
unique_ptr<JoystickDialog> myJoyDialog;
@ -112,7 +112,7 @@ class InputDialog : public Dialog
unique_ptr<GUI::MessageBox> myConfirmMsg;
// Maximum width and height for this dialog
int myMaxWidth, myMaxHeight;
int myMaxWidth{0}, myMaxHeight{0};
private:
// Following constructors and assignment operators not supported

View File

@ -31,11 +31,7 @@
InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& font,
const StringList& labels, const string& title)
: Dialog(boss->instance(), boss->parent(), font, title),
CommandSender(boss),
myEnableCenter(false),
myErrorFlag(false),
myXOrig(0),
myYOrig(0)
CommandSender(boss)
{
initialize(font, font, labels);
}

View File

@ -61,13 +61,13 @@ class InputTextDialog : public Dialog, public CommandSender
private:
vector<EditTextWidget*> myInput;
StaticTextWidget* myMessage;
StaticTextWidget* myMessage{nullptr};
bool myEnableCenter;
bool myErrorFlag;
int myCmd;
bool myEnableCenter{false};
bool myErrorFlag{false};
int myCmd{0};
uInt32 myXOrig, myYOrig;
uInt32 myXOrig{0}, myYOrig{0};
private:
// Following constructors and assignment operators not supported

View File

@ -45,11 +45,11 @@ class JoystickDialog : public Dialog
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
private:
StringListWidget* myJoyList;
EditTextWidget* myJoyText;
StringListWidget* myJoyList{nullptr};
EditTextWidget* myJoyText{nullptr};
ButtonWidget* myRemoveBtn;
ButtonWidget* myCloseBtn;
ButtonWidget* myRemoveBtn{nullptr};
ButtonWidget* myCloseBtn{nullptr};
IntArray myJoyIDs;

View File

@ -27,8 +27,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Launcher::Launcher(OSystem& osystem)
: DialogContainer(osystem),
myBaseDialog(nullptr)
: DialogContainer(osystem)
{
const Common::Size& s = myOSystem.settings().getSize("launcherres");
const Common::Size& d = myOSystem.frameBuffer().desktopSize();

View File

@ -70,11 +70,11 @@ class Launcher : public DialogContainer
Dialog* baseDialog() override;
private:
Dialog* myBaseDialog;
Dialog* myBaseDialog{nullptr};
// The width and height of this dialog
uInt32 myWidth;
uInt32 myHeight;
uInt32 myWidth{0};
uInt32 myHeight{0};
private:
// Following constructors and assignment operators not supported

View File

@ -46,17 +46,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
int x, int y, int w, int h)
: Dialog(osystem, parent, x, y, w, h),
myStartButton(nullptr),
myPrevDirButton(nullptr),
myOptionsButton(nullptr),
myQuitButton(nullptr),
myList(nullptr),
myPattern(nullptr),
myAllFiles(nullptr),
myRomInfoWidget(nullptr),
mySelectedItem(0),
myEventHandled(false)
: Dialog(osystem, parent, x, y, w, h)
{
myUseMinimalUI = instance().settings().getBool("minimal_ui");

View File

@ -111,26 +111,26 @@ class LauncherDialog : public Dialog
unique_ptr<GlobalPropsDialog> myGlobalProps;
unique_ptr<BrowserDialog> myRomDir;
ButtonWidget* myStartButton;
ButtonWidget* myPrevDirButton;
ButtonWidget* myOptionsButton;
ButtonWidget* myQuitButton;
ButtonWidget* myStartButton{nullptr};
ButtonWidget* myPrevDirButton{nullptr};
ButtonWidget* myOptionsButton{nullptr};
ButtonWidget* myQuitButton{nullptr};
FileListWidget* myList;
StaticTextWidget* myDirLabel;
EditTextWidget* myDir;
StaticTextWidget* myRomCount;
EditTextWidget* myPattern;
CheckboxWidget* myAllFiles;
FileListWidget* myList{nullptr};
StaticTextWidget* myDirLabel{nullptr};
EditTextWidget* myDir{nullptr};
StaticTextWidget* myRomCount{nullptr};
EditTextWidget* myPattern{nullptr};
CheckboxWidget* myAllFiles{nullptr};
RomInfoWidget* myRomInfoWidget;
RomInfoWidget* myRomInfoWidget{nullptr};
std::unordered_map<string,string> myMD5List;
int mySelectedItem;
int mySelectedItem{0};
bool myShowOnlyROMs;
bool myUseMinimalUI;
bool myEventHandled;
bool myShowOnlyROMs{false};
bool myUseMinimalUI{false};
bool myEventHandled{false};
enum {
kAllfilesCmd = 'lalf', // show all files (or ROMs only)

View File

@ -27,13 +27,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ListWidget::ListWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h)
: EditableWidget(boss, font, x, y, 16, 16),
_rows(0),
_cols(0),
_currentPos(0),
_selectedItem(-1),
_highlightedItem(-1),
_editMode(false)
: EditableWidget(boss, font, x, y, 16, 16)
{
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS;
_bgcolor = kWidColor;

View File

@ -94,14 +94,14 @@ class ListWidget : public EditableWidget
void scrollToCurrent(int item);
protected:
int _rows;
int _cols;
int _currentPos;
int _selectedItem;
int _highlightedItem;
bool _editMode;
int _rows{0};
int _cols{0};
int _currentPos{0};
int _selectedItem{-1};
int _highlightedItem{-1};
bool _editMode{false};
ScrollBarWidget* _scrollBar;
ScrollBarWidget* _scrollBar{nullptr};
StringList _list;

View File

@ -34,8 +34,7 @@
LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h,
bool uselargefont)
: Dialog(osystem, parent, font, "System logs"),
myLogInfo(nullptr)
: Dialog(osystem, parent, font, "System logs")
{
const int lineHeight = font.getLineHeight(),
buttonWidth = font.getStringWidth("Save log to disk") + 20,

View File

@ -42,9 +42,9 @@ class LoggerDialog : public Dialog
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
private:
StringListWidget* myLogInfo;
PopUpWidget* myLogLevel;
CheckboxWidget* myLogToConsole;
StringListWidget* myLogInfo{nullptr};
PopUpWidget* myLogLevel{nullptr};
CheckboxWidget* myLogToConsole{nullptr};
private:
// Following constructors and assignment operators not supported

View File

@ -25,9 +25,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Menu::Menu(OSystem& osystem)
: DialogContainer(osystem),
stellaSettingDialog(nullptr),
optionsDialog(nullptr)
: DialogContainer(osystem)
{
}

View File

@ -43,8 +43,8 @@ class Menu : public DialogContainer
private:
Dialog* baseDialog() override;
StellaSettingsDialog* stellaSettingDialog;
OptionsDialog* optionsDialog;
StellaSettingsDialog* stellaSettingDialog{nullptr};
OptionsDialog* optionsDialog{nullptr};
private:
// Following constructors and assignment operators not supported

View File

@ -54,7 +54,7 @@ class MessageBox : public Dialog, public CommandSender
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
private:
int myCmd;
int myCmd{0};
private:
// Following constructors and assignment operators not supported

View File

@ -33,9 +33,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MinUICommandDialog::MinUICommandDialog(OSystem& osystem, DialogContainer& parent)
: Dialog(osystem, parent, osystem.frameBuffer().font(), "Commands"),
myStellaSettingsDialog(nullptr),
myOptionsDialog(nullptr)
: Dialog(osystem, parent, osystem.frameBuffer().font(), "Commands")
{
const int HBORDER = 10;
const int VBORDER = 10;

View File

@ -44,19 +44,19 @@ class MinUICommandDialog : public Dialog
void processCancel() override;
// column 0
ButtonWidget* myColorButton;
ButtonWidget* myLeftDiffButton;
ButtonWidget* myRightDiffButton;
ButtonWidget* myColorButton{nullptr};
ButtonWidget* myLeftDiffButton{nullptr};
ButtonWidget* myRightDiffButton{nullptr};
// column 1
ButtonWidget* mySaveStateButton;
ButtonWidget* myStateSlotButton;
ButtonWidget* myLoadStateButton;
ButtonWidget* myRewindButton;
ButtonWidget* myUnwindButton;
ButtonWidget* mySaveStateButton{nullptr};
ButtonWidget* myStateSlotButton{nullptr};
ButtonWidget* myLoadStateButton{nullptr};
ButtonWidget* myRewindButton{nullptr};
ButtonWidget* myUnwindButton{nullptr};
// column 2
ButtonWidget* myTVFormatButton;
ButtonWidget* myStretchButton;
ButtonWidget* myPhosphorButton;
ButtonWidget* myTVFormatButton{nullptr};
ButtonWidget* myStretchButton{nullptr};
ButtonWidget* myPhosphorButton{nullptr};
unique_ptr<StellaSettingsDialog> myStellaSettingsDialog;
unique_ptr<OptionsDialog> myOptionsDialog;

View File

@ -67,12 +67,12 @@ class OptionsDialog : public Dialog
unique_ptr<HelpDialog> myHelpDialog;
unique_ptr<AboutDialog> myAboutDialog;
ButtonWidget* myRomAuditButton;
ButtonWidget* myGameInfoButton;
ButtonWidget* myCheatCodeButton;
ButtonWidget* myRomAuditButton{nullptr};
ButtonWidget* myGameInfoButton{nullptr};
ButtonWidget* myCheatCodeButton{nullptr};
// Indicates if this dialog is used for global (vs. in-game) settings
Menu::AppMode myMode;
Menu::AppMode myMode{Menu::AppMode::emulator};
enum {
kBasSetCmd = 'BAST',

View File

@ -30,8 +30,7 @@ PopUpWidget::PopUpWidget(GuiObject* boss, const GUI::Font& font,
: Widget(boss, font, x, y - 1, w, h + 2),
CommandSender(boss),
_label(label),
_labelWidth(labelWidth),
_changed(false)
_labelWidth(labelWidth)
{
_flags = Widget::FLAG_ENABLED | Widget::FLAG_RETAIN_FOCUS;
_bgcolor = kDlgColor;

View File

@ -72,12 +72,12 @@ class PopUpWidget : public Widget, public CommandSender
private:
unique_ptr<ContextMenu> myMenu;
int myArrowsY;
int myTextY;
int myArrowsY{0};
int myTextY{0};
string _label;
int _labelWidth;
bool _changed;
int _labelWidth{0};
bool _changed{false};
private:
// Following constructors and assignment operators not supported

View File

@ -27,12 +27,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProgressDialog::ProgressDialog(GuiObject* boss, const GUI::Font& font,
const string& message)
: Dialog(boss->instance(), boss->parent()),
myMessage(nullptr),
mySlider(nullptr),
myStart(0),
myFinish(0),
myStep(0)
: Dialog(boss->instance(), boss->parent())
{
const int fontWidth = font.getMaxCharWidth(),
fontHeight = font.getFontHeight(),

View File

@ -36,10 +36,10 @@ class ProgressDialog : public Dialog
void setProgress(int progress);
private:
StaticTextWidget* myMessage;
SliderWidget* mySlider;
StaticTextWidget* myMessage{nullptr};
SliderWidget* mySlider{nullptr};
int myStart, myFinish, myStep;
int myStart{0}, myFinish{0}, myStep{0};
private:
// Following constructors and assignment operators not supported

View File

@ -25,9 +25,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
R77HelpDialog::R77HelpDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font)
: Dialog(osystem, parent, font, "RetroN 77 help"),
myPage(1),
myNumPages(4)
: Dialog(osystem, parent, font, "RetroN 77 help")
{
const int lineHeight = font.getLineHeight(),
fontWidth = font.getMaxCharWidth(),

View File

@ -42,19 +42,19 @@ class R77HelpDialog : public Dialog
private:
static constexpr uInt32 LINES_PER_PAGE = 11;
ButtonWidget* myNextButton;
ButtonWidget* myPrevButton;
ButtonWidget* myNextButton{nullptr};
ButtonWidget* myPrevButton{nullptr};
StaticTextWidget* myTitle;
std::array<StaticTextWidget*, LINES_PER_PAGE> myJoy;
std::array<StaticTextWidget*, LINES_PER_PAGE> myBtn;
std::array<StaticTextWidget*, LINES_PER_PAGE> myDesc;
StaticTextWidget* myTitle{nullptr};
std::array<StaticTextWidget*, LINES_PER_PAGE> myJoy{nullptr};
std::array<StaticTextWidget*, LINES_PER_PAGE> myBtn{nullptr};
std::array<StaticTextWidget*, LINES_PER_PAGE> myDesc{nullptr};
std::array<string, LINES_PER_PAGE> myJoyStr;
std::array<string, LINES_PER_PAGE> myBtnStr;
std::array<string, LINES_PER_PAGE> myDescStr;
uInt8 myPage;
uInt8 myNumPages;
uInt8 myPage{1};
uInt8 myNumPages{4};
private:
// Following constructors and assignment operators not supported

View File

@ -46,8 +46,7 @@ static constexpr std::array<uInt32, RADIO_IMG_FILL_SIZE> radio_img_inactive = {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RadioButtonWidget::RadioButtonWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, const string& label,
RadioButtonGroup* group,
int cmd)
RadioButtonGroup* group, int cmd)
: CheckboxWidget(boss, font, x, y, label, cmd),
myGroup(group)
{
@ -62,7 +61,6 @@ RadioButtonWidget::RadioButtonWidget(GuiObject* boss, const GUI::Font& font,
_w = font.getStringWidth(label) + 20;
_h = font.getFontHeight() < 14 ? 14 : font.getFontHeight();
// Depending on font size, either the font or box will need to be
// centered vertically
if(_h > 14) // center box

View File

@ -42,7 +42,7 @@ class RadioButtonWidget : public CheckboxWidget
void drawWidget(bool hilite) override;
private:
RadioButtonGroup* myGroup;
RadioButtonGroup* myGroup{nullptr};
private:
// Following constructors and assignment operators not supported

View File

@ -57,17 +57,17 @@ class RomAuditDialog : public Dialog
const GUI::Font& myFont;
// ROM audit path
EditTextWidget* myRomPath;
EditTextWidget* myRomPath{nullptr};
// Show the results of the ROM audit
EditTextWidget* myResults1;
EditTextWidget* myResults2;
EditTextWidget* myResults1{nullptr};
EditTextWidget* myResults2{nullptr};
// Show a message about the dangers of using this function
unique_ptr<GUI::MessageBox> myConfirmMsg;
// Maximum width and height for this dialog
int myMaxWidth, myMaxHeight;
int myMaxWidth{0}, myMaxHeight{0};
private:
// Following constructors and assignment operators not supported

View File

@ -36,8 +36,6 @@
RomInfoWidget::RomInfoWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h)
: Widget(boss, font, x, y, w, h),
mySurfaceIsValid(false),
myHaveProperties(false),
myAvail(w > 400 ?
Common::Size(TIAConstants::viewableWidth*2, TIAConstants::viewableHeight*2) :
Common::Size(TIAConstants::viewableWidth, TIAConstants::viewableHeight))

View File

@ -49,7 +49,7 @@ class RomInfoWidget : public Widget
shared_ptr<FBSurface> mySurface;
// Whether the surface should be redrawn by drawWidget()
bool mySurfaceIsValid;
bool mySurfaceIsValid{false};
// Some ROM properties info, as well as 'tEXt' chunks from the PNG image
StringList myRomInfo;
@ -58,7 +58,7 @@ class RomInfoWidget : public Widget
Properties myProperties;
// Indicates if the current properties should actually be used
bool myHaveProperties;
bool myHaveProperties{false};
// Indicates if an error occurred in creating/displaying the surface
string mySurfaceErrorMsg;

View File

@ -33,16 +33,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ScrollBarWidget::ScrollBarWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h)
: Widget(boss, font, x, y, w, h), CommandSender(boss),
_numEntries(0),
_entriesPerPage(0),
_currentPos(0),
_wheel_lines(0),
_part(kNoPart),
_draggingPart(kNoPart),
_sliderHeight(0),
_sliderPos(0),
_sliderDeltaMouseDownPos(0)
: Widget(boss, font, x, y, w, h), CommandSender(boss)
{
_flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE | Widget::FLAG_CLEARBG;
_bgcolor = kWidColor;
@ -54,7 +45,7 @@ void ScrollBarWidget::handleMouseDown(int x, int y, MouseButton b,
int clickCount)
{
// Ignore subsequent mouse clicks when the slider is being moved
if(_draggingPart == kSliderPart)
if(_draggingPart == Part::Slider)
return;
int old_pos = _currentPos;
@ -67,13 +58,13 @@ void ScrollBarWidget::handleMouseDown(int x, int y, MouseButton b,
{
// Up arrow
_currentPos--;
_draggingPart = kUpArrowPart;
_draggingPart = Part::UpArrow;
}
else if(y >= _h - UP_DOWN_BOX_HEIGHT)
{
// Down arrow
_currentPos++;
_draggingPart = kDownArrowPart;
_draggingPart = Part::DownArrow;
}
else if(y < _sliderPos)
{
@ -85,7 +76,7 @@ void ScrollBarWidget::handleMouseDown(int x, int y, MouseButton b,
}
else
{
_draggingPart = kSliderPart;
_draggingPart = Part::Slider;
_sliderDeltaMouseDownPos = y - _sliderPos;
}
@ -97,7 +88,7 @@ void ScrollBarWidget::handleMouseDown(int x, int y, MouseButton b,
void ScrollBarWidget::handleMouseUp(int x, int y, MouseButton b,
int clickCount)
{
_draggingPart = kNoPart;
_draggingPart = Part::None;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -124,7 +115,7 @@ void ScrollBarWidget::handleMouseMoved(int x, int y)
if(_numEntries <= _entriesPerPage)
return;
if(_draggingPart == kSliderPart)
if(_draggingPart == Part::Slider)
{
int old_pos = _currentPos;
_sliderPos = y - _sliderDeltaMouseDownPos;
@ -141,18 +132,18 @@ void ScrollBarWidget::handleMouseMoved(int x, int y)
}
else
{
int old_part = _part;
Part old_part = _part;
if(y <= UP_DOWN_BOX_HEIGHT) // Up arrow
_part = kUpArrowPart;
_part = Part::UpArrow;
else if(y >= _h - UP_DOWN_BOX_HEIGHT) // Down arrow
_part = kDownArrowPart;
_part = Part::DownArrow;
else if(y < _sliderPos)
_part = kPageUpPart;
_part = Part::PageUp;
else if(y >= _sliderPos + _sliderHeight)
_part = kPageDownPart;
_part = Part::PageDown;
else
_part = kSliderPart;
_part = Part::Slider;
if (old_part != _part)
setDirty();
@ -191,7 +182,7 @@ void ScrollBarWidget::handleMouseEntered()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void ScrollBarWidget::handleMouseLeft()
{
_part = kNoPart;
_part = Part::None;
clearFlags(Widget::FLAG_HILITED);
setDirty();
}
@ -255,28 +246,28 @@ void ScrollBarWidget::drawWidget(bool hilite)
s.frameRect(_x, _y, _w, _h, hilite ? kWidColorHi : kColor);
if(_draggingPart != kNoPart)
if(_draggingPart != Part::None)
_part = _draggingPart;
// Up arrow
if(hilite && _part == kUpArrowPart)
if(hilite && _part == Part::UpArrow)
s.fillRect(_x + 1, _y + 1, _w - 2, UP_DOWN_BOX_HEIGHT - 2, kScrollColor);
s.drawBitmap(up_arrow.data(), _x+4, _y+5,
onTop ? isSinglePage ? kColor : (hilite && _part == kUpArrowPart) ? kWidColor
onTop ? isSinglePage ? kColor : (hilite && _part == Part::UpArrow) ? kWidColor
: kTextColor : kColor, 8);
// Down arrow
if(hilite && _part == kDownArrowPart)
if(hilite && _part == Part::DownArrow)
s.fillRect(_x + 1, bottomY - UP_DOWN_BOX_HEIGHT + 1, _w - 2, UP_DOWN_BOX_HEIGHT - 2, kScrollColor);
s.drawBitmap(down_arrow.data(), _x+4, bottomY - UP_DOWN_BOX_HEIGHT + 5,
onTop ? isSinglePage ? kColor : (hilite && _part == kDownArrowPart) ?
onTop ? isSinglePage ? kColor : (hilite && _part == Part::DownArrow) ?
kWidColor : kTextColor : kColor, 8);
// Slider
if(!isSinglePage)
{
s.fillRect(_x + 1, _y + _sliderPos - 1, _w - 2, _sliderHeight + 2,
onTop ? (hilite && _part == kSliderPart) ? kScrollColorHi : kScrollColor : kColor);
onTop ? (hilite && _part == Part::Slider) ? kScrollColorHi : kScrollColor : kColor);
}
}

View File

@ -53,26 +53,19 @@ class ScrollBarWidget : public Widget, public CommandSender
void handleMouseLeft() override;
public:
int _numEntries;
int _entriesPerPage;
int _currentPos;
int _wheel_lines;
int _numEntries{0};
int _entriesPerPage{0};
int _currentPos{0};
int _wheel_lines{0};
private:
enum Part {
kNoPart,
kUpArrowPart,
kDownArrowPart,
kSliderPart,
kPageUpPart,
kPageDownPart
};
enum class Part { None, UpArrow, DownArrow, Slider, PageUp, PageDown };
Part _part;
Part _draggingPart;
int _sliderHeight;
int _sliderPos;
int _sliderDeltaMouseDownPos;
Part _part{Part::None};
Part _draggingPart{Part::None};
int _sliderHeight{0};
int _sliderPos{0};
int _sliderDeltaMouseDownPos{0};
static int _WHEEL_LINES;

View File

@ -55,13 +55,13 @@ class SnapshotDialog : public Dialog
const GUI::Font& myFont;
// Config paths
EditTextWidget* mySnapSavePath;
EditTextWidget* mySnapSavePath{nullptr};
CheckboxWidget* mySnapName;
SliderWidget* mySnapInterval;
CheckboxWidget* mySnapName{nullptr};
SliderWidget* mySnapInterval{nullptr};
CheckboxWidget* mySnapSingle;
CheckboxWidget* mySnap1x;
CheckboxWidget* mySnapSingle{nullptr};
CheckboxWidget* mySnap1x{nullptr};
unique_ptr<BrowserDialog> myBrowser;

View File

@ -70,30 +70,30 @@ class StellaSettingsDialog : public Dialog
private:
// UI theme
PopUpWidget* myThemePopup;
PopUpWidget* myPositionPopup;
PopUpWidget* myThemePopup{nullptr};
PopUpWidget* myPositionPopup{nullptr};
// TV effects
PopUpWidget* myTVMode;
PopUpWidget* myTVMode{nullptr};
// TV scanline intensity
SliderWidget* myTVScanIntense;
SliderWidget* myTVScanIntense{nullptr};
// TV phosphor effect
SliderWidget* myTVPhosLevel;
SliderWidget* myTVPhosLevel{nullptr};
// TV Overscan
SliderWidget* myTVOverscan;
SliderWidget* myTVOverscan{nullptr};
// Controller properties
StaticTextWidget* myGameSettings;
StaticTextWidget* myGameSettings{nullptr};
StaticTextWidget* myLeftPortLabel;
StaticTextWidget* myRightPortLabel;
PopUpWidget* myLeftPort;
StaticTextWidget* myLeftPortDetected;
PopUpWidget* myRightPort;
StaticTextWidget* myRightPortDetected;
StaticTextWidget* myLeftPortLabel{nullptr};
StaticTextWidget* myRightPortLabel{nullptr};
PopUpWidget* myLeftPort{nullptr};
StaticTextWidget* myLeftPortDetected{nullptr};
PopUpWidget* myRightPort{nullptr};
StaticTextWidget* myRightPortDetected{nullptr};
unique_ptr<GUI::MessageBox> myConfirmMsg;
#if defined(RETRON77)
@ -103,7 +103,7 @@ class StellaSettingsDialog : public Dialog
#endif
// Indicates if this dialog is used for global (vs. in-game) settings
Menu::AppMode myMode;
Menu::AppMode myMode{Menu::AppMode::emulator};
enum {
kAdvancedSettings = 'SSad',

View File

@ -38,7 +38,7 @@ class StringListWidget : public ListWidget
Common::Rect getEditRect() const override;
protected:
bool _hilite;
bool _hilite{false};
private:
// Following constructors and assignment operators not supported

View File

@ -28,10 +28,7 @@
TabWidget::TabWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h)
: Widget(boss, font, x, y, w, h),
CommandSender(boss),
_tabWidth(40),
_activeTab(-1),
_firstTime(true)
CommandSender(boss)
{
_id = 0; // For dialogs with multiple tab widgets, they should specifically
// call ::setID to differentiate among them

View File

@ -76,10 +76,10 @@ class TabWidget : public Widget, public CommandSender
private:
struct Tab {
string title;
Widget* firstWidget;
Widget* parentWidget;
bool enabled;
int tabWidth;
Widget* firstWidget{nullptr};
Widget* parentWidget{nullptr};
bool enabled{true};
int tabWidth{0};
Tab(const string& t, int tw = NO_WIDTH,
Widget* first = nullptr, Widget* parent = nullptr, bool e = true)
@ -88,10 +88,10 @@ class TabWidget : public Widget, public CommandSender
using TabList = vector<Tab>;
TabList _tabs;
int _tabWidth;
int _tabHeight;
int _activeTab;
bool _firstTime;
int _tabWidth{40};
int _tabHeight{1};
int _activeTab{-1};
bool _firstTime{true};
enum {
kTabLeftOffset = 0,

View File

@ -33,10 +33,6 @@ TimeLineWidget::TimeLineWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h,
const string& label, uInt32 labelWidth, int cmd)
: ButtonWidget(boss, font, x, y, w, h, label, cmd),
_value(0),
_valueMin(0),
_valueMax(0),
_isDragging(false),
_labelWidth(labelWidth)
{
_flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE;

View File

@ -53,10 +53,10 @@ class TimeLineWidget : public ButtonWidget
uInt32 posToValue(uInt32 pos);
protected:
uInt32 _value;
uInt32 _valueMin, _valueMax;
bool _isDragging;
uInt32 _labelWidth;
uInt32 _value{0};
uInt32 _valueMin{0}, _valueMax{0};
bool _isDragging{false};
uInt32 _labelWidth{0};
uIntArray _stepValue;

View File

@ -23,7 +23,6 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TimeMachine::TimeMachine(OSystem& osystem)
: DialogContainer(osystem),
myBaseDialog(nullptr),
myWidth(FBMinimum::Width)
{
myBaseDialog = new TimeMachineDialog(myOSystem, *this, myWidth);

View File

@ -50,9 +50,9 @@ class TimeMachine : public DialogContainer
void setEnterWinds(Int32 numWinds);
private:
Dialog* myBaseDialog;
Dialog* myBaseDialog{nullptr};
uInt32 myWidth;
uInt32 myWidth{0};
private:
// Following constructors and assignment operators not supported

View File

@ -184,8 +184,7 @@ static constexpr std::array<uInt32, BUTTON_H> LOAD_ALL = {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TimeMachineDialog::TimeMachineDialog(OSystem& osystem, DialogContainer& parent,
int width)
: Dialog(osystem, parent),
_enterWinds(0)
: Dialog(osystem, parent)
{
const GUI::Font& font = instance().frameBuffer().font();
const int H_BORDER = 6, BUTTON_GAP = 4, V_BORDER = 4;

View File

@ -69,25 +69,25 @@ class TimeMachineDialog : public Dialog
kLoadAll = 'TMld',
};
TimeLineWidget* myTimeline;
TimeLineWidget* myTimeline{nullptr};
ButtonWidget* myToggleWidget;
ButtonWidget* myPlayWidget;
ButtonWidget* myRewindAllWidget;
ButtonWidget* myRewind1Widget;
ButtonWidget* myUnwind1Widget;
ButtonWidget* myUnwindAllWidget;
ButtonWidget* mySaveAllWidget;
ButtonWidget* myLoadAllWidget;
ButtonWidget* myToggleWidget{nullptr};
ButtonWidget* myPlayWidget{nullptr};
ButtonWidget* myRewindAllWidget{nullptr};
ButtonWidget* myRewind1Widget{nullptr};
ButtonWidget* myUnwind1Widget{nullptr};
ButtonWidget* myUnwindAllWidget{nullptr};
ButtonWidget* mySaveAllWidget{nullptr};
ButtonWidget* myLoadAllWidget{nullptr};
StaticTextWidget* myCurrentTimeWidget;
StaticTextWidget* myLastTimeWidget;
StaticTextWidget* myCurrentTimeWidget{nullptr};
StaticTextWidget* myLastTimeWidget{nullptr};
StaticTextWidget* myCurrentIdxWidget;
StaticTextWidget* myLastIdxWidget;
StaticTextWidget* myMessageWidget;
StaticTextWidget* myCurrentIdxWidget{nullptr};
StaticTextWidget* myLastIdxWidget{nullptr};
StaticTextWidget* myMessageWidget{nullptr};
Int32 _enterWinds;
Int32 _enterWinds{0};
private:
// Following constructors and assignment operators not supported

View File

@ -50,32 +50,32 @@ class UIDialog : public Dialog, public CommandSender
};
const GUI::Font& myFont;
TabWidget* myTab;
TabWidget* myTab{nullptr};
// Launcher options
EditTextWidget* myRomPath;
SliderWidget* myLauncherWidthSlider;
SliderWidget* myLauncherHeightSlider;
PopUpWidget* myLauncherFontPopup;
PopUpWidget* myRomViewerPopup;
ButtonWidget* myOpenBrowserButton;
EditTextWidget* mySnapLoadPath;
CheckboxWidget* myLauncherExitWidget;
EditTextWidget* myRomPath{nullptr};
SliderWidget* myLauncherWidthSlider{nullptr};
SliderWidget* myLauncherHeightSlider{nullptr};
PopUpWidget* myLauncherFontPopup{nullptr};
PopUpWidget* myRomViewerPopup{nullptr};
ButtonWidget* myOpenBrowserButton{nullptr};
EditTextWidget* mySnapLoadPath{nullptr};
CheckboxWidget* myLauncherExitWidget{nullptr};
// Misc options
PopUpWidget* myPalettePopup;
CheckboxWidget* myHidpiWidget;
PopUpWidget* myPositionPopup;
SliderWidget* myListDelaySlider;
SliderWidget* myWheelLinesSlider;
SliderWidget* myControllerRateSlider;
SliderWidget* myControllerDelaySlider;
SliderWidget* myDoubleClickSlider;
PopUpWidget* myPalettePopup{nullptr};
CheckboxWidget* myHidpiWidget{nullptr};
PopUpWidget* myPositionPopup{nullptr};
SliderWidget* myListDelaySlider{nullptr};
SliderWidget* myWheelLinesSlider{nullptr};
SliderWidget* myControllerRateSlider{nullptr};
SliderWidget* myControllerDelaySlider{nullptr};
SliderWidget* myDoubleClickSlider{nullptr};
unique_ptr<BrowserDialog> myBrowser;
// Indicates if this dialog is used for global (vs. in-game) settings
bool myIsGlobal;
bool myIsGlobal{false};
private:
// Following constructors and assignment operators not supported

View File

@ -54,51 +54,51 @@ class VideoDialog : public Dialog
TabWidget* myTab;
// General options
PopUpWidget* myRenderer;
SliderWidget* myTIAZoom;
PopUpWidget* myTIAPalette;
CheckboxWidget* myTIAInterpolate;
SliderWidget* myNAspectRatio;
SliderWidget* myPAspectRatio;
SliderWidget* mySpeed;
PopUpWidget* myRenderer{nullptr};
SliderWidget* myTIAZoom{nullptr};
PopUpWidget* myTIAPalette{nullptr};
CheckboxWidget* myTIAInterpolate{nullptr};
SliderWidget* myNAspectRatio{nullptr};
SliderWidget* myPAspectRatio{nullptr};
SliderWidget* mySpeed{nullptr};
CheckboxWidget* myFullscreen;
CheckboxWidget* myFullscreen{nullptr};
//PopUpWidget* myFullScreenMode;
CheckboxWidget* myUseStretch;
SliderWidget* myTVOverscan;
CheckboxWidget* myUseVSync;
CheckboxWidget* myUIMessages;
CheckboxWidget* myCenter;
CheckboxWidget* myFastSCBios;
CheckboxWidget* myUseThreads;
CheckboxWidget* myUseStretch{nullptr};
SliderWidget* myTVOverscan{nullptr};
CheckboxWidget* myUseVSync{nullptr};
CheckboxWidget* myUIMessages{nullptr};
CheckboxWidget* myCenter{nullptr};
CheckboxWidget* myFastSCBios{nullptr};
CheckboxWidget* myUseThreads{nullptr};
// TV effects adjustables (custom mode)
PopUpWidget* myTVMode;
SliderWidget* myTVSharp;
SliderWidget* myTVHue;
SliderWidget* myTVRes;
SliderWidget* myTVArtifacts;
SliderWidget* myTVFringe;
SliderWidget* myTVBleed;
SliderWidget* myTVBright;
SliderWidget* myTVContrast;
SliderWidget* myTVSatur;
SliderWidget* myTVGamma;
PopUpWidget* myTVMode{nullptr};
SliderWidget* myTVSharp{nullptr};
SliderWidget* myTVHue{nullptr};
SliderWidget* myTVRes{nullptr};
SliderWidget* myTVArtifacts{nullptr};
SliderWidget* myTVFringe{nullptr};
SliderWidget* myTVBleed{nullptr};
SliderWidget* myTVBright{nullptr};
SliderWidget* myTVContrast{nullptr};
SliderWidget* myTVSatur{nullptr};
SliderWidget* myTVGamma{nullptr};
// TV phosphor effect
CheckboxWidget* myTVPhosphor;
SliderWidget* myTVPhosLevel;
CheckboxWidget* myTVPhosphor{nullptr};
SliderWidget* myTVPhosLevel{nullptr};
// TV scanline intensity and interpolation
StaticTextWidget* myTVScanLabel;
SliderWidget* myTVScanIntense;
StaticTextWidget* myTVScanLabel{nullptr};
SliderWidget* myTVScanIntense{nullptr};
// TV effects adjustables presets (custom mode)
ButtonWidget* myCloneComposite;
ButtonWidget* myCloneSvideo;
ButtonWidget* myCloneRGB;
ButtonWidget* myCloneBad;
ButtonWidget* myCloneCustom;
ButtonWidget* myCloneComposite{nullptr};
ButtonWidget* myCloneSvideo{nullptr};
ButtonWidget* myCloneRGB{nullptr};
ButtonWidget* myCloneBad{nullptr};
ButtonWidget* myCloneCustom{nullptr};
enum {
kSpeedupChanged = 'VDSp',

View File

@ -32,17 +32,7 @@ Widget::Widget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h)
: GuiObject(boss->instance(), boss->parent(), boss->dialog(), x, y, w, h),
_boss(boss),
_font(font),
_id(0),
_flags(0),
_hasFocus(false),
_bgcolor(kWidColor),
_bgcolorhi(kWidColor),
_bgcolorlo(kBGColorLo),
_textcolor(kTextColor),
_textcolorhi(kTextColorHi),
_textcolorlo(kBGColorLo),
_shadowcolor(kShadowColor)
_font(font)
{
// Insert into the widget list of the boss
_next = _boss->_firstWidget;
@ -311,6 +301,7 @@ StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font,
const string& text, TextAlign align,
ColorId shadowColor)
: Widget(boss, font, x, y, w, h),
_label(text),
_align(align)
{
_flags = Widget::FLAG_ENABLED;
@ -319,9 +310,6 @@ StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font,
_textcolor = kTextColor;
_textcolorhi = kTextColor;
_shadowcolor = shadowColor;
_label = text;
_editable = false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -368,11 +356,7 @@ ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font,
: StaticTextWidget(boss, font, x, y, w, h, label, TextAlign::Center),
CommandSender(boss),
_cmd(cmd),
_repeat(repeat),
_useBitmap(false),
_bitmap(nullptr),
_bmw(0),
_bmh(0)
_repeat(repeat)
{
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG;
_bgcolor = kBtnColor;
@ -381,15 +365,14 @@ ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font,
_textcolor = kBtnTextColor;
_textcolorhi = kBtnTextColorHi;
_textcolorlo = kBGColorLo;
_editable = false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int dw,
const string& label, int cmd, bool repeat)
: ButtonWidget(boss, font, x, y, font.getStringWidth(label) + dw, font.getLineHeight() + 4, label, cmd, repeat)
: ButtonWidget(boss, font, x, y, font.getStringWidth(label) + dw,
font.getLineHeight() + 4, label, cmd, repeat)
{
}
@ -499,14 +482,7 @@ void ButtonWidget::drawWidget(bool hilite)
CheckboxWidget::CheckboxWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, const string& label,
int cmd)
: ButtonWidget(boss, font, x, y, 16, 16, label, cmd),
_state(false),
_holdFocus(true),
_drawBox(true),
_changed(false),
_fillColor(kColor),
_boxY(0),
_textY(0)
: ButtonWidget(boss, font, x, y, 16, 16, label, cmd)
{
_flags = Widget::FLAG_ENABLED;
_bgcolor = _bgcolorhi = kWidColor;
@ -520,7 +496,6 @@ CheckboxWidget::CheckboxWidget(GuiObject* boss, const GUI::Font& font,
_w = font.getStringWidth(label) + 20;
_h = font.getFontHeight() < 14 ? 14 : font.getFontHeight();
// Depending on font size, either the font or box will need to be
// centered vertically
if(_h > 14) // center box
@ -648,17 +623,10 @@ SliderWidget::SliderWidget(GuiObject* boss, const GUI::Font& font,
const string& label, int labelWidth, int cmd,
int valueLabelWidth, const string& valueUnit, int valueLabelGap)
: ButtonWidget(boss, font, x, y, w, h, label, cmd),
_value(-1),
_stepValue(1),
_valueMin(0),
_valueMax(100),
_isDragging(false),
_labelWidth(labelWidth),
_valueLabel(""),
_valueUnit(valueUnit),
_valueLabelGap(valueLabelGap),
_valueLabelWidth(valueLabelWidth),
_numIntervals(0)
_valueLabelWidth(valueLabelWidth)
{
_flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE;
_bgcolor = kDlgColor;

View File

@ -133,21 +133,21 @@ class Widget : public GuiObject
{ assert(_boss); _boss->handleCommand(sender, cmd, data, id); }
protected:
GuiObject* _boss;
GuiObject* _boss{nullptr};
const GUI::Font& _font;
Widget* _next;
uInt32 _id;
uInt32 _flags;
bool _hasFocus;
int _fontWidth;
int _fontHeight;
ColorId _bgcolor;
ColorId _bgcolorhi;
ColorId _bgcolorlo;
ColorId _textcolor;
ColorId _textcolorhi;
ColorId _textcolorlo;
ColorId _shadowcolor;
Widget* _next{nullptr};
uInt32 _id{0};
uInt32 _flags{0};
bool _hasFocus{false};
int _fontWidth{0};
int _fontHeight{0};
ColorId _bgcolor{kWidColor};
ColorId _bgcolorhi{kWidColor};
ColorId _bgcolorlo{kBGColorLo};
ColorId _textcolor{kTextColor};
ColorId _textcolorhi{kTextColorHi};
ColorId _textcolorlo{kBGColorLo};
ColorId _shadowcolor{kShadowColor};
public:
static Widget* findWidgetInChain(Widget* start, int x, int y);
@ -200,8 +200,8 @@ class StaticTextWidget : public Widget
protected:
string _label;
bool _editable;
TextAlign _align;
bool _editable{false};
TextAlign _align{TextAlign::Left};
private:
// Following constructors and assignment operators not supported
@ -249,9 +249,9 @@ class ButtonWidget : public StaticTextWidget, public CommandSender
protected:
int _cmd{0};
bool _repeat{false}; // button repeats
bool _useBitmap;
const uInt32* _bitmap;
int _bmw, _bmh;
bool _useBitmap{false};
const uInt32* _bitmap{nullptr};
int _bmw{0}, _bmh{0};
private:
// Following constructors and assignment operators not supported
@ -291,15 +291,15 @@ class CheckboxWidget : public ButtonWidget
void drawWidget(bool hilite) override;
protected:
bool _state;
bool _holdFocus;
bool _drawBox;
bool _changed;
bool _state{false};
bool _holdFocus{true};
bool _drawBox{true};
bool _changed{false};
const uInt32* _img;
ColorId _fillColor;
int _boxY;
int _textY;
const uInt32* _img{nullptr};
ColorId _fillColor{kColor};
int _boxY{0};
int _textY{0};
private:
// Following constructors and assignment operators not supported
@ -317,11 +317,13 @@ class SliderWidget : public ButtonWidget
SliderWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h,
const string& label = "", int labelWidth = 0, int cmd = 0,
int valueLabelWidth = 0, const string& valueUnit = "", int valueLabelGap = 4);
int valueLabelWidth = 0, const string& valueUnit = "",
int valueLabelGap = 4);
SliderWidget(GuiObject* boss, const GUI::Font& font,
int x, int y,
const string& label = "", int labelWidth = 0, int cmd = 0,
int valueLabelWidth = 0, const string& valueUnit = "", int valueLabelGap = 4);
int valueLabelWidth = 0, const string& valueUnit = "",
int valueLabelGap = 4);
virtual ~SliderWidget() = default;
void setValue(int value);
@ -353,15 +355,15 @@ class SliderWidget : public ButtonWidget
int posToValue(int pos) const;
protected:
int _value, _stepValue;
int _valueMin, _valueMax;
bool _isDragging;
int _labelWidth;
int _value{-1}, _stepValue{1};
int _valueMin{0}, _valueMax{100};
bool _isDragging{false};
int _labelWidth{0};
string _valueLabel;
string _valueUnit;
int _valueLabelGap;
int _valueLabelWidth;
int _numIntervals;
int _valueLabelGap{0};
int _valueLabelWidth{0};
int _numIntervals{0};
private:
// Following constructors and assignment operators not supported

View File

@ -55,7 +55,6 @@ class OSystemMACOS : public OSystem
bool useappdir, const string& usedir) override;
protected:
virtual shared_ptr<KeyValueRepository> createSettingsRepository() override;
private:

View File

@ -29,8 +29,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SerialPortMACOS::SerialPortMACOS()
: SerialPort(),
myHandle(0)
: SerialPort()
{
}

View File

@ -50,7 +50,7 @@ class SerialPortMACOS : public SerialPort
private:
// File descriptor for serial connection
int myHandle;
int myHandle{0};
private:
// Following constructors and assignment operators not supported

View File

@ -178,12 +178,6 @@ const TCHAR* FilesystemNodeWINDOWS::toUnicode(const char* str)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilesystemNodeWINDOWS::FilesystemNodeWINDOWS()
{
// Create a virtual root directory for standard Windows system
_isDirectory = true;
_isFile = false;
_isValid = false;
_path = "";
_isPseudoRoot = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -76,10 +76,10 @@ class FilesystemNodeWINDOWS : public AbstractFSNode
protected:
string _displayName;
string _path;
bool _isDirectory;
bool _isFile;
bool _isPseudoRoot;
bool _isValid;
bool _isDirectory{true};
bool _isFile{false};
bool _isPseudoRoot{true};
bool _isValid{false};
private:
/**

View File

@ -21,8 +21,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SerialPortWINDOWS::SerialPortWINDOWS()
: SerialPort(),
myHandle(0)
: SerialPort()
{
}

View File

@ -49,7 +49,7 @@ class SerialPortWINDOWS : public SerialPort
private:
// Handle to serial port
HANDLE myHandle;
HANDLE myHandle{0};
private:
// Following constructors and assignment operators not supported