title bar added to all dialogs

This commit is contained in:
thrust26 2018-01-24 14:37:07 +01:00
parent 41827e03de
commit 5bd33885e3
30 changed files with 246 additions and 165 deletions

View File

@ -33,46 +33,48 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CheatCodeDialog::CheatCodeDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font)
: Dialog(osystem, parent)
: Dialog(osystem, parent, font, "Cheat codes")
{
const int lineHeight = font.getLineHeight(),
fontWidth = font.getMaxCharWidth(),
buttonWidth = font.getStringWidth("Defaults") + 20,
buttonHeight = font.getLineHeight() + 4;
const int HBORDER = 10;
const int VBORDER = 10 + _th;
int xpos, ypos;
WidgetArray wid;
ButtonWidget* b;
// Set real dimensions
_w = 46 * fontWidth + 10;
_h = 11 * (lineHeight + 4) + 10;
_w = 45 * fontWidth + HBORDER * 2;
_h = 11 * (lineHeight + 4) + VBORDER;
// List of cheats, with checkboxes to enable/disable
xpos = 10; ypos = 10;
xpos = HBORDER; ypos = VBORDER;
myCheatList =
new CheckListWidget(this, font, xpos, ypos, _w - buttonWidth - 25,
_h - 2*buttonHeight - 10);
new CheckListWidget(this, font, xpos, ypos, _w - buttonWidth - HBORDER * 2 - 8,
_h - 2*buttonHeight - VBORDER);
myCheatList->setEditable(false);
wid.push_back(myCheatList);
xpos += myCheatList->getWidth() + 5; ypos = 15;
xpos += myCheatList->getWidth() + 8; ypos = VBORDER;
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
"Add" + ELLIPSIS, kAddCheatCmd);
wid.push_back(b);
ypos += lineHeight + 10;
ypos += lineHeight + 8;
myEditButton =
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
"Edit" + ELLIPSIS, kEditCheatCmd);
wid.push_back(myEditButton);
ypos += lineHeight + 10;
ypos += lineHeight + 8;
myRemoveButton =
new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
"Remove", kRemCheatCmd);
wid.push_back(myRemoveButton);
ypos += lineHeight + 10;
ypos += lineHeight + 8 * 3;
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
"One shot" + ELLIPSIS, kAddOneShotCmd);
@ -82,7 +84,7 @@ CheatCodeDialog::CheatCodeDialog(OSystem& osystem, DialogContainer& parent,
StringList labels;
labels.push_back("Name ");
labels.push_back("Code (hex) ");
myCheatInput = make_unique<InputTextDialog>(this, font, labels);
myCheatInput = make_unique<InputTextDialog>(this, font, labels, "Cheat code");
myCheatInput->setTarget(this);
// Add filtering for each textfield
@ -154,7 +156,7 @@ void CheatCodeDialog::addCheat()
myCheatInput->show(); // Center input dialog over entire screen
myCheatInput->setText("", 0);
myCheatInput->setText("", 1);
myCheatInput->setTitle("");
myCheatInput->setMessage("");
myCheatInput->setFocus(0);
myCheatInput->setEmitSignal(kCheatAdded);
}
@ -173,7 +175,7 @@ void CheatCodeDialog::editCheat()
myCheatInput->show(); // Center input dialog over entire screen
myCheatInput->setText(name, 0);
myCheatInput->setText(code, 1);
myCheatInput->setTitle("");
myCheatInput->setMessage("");
myCheatInput->setFocus(1);
myCheatInput->setEmitSignal(kCheatEdited);
}
@ -191,7 +193,7 @@ void CheatCodeDialog::addOneShotCheat()
myCheatInput->show(); // Center input dialog over entire screen
myCheatInput->setText("One-shot cheat", 0);
myCheatInput->setText("", 1);
myCheatInput->setTitle("");
myCheatInput->setMessage("");
myCheatInput->setFocus(1);
myCheatInput->setEmitSignal(kOneShotCheatAdded);
}
@ -234,7 +236,7 @@ void CheatCodeDialog::handleCommand(CommandSender* sender, int cmd,
loadConfig(); // show changes onscreen
}
else
myCheatInput->setTitle("Invalid code");
myCheatInput->setMessage("Invalid code");
break;
}
@ -251,7 +253,7 @@ void CheatCodeDialog::handleCommand(CommandSender* sender, int cmd,
loadConfig(); // show changes onscreen
}
else
myCheatInput->setTitle("Invalid code");
myCheatInput->setMessage("Invalid code");
break;
}
@ -273,7 +275,7 @@ void CheatCodeDialog::handleCommand(CommandSender* sender, int cmd,
instance().cheat().addOneShot(name, code);
}
else
myCheatInput->setTitle("Invalid code");
myCheatInput->setMessage("Invalid code");
break;
}

View File

