make buttons 2 pixel wider (fixes 'Options' button); don't use non-portable hack to swap ints

svn-id: r5427
This commit is contained in:
Max Horn 2002-11-05 22:34:50 +00:00
parent 5c0b145315
commit 56a41a26c0
4 changed files with 9 additions and 7 deletions

View File

@ -282,12 +282,12 @@ Widget *Dialog::findWidget(int x, int y)
return w;
}
Widget *Dialog::addButton(int x, int y, const ScummVM::String &label, uint32 cmd, char hotkey)
ButtonWidget *Dialog::addButton(int x, int y, const ScummVM::String &label, uint32 cmd, char hotkey)
{
return new ButtonWidget(this, x, y, kButtonWidth, 16, label, cmd, hotkey);
}
Widget *Dialog::addPushButton(int x, int y, const ScummVM::String &label, uint32 cmd, char hotkey)
PushButtonWidget *Dialog::addPushButton(int x, int y, const ScummVM::String &label, uint32 cmd, char hotkey)
{
return new PushButtonWidget(this, x, y, kButtonWidth, 16, label, cmd, hotkey);
}

View File

@ -25,6 +25,8 @@
#include "widget.h" // For CommandReceiver
class NewGui;
class ButtonWidget;
class PushButtonWidget;
// Some "common" commands sent to handleCommand()
enum {
@ -74,8 +76,8 @@ protected:
Widget* findWidget(int x, int y); // Find the widget at pos x,y if any
Widget* addButton(int x, int y, const ScummVM::String &label, uint32 cmd, char hotkey);
Widget* addPushButton(int x, int y, const ScummVM::String &label, uint32 cmd, char hotkey);
ButtonWidget* addButton(int x, int y, const ScummVM::String &label, uint32 cmd, char hotkey);
PushButtonWidget* addPushButton(int x, int y, const ScummVM::String &label, uint32 cmd, char hotkey);
};
#endif

View File

@ -286,10 +286,10 @@ void NewGui::line(int x, int y, int x2, int y2, int16 color)
int16 *ptr;
if (x2 < x)
x2 ^= x ^= x2 ^= x; // Swap x2 and x
SWAP(x2, x);
if (y2 < y)
y2 ^= y ^= y2 ^= y; // Swap y2 and y
SWAP(y2, y);
ptr = getBasePtr(x, y);

View File

@ -49,7 +49,7 @@ enum {
};
enum {
kButtonWidth = 54,
kButtonWidth = 56,
kButtonHeight = 16,
};