mirror of https://github.com/stella-emu/stella.git
Final updates for default initialization.
The debugger is crashing, so now the debugging begins :)
This commit is contained in:
parent
54de3415ea
commit
3e3b9b3d50
|
@ -25,10 +25,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
AboutDialog::AboutDialog(OSystem& osystem, DialogContainer& parent,
|
AboutDialog::AboutDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, font, "About Stella"),
|
: Dialog(osystem, parent, font, "About Stella")
|
||||||
myPage(1),
|
|
||||||
myNumPages(4),
|
|
||||||
myLinesPerPage(13)
|
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
fontWidth = font.getMaxCharWidth(),
|
fontWidth = font.getMaxCharWidth(),
|
||||||
|
|
|
@ -41,16 +41,16 @@ class AboutDialog : public Dialog
|
||||||
void loadConfig() override { displayInfo(); }
|
void loadConfig() override { displayInfo(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ButtonWidget* myNextButton;
|
ButtonWidget* myNextButton{nullptr};
|
||||||
ButtonWidget* myPrevButton;
|
ButtonWidget* myPrevButton{nullptr};
|
||||||
|
|
||||||
StaticTextWidget* myTitle;
|
StaticTextWidget* myTitle{nullptr};
|
||||||
vector<StaticTextWidget*> myDesc;
|
vector<StaticTextWidget*> myDesc{nullptr};
|
||||||
vector<string> myDescStr;
|
vector<string> myDescStr;
|
||||||
|
|
||||||
int myPage;
|
int myPage{1};
|
||||||
int myNumPages;
|
int myNumPages{4};
|
||||||
int myLinesPerPage;
|
int myLinesPerPage{13};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -54,16 +54,16 @@ class AudioDialog : public Dialog
|
||||||
kBufferSizeChanged = 'ADbc'
|
kBufferSizeChanged = 'ADbc'
|
||||||
};
|
};
|
||||||
|
|
||||||
CheckboxWidget* mySoundEnableCheckbox;
|
CheckboxWidget* mySoundEnableCheckbox{nullptr};
|
||||||
SliderWidget* myVolumeSlider;
|
SliderWidget* myVolumeSlider{nullptr};
|
||||||
CheckboxWidget* myStereoSoundCheckbox;
|
CheckboxWidget* myStereoSoundCheckbox{nullptr};
|
||||||
PopUpWidget* myModePopup;
|
PopUpWidget* myModePopup{nullptr};
|
||||||
PopUpWidget* myFragsizePopup;
|
PopUpWidget* myFragsizePopup{nullptr};
|
||||||
PopUpWidget* myFreqPopup;
|
PopUpWidget* myFreqPopup{nullptr};
|
||||||
PopUpWidget* myResamplingPopup;
|
PopUpWidget* myResamplingPopup{nullptr};
|
||||||
SliderWidget* myHeadroomSlider;
|
SliderWidget* myHeadroomSlider{nullptr};
|
||||||
SliderWidget* myBufferSizeSlider;
|
SliderWidget* myBufferSizeSlider{nullptr};
|
||||||
SliderWidget* myDpcPitch;
|
SliderWidget* myDpcPitch{nullptr};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -35,9 +35,7 @@
|
||||||
BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font,
|
BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font,
|
||||||
int max_w, int max_h, const string& title)
|
int max_w, int max_h, const string& title)
|
||||||
: Dialog(boss->instance(), boss->parent(), font, title),
|
: Dialog(boss->instance(), boss->parent(), font, title),
|
||||||
CommandSender(boss),
|
CommandSender(boss)
|
||||||
_cmd(0),
|
|
||||||
_mode(FileSave)
|
|
||||||
{
|
{
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
_w = max_w;
|
_w = max_w;
|
||||||
|
|
|
@ -61,16 +61,16 @@ class BrowserDialog : public Dialog, public CommandSender
|
||||||
kBaseDirCmd = 'BADR'
|
kBaseDirCmd = 'BADR'
|
||||||
};
|
};
|
||||||
|
|
||||||
int _cmd;
|
int _cmd{0};
|
||||||
|
|
||||||
FileListWidget* _fileList;
|
FileListWidget* _fileList{nullptr};
|
||||||
EditTextWidget* _currentPath;
|
EditTextWidget* _currentPath{nullptr};
|
||||||
StaticTextWidget* _type;
|
StaticTextWidget* _type{nullptr};
|
||||||
EditTextWidget* _selected;
|
EditTextWidget* _selected{nullptr};
|
||||||
ButtonWidget* _goUpButton;
|
ButtonWidget* _goUpButton{nullptr};
|
||||||
ButtonWidget* _basedirButton;
|
ButtonWidget* _basedirButton{nullptr};
|
||||||
|
|
||||||
BrowserDialog::ListMode _mode;
|
BrowserDialog::ListMode _mode{Directories};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -28,9 +28,7 @@ ColorWidget::ColorWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h, int cmd)
|
int x, int y, int w, int h, int cmd)
|
||||||
: Widget(boss, font, x, y, w, h),
|
: Widget(boss, font, x, y, w, h),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
_color(kNone),
|
_cmd(cmd)
|
||||||
_cmd(cmd),
|
|
||||||
_crossGrid(false)
|
|
||||||
{
|
{
|
||||||
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS;
|
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,10 +48,10 @@ class ColorWidget : public Widget, public CommandSender
|
||||||
void drawWidget(bool hilite) override;
|
void drawWidget(bool hilite) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ColorId _color;
|
ColorId _color{kNone};
|
||||||
int _cmd;
|
int _cmd{0};
|
||||||
|
|
||||||
bool _crossGrid;
|
bool _crossGrid{false};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -29,8 +29,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font,
|
ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font,
|
||||||
const VariantList& combolist)
|
const VariantList& combolist)
|
||||||
: Dialog(boss->instance(), boss->parent(), font, "Add..."),
|
: Dialog(boss->instance(), boss->parent(), font, "Add...")
|
||||||
myComboEvent(Event::NoType)
|
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
fontWidth = font.getMaxCharWidth();
|
fontWidth = font.getMaxCharWidth();
|
||||||
|
|
|
@ -43,8 +43,8 @@ class ComboDialog : public Dialog
|
||||||
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Event::Type myComboEvent;
|
Event::Type myComboEvent{Event::NoType};
|
||||||
std::array<PopUpWidget*, 8> myEvents;
|
std::array<PopUpWidget*, 8> myEvents{nullptr};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -62,7 +62,7 @@ class CommandSender
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CommandReceiver* _target;
|
CommandReceiver* _target{nullptr};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -40,19 +40,19 @@ class CommandDialog : public Dialog
|
||||||
void processCancel() override;
|
void processCancel() override;
|
||||||
|
|
||||||
// column 0
|
// column 0
|
||||||
ButtonWidget* myColorButton;
|
ButtonWidget* myColorButton{nullptr};
|
||||||
ButtonWidget* myLeftDiffButton;
|
ButtonWidget* myLeftDiffButton{nullptr};
|
||||||
ButtonWidget* myRightDiffButton;
|
ButtonWidget* myRightDiffButton{nullptr};
|
||||||
// column 1
|
// column 1
|
||||||
ButtonWidget* mySaveStateButton;
|
ButtonWidget* mySaveStateButton{nullptr};
|
||||||
ButtonWidget* myStateSlotButton;
|
ButtonWidget* myStateSlotButton{nullptr};
|
||||||
ButtonWidget* myLoadStateButton;
|
ButtonWidget* myLoadStateButton{nullptr};
|
||||||
ButtonWidget* myTimeMachineButton;
|
ButtonWidget* myTimeMachineButton{nullptr};
|
||||||
// column 2
|
// column 2
|
||||||
ButtonWidget* myTVFormatButton;
|
ButtonWidget* myTVFormatButton{nullptr};
|
||||||
ButtonWidget* myPaletteButton;
|
ButtonWidget* myPaletteButton{nullptr};
|
||||||
ButtonWidget* myPhosphorButton;
|
ButtonWidget* myPhosphorButton{nullptr};
|
||||||
ButtonWidget* mySoundButton;
|
ButtonWidget* mySoundButton{nullptr};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kSelectCmd = 'Csel',
|
kSelectCmd = 'Csel',
|
||||||
|
|
|
@ -22,8 +22,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
CommandMenu::CommandMenu(OSystem& osystem)
|
CommandMenu::CommandMenu(OSystem& osystem)
|
||||||
: DialogContainer(osystem),
|
: DialogContainer(osystem)
|
||||||
myBaseDialog(nullptr)
|
|
||||||
{
|
{
|
||||||
if (osystem.settings().getBool("minimal_ui"))
|
if (osystem.settings().getBool("minimal_ui"))
|
||||||
myBaseDialog = new MinUICommandDialog(myOSystem, *this);
|
myBaseDialog = new MinUICommandDialog(myOSystem, *this);
|
||||||
|
|
|
@ -43,7 +43,7 @@ class CommandMenu : public DialogContainer
|
||||||
Dialog* baseDialog() override;
|
Dialog* baseDialog() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Dialog* myBaseDialog;
|
Dialog* myBaseDialog{nullptr};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -31,17 +31,7 @@ ContextMenu::ContextMenu(GuiObject* boss, const GUI::Font& font,
|
||||||
: Dialog(boss->instance(), boss->parent(), font),
|
: Dialog(boss->instance(), boss->parent(), font),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
_rowHeight(font.getLineHeight()),
|
_rowHeight(font.getLineHeight()),
|
||||||
_firstEntry(0),
|
|
||||||
_numEntries(0),
|
|
||||||
_selectedOffset(0),
|
|
||||||
_selectedItem(-1),
|
|
||||||
_showScroll(false),
|
|
||||||
_isScrolling(false),
|
|
||||||
_scrollUpColor(kColor),
|
|
||||||
_scrollDnColor(kColor),
|
|
||||||
_cmd(cmd),
|
_cmd(cmd),
|
||||||
_xorig(0),
|
|
||||||
_yorig(0),
|
|
||||||
_maxWidth(width)
|
_maxWidth(width)
|
||||||
{
|
{
|
||||||
addItems(items);
|
addItems(items);
|
||||||
|
|
|
@ -113,17 +113,17 @@ class ContextMenu : public Dialog, public CommandSender
|
||||||
private:
|
private:
|
||||||
VariantList _entries;
|
VariantList _entries;
|
||||||
|
|
||||||
int _rowHeight;
|
int _rowHeight{0};
|
||||||
int _firstEntry, _numEntries;
|
int _firstEntry{0}, _numEntries{0};
|
||||||
int _selectedOffset, _selectedItem;
|
int _selectedOffset{0}, _selectedItem{-1};
|
||||||
bool _showScroll;
|
bool _showScroll{false};
|
||||||
bool _isScrolling;
|
bool _isScrolling{false};
|
||||||
ColorId _scrollUpColor, _scrollDnColor;
|
ColorId _scrollUpColor{kColor}, _scrollDnColor{kColor};
|
||||||
|
|
||||||
int _cmd;
|
int _cmd{0};
|
||||||
|
|
||||||
uInt32 _xorig, _yorig;
|
uInt32 _xorig{0}, _yorig{0};
|
||||||
uInt32 _maxWidth;
|
uInt32 _maxWidth{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -86,64 +86,64 @@ class DeveloperDialog : public Dialog
|
||||||
|
|
||||||
static const int DEBUG_COLORS = 6;
|
static const int DEBUG_COLORS = 6;
|
||||||
|
|
||||||
TabWidget* myTab;
|
TabWidget* myTab{nullptr};
|
||||||
// Emulator widgets
|
// Emulator widgets
|
||||||
RadioButtonGroup* mySettingsGroupEmulation;
|
RadioButtonGroup* mySettingsGroupEmulation{nullptr};
|
||||||
CheckboxWidget* myFrameStatsWidget;
|
CheckboxWidget* myFrameStatsWidget{nullptr};
|
||||||
PopUpWidget* myConsoleWidget;
|
PopUpWidget* myConsoleWidget{nullptr};
|
||||||
StaticTextWidget* myLoadingROMLabel;
|
StaticTextWidget* myLoadingROMLabel{nullptr};
|
||||||
CheckboxWidget* myRandomBankWidget;
|
CheckboxWidget* myRandomBankWidget{nullptr};
|
||||||
CheckboxWidget* myRandomizeRAMWidget;
|
CheckboxWidget* myRandomizeRAMWidget{nullptr};
|
||||||
StaticTextWidget* myRandomizeCPULabel;
|
StaticTextWidget* myRandomizeCPULabel{nullptr};
|
||||||
CheckboxWidget* myUndrivenPinsWidget;
|
CheckboxWidget* myUndrivenPinsWidget{nullptr};
|
||||||
std::array<CheckboxWidget*, 5> myRandomizeCPUWidget;
|
std::array<CheckboxWidget*, 5> myRandomizeCPUWidget{nullptr};
|
||||||
#ifdef DEBUGGER_SUPPORT
|
#ifdef DEBUGGER_SUPPORT
|
||||||
CheckboxWidget* myRWPortBreakWidget;
|
CheckboxWidget* myRWPortBreakWidget{nullptr};
|
||||||
CheckboxWidget* myWRPortBreakWidget;
|
CheckboxWidget* myWRPortBreakWidget{nullptr};
|
||||||
#endif
|
#endif
|
||||||
CheckboxWidget* myThumbExceptionWidget;
|
CheckboxWidget* myThumbExceptionWidget{nullptr};
|
||||||
CheckboxWidget* myEEPROMAccessWidget;
|
CheckboxWidget* myEEPROMAccessWidget{nullptr};
|
||||||
|
|
||||||
// TIA widgets
|
// TIA widgets
|
||||||
RadioButtonGroup* mySettingsGroupTia;
|
RadioButtonGroup* mySettingsGroupTia{nullptr};
|
||||||
PopUpWidget* myTIATypeWidget;
|
PopUpWidget* myTIATypeWidget{nullptr};
|
||||||
StaticTextWidget* myInvPhaseLabel;
|
StaticTextWidget* myInvPhaseLabel{nullptr};
|
||||||
CheckboxWidget* myPlInvPhaseWidget;
|
CheckboxWidget* myPlInvPhaseWidget{nullptr};
|
||||||
CheckboxWidget* myMsInvPhaseWidget;
|
CheckboxWidget* myMsInvPhaseWidget{nullptr};
|
||||||
CheckboxWidget* myBlInvPhaseWidget;
|
CheckboxWidget* myBlInvPhaseWidget{nullptr};
|
||||||
StaticTextWidget* myPlayfieldLabel;
|
StaticTextWidget* myPlayfieldLabel{nullptr};
|
||||||
CheckboxWidget* myPFBitsWidget;
|
CheckboxWidget* myPFBitsWidget{nullptr};
|
||||||
CheckboxWidget* myPFColorWidget;
|
CheckboxWidget* myPFColorWidget{nullptr};
|
||||||
StaticTextWidget* mySwapLabel;
|
StaticTextWidget* mySwapLabel{nullptr};
|
||||||
CheckboxWidget* myPlSwapWidget;
|
CheckboxWidget* myPlSwapWidget{nullptr};
|
||||||
CheckboxWidget* myBlSwapWidget;
|
CheckboxWidget* myBlSwapWidget{nullptr};
|
||||||
|
|
||||||
// Video widgets
|
// Video widgets
|
||||||
RadioButtonGroup* mySettingsGroupVideo;
|
RadioButtonGroup* mySettingsGroupVideo{nullptr};
|
||||||
CheckboxWidget* myTVJitterWidget;
|
CheckboxWidget* myTVJitterWidget{nullptr};
|
||||||
SliderWidget* myTVJitterRecWidget;
|
SliderWidget* myTVJitterRecWidget{nullptr};
|
||||||
StaticTextWidget* myTVJitterRecLabelWidget;
|
StaticTextWidget* myTVJitterRecLabelWidget{nullptr};
|
||||||
CheckboxWidget* myColorLossWidget;
|
CheckboxWidget* myColorLossWidget{nullptr};
|
||||||
CheckboxWidget* myDebugColorsWidget;
|
CheckboxWidget* myDebugColorsWidget{nullptr};
|
||||||
std::array<PopUpWidget*, DEBUG_COLORS> myDbgColour;
|
std::array<PopUpWidget*, DEBUG_COLORS> myDbgColour{nullptr};
|
||||||
std::array<ColorWidget*, DEBUG_COLORS> myDbgColourSwatch;
|
std::array<ColorWidget*, DEBUG_COLORS> myDbgColourSwatch{nullptr};
|
||||||
|
|
||||||
// States widgets
|
// States widgets
|
||||||
RadioButtonGroup* mySettingsGroupTM;
|
RadioButtonGroup* mySettingsGroupTM{nullptr};
|
||||||
CheckboxWidget* myTimeMachineWidget;
|
CheckboxWidget* myTimeMachineWidget{nullptr};
|
||||||
SliderWidget* myStateSizeWidget;
|
SliderWidget* myStateSizeWidget{nullptr};
|
||||||
SliderWidget* myUncompressedWidget;
|
SliderWidget* myUncompressedWidget{nullptr};
|
||||||
PopUpWidget* myStateIntervalWidget;
|
PopUpWidget* myStateIntervalWidget{nullptr};
|
||||||
PopUpWidget* myStateHorizonWidget;
|
PopUpWidget* myStateHorizonWidget{nullptr};
|
||||||
RadioButtonGroup* mySaveOnExitGroup;
|
RadioButtonGroup* mySaveOnExitGroup{nullptr};
|
||||||
|
|
||||||
#ifdef DEBUGGER_SUPPORT
|
#ifdef DEBUGGER_SUPPORT
|
||||||
// Debugger UI widgets
|
// Debugger UI widgets
|
||||||
SliderWidget* myDebuggerWidthSlider;
|
SliderWidget* myDebuggerWidthSlider{nullptr};
|
||||||
SliderWidget* myDebuggerHeightSlider;
|
SliderWidget* myDebuggerHeightSlider{nullptr};
|
||||||
PopUpWidget* myDebuggerFontSize;
|
PopUpWidget* myDebuggerFontSize{nullptr};
|
||||||
PopUpWidget* myDebuggerFontStyle;
|
PopUpWidget* myDebuggerFontStyle{nullptr};
|
||||||
CheckboxWidget* myGhostReadsTrapWidget;
|
CheckboxWidget* myGhostReadsTrapWidget{nullptr};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool mySettings;
|
bool mySettings;
|
||||||
|
|
|
@ -27,13 +27,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
DialogContainer::DialogContainer(OSystem& osystem)
|
DialogContainer::DialogContainer(OSystem& osystem)
|
||||||
: myOSystem(osystem),
|
: myOSystem(osystem)
|
||||||
myTime(0),
|
|
||||||
myClickRepeatTime(0),
|
|
||||||
myButtonRepeatTime(0),
|
|
||||||
myButtonLongPressTime(0),
|
|
||||||
myAxisRepeatTime(0),
|
|
||||||
myHatRepeatTime(0)
|
|
||||||
{
|
{
|
||||||
_DOUBLE_CLICK_DELAY = osystem.settings().getInt("mdouble");
|
_DOUBLE_CLICK_DELAY = osystem.settings().getInt("mdouble");
|
||||||
_REPEAT_INITIAL_DELAY = osystem.settings().getInt("ctrldelay");
|
_REPEAT_INITIAL_DELAY = osystem.settings().getInt("ctrldelay");
|
||||||
|
@ -374,15 +368,12 @@ void DialogContainer::handleJoyHatEvent(int stick, int hat, JoyHatDir hdir, int
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void DialogContainer::reset()
|
void DialogContainer::reset()
|
||||||
{
|
{
|
||||||
myCurrentMouseDown.b = MouseButton::NONE;
|
myCurrentMouseDown = { 0, 0, MouseButton::NONE };
|
||||||
myLastClick.x = myLastClick.y = 0;
|
myCurrentButtonDown = { -1, -1 };
|
||||||
myLastClick.time = 0;
|
myCurrentAxisDown = { -1, JoyAxis::NONE, JoyDir::NONE };
|
||||||
myLastClick.count = 0;
|
myCurrentHatDown = { -1, -1, JoyHatDir::CENTER };
|
||||||
|
|
||||||
myCurrentButtonDown.stick = myCurrentButtonDown.button = -1;
|
myLastClick = { 0, 0, 0, 0 };
|
||||||
myCurrentAxisDown.stick = -1;
|
|
||||||
myCurrentAxisDown.axis = JoyAxis::NONE;
|
|
||||||
myCurrentHatDown.stick = myCurrentHatDown.hat = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -183,7 +183,7 @@ class DialogContainer
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Indicates the most current time (in milliseconds) as set by updateTime()
|
// Indicates the most current time (in milliseconds) as set by updateTime()
|
||||||
uInt64 myTime;
|
uInt64 myTime{0};
|
||||||
|
|
||||||
static uInt64 _DOUBLE_CLICK_DELAY;
|
static uInt64 _DOUBLE_CLICK_DELAY;
|
||||||
static uInt64 _REPEAT_INITIAL_DELAY;
|
static uInt64 _REPEAT_INITIAL_DELAY;
|
||||||
|
@ -193,41 +193,41 @@ class DialogContainer
|
||||||
|
|
||||||
// For continuous 'mouse down' events
|
// For continuous 'mouse down' events
|
||||||
struct {
|
struct {
|
||||||
int x;
|
int x{0};
|
||||||
int y;
|
int y{0};
|
||||||
MouseButton b;
|
MouseButton b{MouseButton::NONE};
|
||||||
} myCurrentMouseDown;
|
} myCurrentMouseDown;
|
||||||
uInt64 myClickRepeatTime;
|
uInt64 myClickRepeatTime{0};
|
||||||
|
|
||||||
// For continuous 'joy button down' events
|
// For continuous 'joy button down' events
|
||||||
struct {
|
struct {
|
||||||
int stick;
|
int stick{-1};
|
||||||
int button;
|
int button{-1};
|
||||||
} myCurrentButtonDown;
|
} myCurrentButtonDown;
|
||||||
uInt64 myButtonRepeatTime;
|
uInt64 myButtonRepeatTime{0};
|
||||||
uInt64 myButtonLongPressTime;
|
uInt64 myButtonLongPressTime{0};
|
||||||
|
|
||||||
// For continuous 'joy axis down' events
|
// For continuous 'joy axis down' events
|
||||||
struct {
|
struct {
|
||||||
int stick;
|
int stick{-1};
|
||||||
JoyAxis axis;
|
JoyAxis axis{JoyAxis::NONE};
|
||||||
JoyDir adir;
|
JoyDir adir{JoyDir::NONE};
|
||||||
} myCurrentAxisDown;
|
} myCurrentAxisDown;
|
||||||
uInt64 myAxisRepeatTime;
|
uInt64 myAxisRepeatTime{0};
|
||||||
|
|
||||||
// For continuous 'joy hat' events
|
// For continuous 'joy hat' events
|
||||||
struct {
|
struct {
|
||||||
int stick;
|
int stick{-1};
|
||||||
int hat;
|
int hat{-1};
|
||||||
JoyHatDir hdir;
|
JoyHatDir hdir{JoyHatDir::CENTER};
|
||||||
} myCurrentHatDown;
|
} myCurrentHatDown;
|
||||||
uInt64 myHatRepeatTime;
|
uInt64 myHatRepeatTime{0};
|
||||||
|
|
||||||
// Position and time of last mouse click (used to detect double clicks)
|
// Position and time of last mouse click (used to detect double clicks)
|
||||||
struct {
|
struct {
|
||||||
int x, y; // Position of mouse when the click occurred
|
int x{0}, y{0}; // Position of mouse when the click occurred
|
||||||
int count; // How often was it already pressed?
|
int count{0}; // How often was it already pressed?
|
||||||
uInt64 time; // Time
|
uInt64 time{0}; // Time
|
||||||
} myLastClick;
|
} myLastClick;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -24,8 +24,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
EditTextWidget::EditTextWidget(GuiObject* boss, const GUI::Font& font,
|
EditTextWidget::EditTextWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h, const string& text)
|
int x, int y, int w, int h, const string& text)
|
||||||
: EditableWidget(boss, font, x, y, w, h + 2, text),
|
: EditableWidget(boss, font, x, y, w, h + 2, text)
|
||||||
_changed(false)
|
|
||||||
{
|
{
|
||||||
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS;
|
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS;
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ class EditTextWidget : public EditableWidget
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
string _backupString;
|
string _backupString;
|
||||||
bool _changed;
|
bool _changed{false};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -21,30 +21,23 @@
|
||||||
#include "Font.hxx"
|
#include "Font.hxx"
|
||||||
#include "EditableWidget.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,
|
EditableWidget::EditableWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h, const string& str)
|
int x, int y, int w, int h, const string& str)
|
||||||
: Widget(boss, font, x, y, w, h),
|
: Widget(boss, font, x, y, w, h),
|
||||||
CommandSender(boss),
|
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;
|
_bgcolor = kWidColor;
|
||||||
_bgcolorhi = kWidColor;
|
_bgcolorhi = kWidColor;
|
||||||
_bgcolorlo = kDlgColor;
|
_bgcolorlo = kDlgColor;
|
||||||
_textcolor = kTextColor;
|
_textcolor = kTextColor;
|
||||||
_textcolorhi = 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()
|
void EditableWidget::copySelectedText()
|
||||||
{
|
{
|
||||||
// _clippedText = _editString;
|
#if defined(PSEUDO_COPY_PASTE)
|
||||||
|
_clippedText = _editString;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void EditableWidget::pasteSelectedText()
|
void EditableWidget::pasteSelectedText()
|
||||||
{
|
{
|
||||||
// _editString = _clippedText;
|
#if defined(PSEUDO_COPY_PASTE)
|
||||||
|
_editString = _clippedText;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -95,17 +95,17 @@ class EditableWidget : public Widget, public CommandSender
|
||||||
bool tryInsertChar(char c, int pos);
|
bool tryInsertChar(char c, int pos);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _editable;
|
bool _editable{true};
|
||||||
string _editString;
|
string _editString;
|
||||||
|
|
||||||
bool _caretVisible;
|
// bool _caretVisible{false};
|
||||||
int _caretTime;
|
// int _caretTime{0};
|
||||||
int _caretPos;
|
int _caretPos{0};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool _caretInverse;
|
bool _caretInverse{false};
|
||||||
|
|
||||||
int _editScrollOffset;
|
int _editScrollOffset{0};
|
||||||
|
|
||||||
static string _clippedText;
|
static string _clippedText;
|
||||||
|
|
||||||
|
|
|
@ -40,21 +40,7 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
EventMode mode)
|
EventMode mode)
|
||||||
: Widget(boss, font, x, y, w, h),
|
: Widget(boss, font, x, y, w, h),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
myFilterPopup(nullptr),
|
myEventMode(mode)
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
const int fontHeight = font.getFontHeight(),
|
const int fontHeight = font.getFontHeight(),
|
||||||
lineHeight = font.getLineHeight(),
|
lineHeight = font.getLineHeight(),
|
||||||
|
@ -139,8 +125,6 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
VariantList combolist = instance().eventHandler().getComboList(mode);
|
VariantList combolist = instance().eventHandler().getComboList(mode);
|
||||||
myComboDialog = new ComboDialog(boss, font, combolist);
|
myComboDialog = new ComboDialog(boss, font, combolist);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
myComboButton = nullptr;
|
|
||||||
|
|
||||||
// Show message for currently selected event
|
// Show message for currently selected event
|
||||||
xpos = HBORDER;
|
xpos = HBORDER;
|
||||||
|
|
|
@ -81,49 +81,49 @@ class EventMappingWidget : public Widget, public CommandSender
|
||||||
void enableButtons(bool state);
|
void enableButtons(bool state);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ButtonWidget* myMapButton;
|
ButtonWidget* myMapButton{nullptr};
|
||||||
ButtonWidget* myCancelMapButton;
|
ButtonWidget* myCancelMapButton{nullptr};
|
||||||
ButtonWidget* myEraseButton;
|
ButtonWidget* myEraseButton{nullptr};
|
||||||
ButtonWidget* myResetButton;
|
ButtonWidget* myResetButton{nullptr};
|
||||||
ButtonWidget* myComboButton;
|
ButtonWidget* myComboButton{nullptr};
|
||||||
PopUpWidget* myFilterPopup;
|
PopUpWidget* myFilterPopup{nullptr};
|
||||||
StringListWidget* myActionsList;
|
StringListWidget* myActionsList{nullptr};
|
||||||
EditTextWidget* myKeyMapping;
|
EditTextWidget* myKeyMapping{nullptr};
|
||||||
|
|
||||||
ComboDialog* myComboDialog;
|
ComboDialog* myComboDialog{nullptr};
|
||||||
|
|
||||||
// Since this widget can be used for different collections of events,
|
// Since this widget can be used for different collections of events,
|
||||||
// we need to specify exactly which group of events we are remapping
|
// 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
|
// 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
|
// Indicates the event that is currently selected
|
||||||
int myActionSelected;
|
int myActionSelected{-1};
|
||||||
|
|
||||||
// Indicates if we're currently in remap mode
|
// Indicates if we're currently in remap mode
|
||||||
// In this mode, the next event received is remapped to some action
|
// 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
|
// Joystick axes and hats can be more problematic than ordinary buttons
|
||||||
// or keys, in that there can be 'drift' in the values
|
// or keys, in that there can be 'drift' in the values
|
||||||
// Therefore, we map these events when they've been 'released', rather
|
// Therefore, we map these events when they've been 'released', rather
|
||||||
// than on their first occurrence (aka, when they're 'pressed')
|
// than on their first occurrence (aka, when they're 'pressed')
|
||||||
// As a result, we need to keep track of their old values
|
// As a result, we need to keep track of their old values
|
||||||
int myLastStick, myLastHat;
|
int myLastStick{0}, myLastHat{0};
|
||||||
JoyAxis myLastAxis;
|
JoyAxis myLastAxis{JoyAxis::NONE};
|
||||||
JoyDir myLastDir;
|
JoyDir myLastDir{JoyDir::NONE};
|
||||||
JoyHatDir myLastHatDir;
|
JoyHatDir myLastHatDir{JoyHatDir::CENTER};
|
||||||
|
|
||||||
// Aggregates the modifier flags of the mapping
|
// Aggregates the modifier flags of the mapping
|
||||||
int myMod;
|
int myMod{0};
|
||||||
// Saves the last *pressed* key
|
// Saves the last *pressed* key
|
||||||
int myLastKey;
|
int myLastKey{0};
|
||||||
// Saves the last *pressed* button
|
// Saves the last *pressed* button
|
||||||
int myLastButton;
|
int myLastButton{JOY_CTRL_NONE};
|
||||||
|
|
||||||
bool myFirstTime;
|
bool myFirstTime{true};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -27,15 +27,10 @@
|
||||||
FileListWidget::FileListWidget(GuiObject* boss, const GUI::Font& font,
|
FileListWidget::FileListWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h)
|
||||||
: StringListWidget(boss, font, x, y, w, h),
|
: StringListWidget(boss, font, x, y, w, h),
|
||||||
_fsmode(FilesystemNode::ListMode::All),
|
_filter([](const FilesystemNode& node) { return true; })
|
||||||
_selected(0),
|
|
||||||
_quickSelectTime(0)
|
|
||||||
{
|
{
|
||||||
// This widget is special, in that it catches signals and redirects them
|
// This widget is special, in that it catches signals and redirects them
|
||||||
setTarget(this);
|
setTarget(this);
|
||||||
|
|
||||||
// By default, all filenames are valid
|
|
||||||
_filter = [](const FilesystemNode& node) { return true; };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -92,16 +92,16 @@ class FileListWidget : public StringListWidget
|
||||||
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FilesystemNode::ListMode _fsmode;
|
FilesystemNode::ListMode _fsmode{FilesystemNode::ListMode::All};
|
||||||
FilesystemNode::NameFilter _filter;
|
FilesystemNode::NameFilter _filter;
|
||||||
FilesystemNode _node;
|
FilesystemNode _node;
|
||||||
FSList _fileList;
|
FSList _fileList;
|
||||||
|
|
||||||
Common::FixedStack<string> _history;
|
Common::FixedStack<string> _history;
|
||||||
uInt32 _selected;
|
uInt32 _selected{0};
|
||||||
|
|
||||||
string _quickSelectStr;
|
string _quickSelectStr;
|
||||||
uInt64 _quickSelectTime;
|
uInt64 _quickSelectTime{0};
|
||||||
static uInt64 _QUICK_SELECT_DELAY;
|
static uInt64 _QUICK_SELECT_DELAY;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -58,49 +58,49 @@ class GameInfoDialog : public Dialog, public CommandSender
|
||||||
void eraseEEPROM();
|
void eraseEEPROM();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TabWidget* myTab;
|
TabWidget* myTab{nullptr};
|
||||||
|
|
||||||
// Emulation properties
|
// Emulation properties
|
||||||
PopUpWidget* myBSType;
|
PopUpWidget* myBSType{nullptr};
|
||||||
StaticTextWidget* myTypeDetected;
|
StaticTextWidget* myTypeDetected{nullptr};
|
||||||
StaticTextWidget* myStartBankLabel;
|
StaticTextWidget* myStartBankLabel{nullptr};
|
||||||
PopUpWidget* myStartBank;
|
PopUpWidget* myStartBank{nullptr};
|
||||||
PopUpWidget* myFormat;
|
PopUpWidget* myFormat{nullptr};
|
||||||
StaticTextWidget* myFormatDetected;
|
StaticTextWidget* myFormatDetected{nullptr};
|
||||||
SliderWidget* myVCenter;
|
SliderWidget* myVCenter{nullptr};
|
||||||
CheckboxWidget* myPhosphor;
|
CheckboxWidget* myPhosphor{nullptr};
|
||||||
SliderWidget* myPPBlend;
|
SliderWidget* myPPBlend{nullptr};
|
||||||
CheckboxWidget* mySound;
|
CheckboxWidget* mySound{nullptr};
|
||||||
|
|
||||||
// Console properties
|
// Console properties
|
||||||
RadioButtonGroup* myLeftDiffGroup;
|
RadioButtonGroup* myLeftDiffGroup{nullptr};
|
||||||
RadioButtonGroup* myRightDiffGroup;
|
RadioButtonGroup* myRightDiffGroup{nullptr};
|
||||||
RadioButtonGroup* myTVTypeGroup;
|
RadioButtonGroup* myTVTypeGroup{nullptr};
|
||||||
|
|
||||||
// Controller properties
|
// Controller properties
|
||||||
StaticTextWidget* myLeftPortLabel;
|
StaticTextWidget* myLeftPortLabel{nullptr};
|
||||||
StaticTextWidget* myRightPortLabel;
|
StaticTextWidget* myRightPortLabel{nullptr};
|
||||||
PopUpWidget* myLeftPort;
|
PopUpWidget* myLeftPort{nullptr};
|
||||||
StaticTextWidget* myLeftPortDetected;
|
StaticTextWidget* myLeftPortDetected{nullptr};
|
||||||
PopUpWidget* myRightPort;
|
PopUpWidget* myRightPort{nullptr};
|
||||||
StaticTextWidget* myRightPortDetected;
|
StaticTextWidget* myRightPortDetected{nullptr};
|
||||||
CheckboxWidget* mySwapPorts;
|
CheckboxWidget* mySwapPorts{nullptr};
|
||||||
CheckboxWidget* mySwapPaddles;
|
CheckboxWidget* mySwapPaddles{nullptr};
|
||||||
StaticTextWidget* myEraseEEPROMLabel;
|
StaticTextWidget* myEraseEEPROMLabel{nullptr};
|
||||||
ButtonWidget* myEraseEEPROMButton;
|
ButtonWidget* myEraseEEPROMButton{nullptr};
|
||||||
StaticTextWidget* myEraseEEPROMInfo;
|
StaticTextWidget* myEraseEEPROMInfo{nullptr};
|
||||||
CheckboxWidget* myMouseControl;
|
CheckboxWidget* myMouseControl{nullptr};
|
||||||
PopUpWidget* myMouseX;
|
PopUpWidget* myMouseX{nullptr};
|
||||||
PopUpWidget* myMouseY;
|
PopUpWidget* myMouseY{nullptr};
|
||||||
SliderWidget* myMouseRange;
|
SliderWidget* myMouseRange{nullptr};
|
||||||
|
|
||||||
// Cartridge properties
|
// Cartridge properties
|
||||||
EditTextWidget* myName;
|
EditTextWidget* myName{nullptr};
|
||||||
EditTextWidget* myMD5;
|
EditTextWidget* myMD5{nullptr};
|
||||||
EditTextWidget* myManufacturer;
|
EditTextWidget* myManufacturer{nullptr};
|
||||||
EditTextWidget* myModelNo;
|
EditTextWidget* myModelNo{nullptr};
|
||||||
EditTextWidget* myRarity;
|
EditTextWidget* myRarity{nullptr};
|
||||||
EditTextWidget* myNote;
|
EditTextWidget* myNote{nullptr};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kVCenterChanged = 'Vcch',
|
kVCenterChanged = 'Vcch',
|
||||||
|
|
|
@ -48,15 +48,15 @@ class GlobalPropsDialog : public Dialog, public CommandSender
|
||||||
kJ1Up, kJ1Down, kJ1Left, kJ1Right, kJ1Fire
|
kJ1Up, kJ1Down, kJ1Left, kJ1Right, kJ1Fire
|
||||||
};
|
};
|
||||||
|
|
||||||
PopUpWidget* myBSType;
|
PopUpWidget* myBSType{nullptr};
|
||||||
PopUpWidget* myLeftDiff;
|
PopUpWidget* myLeftDiff{nullptr};
|
||||||
PopUpWidget* myRightDiff;
|
PopUpWidget* myRightDiff{nullptr};
|
||||||
PopUpWidget* myTVType;
|
PopUpWidget* myTVType{nullptr};
|
||||||
PopUpWidget* myDebug;
|
PopUpWidget* myDebug{nullptr};
|
||||||
|
|
||||||
std::array<CheckboxWidget*, 10> myJoy;
|
std::array<CheckboxWidget*, 10> myJoy{nullptr};
|
||||||
CheckboxWidget* myHoldSelect;
|
CheckboxWidget* myHoldSelect{nullptr};
|
||||||
CheckboxWidget* myHoldReset;
|
CheckboxWidget* myHoldReset{nullptr};
|
||||||
|
|
||||||
static const std::array<string, 10> ourJoyState;
|
static const std::array<string, 10> ourJoyState;
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,7 @@ class GuiObject : public CommandReceiver
|
||||||
: myOSystem(osystem),
|
: myOSystem(osystem),
|
||||||
myParent(parent),
|
myParent(parent),
|
||||||
myDialog(dialog),
|
myDialog(dialog),
|
||||||
_x(x), _y(y), _w(w), _h(h),
|
_x(x), _y(y), _w(w), _h(h) { }
|
||||||
_firstWidget(nullptr) { }
|
|
||||||
|
|
||||||
virtual ~GuiObject() = default;
|
virtual ~GuiObject() = default;
|
||||||
|
|
||||||
|
@ -104,9 +103,9 @@ class GuiObject : public CommandReceiver
|
||||||
Dialog& myDialog;
|
Dialog& myDialog;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int _x, _y, _w, _h;
|
int _x{0}, _y{0}, _w{0}, _h{0};
|
||||||
|
|
||||||
Widget* _firstWidget;
|
Widget* _firstWidget{nullptr};
|
||||||
WidgetArray _focusList;
|
WidgetArray _focusList;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -26,9 +26,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent,
|
HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, font, "Help"),
|
: Dialog(osystem, parent, font, "Help")
|
||||||
myPage(1),
|
|
||||||
myNumPages(5)
|
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
fontWidth = font.getMaxCharWidth(),
|
fontWidth = font.getMaxCharWidth(),
|
||||||
|
|
|
@ -41,17 +41,17 @@ class HelpDialog : public Dialog
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr uInt32 LINES_PER_PAGE = 10;
|
static constexpr uInt32 LINES_PER_PAGE = 10;
|
||||||
ButtonWidget* myNextButton;
|
ButtonWidget* myNextButton{nullptr};
|
||||||
ButtonWidget* myPrevButton;
|
ButtonWidget* myPrevButton{nullptr};
|
||||||
|
|
||||||
StaticTextWidget* myTitle;
|
StaticTextWidget* myTitle;
|
||||||
std::array<StaticTextWidget*, LINES_PER_PAGE> myKey;
|
std::array<StaticTextWidget*, LINES_PER_PAGE> myKey{nullptr};
|
||||||
std::array<StaticTextWidget*, LINES_PER_PAGE> myDesc;
|
std::array<StaticTextWidget*, LINES_PER_PAGE> myDesc{nullptr};
|
||||||
std::array<string, LINES_PER_PAGE> myKeyStr;
|
std::array<string, LINES_PER_PAGE> myKeyStr;
|
||||||
std::array<string, LINES_PER_PAGE> myDescStr;
|
std::array<string, LINES_PER_PAGE> myDescStr;
|
||||||
|
|
||||||
uInt8 myPage;
|
uInt8 myPage{1};
|
||||||
uInt8 myNumPages;
|
uInt8 myNumPages{5};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent,
|
InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, int max_w, int max_h)
|
const GUI::Font& font, int max_w, int max_h)
|
||||||
: Dialog(osystem, parent, font, "Input settings"),
|
: Dialog(osystem, parent, font, "Input settings"),
|
||||||
myConfirmMsg(nullptr),
|
|
||||||
myMaxWidth(max_w),
|
myMaxWidth(max_w),
|
||||||
myMaxHeight(max_h)
|
myMaxHeight(max_h)
|
||||||
{
|
{
|
||||||
|
|
|
@ -76,34 +76,34 @@ class InputDialog : public Dialog
|
||||||
kConfirmEEEraseCmd = 'EEcf'
|
kConfirmEEEraseCmd = 'EEcf'
|
||||||
};
|
};
|
||||||
|
|
||||||
TabWidget* myTab;
|
TabWidget* myTab{nullptr};
|
||||||
|
|
||||||
EventMappingWidget* myEmulEventMapper;
|
EventMappingWidget* myEmulEventMapper{nullptr};
|
||||||
EventMappingWidget* myMenuEventMapper;
|
EventMappingWidget* myMenuEventMapper{nullptr};
|
||||||
|
|
||||||
CheckboxWidget* mySAPort;
|
CheckboxWidget* mySAPort{nullptr};
|
||||||
PopUpWidget* myMouseControl;
|
PopUpWidget* myMouseControl{nullptr};
|
||||||
PopUpWidget* myCursorState;
|
PopUpWidget* myCursorState{nullptr};
|
||||||
|
|
||||||
EditTextWidget* myAVoxPort;
|
EditTextWidget* myAVoxPort{nullptr};
|
||||||
|
|
||||||
SliderWidget* myDeadzone;
|
SliderWidget* myDeadzone{nullptr};
|
||||||
StaticTextWidget* myDeadzoneLabel;
|
StaticTextWidget* myDeadzoneLabel{nullptr};
|
||||||
SliderWidget* myDejitterBase;
|
SliderWidget* myDejitterBase{nullptr};
|
||||||
SliderWidget* myDejitterDiff;
|
SliderWidget* myDejitterDiff{nullptr};
|
||||||
SliderWidget* myDPaddleSpeed;
|
SliderWidget* myDPaddleSpeed{nullptr};
|
||||||
SliderWidget* myMPaddleSpeed;
|
SliderWidget* myMPaddleSpeed{nullptr};
|
||||||
SliderWidget* myTrackBallSpeed;
|
SliderWidget* myTrackBallSpeed{nullptr};
|
||||||
StaticTextWidget* myDejitterLabel;
|
StaticTextWidget* myDejitterLabel{nullptr};
|
||||||
StaticTextWidget* myDPaddleLabel;
|
StaticTextWidget* myDPaddleLabel{nullptr};
|
||||||
StaticTextWidget* myMPaddleLabel;
|
StaticTextWidget* myMPaddleLabel{nullptr};
|
||||||
StaticTextWidget* myTrackBallLabel;
|
StaticTextWidget* myTrackBallLabel{nullptr};
|
||||||
CheckboxWidget* myAllowAll4;
|
CheckboxWidget* myAllowAll4{nullptr};
|
||||||
CheckboxWidget* myGrabMouse;
|
CheckboxWidget* myGrabMouse{nullptr};
|
||||||
CheckboxWidget* myModCombo;
|
CheckboxWidget* myModCombo{nullptr};
|
||||||
|
|
||||||
ButtonWidget* myJoyDlgButton;
|
ButtonWidget* myJoyDlgButton{nullptr};
|
||||||
ButtonWidget* myEraseEEPROMButton;
|
ButtonWidget* myEraseEEPROMButton{nullptr};
|
||||||
|
|
||||||
// Show the list of joysticks that the eventhandler knows about
|
// Show the list of joysticks that the eventhandler knows about
|
||||||
unique_ptr<JoystickDialog> myJoyDialog;
|
unique_ptr<JoystickDialog> myJoyDialog;
|
||||||
|
@ -112,7 +112,7 @@ class InputDialog : public Dialog
|
||||||
unique_ptr<GUI::MessageBox> myConfirmMsg;
|
unique_ptr<GUI::MessageBox> myConfirmMsg;
|
||||||
|
|
||||||
// Maximum width and height for this dialog
|
// Maximum width and height for this dialog
|
||||||
int myMaxWidth, myMaxHeight;
|
int myMaxWidth{0}, myMaxHeight{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -31,11 +31,7 @@
|
||||||
InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& font,
|
InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& font,
|
||||||
const StringList& labels, const string& title)
|
const StringList& labels, const string& title)
|
||||||
: Dialog(boss->instance(), boss->parent(), font, title),
|
: Dialog(boss->instance(), boss->parent(), font, title),
|
||||||
CommandSender(boss),
|
CommandSender(boss)
|
||||||
myEnableCenter(false),
|
|
||||||
myErrorFlag(false),
|
|
||||||
myXOrig(0),
|
|
||||||
myYOrig(0)
|
|
||||||
{
|
{
|
||||||
initialize(font, font, labels);
|
initialize(font, font, labels);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,13 +61,13 @@ class InputTextDialog : public Dialog, public CommandSender
|
||||||
|
|
||||||
private:
|
private:
|
||||||
vector<EditTextWidget*> myInput;
|
vector<EditTextWidget*> myInput;
|
||||||
StaticTextWidget* myMessage;
|
StaticTextWidget* myMessage{nullptr};
|
||||||
|
|
||||||
bool myEnableCenter;
|
bool myEnableCenter{false};
|
||||||
bool myErrorFlag;
|
bool myErrorFlag{false};
|
||||||
int myCmd;
|
int myCmd{0};
|
||||||
|
|
||||||
uInt32 myXOrig, myYOrig;
|
uInt32 myXOrig{0}, myYOrig{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -45,11 +45,11 @@ class JoystickDialog : public Dialog
|
||||||
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StringListWidget* myJoyList;
|
StringListWidget* myJoyList{nullptr};
|
||||||
EditTextWidget* myJoyText;
|
EditTextWidget* myJoyText{nullptr};
|
||||||
|
|
||||||
ButtonWidget* myRemoveBtn;
|
ButtonWidget* myRemoveBtn{nullptr};
|
||||||
ButtonWidget* myCloseBtn;
|
ButtonWidget* myCloseBtn{nullptr};
|
||||||
|
|
||||||
IntArray myJoyIDs;
|
IntArray myJoyIDs;
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Launcher::Launcher(OSystem& osystem)
|
Launcher::Launcher(OSystem& osystem)
|
||||||
: DialogContainer(osystem),
|
: DialogContainer(osystem)
|
||||||
myBaseDialog(nullptr)
|
|
||||||
{
|
{
|
||||||
const Common::Size& s = myOSystem.settings().getSize("launcherres");
|
const Common::Size& s = myOSystem.settings().getSize("launcherres");
|
||||||
const Common::Size& d = myOSystem.frameBuffer().desktopSize();
|
const Common::Size& d = myOSystem.frameBuffer().desktopSize();
|
||||||
|
|
|
@ -70,11 +70,11 @@ class Launcher : public DialogContainer
|
||||||
Dialog* baseDialog() override;
|
Dialog* baseDialog() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Dialog* myBaseDialog;
|
Dialog* myBaseDialog{nullptr};
|
||||||
|
|
||||||
// The width and height of this dialog
|
// The width and height of this dialog
|
||||||
uInt32 myWidth;
|
uInt32 myWidth{0};
|
||||||
uInt32 myHeight;
|
uInt32 myHeight{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -46,17 +46,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
|
LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h)
|
||||||
: Dialog(osystem, parent, x, y, w, 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)
|
|
||||||
{
|
{
|
||||||
myUseMinimalUI = instance().settings().getBool("minimal_ui");
|
myUseMinimalUI = instance().settings().getBool("minimal_ui");
|
||||||
|
|
||||||
|
|
|
@ -111,26 +111,26 @@ class LauncherDialog : public Dialog
|
||||||
unique_ptr<GlobalPropsDialog> myGlobalProps;
|
unique_ptr<GlobalPropsDialog> myGlobalProps;
|
||||||
unique_ptr<BrowserDialog> myRomDir;
|
unique_ptr<BrowserDialog> myRomDir;
|
||||||
|
|
||||||
ButtonWidget* myStartButton;
|
ButtonWidget* myStartButton{nullptr};
|
||||||
ButtonWidget* myPrevDirButton;
|
ButtonWidget* myPrevDirButton{nullptr};
|
||||||
ButtonWidget* myOptionsButton;
|
ButtonWidget* myOptionsButton{nullptr};
|
||||||
ButtonWidget* myQuitButton;
|
ButtonWidget* myQuitButton{nullptr};
|
||||||
|
|
||||||
FileListWidget* myList;
|
FileListWidget* myList{nullptr};
|
||||||
StaticTextWidget* myDirLabel;
|
StaticTextWidget* myDirLabel{nullptr};
|
||||||
EditTextWidget* myDir;
|
EditTextWidget* myDir{nullptr};
|
||||||
StaticTextWidget* myRomCount;
|
StaticTextWidget* myRomCount{nullptr};
|
||||||
EditTextWidget* myPattern;
|
EditTextWidget* myPattern{nullptr};
|
||||||
CheckboxWidget* myAllFiles;
|
CheckboxWidget* myAllFiles{nullptr};
|
||||||
|
|
||||||
RomInfoWidget* myRomInfoWidget;
|
RomInfoWidget* myRomInfoWidget{nullptr};
|
||||||
std::unordered_map<string,string> myMD5List;
|
std::unordered_map<string,string> myMD5List;
|
||||||
|
|
||||||
int mySelectedItem;
|
int mySelectedItem{0};
|
||||||
|
|
||||||
bool myShowOnlyROMs;
|
bool myShowOnlyROMs{false};
|
||||||
bool myUseMinimalUI;
|
bool myUseMinimalUI{false};
|
||||||
bool myEventHandled;
|
bool myEventHandled{false};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kAllfilesCmd = 'lalf', // show all files (or ROMs only)
|
kAllfilesCmd = 'lalf', // show all files (or ROMs only)
|
||||||
|
|
|
@ -27,13 +27,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
ListWidget::ListWidget(GuiObject* boss, const GUI::Font& font,
|
ListWidget::ListWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h)
|
||||||
: EditableWidget(boss, font, x, y, 16, 16),
|
: EditableWidget(boss, font, x, y, 16, 16)
|
||||||
_rows(0),
|
|
||||||
_cols(0),
|
|
||||||
_currentPos(0),
|
|
||||||
_selectedItem(-1),
|
|
||||||
_highlightedItem(-1),
|
|
||||||
_editMode(false)
|
|
||||||
{
|
{
|
||||||
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS;
|
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS;
|
||||||
_bgcolor = kWidColor;
|
_bgcolor = kWidColor;
|
||||||
|
|
|
@ -94,14 +94,14 @@ class ListWidget : public EditableWidget
|
||||||
void scrollToCurrent(int item);
|
void scrollToCurrent(int item);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int _rows;
|
int _rows{0};
|
||||||
int _cols;
|
int _cols{0};
|
||||||
int _currentPos;
|
int _currentPos{0};
|
||||||
int _selectedItem;
|
int _selectedItem{-1};
|
||||||
int _highlightedItem;
|
int _highlightedItem{-1};
|
||||||
bool _editMode;
|
bool _editMode{false};
|
||||||
|
|
||||||
ScrollBarWidget* _scrollBar;
|
ScrollBarWidget* _scrollBar{nullptr};
|
||||||
|
|
||||||
StringList _list;
|
StringList _list;
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,7 @@
|
||||||
LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent,
|
LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, int max_w, int max_h,
|
const GUI::Font& font, int max_w, int max_h,
|
||||||
bool uselargefont)
|
bool uselargefont)
|
||||||
: Dialog(osystem, parent, font, "System logs"),
|
: Dialog(osystem, parent, font, "System logs")
|
||||||
myLogInfo(nullptr)
|
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
buttonWidth = font.getStringWidth("Save log to disk") + 20,
|
buttonWidth = font.getStringWidth("Save log to disk") + 20,
|
||||||
|
|
|
@ -42,9 +42,9 @@ class LoggerDialog : public Dialog
|
||||||
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StringListWidget* myLogInfo;
|
StringListWidget* myLogInfo{nullptr};
|
||||||
PopUpWidget* myLogLevel;
|
PopUpWidget* myLogLevel{nullptr};
|
||||||
CheckboxWidget* myLogToConsole;
|
CheckboxWidget* myLogToConsole{nullptr};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -25,9 +25,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Menu::Menu(OSystem& osystem)
|
Menu::Menu(OSystem& osystem)
|
||||||
: DialogContainer(osystem),
|
: DialogContainer(osystem)
|
||||||
stellaSettingDialog(nullptr),
|
|
||||||
optionsDialog(nullptr)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,8 @@ class Menu : public DialogContainer
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Dialog* baseDialog() override;
|
Dialog* baseDialog() override;
|
||||||
StellaSettingsDialog* stellaSettingDialog;
|
StellaSettingsDialog* stellaSettingDialog{nullptr};
|
||||||
OptionsDialog* optionsDialog;
|
OptionsDialog* optionsDialog{nullptr};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -54,7 +54,7 @@ class MessageBox : public Dialog, public CommandSender
|
||||||
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int myCmd;
|
int myCmd{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -33,9 +33,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
MinUICommandDialog::MinUICommandDialog(OSystem& osystem, DialogContainer& parent)
|
MinUICommandDialog::MinUICommandDialog(OSystem& osystem, DialogContainer& parent)
|
||||||
: Dialog(osystem, parent, osystem.frameBuffer().font(), "Commands"),
|
: Dialog(osystem, parent, osystem.frameBuffer().font(), "Commands")
|
||||||
myStellaSettingsDialog(nullptr),
|
|
||||||
myOptionsDialog(nullptr)
|
|
||||||
{
|
{
|
||||||
const int HBORDER = 10;
|
const int HBORDER = 10;
|
||||||
const int VBORDER = 10;
|
const int VBORDER = 10;
|
||||||
|
|
|
@ -44,19 +44,19 @@ class MinUICommandDialog : public Dialog
|
||||||
void processCancel() override;
|
void processCancel() override;
|
||||||
|
|
||||||
// column 0
|
// column 0
|
||||||
ButtonWidget* myColorButton;
|
ButtonWidget* myColorButton{nullptr};
|
||||||
ButtonWidget* myLeftDiffButton;
|
ButtonWidget* myLeftDiffButton{nullptr};
|
||||||
ButtonWidget* myRightDiffButton;
|
ButtonWidget* myRightDiffButton{nullptr};
|
||||||
// column 1
|
// column 1
|
||||||
ButtonWidget* mySaveStateButton;
|
ButtonWidget* mySaveStateButton{nullptr};
|
||||||
ButtonWidget* myStateSlotButton;
|
ButtonWidget* myStateSlotButton{nullptr};
|
||||||
ButtonWidget* myLoadStateButton;
|
ButtonWidget* myLoadStateButton{nullptr};
|
||||||
ButtonWidget* myRewindButton;
|
ButtonWidget* myRewindButton{nullptr};
|
||||||
ButtonWidget* myUnwindButton;
|
ButtonWidget* myUnwindButton{nullptr};
|
||||||
// column 2
|
// column 2
|
||||||
ButtonWidget* myTVFormatButton;
|
ButtonWidget* myTVFormatButton{nullptr};
|
||||||
ButtonWidget* myStretchButton;
|
ButtonWidget* myStretchButton{nullptr};
|
||||||
ButtonWidget* myPhosphorButton;
|
ButtonWidget* myPhosphorButton{nullptr};
|
||||||
|
|
||||||
unique_ptr<StellaSettingsDialog> myStellaSettingsDialog;
|
unique_ptr<StellaSettingsDialog> myStellaSettingsDialog;
|
||||||
unique_ptr<OptionsDialog> myOptionsDialog;
|
unique_ptr<OptionsDialog> myOptionsDialog;
|
||||||
|
|
|
@ -67,12 +67,12 @@ class OptionsDialog : public Dialog
|
||||||
unique_ptr<HelpDialog> myHelpDialog;
|
unique_ptr<HelpDialog> myHelpDialog;
|
||||||
unique_ptr<AboutDialog> myAboutDialog;
|
unique_ptr<AboutDialog> myAboutDialog;
|
||||||
|
|
||||||
ButtonWidget* myRomAuditButton;
|
ButtonWidget* myRomAuditButton{nullptr};
|
||||||
ButtonWidget* myGameInfoButton;
|
ButtonWidget* myGameInfoButton{nullptr};
|
||||||
ButtonWidget* myCheatCodeButton;
|
ButtonWidget* myCheatCodeButton{nullptr};
|
||||||
|
|
||||||
// Indicates if this dialog is used for global (vs. in-game) settings
|
// Indicates if this dialog is used for global (vs. in-game) settings
|
||||||
Menu::AppMode myMode;
|
Menu::AppMode myMode{Menu::AppMode::emulator};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kBasSetCmd = 'BAST',
|
kBasSetCmd = 'BAST',
|
||||||
|
|
|
@ -30,8 +30,7 @@ PopUpWidget::PopUpWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
: Widget(boss, font, x, y - 1, w, h + 2),
|
: Widget(boss, font, x, y - 1, w, h + 2),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
_label(label),
|
_label(label),
|
||||||
_labelWidth(labelWidth),
|
_labelWidth(labelWidth)
|
||||||
_changed(false)
|
|
||||||
{
|
{
|
||||||
_flags = Widget::FLAG_ENABLED | Widget::FLAG_RETAIN_FOCUS;
|
_flags = Widget::FLAG_ENABLED | Widget::FLAG_RETAIN_FOCUS;
|
||||||
_bgcolor = kDlgColor;
|
_bgcolor = kDlgColor;
|
||||||
|
|
|
@ -72,12 +72,12 @@ class PopUpWidget : public Widget, public CommandSender
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unique_ptr<ContextMenu> myMenu;
|
unique_ptr<ContextMenu> myMenu;
|
||||||
int myArrowsY;
|
int myArrowsY{0};
|
||||||
int myTextY;
|
int myTextY{0};
|
||||||
|
|
||||||
string _label;
|
string _label;
|
||||||
int _labelWidth;
|
int _labelWidth{0};
|
||||||
bool _changed;
|
bool _changed{false};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -27,12 +27,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
ProgressDialog::ProgressDialog(GuiObject* boss, const GUI::Font& font,
|
ProgressDialog::ProgressDialog(GuiObject* boss, const GUI::Font& font,
|
||||||
const string& message)
|
const string& message)
|
||||||
: Dialog(boss->instance(), boss->parent()),
|
: Dialog(boss->instance(), boss->parent())
|
||||||
myMessage(nullptr),
|
|
||||||
mySlider(nullptr),
|
|
||||||
myStart(0),
|
|
||||||
myFinish(0),
|
|
||||||
myStep(0)
|
|
||||||
{
|
{
|
||||||
const int fontWidth = font.getMaxCharWidth(),
|
const int fontWidth = font.getMaxCharWidth(),
|
||||||
fontHeight = font.getFontHeight(),
|
fontHeight = font.getFontHeight(),
|
||||||
|
|
|
@ -36,10 +36,10 @@ class ProgressDialog : public Dialog
|
||||||
void setProgress(int progress);
|
void setProgress(int progress);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StaticTextWidget* myMessage;
|
StaticTextWidget* myMessage{nullptr};
|
||||||
SliderWidget* mySlider;
|
SliderWidget* mySlider{nullptr};
|
||||||
|
|
||||||
int myStart, myFinish, myStep;
|
int myStart{0}, myFinish{0}, myStep{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -24,10 +24,8 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
R77HelpDialog::R77HelpDialog(OSystem& osystem, DialogContainer& parent,
|
R77HelpDialog::R77HelpDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font)
|
const GUI::Font& font)
|
||||||
: Dialog(osystem, parent, font, "RetroN 77 help"),
|
: Dialog(osystem, parent, font, "RetroN 77 help")
|
||||||
myPage(1),
|
|
||||||
myNumPages(4)
|
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
fontWidth = font.getMaxCharWidth(),
|
fontWidth = font.getMaxCharWidth(),
|
||||||
|
|
|
@ -42,19 +42,19 @@ class R77HelpDialog : public Dialog
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr uInt32 LINES_PER_PAGE = 11;
|
static constexpr uInt32 LINES_PER_PAGE = 11;
|
||||||
ButtonWidget* myNextButton;
|
ButtonWidget* myNextButton{nullptr};
|
||||||
ButtonWidget* myPrevButton;
|
ButtonWidget* myPrevButton{nullptr};
|
||||||
|
|
||||||
StaticTextWidget* myTitle;
|
StaticTextWidget* myTitle{nullptr};
|
||||||
std::array<StaticTextWidget*, LINES_PER_PAGE> myJoy;
|
std::array<StaticTextWidget*, LINES_PER_PAGE> myJoy{nullptr};
|
||||||
std::array<StaticTextWidget*, LINES_PER_PAGE> myBtn;
|
std::array<StaticTextWidget*, LINES_PER_PAGE> myBtn{nullptr};
|
||||||
std::array<StaticTextWidget*, LINES_PER_PAGE> myDesc;
|
std::array<StaticTextWidget*, LINES_PER_PAGE> myDesc{nullptr};
|
||||||
std::array<string, LINES_PER_PAGE> myJoyStr;
|
std::array<string, LINES_PER_PAGE> myJoyStr;
|
||||||
std::array<string, LINES_PER_PAGE> myBtnStr;
|
std::array<string, LINES_PER_PAGE> myBtnStr;
|
||||||
std::array<string, LINES_PER_PAGE> myDescStr;
|
std::array<string, LINES_PER_PAGE> myDescStr;
|
||||||
|
|
||||||
uInt8 myPage;
|
uInt8 myPage{1};
|
||||||
uInt8 myNumPages;
|
uInt8 myNumPages{4};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -46,8 +46,7 @@ static constexpr std::array<uInt32, RADIO_IMG_FILL_SIZE> radio_img_inactive = {
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
RadioButtonWidget::RadioButtonWidget(GuiObject* boss, const GUI::Font& font,
|
RadioButtonWidget::RadioButtonWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, const string& label,
|
int x, int y, const string& label,
|
||||||
RadioButtonGroup* group,
|
RadioButtonGroup* group, int cmd)
|
||||||
int cmd)
|
|
||||||
: CheckboxWidget(boss, font, x, y, label, cmd),
|
: CheckboxWidget(boss, font, x, y, label, cmd),
|
||||||
myGroup(group)
|
myGroup(group)
|
||||||
{
|
{
|
||||||
|
@ -62,7 +61,6 @@ RadioButtonWidget::RadioButtonWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
_w = font.getStringWidth(label) + 20;
|
_w = font.getStringWidth(label) + 20;
|
||||||
_h = font.getFontHeight() < 14 ? 14 : font.getFontHeight();
|
_h = font.getFontHeight() < 14 ? 14 : font.getFontHeight();
|
||||||
|
|
||||||
|
|
||||||
// Depending on font size, either the font or box will need to be
|
// Depending on font size, either the font or box will need to be
|
||||||
// centered vertically
|
// centered vertically
|
||||||
if(_h > 14) // center box
|
if(_h > 14) // center box
|
||||||
|
|
|
@ -42,7 +42,7 @@ class RadioButtonWidget : public CheckboxWidget
|
||||||
void drawWidget(bool hilite) override;
|
void drawWidget(bool hilite) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RadioButtonGroup* myGroup;
|
RadioButtonGroup* myGroup{nullptr};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -57,17 +57,17 @@ class RomAuditDialog : public Dialog
|
||||||
const GUI::Font& myFont;
|
const GUI::Font& myFont;
|
||||||
|
|
||||||
// ROM audit path
|
// ROM audit path
|
||||||
EditTextWidget* myRomPath;
|
EditTextWidget* myRomPath{nullptr};
|
||||||
|
|
||||||
// Show the results of the ROM audit
|
// Show the results of the ROM audit
|
||||||
EditTextWidget* myResults1;
|
EditTextWidget* myResults1{nullptr};
|
||||||
EditTextWidget* myResults2;
|
EditTextWidget* myResults2{nullptr};
|
||||||
|
|
||||||
// Show a message about the dangers of using this function
|
// Show a message about the dangers of using this function
|
||||||
unique_ptr<GUI::MessageBox> myConfirmMsg;
|
unique_ptr<GUI::MessageBox> myConfirmMsg;
|
||||||
|
|
||||||
// Maximum width and height for this dialog
|
// Maximum width and height for this dialog
|
||||||
int myMaxWidth, myMaxHeight;
|
int myMaxWidth{0}, myMaxHeight{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -36,8 +36,6 @@
|
||||||
RomInfoWidget::RomInfoWidget(GuiObject* boss, const GUI::Font& font,
|
RomInfoWidget::RomInfoWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h)
|
||||||
: Widget(boss, font, x, y, w, h),
|
: Widget(boss, font, x, y, w, h),
|
||||||
mySurfaceIsValid(false),
|
|
||||||
myHaveProperties(false),
|
|
||||||
myAvail(w > 400 ?
|
myAvail(w > 400 ?
|
||||||
Common::Size(TIAConstants::viewableWidth*2, TIAConstants::viewableHeight*2) :
|
Common::Size(TIAConstants::viewableWidth*2, TIAConstants::viewableHeight*2) :
|
||||||
Common::Size(TIAConstants::viewableWidth, TIAConstants::viewableHeight))
|
Common::Size(TIAConstants::viewableWidth, TIAConstants::viewableHeight))
|
||||||
|
|
|
@ -49,7 +49,7 @@ class RomInfoWidget : public Widget
|
||||||
shared_ptr<FBSurface> mySurface;
|
shared_ptr<FBSurface> mySurface;
|
||||||
|
|
||||||
// Whether the surface should be redrawn by drawWidget()
|
// 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
|
// Some ROM properties info, as well as 'tEXt' chunks from the PNG image
|
||||||
StringList myRomInfo;
|
StringList myRomInfo;
|
||||||
|
@ -58,7 +58,7 @@ class RomInfoWidget : public Widget
|
||||||
Properties myProperties;
|
Properties myProperties;
|
||||||
|
|
||||||
// Indicates if the current properties should actually be used
|
// Indicates if the current properties should actually be used
|
||||||
bool myHaveProperties;
|
bool myHaveProperties{false};
|
||||||
|
|
||||||
// Indicates if an error occurred in creating/displaying the surface
|
// Indicates if an error occurred in creating/displaying the surface
|
||||||
string mySurfaceErrorMsg;
|
string mySurfaceErrorMsg;
|
||||||
|
|
|
@ -33,16 +33,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
ScrollBarWidget::ScrollBarWidget(GuiObject* boss, const GUI::Font& font,
|
ScrollBarWidget::ScrollBarWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h)
|
||||||
: Widget(boss, font, x, y, w, h), CommandSender(boss),
|
: 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)
|
|
||||||
{
|
{
|
||||||
_flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE | Widget::FLAG_CLEARBG;
|
_flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE | Widget::FLAG_CLEARBG;
|
||||||
_bgcolor = kWidColor;
|
_bgcolor = kWidColor;
|
||||||
|
@ -54,7 +45,7 @@ void ScrollBarWidget::handleMouseDown(int x, int y, MouseButton b,
|
||||||
int clickCount)
|
int clickCount)
|
||||||
{
|
{
|
||||||
// Ignore subsequent mouse clicks when the slider is being moved
|
// Ignore subsequent mouse clicks when the slider is being moved
|
||||||
if(_draggingPart == kSliderPart)
|
if(_draggingPart == Part::Slider)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int old_pos = _currentPos;
|
int old_pos = _currentPos;
|
||||||
|
@ -67,13 +58,13 @@ void ScrollBarWidget::handleMouseDown(int x, int y, MouseButton b,
|
||||||
{
|
{
|
||||||
// Up arrow
|
// Up arrow
|
||||||
_currentPos--;
|
_currentPos--;
|
||||||
_draggingPart = kUpArrowPart;
|
_draggingPart = Part::UpArrow;
|
||||||
}
|
}
|
||||||
else if(y >= _h - UP_DOWN_BOX_HEIGHT)
|
else if(y >= _h - UP_DOWN_BOX_HEIGHT)
|
||||||
{
|
{
|
||||||
// Down arrow
|
// Down arrow
|
||||||
_currentPos++;
|
_currentPos++;
|
||||||
_draggingPart = kDownArrowPart;
|
_draggingPart = Part::DownArrow;
|
||||||
}
|
}
|
||||||
else if(y < _sliderPos)
|
else if(y < _sliderPos)
|
||||||
{
|
{
|
||||||
|
@ -85,7 +76,7 @@ void ScrollBarWidget::handleMouseDown(int x, int y, MouseButton b,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_draggingPart = kSliderPart;
|
_draggingPart = Part::Slider;
|
||||||
_sliderDeltaMouseDownPos = y - _sliderPos;
|
_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,
|
void ScrollBarWidget::handleMouseUp(int x, int y, MouseButton b,
|
||||||
int clickCount)
|
int clickCount)
|
||||||
{
|
{
|
||||||
_draggingPart = kNoPart;
|
_draggingPart = Part::None;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -124,7 +115,7 @@ void ScrollBarWidget::handleMouseMoved(int x, int y)
|
||||||
if(_numEntries <= _entriesPerPage)
|
if(_numEntries <= _entriesPerPage)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(_draggingPart == kSliderPart)
|
if(_draggingPart == Part::Slider)
|
||||||
{
|
{
|
||||||
int old_pos = _currentPos;
|
int old_pos = _currentPos;
|
||||||
_sliderPos = y - _sliderDeltaMouseDownPos;
|
_sliderPos = y - _sliderDeltaMouseDownPos;
|
||||||
|
@ -141,18 +132,18 @@ void ScrollBarWidget::handleMouseMoved(int x, int y)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int old_part = _part;
|
Part old_part = _part;
|
||||||
|
|
||||||
if(y <= UP_DOWN_BOX_HEIGHT) // Up arrow
|
if(y <= UP_DOWN_BOX_HEIGHT) // Up arrow
|
||||||
_part = kUpArrowPart;
|
_part = Part::UpArrow;
|
||||||
else if(y >= _h - UP_DOWN_BOX_HEIGHT) // Down arrow
|
else if(y >= _h - UP_DOWN_BOX_HEIGHT) // Down arrow
|
||||||
_part = kDownArrowPart;
|
_part = Part::DownArrow;
|
||||||
else if(y < _sliderPos)
|
else if(y < _sliderPos)
|
||||||
_part = kPageUpPart;
|
_part = Part::PageUp;
|
||||||
else if(y >= _sliderPos + _sliderHeight)
|
else if(y >= _sliderPos + _sliderHeight)
|
||||||
_part = kPageDownPart;
|
_part = Part::PageDown;
|
||||||
else
|
else
|
||||||
_part = kSliderPart;
|
_part = Part::Slider;
|
||||||
|
|
||||||
if (old_part != _part)
|
if (old_part != _part)
|
||||||
setDirty();
|
setDirty();
|
||||||
|
@ -191,7 +182,7 @@ void ScrollBarWidget::handleMouseEntered()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void ScrollBarWidget::handleMouseLeft()
|
void ScrollBarWidget::handleMouseLeft()
|
||||||
{
|
{
|
||||||
_part = kNoPart;
|
_part = Part::None;
|
||||||
clearFlags(Widget::FLAG_HILITED);
|
clearFlags(Widget::FLAG_HILITED);
|
||||||
setDirty();
|
setDirty();
|
||||||
}
|
}
|
||||||
|
@ -255,28 +246,28 @@ void ScrollBarWidget::drawWidget(bool hilite)
|
||||||
|
|
||||||
s.frameRect(_x, _y, _w, _h, hilite ? kWidColorHi : kColor);
|
s.frameRect(_x, _y, _w, _h, hilite ? kWidColorHi : kColor);
|
||||||
|
|
||||||
if(_draggingPart != kNoPart)
|
if(_draggingPart != Part::None)
|
||||||
_part = _draggingPart;
|
_part = _draggingPart;
|
||||||
|
|
||||||
// Up arrow
|
// 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.fillRect(_x + 1, _y + 1, _w - 2, UP_DOWN_BOX_HEIGHT - 2, kScrollColor);
|
||||||
s.drawBitmap(up_arrow.data(), _x+4, _y+5,
|
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);
|
: kTextColor : kColor, 8);
|
||||||
|
|
||||||
// Down arrow
|
// 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.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,
|
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);
|
kWidColor : kTextColor : kColor, 8);
|
||||||
|
|
||||||
// Slider
|
// Slider
|
||||||
if(!isSinglePage)
|
if(!isSinglePage)
|
||||||
{
|
{
|
||||||
s.fillRect(_x + 1, _y + _sliderPos - 1, _w - 2, _sliderHeight + 2,
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,26 +53,19 @@ class ScrollBarWidget : public Widget, public CommandSender
|
||||||
void handleMouseLeft() override;
|
void handleMouseLeft() override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int _numEntries;
|
int _numEntries{0};
|
||||||
int _entriesPerPage;
|
int _entriesPerPage{0};
|
||||||
int _currentPos;
|
int _currentPos{0};
|
||||||
int _wheel_lines;
|
int _wheel_lines{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum Part {
|
enum class Part { None, UpArrow, DownArrow, Slider, PageUp, PageDown };
|
||||||
kNoPart,
|
|
||||||
kUpArrowPart,
|
|
||||||
kDownArrowPart,
|
|
||||||
kSliderPart,
|
|
||||||
kPageUpPart,
|
|
||||||
kPageDownPart
|
|
||||||
};
|
|
||||||
|
|
||||||
Part _part;
|
Part _part{Part::None};
|
||||||
Part _draggingPart;
|
Part _draggingPart{Part::None};
|
||||||
int _sliderHeight;
|
int _sliderHeight{0};
|
||||||
int _sliderPos;
|
int _sliderPos{0};
|
||||||
int _sliderDeltaMouseDownPos;
|
int _sliderDeltaMouseDownPos{0};
|
||||||
|
|
||||||
static int _WHEEL_LINES;
|
static int _WHEEL_LINES;
|
||||||
|
|
||||||
|
|
|
@ -55,13 +55,13 @@ class SnapshotDialog : public Dialog
|
||||||
const GUI::Font& myFont;
|
const GUI::Font& myFont;
|
||||||
|
|
||||||
// Config paths
|
// Config paths
|
||||||
EditTextWidget* mySnapSavePath;
|
EditTextWidget* mySnapSavePath{nullptr};
|
||||||
|
|
||||||
CheckboxWidget* mySnapName;
|
CheckboxWidget* mySnapName{nullptr};
|
||||||
SliderWidget* mySnapInterval;
|
SliderWidget* mySnapInterval{nullptr};
|
||||||
|
|
||||||
CheckboxWidget* mySnapSingle;
|
CheckboxWidget* mySnapSingle{nullptr};
|
||||||
CheckboxWidget* mySnap1x;
|
CheckboxWidget* mySnap1x{nullptr};
|
||||||
|
|
||||||
unique_ptr<BrowserDialog> myBrowser;
|
unique_ptr<BrowserDialog> myBrowser;
|
||||||
|
|
||||||
|
|
|
@ -70,30 +70,30 @@ class StellaSettingsDialog : public Dialog
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// UI theme
|
// UI theme
|
||||||
PopUpWidget* myThemePopup;
|
PopUpWidget* myThemePopup{nullptr};
|
||||||
PopUpWidget* myPositionPopup;
|
PopUpWidget* myPositionPopup{nullptr};
|
||||||
|
|
||||||
// TV effects
|
// TV effects
|
||||||
PopUpWidget* myTVMode;
|
PopUpWidget* myTVMode{nullptr};
|
||||||
|
|
||||||
// TV scanline intensity
|
// TV scanline intensity
|
||||||
SliderWidget* myTVScanIntense;
|
SliderWidget* myTVScanIntense{nullptr};
|
||||||
|
|
||||||
// TV phosphor effect
|
// TV phosphor effect
|
||||||
SliderWidget* myTVPhosLevel;
|
SliderWidget* myTVPhosLevel{nullptr};
|
||||||
|
|
||||||
// TV Overscan
|
// TV Overscan
|
||||||
SliderWidget* myTVOverscan;
|
SliderWidget* myTVOverscan{nullptr};
|
||||||
|
|
||||||
// Controller properties
|
// Controller properties
|
||||||
StaticTextWidget* myGameSettings;
|
StaticTextWidget* myGameSettings{nullptr};
|
||||||
|
|
||||||
StaticTextWidget* myLeftPortLabel;
|
StaticTextWidget* myLeftPortLabel{nullptr};
|
||||||
StaticTextWidget* myRightPortLabel;
|
StaticTextWidget* myRightPortLabel{nullptr};
|
||||||
PopUpWidget* myLeftPort;
|
PopUpWidget* myLeftPort{nullptr};
|
||||||
StaticTextWidget* myLeftPortDetected;
|
StaticTextWidget* myLeftPortDetected{nullptr};
|
||||||
PopUpWidget* myRightPort;
|
PopUpWidget* myRightPort{nullptr};
|
||||||
StaticTextWidget* myRightPortDetected;
|
StaticTextWidget* myRightPortDetected{nullptr};
|
||||||
|
|
||||||
unique_ptr<GUI::MessageBox> myConfirmMsg;
|
unique_ptr<GUI::MessageBox> myConfirmMsg;
|
||||||
#if defined(RETRON77)
|
#if defined(RETRON77)
|
||||||
|
@ -103,7 +103,7 @@ class StellaSettingsDialog : public Dialog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Indicates if this dialog is used for global (vs. in-game) settings
|
// Indicates if this dialog is used for global (vs. in-game) settings
|
||||||
Menu::AppMode myMode;
|
Menu::AppMode myMode{Menu::AppMode::emulator};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kAdvancedSettings = 'SSad',
|
kAdvancedSettings = 'SSad',
|
||||||
|
|
|
@ -38,7 +38,7 @@ class StringListWidget : public ListWidget
|
||||||
Common::Rect getEditRect() const override;
|
Common::Rect getEditRect() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool _hilite;
|
bool _hilite{false};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -28,10 +28,7 @@
|
||||||
TabWidget::TabWidget(GuiObject* boss, const GUI::Font& font,
|
TabWidget::TabWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h)
|
||||||
: Widget(boss, font, x, y, w, h),
|
: Widget(boss, font, x, y, w, h),
|
||||||
CommandSender(boss),
|
CommandSender(boss)
|
||||||
_tabWidth(40),
|
|
||||||
_activeTab(-1),
|
|
||||||
_firstTime(true)
|
|
||||||
{
|
{
|
||||||
_id = 0; // For dialogs with multiple tab widgets, they should specifically
|
_id = 0; // For dialogs with multiple tab widgets, they should specifically
|
||||||
// call ::setID to differentiate among them
|
// call ::setID to differentiate among them
|
||||||
|
|
|
@ -76,10 +76,10 @@ class TabWidget : public Widget, public CommandSender
|
||||||
private:
|
private:
|
||||||
struct Tab {
|
struct Tab {
|
||||||
string title;
|
string title;
|
||||||
Widget* firstWidget;
|
Widget* firstWidget{nullptr};
|
||||||
Widget* parentWidget;
|
Widget* parentWidget{nullptr};
|
||||||
bool enabled;
|
bool enabled{true};
|
||||||
int tabWidth;
|
int tabWidth{0};
|
||||||
|
|
||||||
Tab(const string& t, int tw = NO_WIDTH,
|
Tab(const string& t, int tw = NO_WIDTH,
|
||||||
Widget* first = nullptr, Widget* parent = nullptr, bool e = true)
|
Widget* first = nullptr, Widget* parent = nullptr, bool e = true)
|
||||||
|
@ -88,10 +88,10 @@ class TabWidget : public Widget, public CommandSender
|
||||||
using TabList = vector<Tab>;
|
using TabList = vector<Tab>;
|
||||||
|
|
||||||
TabList _tabs;
|
TabList _tabs;
|
||||||
int _tabWidth;
|
int _tabWidth{40};
|
||||||
int _tabHeight;
|
int _tabHeight{1};
|
||||||
int _activeTab;
|
int _activeTab{-1};
|
||||||
bool _firstTime;
|
bool _firstTime{true};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kTabLeftOffset = 0,
|
kTabLeftOffset = 0,
|
||||||
|
|
|
@ -33,10 +33,6 @@ TimeLineWidget::TimeLineWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h,
|
int x, int y, int w, int h,
|
||||||
const string& label, uInt32 labelWidth, int cmd)
|
const string& label, uInt32 labelWidth, int cmd)
|
||||||
: ButtonWidget(boss, font, x, y, w, h, label, cmd),
|
: ButtonWidget(boss, font, x, y, w, h, label, cmd),
|
||||||
_value(0),
|
|
||||||
_valueMin(0),
|
|
||||||
_valueMax(0),
|
|
||||||
_isDragging(false),
|
|
||||||
_labelWidth(labelWidth)
|
_labelWidth(labelWidth)
|
||||||
{
|
{
|
||||||
_flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE;
|
_flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE;
|
||||||
|
|
|
@ -53,10 +53,10 @@ class TimeLineWidget : public ButtonWidget
|
||||||
uInt32 posToValue(uInt32 pos);
|
uInt32 posToValue(uInt32 pos);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uInt32 _value;
|
uInt32 _value{0};
|
||||||
uInt32 _valueMin, _valueMax;
|
uInt32 _valueMin{0}, _valueMax{0};
|
||||||
bool _isDragging;
|
bool _isDragging{false};
|
||||||
uInt32 _labelWidth;
|
uInt32 _labelWidth{0};
|
||||||
|
|
||||||
uIntArray _stepValue;
|
uIntArray _stepValue;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
TimeMachine::TimeMachine(OSystem& osystem)
|
TimeMachine::TimeMachine(OSystem& osystem)
|
||||||
: DialogContainer(osystem),
|
: DialogContainer(osystem),
|
||||||
myBaseDialog(nullptr),
|
|
||||||
myWidth(FBMinimum::Width)
|
myWidth(FBMinimum::Width)
|
||||||
{
|
{
|
||||||
myBaseDialog = new TimeMachineDialog(myOSystem, *this, myWidth);
|
myBaseDialog = new TimeMachineDialog(myOSystem, *this, myWidth);
|
||||||
|
|
|
@ -50,9 +50,9 @@ class TimeMachine : public DialogContainer
|
||||||
void setEnterWinds(Int32 numWinds);
|
void setEnterWinds(Int32 numWinds);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Dialog* myBaseDialog;
|
Dialog* myBaseDialog{nullptr};
|
||||||
|
|
||||||
uInt32 myWidth;
|
uInt32 myWidth{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -184,8 +184,7 @@ static constexpr std::array<uInt32, BUTTON_H> LOAD_ALL = {
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
TimeMachineDialog::TimeMachineDialog(OSystem& osystem, DialogContainer& parent,
|
TimeMachineDialog::TimeMachineDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
int width)
|
int width)
|
||||||
: Dialog(osystem, parent),
|
: Dialog(osystem, parent)
|
||||||
_enterWinds(0)
|
|
||||||
{
|
{
|
||||||
const GUI::Font& font = instance().frameBuffer().font();
|
const GUI::Font& font = instance().frameBuffer().font();
|
||||||
const int H_BORDER = 6, BUTTON_GAP = 4, V_BORDER = 4;
|
const int H_BORDER = 6, BUTTON_GAP = 4, V_BORDER = 4;
|
||||||
|
|
|
@ -69,25 +69,25 @@ class TimeMachineDialog : public Dialog
|
||||||
kLoadAll = 'TMld',
|
kLoadAll = 'TMld',
|
||||||
};
|
};
|
||||||
|
|
||||||
TimeLineWidget* myTimeline;
|
TimeLineWidget* myTimeline{nullptr};
|
||||||
|
|
||||||
ButtonWidget* myToggleWidget;
|
ButtonWidget* myToggleWidget{nullptr};
|
||||||
ButtonWidget* myPlayWidget;
|
ButtonWidget* myPlayWidget{nullptr};
|
||||||
ButtonWidget* myRewindAllWidget;
|
ButtonWidget* myRewindAllWidget{nullptr};
|
||||||
ButtonWidget* myRewind1Widget;
|
ButtonWidget* myRewind1Widget{nullptr};
|
||||||
ButtonWidget* myUnwind1Widget;
|
ButtonWidget* myUnwind1Widget{nullptr};
|
||||||
ButtonWidget* myUnwindAllWidget;
|
ButtonWidget* myUnwindAllWidget{nullptr};
|
||||||
ButtonWidget* mySaveAllWidget;
|
ButtonWidget* mySaveAllWidget{nullptr};
|
||||||
ButtonWidget* myLoadAllWidget;
|
ButtonWidget* myLoadAllWidget{nullptr};
|
||||||
|
|
||||||
StaticTextWidget* myCurrentTimeWidget;
|
StaticTextWidget* myCurrentTimeWidget{nullptr};
|
||||||
StaticTextWidget* myLastTimeWidget;
|
StaticTextWidget* myLastTimeWidget{nullptr};
|
||||||
|
|
||||||
StaticTextWidget* myCurrentIdxWidget;
|
StaticTextWidget* myCurrentIdxWidget{nullptr};
|
||||||
StaticTextWidget* myLastIdxWidget;
|
StaticTextWidget* myLastIdxWidget{nullptr};
|
||||||
StaticTextWidget* myMessageWidget;
|
StaticTextWidget* myMessageWidget{nullptr};
|
||||||
|
|
||||||
Int32 _enterWinds;
|
Int32 _enterWinds{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -50,32 +50,32 @@ class UIDialog : public Dialog, public CommandSender
|
||||||
};
|
};
|
||||||
|
|
||||||
const GUI::Font& myFont;
|
const GUI::Font& myFont;
|
||||||
TabWidget* myTab;
|
TabWidget* myTab{nullptr};
|
||||||
|
|
||||||
// Launcher options
|
// Launcher options
|
||||||
EditTextWidget* myRomPath;
|
EditTextWidget* myRomPath{nullptr};
|
||||||
SliderWidget* myLauncherWidthSlider;
|
SliderWidget* myLauncherWidthSlider{nullptr};
|
||||||
SliderWidget* myLauncherHeightSlider;
|
SliderWidget* myLauncherHeightSlider{nullptr};
|
||||||
PopUpWidget* myLauncherFontPopup;
|
PopUpWidget* myLauncherFontPopup{nullptr};
|
||||||
PopUpWidget* myRomViewerPopup;
|
PopUpWidget* myRomViewerPopup{nullptr};
|
||||||
ButtonWidget* myOpenBrowserButton;
|
ButtonWidget* myOpenBrowserButton{nullptr};
|
||||||
EditTextWidget* mySnapLoadPath;
|
EditTextWidget* mySnapLoadPath{nullptr};
|
||||||
CheckboxWidget* myLauncherExitWidget;
|
CheckboxWidget* myLauncherExitWidget{nullptr};
|
||||||
|
|
||||||
// Misc options
|
// Misc options
|
||||||
PopUpWidget* myPalettePopup;
|
PopUpWidget* myPalettePopup{nullptr};
|
||||||
CheckboxWidget* myHidpiWidget;
|
CheckboxWidget* myHidpiWidget{nullptr};
|
||||||
PopUpWidget* myPositionPopup;
|
PopUpWidget* myPositionPopup{nullptr};
|
||||||
SliderWidget* myListDelaySlider;
|
SliderWidget* myListDelaySlider{nullptr};
|
||||||
SliderWidget* myWheelLinesSlider;
|
SliderWidget* myWheelLinesSlider{nullptr};
|
||||||
SliderWidget* myControllerRateSlider;
|
SliderWidget* myControllerRateSlider{nullptr};
|
||||||
SliderWidget* myControllerDelaySlider;
|
SliderWidget* myControllerDelaySlider{nullptr};
|
||||||
SliderWidget* myDoubleClickSlider;
|
SliderWidget* myDoubleClickSlider{nullptr};
|
||||||
|
|
||||||
unique_ptr<BrowserDialog> myBrowser;
|
unique_ptr<BrowserDialog> myBrowser;
|
||||||
|
|
||||||
// Indicates if this dialog is used for global (vs. in-game) settings
|
// Indicates if this dialog is used for global (vs. in-game) settings
|
||||||
bool myIsGlobal;
|
bool myIsGlobal{false};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -54,51 +54,51 @@ class VideoDialog : public Dialog
|
||||||
TabWidget* myTab;
|
TabWidget* myTab;
|
||||||
|
|
||||||
// General options
|
// General options
|
||||||
PopUpWidget* myRenderer;
|
PopUpWidget* myRenderer{nullptr};
|
||||||
SliderWidget* myTIAZoom;
|
SliderWidget* myTIAZoom{nullptr};
|
||||||
PopUpWidget* myTIAPalette;
|
PopUpWidget* myTIAPalette{nullptr};
|
||||||
CheckboxWidget* myTIAInterpolate;
|
CheckboxWidget* myTIAInterpolate{nullptr};
|
||||||
SliderWidget* myNAspectRatio;
|
SliderWidget* myNAspectRatio{nullptr};
|
||||||
SliderWidget* myPAspectRatio;
|
SliderWidget* myPAspectRatio{nullptr};
|
||||||
SliderWidget* mySpeed;
|
SliderWidget* mySpeed{nullptr};
|
||||||
|
|
||||||
CheckboxWidget* myFullscreen;
|
CheckboxWidget* myFullscreen{nullptr};
|
||||||
//PopUpWidget* myFullScreenMode;
|
//PopUpWidget* myFullScreenMode;
|
||||||
CheckboxWidget* myUseStretch;
|
CheckboxWidget* myUseStretch{nullptr};
|
||||||
SliderWidget* myTVOverscan;
|
SliderWidget* myTVOverscan{nullptr};
|
||||||
CheckboxWidget* myUseVSync;
|
CheckboxWidget* myUseVSync{nullptr};
|
||||||
CheckboxWidget* myUIMessages;
|
CheckboxWidget* myUIMessages{nullptr};
|
||||||
CheckboxWidget* myCenter;
|
CheckboxWidget* myCenter{nullptr};
|
||||||
CheckboxWidget* myFastSCBios;
|
CheckboxWidget* myFastSCBios{nullptr};
|
||||||
CheckboxWidget* myUseThreads;
|
CheckboxWidget* myUseThreads{nullptr};
|
||||||
|
|
||||||
// TV effects adjustables (custom mode)
|
// TV effects adjustables (custom mode)
|
||||||
PopUpWidget* myTVMode;
|
PopUpWidget* myTVMode{nullptr};
|
||||||
SliderWidget* myTVSharp;
|
SliderWidget* myTVSharp{nullptr};
|
||||||
SliderWidget* myTVHue;
|
SliderWidget* myTVHue{nullptr};
|
||||||
SliderWidget* myTVRes;
|
SliderWidget* myTVRes{nullptr};
|
||||||
SliderWidget* myTVArtifacts;
|
SliderWidget* myTVArtifacts{nullptr};
|
||||||
SliderWidget* myTVFringe;
|
SliderWidget* myTVFringe{nullptr};
|
||||||
SliderWidget* myTVBleed;
|
SliderWidget* myTVBleed{nullptr};
|
||||||
SliderWidget* myTVBright;
|
SliderWidget* myTVBright{nullptr};
|
||||||
SliderWidget* myTVContrast;
|
SliderWidget* myTVContrast{nullptr};
|
||||||
SliderWidget* myTVSatur;
|
SliderWidget* myTVSatur{nullptr};
|
||||||
SliderWidget* myTVGamma;
|
SliderWidget* myTVGamma{nullptr};
|
||||||
|
|
||||||
// TV phosphor effect
|
// TV phosphor effect
|
||||||
CheckboxWidget* myTVPhosphor;
|
CheckboxWidget* myTVPhosphor{nullptr};
|
||||||
SliderWidget* myTVPhosLevel;
|
SliderWidget* myTVPhosLevel{nullptr};
|
||||||
|
|
||||||
// TV scanline intensity and interpolation
|
// TV scanline intensity and interpolation
|
||||||
StaticTextWidget* myTVScanLabel;
|
StaticTextWidget* myTVScanLabel{nullptr};
|
||||||
SliderWidget* myTVScanIntense;
|
SliderWidget* myTVScanIntense{nullptr};
|
||||||
|
|
||||||
// TV effects adjustables presets (custom mode)
|
// TV effects adjustables presets (custom mode)
|
||||||
ButtonWidget* myCloneComposite;
|
ButtonWidget* myCloneComposite{nullptr};
|
||||||
ButtonWidget* myCloneSvideo;
|
ButtonWidget* myCloneSvideo{nullptr};
|
||||||
ButtonWidget* myCloneRGB;
|
ButtonWidget* myCloneRGB{nullptr};
|
||||||
ButtonWidget* myCloneBad;
|
ButtonWidget* myCloneBad{nullptr};
|
||||||
ButtonWidget* myCloneCustom;
|
ButtonWidget* myCloneCustom{nullptr};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kSpeedupChanged = 'VDSp',
|
kSpeedupChanged = 'VDSp',
|
||||||
|
|
|
@ -32,17 +32,7 @@ Widget::Widget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h)
|
||||||
: GuiObject(boss->instance(), boss->parent(), boss->dialog(), x, y, w, h),
|
: GuiObject(boss->instance(), boss->parent(), boss->dialog(), x, y, w, h),
|
||||||
_boss(boss),
|
_boss(boss),
|
||||||
_font(font),
|
_font(font)
|
||||||
_id(0),
|
|
||||||
_flags(0),
|
|
||||||
_hasFocus(false),
|
|
||||||
_bgcolor(kWidColor),
|
|
||||||
_bgcolorhi(kWidColor),
|
|
||||||
_bgcolorlo(kBGColorLo),
|
|
||||||
_textcolor(kTextColor),
|
|
||||||
_textcolorhi(kTextColorHi),
|
|
||||||
_textcolorlo(kBGColorLo),
|
|
||||||
_shadowcolor(kShadowColor)
|
|
||||||
{
|
{
|
||||||
// Insert into the widget list of the boss
|
// Insert into the widget list of the boss
|
||||||
_next = _boss->_firstWidget;
|
_next = _boss->_firstWidget;
|
||||||
|
@ -311,6 +301,7 @@ StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
const string& text, TextAlign align,
|
const string& text, TextAlign align,
|
||||||
ColorId shadowColor)
|
ColorId shadowColor)
|
||||||
: Widget(boss, font, x, y, w, h),
|
: Widget(boss, font, x, y, w, h),
|
||||||
|
_label(text),
|
||||||
_align(align)
|
_align(align)
|
||||||
{
|
{
|
||||||
_flags = Widget::FLAG_ENABLED;
|
_flags = Widget::FLAG_ENABLED;
|
||||||
|
@ -319,9 +310,6 @@ StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
_textcolor = kTextColor;
|
_textcolor = kTextColor;
|
||||||
_textcolorhi = kTextColor;
|
_textcolorhi = kTextColor;
|
||||||
_shadowcolor = shadowColor;
|
_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),
|
: StaticTextWidget(boss, font, x, y, w, h, label, TextAlign::Center),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
_cmd(cmd),
|
_cmd(cmd),
|
||||||
_repeat(repeat),
|
_repeat(repeat)
|
||||||
_useBitmap(false),
|
|
||||||
_bitmap(nullptr),
|
|
||||||
_bmw(0),
|
|
||||||
_bmh(0)
|
|
||||||
{
|
{
|
||||||
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG;
|
_flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG;
|
||||||
_bgcolor = kBtnColor;
|
_bgcolor = kBtnColor;
|
||||||
|
@ -381,15 +365,14 @@ ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
_textcolor = kBtnTextColor;
|
_textcolor = kBtnTextColor;
|
||||||
_textcolorhi = kBtnTextColorHi;
|
_textcolorhi = kBtnTextColorHi;
|
||||||
_textcolorlo = kBGColorLo;
|
_textcolorlo = kBGColorLo;
|
||||||
|
|
||||||
_editable = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font,
|
ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int dw,
|
int x, int y, int dw,
|
||||||
const string& label, int cmd, bool repeat)
|
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,
|
CheckboxWidget::CheckboxWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, const string& label,
|
int x, int y, const string& label,
|
||||||
int cmd)
|
int cmd)
|
||||||
: ButtonWidget(boss, font, x, y, 16, 16, label, cmd),
|
: ButtonWidget(boss, font, x, y, 16, 16, label, cmd)
|
||||||
_state(false),
|
|
||||||
_holdFocus(true),
|
|
||||||
_drawBox(true),
|
|
||||||
_changed(false),
|
|
||||||
_fillColor(kColor),
|
|
||||||
_boxY(0),
|
|
||||||
_textY(0)
|
|
||||||
{
|
{
|
||||||
_flags = Widget::FLAG_ENABLED;
|
_flags = Widget::FLAG_ENABLED;
|
||||||
_bgcolor = _bgcolorhi = kWidColor;
|
_bgcolor = _bgcolorhi = kWidColor;
|
||||||
|
@ -520,7 +496,6 @@ CheckboxWidget::CheckboxWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
_w = font.getStringWidth(label) + 20;
|
_w = font.getStringWidth(label) + 20;
|
||||||
_h = font.getFontHeight() < 14 ? 14 : font.getFontHeight();
|
_h = font.getFontHeight() < 14 ? 14 : font.getFontHeight();
|
||||||
|
|
||||||
|
|
||||||
// Depending on font size, either the font or box will need to be
|
// Depending on font size, either the font or box will need to be
|
||||||
// centered vertically
|
// centered vertically
|
||||||
if(_h > 14) // center box
|
if(_h > 14) // center box
|
||||||
|
@ -648,17 +623,10 @@ SliderWidget::SliderWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
const string& label, int labelWidth, int cmd,
|
const string& label, int labelWidth, int cmd,
|
||||||
int valueLabelWidth, const string& valueUnit, int valueLabelGap)
|
int valueLabelWidth, const string& valueUnit, int valueLabelGap)
|
||||||
: ButtonWidget(boss, font, x, y, w, h, label, cmd),
|
: ButtonWidget(boss, font, x, y, w, h, label, cmd),
|
||||||
_value(-1),
|
|
||||||
_stepValue(1),
|
|
||||||
_valueMin(0),
|
|
||||||
_valueMax(100),
|
|
||||||
_isDragging(false),
|
|
||||||
_labelWidth(labelWidth),
|
_labelWidth(labelWidth),
|
||||||
_valueLabel(""),
|
|
||||||
_valueUnit(valueUnit),
|
_valueUnit(valueUnit),
|
||||||
_valueLabelGap(valueLabelGap),
|
_valueLabelGap(valueLabelGap),
|
||||||
_valueLabelWidth(valueLabelWidth),
|
_valueLabelWidth(valueLabelWidth)
|
||||||
_numIntervals(0)
|
|
||||||
{
|
{
|
||||||
_flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE;
|
_flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE;
|
||||||
_bgcolor = kDlgColor;
|
_bgcolor = kDlgColor;
|
||||||
|
|
|
@ -133,21 +133,21 @@ class Widget : public GuiObject
|
||||||
{ assert(_boss); _boss->handleCommand(sender, cmd, data, id); }
|
{ assert(_boss); _boss->handleCommand(sender, cmd, data, id); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
GuiObject* _boss;
|
GuiObject* _boss{nullptr};
|
||||||
const GUI::Font& _font;
|
const GUI::Font& _font;
|
||||||
Widget* _next;
|
Widget* _next{nullptr};
|
||||||
uInt32 _id;
|
uInt32 _id{0};
|
||||||
uInt32 _flags;
|
uInt32 _flags{0};
|
||||||
bool _hasFocus;
|
bool _hasFocus{false};
|
||||||
int _fontWidth;
|
int _fontWidth{0};
|
||||||
int _fontHeight;
|
int _fontHeight{0};
|
||||||
ColorId _bgcolor;
|
ColorId _bgcolor{kWidColor};
|
||||||
ColorId _bgcolorhi;
|
ColorId _bgcolorhi{kWidColor};
|
||||||
ColorId _bgcolorlo;
|
ColorId _bgcolorlo{kBGColorLo};
|
||||||
ColorId _textcolor;
|
ColorId _textcolor{kTextColor};
|
||||||
ColorId _textcolorhi;
|
ColorId _textcolorhi{kTextColorHi};
|
||||||
ColorId _textcolorlo;
|
ColorId _textcolorlo{kBGColorLo};
|
||||||
ColorId _shadowcolor;
|
ColorId _shadowcolor{kShadowColor};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Widget* findWidgetInChain(Widget* start, int x, int y);
|
static Widget* findWidgetInChain(Widget* start, int x, int y);
|
||||||
|
@ -200,8 +200,8 @@ class StaticTextWidget : public Widget
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
string _label;
|
string _label;
|
||||||
bool _editable;
|
bool _editable{false};
|
||||||
TextAlign _align;
|
TextAlign _align{TextAlign::Left};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
@ -249,9 +249,9 @@ class ButtonWidget : public StaticTextWidget, public CommandSender
|
||||||
protected:
|
protected:
|
||||||
int _cmd{0};
|
int _cmd{0};
|
||||||
bool _repeat{false}; // button repeats
|
bool _repeat{false}; // button repeats
|
||||||
bool _useBitmap;
|
bool _useBitmap{false};
|
||||||
const uInt32* _bitmap;
|
const uInt32* _bitmap{nullptr};
|
||||||
int _bmw, _bmh;
|
int _bmw{0}, _bmh{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
@ -291,15 +291,15 @@ class CheckboxWidget : public ButtonWidget
|
||||||
void drawWidget(bool hilite) override;
|
void drawWidget(bool hilite) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool _state;
|
bool _state{false};
|
||||||
bool _holdFocus;
|
bool _holdFocus{true};
|
||||||
bool _drawBox;
|
bool _drawBox{true};
|
||||||
bool _changed;
|
bool _changed{false};
|
||||||
|
|
||||||
const uInt32* _img;
|
const uInt32* _img{nullptr};
|
||||||
ColorId _fillColor;
|
ColorId _fillColor{kColor};
|
||||||
int _boxY;
|
int _boxY{0};
|
||||||
int _textY;
|
int _textY{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
@ -317,11 +317,13 @@ class SliderWidget : public ButtonWidget
|
||||||
SliderWidget(GuiObject* boss, const GUI::Font& font,
|
SliderWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h,
|
int x, int y, int w, int h,
|
||||||
const string& label = "", int labelWidth = 0, int cmd = 0,
|
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,
|
SliderWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y,
|
int x, int y,
|
||||||
const string& label = "", int labelWidth = 0, int cmd = 0,
|
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;
|
virtual ~SliderWidget() = default;
|
||||||
|
|
||||||
void setValue(int value);
|
void setValue(int value);
|
||||||
|
@ -353,15 +355,15 @@ class SliderWidget : public ButtonWidget
|
||||||
int posToValue(int pos) const;
|
int posToValue(int pos) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int _value, _stepValue;
|
int _value{-1}, _stepValue{1};
|
||||||
int _valueMin, _valueMax;
|
int _valueMin{0}, _valueMax{100};
|
||||||
bool _isDragging;
|
bool _isDragging{false};
|
||||||
int _labelWidth;
|
int _labelWidth{0};
|
||||||
string _valueLabel;
|
string _valueLabel;
|
||||||
string _valueUnit;
|
string _valueUnit;
|
||||||
int _valueLabelGap;
|
int _valueLabelGap{0};
|
||||||
int _valueLabelWidth;
|
int _valueLabelWidth{0};
|
||||||
int _numIntervals;
|
int _numIntervals{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -54,9 +54,8 @@ class OSystemMACOS : public OSystem
|
||||||
string& savedir, string& loaddir,
|
string& savedir, string& loaddir,
|
||||||
bool useappdir, const string& usedir) override;
|
bool useappdir, const string& usedir) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual shared_ptr<KeyValueRepository> createSettingsRepository() override;
|
||||||
virtual shared_ptr<KeyValueRepository> createSettingsRepository() override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -29,8 +29,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
SerialPortMACOS::SerialPortMACOS()
|
SerialPortMACOS::SerialPortMACOS()
|
||||||
: SerialPort(),
|
: SerialPort()
|
||||||
myHandle(0)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ class SerialPortMACOS : public SerialPort
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// File descriptor for serial connection
|
// File descriptor for serial connection
|
||||||
int myHandle;
|
int myHandle{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -22,12 +22,12 @@
|
||||||
|
|
||||||
class SettingsRepositoryMACOS : public KeyValueRepository
|
class SettingsRepositoryMACOS : public KeyValueRepository
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::map<string, Variant> load() override;
|
std::map<string, Variant> load() override;
|
||||||
|
|
||||||
void save(const std::map<string, Variant>& values) override;
|
void save(const std::map<string, Variant>& values) override;
|
||||||
|
|
||||||
void save(const string& key, const Variant& value) override;
|
void save(const string& key, const Variant& value) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SETTINGS_REPOSITORY_MACOS_HXX
|
#endif // SETTINGS_REPOSITORY_MACOS_HXX
|
||||||
|
|
|
@ -178,12 +178,6 @@ const TCHAR* FilesystemNodeWINDOWS::toUnicode(const char* str)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
FilesystemNodeWINDOWS::FilesystemNodeWINDOWS()
|
FilesystemNodeWINDOWS::FilesystemNodeWINDOWS()
|
||||||
{
|
{
|
||||||
// Create a virtual root directory for standard Windows system
|
|
||||||
_isDirectory = true;
|
|
||||||
_isFile = false;
|
|
||||||
_isValid = false;
|
|
||||||
_path = "";
|
|
||||||
_isPseudoRoot = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -76,10 +76,10 @@ class FilesystemNodeWINDOWS : public AbstractFSNode
|
||||||
protected:
|
protected:
|
||||||
string _displayName;
|
string _displayName;
|
||||||
string _path;
|
string _path;
|
||||||
bool _isDirectory;
|
bool _isDirectory{true};
|
||||||
bool _isFile;
|
bool _isFile{false};
|
||||||
bool _isPseudoRoot;
|
bool _isPseudoRoot{true};
|
||||||
bool _isValid;
|
bool _isValid{false};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,8 +21,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
SerialPortWINDOWS::SerialPortWINDOWS()
|
SerialPortWINDOWS::SerialPortWINDOWS()
|
||||||
: SerialPort(),
|
: SerialPort()
|
||||||
myHandle(0)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ class SerialPortWINDOWS : public SerialPort
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Handle to serial port
|
// Handle to serial port
|
||||||
HANDLE myHandle;
|
HANDLE myHandle{0};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
Loading…
Reference in New Issue