@ -146,8 +146,8 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
myLabel->setEditable(false, true);
// Inputbox which will pop up when searching RAM
StringList labels = { "Search " };
myInputBox = make_unique<InputTextDialog>(boss, lfont, nfont, labels);
StringList labels = { "Value" };
myInputBox = make_unique<InputTextDialog>(boss, lfont, nfont, labels, " ");
myInputBox->setTarget(this);
// Start with these buttons disabled
@ -247,7 +247,7 @@ void RamWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
{
const string& result = doSearch(myInputBox->getResult());
if(result != "")
myInputBox->setTitle(result);
myInputBox->setMessage(result);
else
myInputBox->close();
break;
@ -257,7 +257,7 @@ void RamWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
{
const string& result = doCompare(myInputBox->getResult());
if(result != "")
myInputBox->setTitle(result);
myInputBox->setMessage(result);
else
myInputBox->close();
break;
@ -322,11 +322,13 @@ void RamWidget::showInputBox(int cmd)
// Add inputbox in the middle of the RAM widget
uInt32 x = getAbsX() + ((getWidth() - myInputBox->getWidth()) >> 1);
uInt32 y = getAbsY() + ((getHeight() - myInputBox->getHeight()) >> 1);
myInputBox->show(x, y);
myInputBox->setText("");
myInputBox->setTitle("");
myInputBox->setMessage("");
myInputBox->setFocus(0);
myInputBox->setEmitSignal(cmd);
myInputBox->setTitle(cmd == kSValEntered ? "Search" : "Compare");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -1012,31 +1012,33 @@ void FrameBuffer::VideoModeList::setZoom(uInt32 zoom)
kDbgChangedTextColor Text color for changed cells
kDbgColorHi Highlighted color in debugger data cells
kDbgColorRed Red color in debugger
*** Info color ***
kColorinfo
*** Other colors ***
kColorInfo TIA output position color
kTitleBarColor Title bar color
kTitleTextColor Title text color
*/
uInt32 FrameBuffer::ourGUIColors[3][kNumColors-256] = {
// Standard
{ 0x686868, 0x000000, 0xa38c61, 0xdccfa5, 0x404040,
0x000000, 0x62a108, 0x9f0000, 0x000000,
0xc9af7c, 0xf0f0cf, 0xc80000,
0xac3410, 0xd55941, 0xffffff, 0xffd652,
0xac3410,
0xac3410, 0xd55941,
0xac3410, 0xd55941,
0xc80000, 0x00ff00, 0xc8c8ff, 0xc80000,
0xffffff
{ 0x686868, 0x000000, 0xa38c61, 0xdccfa5, 0x404040, // base
0x000000, 0x62a108, 0x9f0000, 0x000000, // text
0xc9af7c, 0xf0f0cf, 0xc80000, // elements
0xac3410, 0xd55941, 0xffffff, 0xffd652, // buttons
0xac3410, // checkbox
0xac3410, 0xd55941, // scrollbar
0xac3410, 0xd55941, // slider
0xc80000, 0x00ff00, 0xc8c8ff, 0xc80000, // debugger
0xffffff, 0xac3410, 0xffffff // other
},
// Classic
{ 0x686868, 0x000000, 0x404040, 0x404040, 0x404040,
0x20a020, 0x00ff00, 0xc80000, 0x20a020,
0x000000, 0x000000, 0xc80000,
0x000000, 0x000000, 0x20a020, 0x00ff00,
0x20a020,
0x20a020, 0x00ff00,
0x20a020, 0x00ff00,
0xc80000, 0x00ff00, 0xc8c8ff, 0xc80000,
0x20a020
{ 0x686868, 0x000000, 0x404040, 0x404040, 0x404040, // base
0x20a020, 0x00ff00, 0xc80000, 0x20a020, // text
0x000000, 0x000000, 0xc80000, // elements
0x000000, 0x000000, 0x20a020, 0x00ff00, // buttons
0x20a020, // checkbox
0x20a020, 0x00ff00, // scrollbar
0x20a020, 0x00ff00, // slider
0xc80000, 0x00ff00, 0xc8c8ff, 0xc80000, // debugger
0x20a020, 0x20a020, 0x000000 // other
},
// Light
{
@ -1048,6 +1050,6 @@ uInt32 FrameBuffer::ourGUIColors[3][kNumColors-256] = {
0x808080, 0x0078d7, // scrollbar
0x333333, 0x0078d7, // slider
0xffc0c0, 0x000000, 0xe00000, 0xc00000, // debugger
0xffffff // info
0xffffff, 0x808080, 0xffffff // other
}
};

View File

@ -68,6 +68,8 @@ enum {
kDbgColorHi,
kDbgColorRed,
kColorInfo,
kColorTitleBar,
kColorTitleText,
kNumColors
};

View File

@ -25,7 +25,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AboutDialog::AboutDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font)
: Dialog(osystem, parent),
: Dialog(osystem, parent, font, "About Stella"),
myPage(1),
myNumPages(4),
myLinesPerPage(13)
@ -40,7 +40,7 @@ AboutDialog::AboutDialog(OSystem& osystem, DialogContainer& parent,
// Set real dimensions
_w = 55 * fontWidth + 8;
_h = 15 * lineHeight + 20;
_h = 15 * lineHeight + 20 + _th;
// Add Previous, Next and Close buttons
xpos = 10; ypos = _h - buttonHeight - 10;
@ -63,15 +63,15 @@ AboutDialog::AboutDialog(OSystem& osystem, DialogContainer& parent,
wid.push_back(b);
addOKWidget(b); addCancelWidget(b);
xpos = 5; ypos = 5;
myTitle = new StaticTextWidget(this, font, xpos, ypos, _w - 10, fontHeight,
xpos = 5; ypos = 5 + _th;
myTitle = new StaticTextWidget(this, font, xpos, ypos, _w - xpos * 2, fontHeight,
"", TextAlign::Center);
myTitle->setTextColor(kTextColorEm);
xpos = 10; ypos += lineHeight + 4;
xpos = 16; ypos += lineHeight + 4;
for(int i = 0; i < myLinesPerPage; i++)
{
myDesc.push_back(new StaticTextWidget(this, font, xpos, ypos, _w - 20,
myDesc.push_back(new StaticTextWidget(this, font, xpos, ypos, _w - xpos * 2,
fontHeight, "", TextAlign::Left));
myDescStr.push_back("");
ypos += fontHeight;
@ -116,30 +116,30 @@ void AboutDialog::updateStrings(int page, int lines, string& title)
case 2:
title = "The Stella Team";
ADD_ATEXT("\\L\\c0"" Stephen Anthony");
ADD_ATEXT("\\L\\c2"" Lead developer, current maintainer for the");
ADD_ATEXT("\\L\\c2"" Linux/OSX and Windows ports ");
ADD_ATEXT("\\L\\c0"" Christian Speckner");
ADD_ATEXT("\\L\\c2"" Emulation core development, TIA core");
ADD_ATEXT("\\L\\c0"" Eckhard Stolberg");
ADD_ATEXT("\\L\\c2"" Emulation core development");
ADD_ATEXT("\\L\\c0"" Thomas Jentzsch");
ADD_ATEXT("\\L\\c2"" Emulation core development, jack-of-all-trades");
ADD_ATEXT("\\L\\c0"" Brian Watson");
ADD_ATEXT("\\L\\c2"" Emulation core enhancement, debugger support");
ADD_ATEXT("\\L\\c0"" Bradford W. Mott");
ADD_ATEXT("\\L\\c2"" Original author of Stella");
ADD_ATEXT("\\L\\c0""Stephen Anthony");
ADD_ATEXT("\\L\\c2"" Lead developer, current maintainer for the");
ADD_ATEXT("\\L\\c2"" Linux/OSX and Windows ports ");
ADD_ATEXT("\\L\\c0""Christian Speckner");
ADD_ATEXT("\\L\\c2"" Emulation core development, TIA core");
ADD_ATEXT("\\L\\c0""Eckhard Stolberg");
ADD_ATEXT("\\L\\c2"" Emulation core development");
ADD_ATEXT("\\L\\c0""Thomas Jentzsch");
ADD_ATEXT("\\L\\c2"" Emulation core development, jack-of-all-trades");
ADD_ATEXT("\\L\\c0""Brian Watson");
ADD_ATEXT("\\L\\c2"" Emulation core enhancement, debugger support");
ADD_ATEXT("\\L\\c0""Bradford W. Mott");
ADD_ATEXT("\\L\\c2"" Original author of Stella");
break;
case 3:
title = "Contributors";
ADD_ATEXT("\\L\\c0"" See https://stella-emu.github.io/credits.html for");
ADD_ATEXT("\\L\\c0"" people that have contributed to Stella.");
ADD_ATEXT("\\L\\c0""See https://stella-emu.github.io/credits.html for");
ADD_ATEXT("\\L\\c0""people that have contributed to Stella.");
ADD_ALINE();
ADD_ATEXT("\\L\\c0"" Thanks to the ScummVM project for the GUI code.");
ADD_ATEXT("\\L\\c0""Thanks to the ScummVM project for the GUI code.");
ADD_ALINE();
ADD_ATEXT("\\L\\c0"" Thanks to Ian Bogost and the Georgia Tech");
ADD_ATEXT("\\L\\c0"" Atari Team for the CRT Simulation effects.");
ADD_ATEXT("\\L\\c0""Thanks to Ian Bogost and the Georgia Tech Atari Team");
ADD_ATEXT("\\L\\c0""for the CRT Simulation effects.");
break;
case 4:

View File

@ -35,7 +35,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AudioDialog::AudioDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font)
: Dialog(osystem, parent)
: Dialog(osystem, parent, font, "Audio settings")
{
const int VBORDER = 10;
const int HBORDER = 10;
@ -53,9 +53,9 @@ AudioDialog::AudioDialog(OSystem& osystem, DialogContainer& parent,
// Set real dimensions
_w = 35 * fontWidth + HBORDER * 2;
_h = 7 * (lineHeight + 4) + VBORDER;
_h = 7 * (lineHeight + 4) + VBORDER + _th;
xpos = HBORDER; ypos = VBORDER;
xpos = HBORDER; ypos = VBORDER + _th;
// Enable sound
xpos = HBORDER;

View File

@ -29,7 +29,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font,
const VariantList& combolist)
: Dialog(boss->instance(), boss->parent()),
: Dialog(boss->instance(), boss->parent(), font, ""),
myComboEvent(Event::NoType)
{
const int lineHeight = font.getLineHeight(),
@ -42,19 +42,15 @@ ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font,
// Set real dimensions
_w = 35 * fontWidth + 10;
_h = 11 * (lineHeight + 4) + 10;
xpos = ypos = 5;
_h = 10 * (lineHeight + 4) + 10 + _th;
xpos = 10;
ypos = 10 + _th;
// Get maximum width of popupwidget
int pwidth = 0;
for(const auto& s: combolist)
pwidth = std::max(font.getStringWidth(s.first), pwidth);
// Label for dialog, indicating which combo is being changed
myComboName = new StaticTextWidget(this, font, xpos, ypos, _w - xpos - 10,
fontHeight, "", TextAlign::Center);
ypos += (lineHeight + 4) + 5;
// Add event popup for 8 events
auto ADD_EVENT_POPUP = [&](int idx, const string& label)
{
@ -87,7 +83,7 @@ void ComboDialog::show(Event::Type event, const string& name)
if(event >= Event::Combo1 && event <= Event::Combo16)
{
myComboEvent = event;
myComboName->setLabel("Add events for " + name);
setTitle("Add events for " + name);
open();
}
else

View File

@ -45,7 +45,6 @@ class ComboDialog : public Dialog
private:
Event::Type myComboEvent;
StaticTextWidget* myComboName;
PopUpWidget* myEvents[8];
private:

View File

@ -30,23 +30,25 @@ CommandDialog::CommandDialog(OSystem& osystem, DialogContainer& parent)
: Dialog(osystem, parent)
{
const GUI::Font& font = instance().frameBuffer().font();
initTitle(font, "Commands");
const int buttonWidth = font.getStringWidth("Right Diff B") + 20,
buttonHeight = font.getLineHeight() + 6,
rowHeight = font.getLineHeight() + 10;
rowHeight = buttonHeight + 8;
// Set real dimensions
_w = 3 * (buttonWidth + 5) + 20;
_h = 6 * rowHeight + 15;
_h = 6 * rowHeight + 8 + _th;
WidgetArray wid;
ButtonWidget* b[16];
int xoffset = 10, yoffset = 10;
int xoffset = 10, yoffset = 8 + _th;
auto ADD_CD_BUTTON = [&](const string& label, int cmd)
{
ButtonWidget* bw = new ButtonWidget(this, font, xoffset, yoffset,
buttonWidth, buttonHeight, label, cmd);
xoffset += buttonWidth + 6;
xoffset += buttonWidth + 8;
return bw;
};
@ -56,31 +58,31 @@ CommandDialog::CommandDialog(OSystem& osystem, DialogContainer& parent)
b[8] = ADD_CD_BUTTON("Save State", kSaveStateCmd);
// Row 2
xoffset = 10; yoffset += buttonHeight + 3;
xoffset = 10; yoffset += buttonHeight + 8;
b[1] = ADD_CD_BUTTON("Reset", kResetCmd);
b[5] = ADD_CD_BUTTON("Left Diff B", kLeftDiffBCmd);
b[9] = ADD_CD_BUTTON("State Slot", kStateSlotCmd);
// Row 3
xoffset = 10; yoffset += buttonHeight + 3;
xoffset = 10; yoffset += buttonHeight + 8;
b[2] = ADD_CD_BUTTON("Color TV", kColorCmd);
b[6] = ADD_CD_BUTTON("Right Diff A", kRightDiffACmd);
b[10] = ADD_CD_BUTTON("Load State", kLoadStateCmd);
// Row 4
xoffset = 10; yoffset += buttonHeight + 3;
xoffset = 10; yoffset += buttonHeight + 8;
b[3] = ADD_CD_BUTTON("B/W TV", kBWCmd);
b[7] = ADD_CD_BUTTON("Right Diff B", kRightDiffBCmd);
b[11] = ADD_CD_BUTTON("Snapshot", kSnapshotCmd);
// Row 5
xoffset = 10; yoffset += buttonHeight + 3;
xoffset = 10; yoffset += buttonHeight + 8;
b[12] = ADD_CD_BUTTON("NTSC/PAL", kFormatCmd);
b[13] = ADD_CD_BUTTON("Palette", kPaletteCmd);
b[14] = ADD_CD_BUTTON("Reload ROM", kReloadRomCmd);
// Row 6
xoffset = 10 + buttonWidth + 6; yoffset += buttonHeight + 3;
xoffset = 10 + buttonWidth + 8; yoffset += buttonHeight + 8;
b[15] = ADD_CD_BUTTON("Exit Game", kExitCmd);
for(int i = 0; i < 16; ++i)

View File

@ -29,13 +29,13 @@
ConfigPathDialog::ConfigPathDialog(
OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, GuiObject* boss)
: Dialog(osystem, parent),
: Dialog(osystem, parent, font, "Configure paths"),
CommandSender(boss),
myFont(font),
myBrowser(nullptr),
myIsGlobal(boss != nullptr)
{
const int VBORDER = 10;
const int VBORDER = 10 + _th;
const int HBORDER = 10;
const int V_GAP = 4;
const int H_GAP = 8;
@ -49,7 +49,7 @@ ConfigPathDialog::ConfigPathDialog(
// Set real dimensions
_w = 64 * fontWidth + HBORDER*2;
_h = 9 * (lineHeight + V_GAP) + 10;
_h = 9 * (lineHeight + V_GAP) + VBORDER;
xpos = HBORDER; ypos = VBORDER;

View File

@ -44,7 +44,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DeveloperDialog::DeveloperDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h)
: Dialog(osystem, parent)
: Dialog(osystem, parent, font, "Developer settings")
{
const int VGAP = 4;
const int lineHeight = font.getLineHeight(),
@ -54,11 +54,11 @@ DeveloperDialog::DeveloperDialog(OSystem& osystem, DialogContainer& parent,
// Set real dimensions
_w = std::min(53 * fontWidth + 10, max_w);
_h = std::min(15 * (lineHeight + VGAP) + 14, max_h);
_h = std::min(15 * (lineHeight + VGAP) + 14 + _th, max_h);
// The tab widget
xpos = 2; ypos = 4;
myTab = new TabWidget(this, font, xpos, ypos, _w - 2 * xpos, _h - buttonHeight - 16 - ypos);
myTab = new TabWidget(this, font, xpos, ypos + _th, _w - 2 * xpos, _h - _th - buttonHeight - 16 - ypos);
addTabWidget(myTab);
addEmulationTab(font);

View File

@ -38,9 +38,34 @@
* ...
*/
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Dialog::Dialog(OSystem& instance, DialogContainer& parent, const GUI::Font& font, const string& title,
int x, int y, int w, int h)
: GuiObject(instance, parent, *this, x, y, w, h),
_font(&font),
_title(title),
_th(0),
_mouseWidget(nullptr),
_focusedWidget(nullptr),
_dragWidget(nullptr),
_okWidget(nullptr),
_cancelWidget(nullptr),
_visible(false),
_processCancel(false),
_surface(nullptr),
_tabID(0),
_flags(WIDGET_ENABLED | WIDGET_BORDER | WIDGET_CLEARBG)
{
initTitle(font, title);
}
Dialog::Dialog(OSystem& instance, DialogContainer& parent,
int x, int y, int w, int h)
: GuiObject(instance, parent, *this, x, y, w, h),
_font(nullptr),
_title(""),
_th(0),
_fh(0),
_mouseWidget(nullptr),
_focusedWidget(nullptr),
_dragWidget(nullptr),
@ -102,6 +127,29 @@ void Dialog::close(bool refresh)
parent().removeDialog();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Dialog::initTitle(const GUI::Font& font, const string& title)
{
_font = &font;
_fh = font.getLineHeight();
setTitle(title);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Dialog::setTitle(const string& title)
{
if(_font != nullptr)
{
_title = title;
_h -= _th;
if(title.empty())
_th = 0;
else
_th = _fh + 4;
_h += _th;
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Dialog::center()
{
@ -271,8 +319,19 @@ void Dialog::drawDialog()
if(_dirty)
{
if(_flags & WIDGET_CLEARBG)
{
// cerr << "Dialog::drawDialog(): w = " << _w << ", h = " << _h << " @ " << &s << endl << endl;
s.fillRect(_x, _y, _w, _h, kDlgColor);
s.fillRect(_x, _y + _th, _w, _h - _th, kDlgColor);
if(_th)
{
s.fillRect(_x, _y, _w, _th, kColorTitleBar);
s.drawString(*_font, _title, _x + 10, _y + 2 + 1, _font->getStringWidth(_title), kColorTitleText);
/*int lSize = _th * 1 / 2;
int lBorder = (_th - lSize) / 2;
s.line(_w - lSize - lBorder, _y + lBorder, _w - lBorder, _y + lBorder + lSize, kColorTitleText);
s.line(_w - lSize - lBorder + 1, _y + lBorder, _w - lBorder + 1, _y + lBorder + lSize, kColorTitleText);*/
}
}
else
s.invalidate();
if(_flags & WIDGET_BORDER)

View File

@ -46,6 +46,8 @@ class Dialog : public GuiObject
public:
Dialog(OSystem& instance, DialogContainer& parent,
int x = 0, int y = 0, int w = 0, int h = 0);
Dialog(OSystem& instance, DialogContainer& parent, const GUI::Font& font, const string& title,
int x = 0, int y = 0, int w = 0, int h = 0);
virtual ~Dialog();
@ -84,6 +86,8 @@ class Dialog : public GuiObject
void clearFlags(int flags) { _flags &= ~flags; setDirty(); }
int getFlags() const { return _flags; }
void setTitle(const string& title);
protected:
virtual void draw() override { }
void releaseFocus() override;
@ -123,6 +127,8 @@ class Dialog : public GuiObject
*/
bool getResizableBounds(uInt32& w, uInt32& h) const;
void initTitle(const GUI::Font& font, const string& title);
private:
void buildCurrentFocusList(int tabID = -1);
bool handleNavEvent(Event::Type e);
@ -138,6 +144,10 @@ class Dialog : public GuiObject
Widget* _cancelWidget;
bool _visible;
bool _processCancel;
string _title;
int _th;
const GUI::Font* _font;
int _fh;
Common::FixedStack<shared_ptr<FBSurface>> mySurfaceStack;

View File

@ -37,7 +37,7 @@
GameInfoDialog::GameInfoDialog(
OSystem& osystem, DialogContainer& parent, const GUI::Font& font,
GuiObject* boss)
: Dialog(osystem, parent),
: Dialog(osystem, parent, font, "Game properties"),
CommandSender(boss),
myPropertiesLoaded(false),
myDefaultsSelected(false)
@ -61,12 +61,12 @@ GameInfoDialog::GameInfoDialog(
// Set real dimensions
_w = 52 * fontWidth + 8;
_h = 9 * (lineHeight + vGap) + vBorder * 2 + buttonHeight + fontHeight + ifont.getLineHeight() + 20;
_h = 9 * (lineHeight + vGap) + vBorder * 2 + _th + buttonHeight + fontHeight + ifont.getLineHeight() + 20;
// The tab widget
xpos = hBorder; ypos = vBorder;
myTab = new TabWidget(this, font, 2, 4, _w - 2 * 2,
_h - (buttonHeight + fontHeight + ifont.getLineHeight() + 20));
myTab = new TabWidget(this, font, 2, 4 + _th, _w - 2 * 2,
_h - (_th + buttonHeight + fontHeight + ifont.getLineHeight() + 20));
addTabWidget(myTab);
// 1) Cartridge properties

View File

@ -30,7 +30,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
: Dialog(boss->instance(), boss->parent()),
: Dialog(boss->instance(), boss->parent(), font, "Power-on options"),
CommandSender(boss)
{
const int lineHeight = font.getLineHeight(),
@ -47,9 +47,9 @@ GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
// Set real dimensions
_w = lwidth + pwidth + fontWidth*3 + 15;
_h = 17 * (lineHeight + 4) + buttonHeight + 20;
_h = 17 * (lineHeight + 4) + buttonHeight + 20 + _th;
xpos = 10; ypos = 10;
xpos = 10; ypos = 10 + _th;
// Bankswitch type
new StaticTextWidget(this, font, xpos, ypos+1, lwidth, fontHeight,

View File

@ -24,7 +24,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font)
: Dialog(osystem, parent),
: Dialog(osystem, parent, font, "Help"),
myPage(1),
myNumPages(5)
{
@ -39,7 +39,7 @@ HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent,
// Set real dimensions
_w = 46 * fontWidth + 10;
_h = 12 * lineHeight + 20;
_h = 12 * lineHeight + 20 + _th;
// Add Previous, Next and Close buttons
xpos = 10; ypos = _h - buttonHeight - 10;
@ -61,7 +61,7 @@ HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent,
"Close", GuiObject::kCloseCmd);
wid.push_back(b);
xpos = 5; ypos = 5;
xpos = 5; ypos = 5 + _th;
myTitle = new StaticTextWidget(this, font, xpos, ypos, _w - 10, fontHeight,
"", TextAlign::Center);

View File

@ -38,11 +38,10 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h)
: Dialog(osystem, parent),
: Dialog(osystem, parent, font, "Input settings"),
myConfirmMsg(nullptr),
myMaxWidth(max_w),
myMaxHeight(max_h)
{
const int lineHeight = font.getLineHeight(),
fontWidth = font.getMaxCharWidth(),
@ -54,11 +53,11 @@ InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent,
// Set real dimensions
_w = std::min(50 * fontWidth + 10, max_w);
_h = std::min(16 * (lineHeight + 4) + 16, max_h);
_h = std::min(16 * (lineHeight + 4) + 16 + _th, max_h);
// The tab widget
xpos = 2; ypos = vBorder;
myTab = new TabWidget(this, font, xpos, ypos, _w - 2*xpos, _h - buttonHeight - 20);
xpos = 2; ypos = vBorder + _th;
myTab = new TabWidget(this, font, xpos, ypos, _w - 2*xpos, _h -_th - buttonHeight - 20);
addTabWidget(myTab);
// 1) Event mapper for emulation actions
@ -536,7 +535,7 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd,
myConfirmMsg = make_unique<GUI::MessageBox>
(this, instance().frameBuffer().font(), msg,
myMaxWidth, myMaxHeight, kConfirmEEEraseCmd,
"OK", "Cancel", false);
"OK", "Cancel", "Erase EEPROM", false);
}
myConfirmMsg->show();
break;

View File

@ -29,8 +29,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& font,
const StringList& labels)
: Dialog(boss->instance(), boss->parent()),
const StringList& labels, const string& title)
: Dialog(boss->instance(), boss->parent(), font, title),
CommandSender(boss),
myEnableCenter(false),
myErrorFlag(false),
@ -43,8 +43,8 @@ InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& font,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont,
const StringList& labels)
: Dialog(boss->instance(), boss->parent()),
const StringList& labels, const string& title)
: Dialog(boss->instance(), boss->parent(), lfont, title),
CommandSender(boss),
myEnableCenter(false),
myErrorFlag(false),
@ -66,7 +66,7 @@ void InputTextDialog::initialize(const GUI::Font& lfont, const GUI::Font& nfont,
// Calculate real dimensions
_w = fontWidth * 41;
_h = lineHeight * 4 + int(labels.size()) * (lineHeight + 5);
_h = lineHeight * 4 + int(labels.size()) * (lineHeight + 5) + _th;
// Determine longest label
for(i = 0; i < labels.size(); ++i)
@ -80,7 +80,7 @@ void InputTextDialog::initialize(const GUI::Font& lfont, const GUI::Font& nfont,
lwidth = lfont.getStringWidth(labels[maxIdx]);
// Create editboxes for all labels
ypos = lineHeight;
ypos = lineHeight + _th;
for(i = 0; i < labels.size(); ++i)
{
xpos = 10;
@ -98,9 +98,9 @@ void InputTextDialog::initialize(const GUI::Font& lfont, const GUI::Font& nfont,
}
xpos = 10;
myTitle = new StaticTextWidget(this, lfont, xpos, ypos, _w - 2*xpos, fontHeight,
myMessage = new StaticTextWidget(this, lfont, xpos, ypos, _w - 2*xpos, fontHeight,
"", TextAlign::Left);
myTitle->setTextColor(kTextColorEm);
myMessage->setTextColor(kTextColorEm);
addToFocusList(wid);
@ -148,9 +148,9 @@ void InputTextDialog::center()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void InputTextDialog::setTitle(const string& title)
void InputTextDialog::setMessage(const string& title)
{
myTitle->setLabel(title);
myMessage->setLabel(title);
myErrorFlag = true;
}
@ -207,7 +207,7 @@ void InputTextDialog::handleCommand(CommandSender* sender, int cmd,
// Erase the invalid message once editing is restarted
if(myErrorFlag)
{
myTitle->setLabel("");
myMessage->setLabel("");
myErrorFlag = false;
}
break;

View File

@ -30,9 +30,9 @@ class InputTextDialog : public Dialog, public CommandSender
{
public:
InputTextDialog(GuiObject* boss, const GUI::Font& font,
const StringList& labels);
const StringList& labels, const string& title = "");
InputTextDialog(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont, const StringList& labels);
const GUI::Font& nfont, const StringList& labels, const string& title = "");
virtual ~InputTextDialog() = default;
/** Place the input dialog onscreen and center it */
@ -47,7 +47,7 @@ class InputTextDialog : public Dialog, public CommandSender
void setTextFilter(const EditableWidget::TextFilter& f, int idx = 0);
void setEmitSignal(int cmd) { myCmd = cmd; }
void setTitle(const string& title);
void setMessage(const string& title);
void setFocus(int idx = 0);
@ -61,7 +61,7 @@ class InputTextDialog : public Dialog, public CommandSender
private:
vector<EditTextWidget*> myInput;
StaticTextWidget* myTitle;
StaticTextWidget* myMessage;
bool myEnableCenter;
bool myErrorFlag;

View File

@ -27,7 +27,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
JoystickDialog::JoystickDialog(GuiObject* boss, const GUI::Font& font,
int max_w, int max_h)
: Dialog(boss->instance(), boss->parent(), 0, 0, max_w, max_h)
: Dialog(boss->instance(), boss->parent(), font, "Joystick database", 0, 0, max_w, max_h)
{
int xpos, ypos;
WidgetArray wid;
@ -36,7 +36,7 @@ JoystickDialog::JoystickDialog(GuiObject* boss, const GUI::Font& font,
buttonHeight = font.getLineHeight() + 4;
// Joystick list
xpos = 10; ypos = 10;
xpos = 10; ypos = 10 + _th;
int w = _w - 2 * xpos;
int h = _h - buttonHeight - ypos - 20;
myJoyList = new StringListWidget(this, font, xpos, ypos, w, h);

View File

@ -215,8 +215,8 @@ void LauncherDialog::loadConfig()
instance().settings().getString("romdir");
// When romdir hasn't been set, it probably indicates that this is the first
// time running Stella; in this case, we should prompt the user
if(romdir == "")
// time running Stella; in this case, we should prompt the user
if(true || romdir == "")
{
if(!myFirstRunMsg)
{
@ -225,11 +225,12 @@ void LauncherDialog::loadConfig()
msg.push_back("Before you can start a game, you need to");
msg.push_back("specify where your ROMs are located.");
msg.push_back("");
msg.push_back("Click 'OK' to select a default ROM directory,");
msg.push_back("or 'Cancel' to browse the filesystem manually.");
msg.push_back("Click 'Default' to select a default ROM directory,");
msg.push_back("or 'Browse' to browse the filesystem manually.");
myFirstRunMsg = make_unique<GUI::MessageBox>
(this, instance().frameBuffer().font(),
msg, _w, _h, kFirstRunMsgChosenCmd);
msg, _w, _h, kFirstRunMsgChosenCmd,
"Default", "Browse", "ROM directory");
}
myFirstRunMsg->show();
}

View File

@ -28,7 +28,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LauncherFilterDialog::LauncherFilterDialog(GuiObject* boss, const GUI::Font& font)
: Dialog(boss->instance(), boss->parent()),
: Dialog(boss->instance(), boss->parent(), font, "Filter file list"),
CommandSender(boss)
{
const int lineHeight = font.getLineHeight(),
@ -41,9 +41,9 @@ LauncherFilterDialog::LauncherFilterDialog(GuiObject* boss, const GUI::Font& fon
VariantList items;
// Set real dimensions
_w = 3 * buttonWidth;//lwidth + pwidth + fontWidth*5 + 10;
_w = 3 * buttonWidth + 20 + 4 * 8;
xpos = 10; ypos = 10;
xpos = 10; ypos = 10 + _th;
// Types of files to show
VarList::push_back(items, "All files", "allfiles");
@ -56,13 +56,13 @@ LauncherFilterDialog::LauncherFilterDialog(GuiObject* boss, const GUI::Font& fon
ypos += lineHeight + 10;
// Different types of ROM extensions
xpos = 40;
xpos += font.getStringWidth("Show ");
myRomType[0] = new CheckboxWidget(this, font, xpos, ypos, ourRomTypes[0][0]);
int rightcol = xpos + myRomType[0]->getWidth() + 10;
myRomType[3] = new CheckboxWidget(this, font, xpos+rightcol, ypos, ourRomTypes[0][3]);
int rightcol = xpos + myRomType[0]->getWidth() + 8 * 3;
myRomType[3] = new CheckboxWidget(this, font, rightcol, ypos, ourRomTypes[0][3]);
ypos += lineHeight + 4;
myRomType[1] = new CheckboxWidget(this, font, xpos, ypos, ourRomTypes[0][1]);
myRomType[4] = new CheckboxWidget(this, font, xpos+rightcol, ypos, ourRomTypes[0][4]);
myRomType[4] = new CheckboxWidget(this, font, rightcol, ypos, ourRomTypes[0][4]);
ypos += lineHeight + 4;
myRomType[2] = new CheckboxWidget(this, font, xpos, ypos, ourRomTypes[0][2]);
ypos += lineHeight + 10;
@ -177,7 +177,7 @@ void LauncherFilterDialog::saveConfig()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void LauncherFilterDialog::setDefaults()
{
handleFileTypeChange("allfiles");
handleFileTypeChange("allroms");
_dirty = true;
}

View File

@ -33,7 +33,7 @@
LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h,
bool uselargefont)
: Dialog(osystem, parent),
: Dialog(osystem, parent, font, "System logs"),
myLogInfo(nullptr)
{
const int lineHeight = font.getLineHeight(),
@ -48,7 +48,7 @@ LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent,
_h = max_h;
// Test listing of the log output
xpos = 10; ypos = 10;
xpos = 10; ypos = 10 + _th;
myLogInfo = new StringListWidget(this, uselargefont ? font :
instance().frameBuffer().infoFont(), xpos, ypos, _w - 2 * xpos,
_h - buttonHeight - ypos - 20 - 2 * lineHeight, false);

View File

@ -29,8 +29,9 @@ namespace GUI {
MessageBox::MessageBox(GuiObject* boss, const GUI::Font& font,
const StringList& text, int max_w, int max_h, int cmd,
const string& okText, const string& cancelText,
const string& title,
bool focusOKButton)
: Dialog(boss->instance(), boss->parent(), 0, 0, max_w, max_h),
: Dialog(boss->instance(), boss->parent(), font, title, 0, 0, max_w, max_h),
CommandSender(boss),
myCmd(cmd)
{
@ -45,9 +46,10 @@ MessageBox::MessageBox(GuiObject* boss, const GUI::Font& font,
MessageBox::MessageBox(GuiObject* boss, const GUI::Font& font,
const string& text, int max_w, int max_h, int cmd,
const string& okText, const string& cancelText,
const string& title,
bool focusOKButton)
: MessageBox(boss, font, StringParser(text).stringList(), max_w, max_h,
cmd, okText, cancelText, focusOKButton)
cmd, okText, cancelText, title, focusOKButton)
{
}
@ -64,9 +66,9 @@ void MessageBox::addText(const GUI::Font& font, const StringList& text)
for(const auto& s: text)
str_w = std::max(int(s.length()), str_w);
_w = std::min(str_w * fontWidth + 20, _w);
_h = std::min(uInt32((text.size() + 2) * lineHeight + 20), uInt32(_h));
_h = std::min(uInt32((text.size() + 2) * lineHeight + 20 + _th), uInt32(_h));
xpos = 10; ypos = 10;
xpos = 10; ypos = 10 + _th;
for(const auto& s: text)
{
new StaticTextWidget(this, font, xpos, ypos, _w - 20,

View File

@ -37,10 +37,12 @@ class MessageBox : public Dialog, public CommandSender
MessageBox(GuiObject* boss, const GUI::Font& font, const StringList& text,
int max_w, int max_h, int cmd = 0,
const string& okText = "OK", const string& cancelText = "Cancel",
const string& title = "",
bool focusOKButton = true);
MessageBox(GuiObject* boss, const GUI::Font& font, const string& text,
int max_w, int max_h, int cmd = 0,
const string& okText = "OK", const string& cancelText = "Cancel",
const string& title = "",
bool focusOKButton = true);
virtual ~MessageBox() = default;

View File

@ -51,14 +51,17 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
myMode(mode)
{
const GUI::Font& font = instance().frameBuffer().font();
initTitle(font, "Options");
const int buttonWidth = font.getStringWidth("Developer Settings" + ELLIPSIS) + 20,
buttonHeight = font.getLineHeight() + 6,
rowHeight = font.getLineHeight() + 10;
const int VBORDER = 10 + _th;
_w = 2 * buttonWidth + 30;
_h = 7 * rowHeight + 15;
_h = 7 * rowHeight + 15 + _th;
int xoffset = 10, yoffset = 10;
int xoffset = 10, yoffset = VBORDER;
WidgetArray wid;
ButtonWidget* b = nullptr;
@ -95,12 +98,12 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
wid.push_back(myRomAuditButton);
// Move to second column
xoffset += buttonWidth + 10; yoffset = 10;
xoffset += buttonWidth + 10; yoffset = VBORDER;
myGameInfoButton = ADD_OD_BUTTON("Game Properties" + ELLIPSIS, kInfoCmd);
wid.push_back(myGameInfoButton);
myCheatCodeButton = ADD_OD_BUTTON("Cheat Code" + ELLIPSIS, kCheatCmd);
myCheatCodeButton = ADD_OD_BUTTON("Cheat Codes" + ELLIPSIS, kCheatCmd);
#ifndef CHEATCODE_SUPPORT
myCheatCodeButton->clearFlags(WIDGET_ENABLED);
#endif

View File

@ -35,12 +35,12 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RomAuditDialog::RomAuditDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h)
: Dialog(osystem, parent),
: Dialog(osystem, parent, font, "Audit ROMs"),
myConfirmMsg(nullptr),
myMaxWidth(max_w),
myMaxHeight(max_h)
{
const int VBORDER = 10;
const int VBORDER = 10 + _th;
const int HBORDER = 10;
const int lineHeight = font.getLineHeight(),
@ -54,7 +54,7 @@ RomAuditDialog::RomAuditDialog(OSystem& osystem, DialogContainer& parent,
// Set real dimensions
_w = 64 * fontWidth + HBORDER * 2;
_h = 7 * (lineHeight + 4) + 10;
_h = 7 * (lineHeight + 4) + VBORDER;
// Audit path
ButtonWidget* romButton =
@ -189,7 +189,7 @@ void RomAuditDialog::handleCommand(CommandSender* sender, int cmd,
myConfirmMsg = make_unique<GUI::MessageBox>
(this, instance().frameBuffer().font(), msg,
myMaxWidth, myMaxHeight, kConfirmAuditCmd,
"OK", "Cancel", false);
"OK", "Cancel", "ROM Audit", false);
}
myConfirmMsg->show();
break;

View File

@ -28,7 +28,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font)
: Dialog(osystem, parent),
: Dialog(osystem, parent, font, "Snapshot settings"),
myFont(font)
{
const int VBORDER = 10;
@ -45,9 +45,9 @@ SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent,
// Set real dimensions
_w = 64 * fontWidth + HBORDER * 2;
_h = 10 * (lineHeight + 4) + 10;
_h = 10 * (lineHeight + 4) + VBORDER + _th;
xpos = HBORDER; ypos = VBORDER;
xpos = HBORDER; ypos = VBORDER + _th;
// Snapshot path (save files)
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,

View File

@ -35,7 +35,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font)
: Dialog(osystem, parent)
: Dialog(osystem, parent, font, "UI settings")
{
const GUI::Font& ifont = instance().frameBuffer().infoFont();
const int lineHeight = font.getLineHeight(),
@ -54,11 +54,11 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
// Set real dimensions
_w = 37 * fontWidth + 10;
_h = 10 * (lineHeight + 4) + 10;
_h = 10 * (lineHeight + 4) + VBORDER + _th;
// The tab widget
xpos = HBORDER; ypos = VBORDER;
myTab = new TabWidget(this, font, 2, 4, _w - 2*2, _h - buttonHeight - 20);
myTab = new TabWidget(this, font, 2, 4 + _th, _w - 2*2, _h - _th - buttonHeight - 20);
addTabWidget(myTab);
//////////////////////////////////////////////////////////

View File

@ -35,7 +35,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h)
: Dialog(osystem, parent)
: Dialog(osystem, parent, font, "Video settings")
{
const int VGAP = 4;
const int VBORDER = 8;
@ -56,11 +56,11 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
// Set real dimensions
_w = std::min((52+4*0) * fontWidth + HBORDER * 2, max_w);
_h = std::min((16-2) * (lineHeight + VGAP) + 14, max_h);
_h = std::min((16-2) * (lineHeight + VGAP) + 14 + _th, max_h);
// The tab widget
xpos = 2; ypos = 4;
myTab = new TabWidget(this, font, xpos, ypos, _w - 2*xpos, _h - buttonHeight - 20);
myTab = new TabWidget(this, font, xpos, ypos + _th, _w - 2*xpos, _h - _th - buttonHeight - 20);
addTabWidget(myTab);
xpos = HBORDER; ypos = VBORDER;