mirror of https://github.com/stella-emu/stella.git
more response to SliderWidget added
units to SliderWidget added enhanced various dialogs with slider units
This commit is contained in:
parent
a0052e071f
commit
966ba155ed
|
@ -1010,6 +1010,9 @@ void FrameBuffer::VideoModeList::setZoom(uInt32 zoom)
|
|||
*** Slider colors ***
|
||||
kSliderColor,
|
||||
kSliderColorHi
|
||||
kSliderBGColor
|
||||
kSliderBGColorHi
|
||||
kSliderBGColorLo,
|
||||
*** Debugger colors ***
|
||||
kDbgChangedColor Background color for changed cells
|
||||
kDbgChangedTextColor Text color for changed cells
|
||||
|
@ -1019,6 +1022,8 @@ void FrameBuffer::VideoModeList::setZoom(uInt32 zoom)
|
|||
kColorInfo TIA output position color
|
||||
kColorTitleBar Title bar color
|
||||
kColorTitleText Title text color
|
||||
kColorTitleBarLo Disabled title bar color
|
||||
kColorTitleTextLo Disabled title text color
|
||||
*/
|
||||
uInt32 FrameBuffer::ourGUIColors[3][kNumColors-256] = {
|
||||
// Standard
|
||||
|
@ -1028,7 +1033,7 @@ uInt32 FrameBuffer::ourGUIColors[3][kNumColors-256] = {
|
|||
0xac3410, 0xd55941, 0x686868, 0xdccfa5, 0xf0f0cf, 0xf0f0cf, // buttons
|
||||
0xac3410, // checkbox
|
||||
0xac3410, 0xd55941, // scrollbar
|
||||
0xac3410, 0xd55941, // slider
|
||||
0xac3410, 0xd55941, 0xdccfa5, 0xf0f0cf, 0xa38c61, // slider
|
||||
0xc80000, 0x00ff00, 0xc8c8ff, 0xc80000, // debugger
|
||||
0xffffff, 0xac3410, 0xf0f0cf, 0x686868, 0xdccfa5 // other
|
||||
},
|
||||
|
@ -1039,7 +1044,7 @@ uInt32 FrameBuffer::ourGUIColors[3][kNumColors-256] = {
|
|||
0x000000, 0x000000, 0x686868, 0x00ff00, 0x20a020, 0x00ff00, // buttons
|
||||
0x20a020, // checkbox
|
||||
0x20a020, 0x00ff00, // scrollbar
|
||||
0x20a020, 0x00ff00, // slider
|
||||
0x20a020, 0x00ff00, 0x404040, 0x686868, 0x404040, // slider
|
||||
0xc80000, 0x00ff00, 0xc8c8ff, 0xc80000, // debugger
|
||||
0x20a020, 0x20a020, 0x000000, 0x686868, 0x404040 // other
|
||||
},
|
||||
|
@ -1050,7 +1055,7 @@ uInt32 FrameBuffer::ourGUIColors[3][kNumColors-256] = {
|
|||
0xe1e1e1, 0xe5f1fb, 0x808080, 0x0078d7, 0x000000, 0x000000, // buttons
|
||||
0x333333, // checkbox
|
||||
0xc0c0c0, 0x808080, // scrollbar
|
||||
0x333333, 0x0078d7, // slider
|
||||
0x333333, 0x0078d7, 0xc0c0c0, 0x808080, 0xe1e1e1, // slider
|
||||
0xffc0c0, 0x000000, 0xe00000, 0xc00000, // debugger
|
||||
0xffffff, 0x333333, 0xf0f0f0, 0x808080, 0xc0c0c0 // other
|
||||
}
|
||||
|
|
|
@ -66,6 +66,9 @@ enum {
|
|||
kScrollColorHi,
|
||||
kSliderColor,
|
||||
kSliderColorHi,
|
||||
kSliderBGColor,
|
||||
kSliderBGColorHi,
|
||||
kSliderBGColorLo,
|
||||
kDbgChangedColor,
|
||||
kDbgChangedTextColor,
|
||||
kDbgColorHi,
|
||||
|
|
|
@ -66,8 +66,8 @@ AudioDialog::AudioDialog(OSystem& osystem, DialogContainer& parent,
|
|||
xpos += INDENT;
|
||||
|
||||
// Volume
|
||||
myVolumeSlider = new SliderWidget(this, font, xpos, ypos,
|
||||
"Volume ", lwidth, 0, 3 * fontWidth);
|
||||
myVolumeSlider = new SliderWidget(this, font, xpos, ypos, 11 * fontWidth + 5, lineHeight,
|
||||
"Volume ", lwidth, 0, 4 * fontWidth, "%");
|
||||
myVolumeSlider->setMinValue(1); myVolumeSlider->setMaxValue(100);
|
||||
wid.push_back(myVolumeSlider);
|
||||
ypos += lineHeight + 4;
|
||||
|
|
|
@ -310,8 +310,10 @@ void DeveloperDialog::addTimeMachineTab(const GUI::Font& font)
|
|||
const int VBORDER = 8;
|
||||
const int VGAP = 4;
|
||||
int ypos = VBORDER;
|
||||
int lineHeight = font.getLineHeight();
|
||||
int fontHeight = font.getFontHeight();
|
||||
int lineHeight = font.getLineHeight(),
|
||||
fontHeight = font.getFontHeight(),
|
||||
fontWidth = font.getMaxCharWidth(),
|
||||
lwidth = fontWidth * 11;
|
||||
WidgetArray wid;
|
||||
VariantList items;
|
||||
int tabID = myTab->addTab("Time Machine");
|
||||
|
@ -332,24 +334,21 @@ void DeveloperDialog::addTimeMachineTab(const GUI::Font& font)
|
|||
wid.push_back(myTimeMachineWidget);
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
myStateSizeWidget = new SliderWidget(myTab, font, HBORDER + INDENT * 2, ypos - 1,
|
||||
"Buffer size (*) ", 0, kSizeChanged);
|
||||
int swidth = fontWidth * 12 + 5; // width of PopUpWidgets below
|
||||
myStateSizeWidget = new SliderWidget(myTab, font, HBORDER + INDENT * 2, ypos - 1, swidth, lineHeight,
|
||||
"Buffer size (*) ", 0, kSizeChanged, lwidth, " states");
|
||||
myStateSizeWidget->setMinValue(20);
|
||||
myStateSizeWidget->setMaxValue(1000);
|
||||
myStateSizeWidget->setStepValue(20);
|
||||
wid.push_back(myStateSizeWidget);
|
||||
myStateSizeLabelWidget = new StaticTextWidget(myTab, font, myStateSizeWidget->getRight() + 4,
|
||||
myStateSizeWidget->getTop() + 2, "100 ");
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
myUncompressedWidget = new SliderWidget(myTab, font, HBORDER + INDENT * 2, ypos - 1,
|
||||
"Uncompressed size ", 0, kUncompressedChanged);
|
||||
myUncompressedWidget = new SliderWidget(myTab, font, HBORDER + INDENT * 2, ypos - 1, swidth, lineHeight,
|
||||
"Uncompressed size ", 0, kUncompressedChanged, lwidth, " states");
|
||||
myUncompressedWidget->setMinValue(0);
|
||||
myUncompressedWidget->setMaxValue(1000);
|
||||
myUncompressedWidget->setStepValue(20);
|
||||
wid.push_back(myUncompressedWidget);
|
||||
myUncompressedLabelWidget = new StaticTextWidget(myTab, font, myUncompressedWidget->getRight() + 4,
|
||||
myUncompressedWidget->getTop() + 2, "50 ");
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
items.clear();
|
||||
|
@ -425,29 +424,21 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
|
|||
|
||||
// Debugger width and height
|
||||
myDebuggerWidthSlider = new SliderWidget(myTab, font, xpos, ypos-1, "Debugger width (*) ",
|
||||
0, kDWidthChanged);
|
||||
0, 0, 6 * fontWidth, "px");
|
||||
myDebuggerWidthSlider->setMinValue(DebuggerDialog::kSmallFontMinW);
|
||||
myDebuggerWidthSlider->setMaxValue(ds.w);
|
||||
myDebuggerWidthSlider->setStepValue(10);
|
||||
wid.push_back(myDebuggerWidthSlider);
|
||||
myDebuggerWidthLabel =
|
||||
new StaticTextWidget(myTab, font,
|
||||
xpos + myDebuggerWidthSlider->getWidth() + 4,
|
||||
ypos + 1, 4 * fontWidth, fontHeight, "");
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
myDebuggerHeightSlider = new SliderWidget(myTab, font, xpos, ypos-1, "Debugger height (*) ",
|
||||
0, kDHeightChanged);
|
||||
0, 0, 6 * fontWidth, "px");
|
||||
myDebuggerHeightSlider->setMinValue(DebuggerDialog::kSmallFontMinH);
|
||||
myDebuggerHeightSlider->setMaxValue(ds.h);
|
||||
myDebuggerHeightSlider->setStepValue(10);
|
||||
wid.push_back(myDebuggerHeightSlider);
|
||||
myDebuggerHeightLabel =
|
||||
new StaticTextWidget(myTab, font,
|
||||
xpos + myDebuggerHeightSlider->getWidth() + 4,
|
||||
ypos + 1, 4 * fontWidth, fontHeight, "");
|
||||
|
||||
ypos += lineHeight + VGAP * 4;
|
||||
|
||||
myGhostReadsTrapWidget = new CheckboxWidget(myTab, font, HBORDER, ypos + 1,
|
||||
"Trap on 'ghost' reads", kGhostReads);
|
||||
wid.push_back(myGhostReadsTrapWidget);
|
||||
|
@ -468,11 +459,8 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
|
|||
if(!debuggerAvailable)
|
||||
{
|
||||
myDebuggerWidthSlider->clearFlags(WIDGET_ENABLED);
|
||||
myDebuggerWidthLabel->clearFlags(WIDGET_ENABLED);
|
||||
myDebuggerHeightSlider->clearFlags(WIDGET_ENABLED);
|
||||
myDebuggerHeightLabel->clearFlags(WIDGET_ENABLED);
|
||||
}
|
||||
|
||||
#else
|
||||
new StaticTextWidget(myTab, font, 0, 20, _w - 20, font.getFontHeight(),
|
||||
"Debugger support not included", TextAlign::Center);
|
||||
|
@ -660,9 +648,7 @@ void DeveloperDialog::loadConfig()
|
|||
w = ds.w; h = ds.h;
|
||||
|
||||
myDebuggerWidthSlider->setValue(w);
|
||||
myDebuggerWidthLabel->setValue(w);
|
||||
myDebuggerHeightSlider->setValue(h);
|
||||
myDebuggerHeightLabel->setValue(h);
|
||||
|
||||
// Debugger font size
|
||||
string size = instance().settings().getString("dbg.fontsize");
|
||||
|
@ -789,9 +775,7 @@ void DeveloperDialog::setDefaults()
|
|||
uInt32 w = std::min(instance().frameBuffer().desktopSize().w, uInt32(DebuggerDialog::kMediumFontMinW));
|
||||
uInt32 h = std::min(instance().frameBuffer().desktopSize().h, uInt32(DebuggerDialog::kMediumFontMinH));
|
||||
myDebuggerWidthSlider->setValue(w);
|
||||
myDebuggerWidthLabel->setValue(w);
|
||||
myDebuggerHeightSlider->setValue(h);
|
||||
myDebuggerHeightLabel->setValue(h);
|
||||
myDebuggerFontSize->setSelected("medium");
|
||||
myDebuggerFontStyle->setSelected("0");
|
||||
|
||||
|
@ -881,14 +865,6 @@ void DeveloperDialog::handleCommand(CommandSender* sender, int cmd, int data, in
|
|||
break;
|
||||
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
case kDWidthChanged:
|
||||
myDebuggerWidthLabel->setValue(myDebuggerWidthSlider->getValue());
|
||||
break;
|
||||
|
||||
case kDHeightChanged:
|
||||
myDebuggerHeightLabel->setValue(myDebuggerHeightSlider->getValue());
|
||||
break;
|
||||
|
||||
case kDFontSizeChanged:
|
||||
handleFontSize();
|
||||
break;
|
||||
|
@ -961,11 +937,7 @@ void DeveloperDialog::handleTimeMachine()
|
|||
bool enable = myTimeMachineWidget->getState();
|
||||
|
||||
myStateSizeWidget->setEnabled(enable);
|
||||
myStateSizeLabelWidget->setEnabled(enable);
|
||||
|
||||
myUncompressedWidget->setEnabled(enable);
|
||||
myUncompressedLabelWidget->setEnabled(enable);
|
||||
|
||||
myStateIntervalWidget->setEnabled(enable);
|
||||
|
||||
uInt32 size = myStateSizeWidget->getValue();
|
||||
|
@ -990,7 +962,6 @@ void DeveloperDialog::handleSize()
|
|||
if(horizon == -1)
|
||||
horizon = 0;
|
||||
|
||||
myStateSizeLabelWidget->setValue(size);
|
||||
// adapt horizon and interval
|
||||
do
|
||||
{
|
||||
|
@ -1020,8 +991,6 @@ void DeveloperDialog::handleUncompressed()
|
|||
uInt32 size = myStateSizeWidget->getValue();
|
||||
uInt32 uncompressed = myUncompressedWidget->getValue();
|
||||
|
||||
myUncompressedLabelWidget->setValue(myUncompressedWidget->getValue());
|
||||
|
||||
if(size < uncompressed)
|
||||
myStateSizeWidget->setValue(uncompressed);
|
||||
myStateHorizonWidget->setEnabled(myTimeMachineWidget->getState() && size > uncompressed);
|
||||
|
@ -1219,16 +1188,10 @@ void DeveloperDialog::handleFontSize()
|
|||
|
||||
myDebuggerWidthSlider->setMinValue(minW);
|
||||
if(minW > uInt32(myDebuggerWidthSlider->getValue()))
|
||||
{
|
||||
myDebuggerWidthSlider->setValue(minW);
|
||||
myDebuggerWidthLabel->setValue(minW);
|
||||
}
|
||||
|
||||
myDebuggerHeightSlider->setMinValue(minH);
|
||||
if(minH > uInt32(myDebuggerHeightSlider->getValue()))
|
||||
{
|
||||
myDebuggerHeightSlider->setValue(minH);
|
||||
myDebuggerHeightLabel->setValue(minH);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -74,8 +74,6 @@ class DeveloperDialog : public Dialog
|
|||
kPFColourChangedCmd = 'GOpf',
|
||||
kBLColourChangedCmd = 'GObl',
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
kDWidthChanged = 'UIdw',
|
||||
kDHeightChanged = 'UIdh',
|
||||
kDFontSizeChanged = 'UIfs',
|
||||
kGhostReads = 'Dbgh'
|
||||
#endif
|
||||
|
@ -120,18 +118,14 @@ class DeveloperDialog : public Dialog
|
|||
RadioButtonGroup* mySettingsGroup2;
|
||||
CheckboxWidget* myTimeMachineWidget;
|
||||
SliderWidget* myStateSizeWidget;
|
||||
StaticTextWidget* myStateSizeLabelWidget;
|
||||
SliderWidget* myUncompressedWidget;
|
||||
StaticTextWidget* myUncompressedLabelWidget;
|
||||
PopUpWidget* myStateIntervalWidget;
|
||||
PopUpWidget* myStateHorizonWidget;
|
||||
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
// Debugger UI widgets
|
||||
SliderWidget* myDebuggerWidthSlider;
|
||||
StaticTextWidget* myDebuggerWidthLabel;
|
||||
SliderWidget* myDebuggerHeightSlider;
|
||||
StaticTextWidget* myDebuggerHeightLabel;
|
||||
PopUpWidget* myDebuggerFontSize;
|
||||
PopUpWidget* myDebuggerFontStyle;
|
||||
CheckboxWidget* myGhostReadsTrapWidget;
|
||||
|
|
|
@ -55,7 +55,7 @@ GameInfoDialog::GameInfoDialog(
|
|||
const int hSpace = 10;
|
||||
const int VGAP = 4;
|
||||
|
||||
int xpos, ypos, lwidth, fwidth, pwidth, tabID;
|
||||
int xpos, ypos, lwidth, fwidth, pwidth, swidth, tabID;
|
||||
WidgetArray wid;
|
||||
VariantList items, ports, ctrls;
|
||||
StaticTextWidget* t;
|
||||
|
@ -178,7 +178,7 @@ GameInfoDialog::GameInfoDialog(
|
|||
|
||||
ypos = vBorder;
|
||||
pwidth = font.getStringWidth("Paddles_IAxis");
|
||||
myP0Label = new StaticTextWidget(myTab, font, hSpace, ypos+1, "P0 Controller ");
|
||||
myP0Label = new StaticTextWidget(myTab, font, hSpace, ypos+1, "P0 controller ");
|
||||
ctrls.clear();
|
||||
VarList::push_back(ctrls, "Joystick", "JOYSTICK" );
|
||||
VarList::push_back(ctrls, "Paddles", "PADDLES" );
|
||||
|
@ -203,18 +203,18 @@ GameInfoDialog::GameInfoDialog(
|
|||
|
||||
ypos += lineHeight + VGAP;
|
||||
pwidth = font.getStringWidth("Paddles_IAxis");
|
||||
myP1Label = new StaticTextWidget(myTab, font, hSpace, ypos+1, "P1 Controller ");
|
||||
myP1Label = new StaticTextWidget(myTab, font, hSpace, ypos+1, "P1 controller ");
|
||||
myP1Controller = new PopUpWidget(myTab, font, myP1Label->getRight(), myP1Label->getTop()-1,
|
||||
pwidth, lineHeight, ctrls, "", 0, kRightCChanged);
|
||||
wid.push_back(myP1Controller);
|
||||
|
||||
//ypos += lineHeight + VGAP;
|
||||
mySwapPorts = new CheckboxWidget(myTab, font, myP0Controller->getRight() + fontWidth*4, myP0Controller->getTop()+1,
|
||||
"Swap Ports");
|
||||
"Swap ports");
|
||||
wid.push_back(mySwapPorts);
|
||||
//ypos += lineHeight + VGAP;
|
||||
mySwapPaddles = new CheckboxWidget(myTab, font, myP1Controller->getRight() + fontWidth*4, myP1Controller->getTop()+1,
|
||||
"Swap Paddles");
|
||||
"Swap paddles");
|
||||
wid.push_back(mySwapPaddles);
|
||||
|
||||
// EEPROM erase button for P0/P1
|
||||
|
@ -259,7 +259,7 @@ GameInfoDialog::GameInfoDialog(
|
|||
xpos = hSpace; ypos += lineHeight + VGAP;
|
||||
lwidth = font.getStringWidth("Mouse axis range ");
|
||||
myMouseRange = new SliderWidget(myTab, font, hSpace, ypos,
|
||||
"Mouse axis range ", lwidth, 0, fontWidth * 3);
|
||||
"Mouse axis range ", lwidth, 0, fontWidth * 4, "%");
|
||||
myMouseRange->setMinValue(1); myMouseRange->setMaxValue(100);
|
||||
wid.push_back(myMouseRange);
|
||||
|
||||
|
@ -287,24 +287,21 @@ GameInfoDialog::GameInfoDialog(
|
|||
wid.push_back(myFormat);
|
||||
|
||||
ypos += lineHeight + VGAP;
|
||||
t = new StaticTextWidget(myTab, font, hSpace, ypos+1, "YStart ");
|
||||
myYStart = new SliderWidget(myTab, font, t->getRight(), ypos,
|
||||
"", 0, kYStartChanged);
|
||||
swidth = myFormat->getWidth();
|
||||
t = new StaticTextWidget(myTab, font, hSpace, ypos+1, "Y-Start ");
|
||||
myYStart = new SliderWidget(myTab, font, t->getRight(), ypos, swidth, lineHeight,
|
||||
"", 0, kYStartChanged, 4 * fontWidth, "px");
|
||||
myYStart->setMinValue(TIAConstants::minYStart-1);
|
||||
myYStart->setMaxValue(TIAConstants::maxYStart);
|
||||
wid.push_back(myYStart);
|
||||
myYStartLabel = new StaticTextWidget(myTab, font, myYStart->getRight() + 4,
|
||||
ypos+1, 5*fontWidth, fontHeight);
|
||||
|
||||
ypos += lineHeight + VGAP;
|
||||
t = new StaticTextWidget(myTab, font, hSpace, ypos+1, "Height ");
|
||||
myHeight = new SliderWidget(myTab, font, t->getRight(), ypos,
|
||||
"", 0, kHeightChanged);
|
||||
myHeight = new SliderWidget(myTab, font, t->getRight(), ypos, swidth, lineHeight,
|
||||
"", 0, kHeightChanged, 5 * fontWidth, "px");
|
||||
myHeight->setMinValue(TIAConstants::minViewableHeight-1);
|
||||
myHeight->setMaxValue(TIAConstants::maxViewableHeight);
|
||||
wid.push_back(myHeight);
|
||||
myHeightLabel = new StaticTextWidget(myTab, font, myHeight->getRight() + 4,
|
||||
ypos+1, 5*fontWidth, fontHeight);
|
||||
|
||||
// Phosphor
|
||||
ypos += lineHeight + VGAP*4;
|
||||
|
@ -313,13 +310,10 @@ GameInfoDialog::GameInfoDialog(
|
|||
|
||||
myPPBlend = new SliderWidget(myTab, font,
|
||||
myPhosphor->getRight() + fontWidth * 3, myPhosphor->getTop()-2,
|
||||
"Blend ", 0, kPPBlendChanged);
|
||||
"Blend ", 0, kPPBlendChanged, 7 * fontWidth, "%");
|
||||
myPPBlend->setMinValue(0); myPPBlend->setMaxValue(100);
|
||||
wid.push_back(myPPBlend);
|
||||
|
||||
myPPBlendLabel = new StaticTextWidget(myTab, font,
|
||||
myPPBlend->getRight() + 4, myPhosphor->getTop(), " ");
|
||||
|
||||
// Add items for tab 3
|
||||
addToFocusList(wid, myTab, tabID);
|
||||
|
||||
|
@ -425,20 +419,22 @@ void GameInfoDialog::loadView()
|
|||
|
||||
const string& ystart = myGameProperties.get(Display_YStart);
|
||||
myYStart->setValue(atoi(ystart.c_str()));
|
||||
myYStartLabel->setLabel(ystart == "0" ? "Auto" : ystart);
|
||||
myYStart->setValueLabel(ystart == "0" ? "Auto" : ystart);
|
||||
myYStart->setValueUnit(ystart == "0" ? "" : "px");
|
||||
|
||||
const string& height = myGameProperties.get(Display_Height);
|
||||
myHeight->setValue(atoi(height.c_str()));
|
||||
myHeightLabel->setLabel(height == "0" ? "Auto" : height);
|
||||
myHeight->setValueLabel(height == "0" ? "Auto" : height);
|
||||
myHeight->setValueUnit(height == "0" ? "" : "px");
|
||||
|
||||
bool usePhosphor = myGameProperties.get(Display_Phosphor) == "YES";
|
||||
myPhosphor->setState(usePhosphor);
|
||||
myPPBlend->setEnabled(usePhosphor);
|
||||
myPPBlendLabel->setEnabled(usePhosphor);
|
||||
|
||||
const string& blend = myGameProperties.get(Display_PPBlend);
|
||||
myPPBlend->setValue(atoi(blend.c_str()));
|
||||
myPPBlendLabel->setLabel(blend == "0" ? "Auto" : blend);
|
||||
myPPBlend->setValueLabel(blend == "0" ? "Default" : blend);
|
||||
myPPBlend->setValueUnit(blend == "0" ? "" : "%");
|
||||
|
||||
myTab->loadConfig();
|
||||
}
|
||||
|
@ -481,14 +477,14 @@ void GameInfoDialog::saveConfig()
|
|||
|
||||
// Display properties
|
||||
myGameProperties.set(Display_Format, myFormat->getSelectedTag().toString());
|
||||
myGameProperties.set(Display_YStart, myYStartLabel->getLabel() == "Auto" ? "0" :
|
||||
myYStartLabel->getLabel());
|
||||
myGameProperties.set(Display_Height, myHeightLabel->getLabel() == "Auto" ? "0" :
|
||||
myHeightLabel->getLabel());
|
||||
myGameProperties.set(Display_YStart, myYStart->getValueLabel() == "Auto" ? "0" :
|
||||
myYStart->getValueLabel());
|
||||
myGameProperties.set(Display_Height, myHeight->getValueLabel() == "Auto" ? "0" :
|
||||
myHeight->getValueLabel());
|
||||
myGameProperties.set(Display_Phosphor, myPhosphor->getState() ? "YES" : "NO");
|
||||
|
||||
myGameProperties.set(Display_PPBlend, myPPBlendLabel->getLabel() == "Auto" ? "0" :
|
||||
myPPBlendLabel->getLabel());
|
||||
myGameProperties.set(Display_PPBlend, myPPBlend->getValueLabel() == "Default" ? "0" :
|
||||
myPPBlend->getValueLabel());
|
||||
|
||||
// Determine whether to add or remove an entry from the properties set
|
||||
if(myDefaultsSelected)
|
||||
|
@ -609,29 +605,38 @@ void GameInfoDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
bool status = myPhosphor->getState();
|
||||
myPPBlend->setEnabled(status);
|
||||
myPPBlendLabel->setEnabled(status);
|
||||
break;
|
||||
}
|
||||
|
||||
case kYStartChanged:
|
||||
if(myYStart->getValue() == TIAConstants::minYStart-1)
|
||||
myYStartLabel->setLabel("Auto");
|
||||
{
|
||||
myYStart->setValueLabel("Auto");
|
||||
myYStart->setValueUnit("");
|
||||
}
|
||||
else
|
||||
myYStartLabel->setValue(myYStart->getValue());
|
||||
myYStart->setValueUnit("px");
|
||||
|
||||
break;
|
||||
|
||||
case kHeightChanged:
|
||||
if(myHeight->getValue() == TIAConstants::minViewableHeight-1)
|
||||
myHeightLabel->setLabel("Auto");
|
||||
{
|
||||
myHeight->setValueLabel("Auto");
|
||||
myHeight->setValueUnit("");
|
||||
}
|
||||
else
|
||||
myHeightLabel->setValue(myHeight->getValue());
|
||||
myHeight->setValueUnit("px");
|
||||
break;
|
||||
|
||||
case kPPBlendChanged:
|
||||
if(myPPBlend->getValue() == 0)
|
||||
myPPBlendLabel->setLabel("Auto");
|
||||
{
|
||||
myPPBlend->setValueLabel("Default");
|
||||
myPPBlend->setValueUnit("");
|
||||
}
|
||||
else
|
||||
myPPBlendLabel->setValue(myPPBlend->getValue());
|
||||
myPPBlend->setValueUnit("%");
|
||||
break;
|
||||
|
||||
case kMCtrlChanged:
|
||||
|
|
|
@ -85,12 +85,9 @@ class GameInfoDialog : public Dialog, public CommandSender
|
|||
// Display properties
|
||||
PopUpWidget* myFormat;
|
||||
SliderWidget* myYStart;
|
||||
StaticTextWidget* myYStartLabel;
|
||||
SliderWidget* myHeight;
|
||||
StaticTextWidget* myHeightLabel;
|
||||
CheckboxWidget* myPhosphor;
|
||||
SliderWidget* myPPBlend;
|
||||
StaticTextWidget* myPPBlendLabel;
|
||||
|
||||
enum {
|
||||
kLeftCChanged = 'LCch',
|
||||
|
|
|
@ -132,27 +132,19 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
|
|||
|
||||
// Launcher width and height
|
||||
myLauncherWidthSlider = new SliderWidget(myTab, font, xpos, ypos, "Launcher Width ",
|
||||
lwidth, kLWidthChanged);
|
||||
lwidth, 0, 6 * fontWidth, "px");
|
||||
myLauncherWidthSlider->setMinValue(FrameBuffer::kFBMinW);
|
||||
myLauncherWidthSlider->setMaxValue(ds.w);
|
||||
myLauncherWidthSlider->setStepValue(10);
|
||||
wid.push_back(myLauncherWidthSlider);
|
||||
myLauncherWidthLabel =
|
||||
new StaticTextWidget(myTab, font,
|
||||
xpos + myLauncherWidthSlider->getWidth() + 4,
|
||||
ypos + 1, 4 * fontWidth, fontHeight, "");
|
||||
ypos += lineHeight + 4;
|
||||
|
||||
myLauncherHeightSlider = new SliderWidget(myTab, font, xpos, ypos, "Launcher Height ",
|
||||
lwidth, kLHeightChanged);
|
||||
lwidth, 0, 6 * fontWidth, "px");
|
||||
myLauncherHeightSlider->setMinValue(FrameBuffer::kFBMinH);
|
||||
myLauncherHeightSlider->setMaxValue(ds.h);
|
||||
myLauncherHeightSlider->setStepValue(10);
|
||||
wid.push_back(myLauncherHeightSlider);
|
||||
myLauncherHeightLabel =
|
||||
new StaticTextWidget(myTab, font,
|
||||
xpos + myLauncherHeightSlider->getWidth() + 4,
|
||||
ypos + 1, 4 * fontWidth, fontHeight, "", TextAlign::Left);
|
||||
ypos += lineHeight + 4;
|
||||
|
||||
// Launcher font
|
||||
|
@ -215,9 +207,7 @@ void UIDialog::loadConfig()
|
|||
h = std::min(h, instance().frameBuffer().desktopSize().h);
|
||||
|
||||
myLauncherWidthSlider->setValue(w);
|
||||
myLauncherWidthLabel->setValue(w);
|
||||
myLauncherHeightSlider->setValue(h);
|
||||
myLauncherHeightLabel->setValue(h);
|
||||
|
||||
// Launcher font
|
||||
const string& font = instance().settings().getString("launcherfont");
|
||||
|
@ -290,9 +280,7 @@ void UIDialog::setDefaults()
|
|||
uInt32 w = std::min(instance().frameBuffer().desktopSize().w, 900u);
|
||||
uInt32 h = std::min(instance().frameBuffer().desktopSize().h, 600u);
|
||||
myLauncherWidthSlider->setValue(w);
|
||||
myLauncherWidthLabel->setValue(w);
|
||||
myLauncherHeightSlider->setValue(h);
|
||||
myLauncherHeightLabel->setValue(h);
|
||||
myLauncherFontPopup->setSelected("medium", "");
|
||||
myRomViewerPopup->setSelected("1", "");
|
||||
myLauncherExitWidget->setState(false);
|
||||
|
@ -317,14 +305,6 @@ void UIDialog::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
|||
{
|
||||
switch(cmd)
|
||||
{
|
||||
case kLWidthChanged:
|
||||
myLauncherWidthLabel->setValue(myLauncherWidthSlider->getValue());
|
||||
break;
|
||||
|
||||
case kLHeightChanged:
|
||||
myLauncherHeightLabel->setValue(myLauncherHeightSlider->getValue());
|
||||
break;
|
||||
|
||||
case GuiObject::kOKCmd:
|
||||
saveConfig();
|
||||
close();
|
||||
|
|
|
@ -48,9 +48,7 @@ class UIDialog : public Dialog
|
|||
|
||||
// Launcher options
|
||||
SliderWidget* myLauncherWidthSlider;
|
||||
StaticTextWidget* myLauncherWidthLabel;
|
||||
SliderWidget* myLauncherHeightSlider;
|
||||
StaticTextWidget* myLauncherHeightLabel;
|
||||
CheckboxWidget* myLauncherExitWidget;
|
||||
PopUpWidget* myLauncherFontPopup;
|
||||
PopUpWidget* myRomViewerPopup;
|
||||
|
@ -60,11 +58,6 @@ class UIDialog : public Dialog
|
|||
PopUpWidget* myListDelayPopup;
|
||||
PopUpWidget* myWheelLinesPopup;
|
||||
|
||||
enum {
|
||||
kLWidthChanged = 'UIlw',
|
||||
kLHeightChanged = 'UIlh',
|
||||
};
|
||||
|
||||
private:
|
||||
// Following constructors and assignment operators not supported
|
||||
UIDialog() = delete;
|
||||
|
|
|
@ -55,7 +55,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
|||
VariantList items;
|
||||
|
||||
// Set real dimensions
|
||||
_w = std::min(55 * fontWidth + HBORDER * 2, max_w);
|
||||
_w = std::min(57 * fontWidth + HBORDER * 2, max_w);
|
||||
_h = std::min((16-2) * (lineHeight + VGAP) + 14 + _th, max_h);
|
||||
|
||||
// The tab widget
|
||||
|
@ -91,6 +91,13 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
|||
wid.push_back(myTIAZoom);
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
SliderWidget* s = new SliderWidget(myTab, font, xpos, ypos - 1, swidth, lineHeight,
|
||||
"TIA zoom", lwidth, 0, fontWidth * 4, "%");
|
||||
s->setMinValue(200); s->setMaxValue(500);
|
||||
wid.push_back(s);
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
|
||||
// TIA interpolation
|
||||
myTIAInterpolate = new CheckboxWidget(myTab, font, xpos, ypos + 1, "TIA interpolation ");
|
||||
wid.push_back(myTIAInterpolate);
|
||||
|
@ -100,7 +107,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
|||
myNAspectRatio =
|
||||
new SliderWidget(myTab, font, xpos, ypos-1, swidth, lineHeight,
|
||||
"NTSC aspect ", lwidth, 0,
|
||||
fontWidth * 3);
|
||||
fontWidth * 4, "%");
|
||||
myNAspectRatio->setMinValue(80); myNAspectRatio->setMaxValue(120);
|
||||
wid.push_back(myNAspectRatio);
|
||||
ypos += lineHeight + VGAP;
|
||||
|
@ -109,7 +116,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
|||
myPAspectRatio =
|
||||
new SliderWidget(myTab, font, xpos, ypos-1, swidth, lineHeight,
|
||||
"PAL aspect ", lwidth, 0,
|
||||
fontWidth * 3);
|
||||
fontWidth * 4, "%");
|
||||
myPAspectRatio->setMinValue(80); myPAspectRatio->setMaxValue(120);
|
||||
wid.push_back(myPAspectRatio);
|
||||
ypos += lineHeight + VGAP;
|
||||
|
@ -117,7 +124,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
|||
// Framerate
|
||||
myFrameRate =
|
||||
new SliderWidget(myTab, font, xpos, ypos-1, swidth, lineHeight,
|
||||
"Frame rate ", lwidth, 0, fontWidth * 4);
|
||||
"Frame rate ", lwidth, kFrameRateChanged, fontWidth * 6, "fps");
|
||||
myFrameRate->setMinValue(0); myFrameRate->setMaxValue(900);
|
||||
myFrameRate->setStepValue(10);
|
||||
wid.push_back(myFrameRate);
|
||||
|
@ -213,7 +220,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
|||
#define CREATE_CUSTOM_SLIDERS(obj, desc) \
|
||||
myTV ## obj = \
|
||||
new SliderWidget(myTab, font, xpos, ypos-1, swidth, lineHeight, \
|
||||
desc, lwidth, 0, fontWidth*3); \
|
||||
desc, lwidth, 0, fontWidth*4, "%"); \
|
||||
myTV ## obj->setMinValue(0); myTV ## obj->setMaxValue(100); \
|
||||
wid.push_back(myTV ## obj); \
|
||||
ypos += lineHeight + VGAP;
|
||||
|
@ -325,6 +332,7 @@ void VideoDialog::loadConfig()
|
|||
myFrameRate->setValue(rate < 0 ? 0 : rate);
|
||||
myFrameRate->setValueLabel(rate <= 0 ? "Auto" :
|
||||
instance().settings().getString("framerate"));
|
||||
myFrameRate->setValueUnit(rate <= 0 ? "" : "fps");
|
||||
|
||||
// Fullscreen
|
||||
myFullscreen->setState(instance().settings().getBool("fullscreen"));
|
||||
|
@ -581,6 +589,7 @@ void VideoDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
case kFrameRateChanged:
|
||||
if(myFrameRate->getValue() == 0)
|
||||
myFrameRate->setValueLabel("Auto");
|
||||
myFrameRate->setValueUnit(myFrameRate->getValue() == 0 ? "" : "fps");
|
||||
break;
|
||||
|
||||
case kTVModeChanged:
|
||||
|
|
|
@ -627,9 +627,9 @@ void CheckboxWidget::drawWidget(bool hilite)
|
|||
SliderWidget::SliderWidget(GuiObject* boss, const GUI::Font& font,
|
||||
int x, int y, int w, int h,
|
||||
const string& label, int labelWidth, int cmd,
|
||||
int valueLabelWidth, int valueLabelGap)
|
||||
int valueLabelWidth, const string& valueUnit, int valueLabelGap)
|
||||
: ButtonWidget(boss, font, x, y, w, h, label, cmd),
|
||||
_value(0),
|
||||
_value(-1),
|
||||
_stepValue(1),
|
||||
_valueMin(0),
|
||||
_valueMax(100),
|
||||
|
@ -637,7 +637,8 @@ SliderWidget::SliderWidget(GuiObject* boss, const GUI::Font& font,
|
|||
_labelWidth(labelWidth),
|
||||
_valueLabelGap(valueLabelGap),
|
||||
_valueLabelWidth(valueLabelWidth),
|
||||
_valueLabel("")
|
||||
_valueLabel(""),
|
||||
_valueUnit(valueUnit)
|
||||
{
|
||||
_flags = WIDGET_ENABLED | WIDGET_TRACK_MOUSE;
|
||||
_bgcolor = kDlgColor;
|
||||
|
@ -656,9 +657,9 @@ SliderWidget::SliderWidget(GuiObject* boss, const GUI::Font& font,
|
|||
SliderWidget::SliderWidget(GuiObject* boss, const GUI::Font& font,
|
||||
int x, int y,
|
||||
const string& label, int labelWidth, int cmd,
|
||||
int valueLabelWidth, int valueLabelGap)
|
||||
int valueLabelWidth, const string& valueUnit, int valueLabelGap)
|
||||
: SliderWidget(boss, font, x, y, font.getMaxCharWidth() * 10, font.getLineHeight(),
|
||||
label, labelWidth, cmd, valueLabelWidth, valueLabelGap)
|
||||
label, labelWidth, cmd, valueLabelWidth, valueUnit, valueLabelGap)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -700,7 +701,6 @@ void SliderWidget::setStepValue(int value)
|
|||
void SliderWidget::setValueLabel(const string& valueLabel)
|
||||
{
|
||||
_valueLabel = valueLabel;
|
||||
|
||||
setDirty();
|
||||
}
|
||||
|
||||
|
@ -714,6 +714,13 @@ void SliderWidget::setValueLabel(int value)
|
|||
setDirty();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void SliderWidget::setValueUnit(const string& valueUnit)
|
||||
{
|
||||
_valueUnit = valueUnit;
|
||||
setDirty();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void SliderWidget::handleMouseMoved(int x, int y)
|
||||
{
|
||||
|
@ -805,7 +812,7 @@ void SliderWidget::drawWidget(bool hilite)
|
|||
|
||||
// Fill the box
|
||||
s.fillRect(x, y, _w - _labelWidth - _valueLabelGap - _valueLabelWidth, h,
|
||||
!isEnabled() ? kBGColorHi : kBGColorLo);
|
||||
!isEnabled() ? kSliderBGColorLo : hilite ? kSliderBGColorHi : kSliderBGColor);
|
||||
// Draw the 'bar'
|
||||
s.fillRect(x, y, p, h,
|
||||
!isEnabled() ? kColor : hilite ? kSliderColorHi : kSliderColor);
|
||||
|
@ -814,7 +821,7 @@ void SliderWidget::drawWidget(bool hilite)
|
|||
!isEnabled() ? kColor : hilite ? kSliderColorHi : kSliderColor);
|
||||
|
||||
if(_valueLabelWidth > 0)
|
||||
s.drawString(_font, _valueLabel, _x + _w - _valueLabelWidth, _y + 2,
|
||||
s.drawString(_font, _valueLabel + _valueUnit, _x + _w - _valueLabelWidth, _y + 2,
|
||||
_valueLabelWidth, isEnabled() ? kTextColor : kColor);
|
||||
}
|
||||
|
||||
|
|
|
@ -308,11 +308,11 @@ class SliderWidget : public ButtonWidget
|
|||
SliderWidget(GuiObject* boss, const GUI::Font& font,
|
||||
int x, int y, int w, int h,
|
||||
const string& label = "", int labelWidth = 0, int cmd = 0,
|
||||
int valueLabelWidth = 0, int valueLabelGap = 4);
|
||||
int valueLabelWidth = 0, const string& valueUnit = "", int valueLabelGap = 4);
|
||||
SliderWidget(GuiObject* boss, const GUI::Font& font,
|
||||
int x, int y,
|
||||
const string& label = "", int labelWidth = 0, int cmd = 0,
|
||||
int valueLabelWidth = 0, int valueLabelGap = 4);
|
||||
int valueLabelWidth = 0, const string& valueUnit = "", int valueLabelGap = 4);
|
||||
|
||||
void setValue(int value);
|
||||
int getValue() const { return _value; }
|
||||
|
@ -326,6 +326,7 @@ class SliderWidget : public ButtonWidget
|
|||
void setValueLabel(const string& valueLabel);
|
||||
void setValueLabel(int value);
|
||||
const string& getValueLabel() const { return _valueLabel; }
|
||||
void setValueUnit(const string& valueUnit);
|
||||
|
||||
protected:
|
||||
void handleMouseMoved(int x, int y) override;
|
||||
|
@ -345,6 +346,7 @@ class SliderWidget : public ButtonWidget
|
|||
bool _isDragging;
|
||||
int _labelWidth;
|
||||
string _valueLabel;
|
||||
string _valueUnit;
|
||||
int _valueLabelWidth;
|
||||
int _valueLabelGap;
|
||||
|
||||
|
|
Loading…
Reference in New Issue