GUI: Remove GuiObject::getMillis()

svn-id: r48241
This commit is contained in:
Max Horn 2010-03-11 23:41:28 +00:00
parent 6e78fdc161
commit 4fc8ebab01
8 changed files with 14 additions and 22 deletions

View file

@ -674,7 +674,7 @@ void ValueDisplayDialog::drawDialog() {
} }
void ValueDisplayDialog::handleTickle() { void ValueDisplayDialog::handleTickle() {
if (getMillis() > _timer) { if (g_system->getMillis() > _timer) {
close(); close();
} }
} }
@ -702,7 +702,7 @@ void ValueDisplayDialog::handleKeyDown(Common::KeyState state) {
_value--; _value--;
setResult(_value); setResult(_value);
_timer = getMillis() + kDisplayDelay; _timer = g_system->getMillis() + kDisplayDelay;
draw(); draw();
} else { } else {
close(); close();
@ -712,7 +712,7 @@ void ValueDisplayDialog::handleKeyDown(Common::KeyState state) {
void ValueDisplayDialog::open() { void ValueDisplayDialog::open() {
GUI_Dialog::open(); GUI_Dialog::open();
setResult(_value); setResult(_value);
_timer = getMillis() + kDisplayDelay; _timer = g_system->getMillis() + kDisplayDelay;
} }
SubtitleSettingsDialog::SubtitleSettingsDialog(ScummEngine *scumm, int value) SubtitleSettingsDialog::SubtitleSettingsDialog(ScummEngine *scumm, int value)
@ -722,7 +722,7 @@ SubtitleSettingsDialog::SubtitleSettingsDialog(ScummEngine *scumm, int value)
void SubtitleSettingsDialog::handleTickle() { void SubtitleSettingsDialog::handleTickle() {
InfoDialog::handleTickle(); InfoDialog::handleTickle();
if (getMillis() > _timer) if (g_system->getMillis() > _timer)
close(); close();
} }
@ -759,7 +759,7 @@ void SubtitleSettingsDialog::cycleValue() {
else else
setInfoText(subtitleDesc[_value]); setInfoText(subtitleDesc[_value]);
_timer = getMillis() + 1500; _timer = g_system->getMillis() + 1500;
} }
Indy3IQPointsDialog::Indy3IQPointsDialog(ScummEngine *scumm, char* text) Indy3IQPointsDialog::Indy3IQPointsDialog(ScummEngine *scumm, char* text)

View file

@ -290,7 +290,7 @@ bool ListWidget::handleKeyDown(Common::KeyState state) {
// Quick selection mode: Go to first list item starting with this key // Quick selection mode: Go to first list item starting with this key
// (or a substring accumulated from the last couple key presses). // (or a substring accumulated from the last couple key presses).
// Only works in a useful fashion if the list entries are sorted. // Only works in a useful fashion if the list entries are sorted.
uint32 time = getMillis(); uint32 time = g_system->getMillis();
if (_quickSelectTime < time) { if (_quickSelectTime < time) {
_quickSelectStr = (char)state.ascii; _quickSelectStr = (char)state.ascii;
} else { } else {

View file

@ -170,7 +170,7 @@ void PopUpDialog::drawDialog() {
if (_openTime == 0) { if (_openTime == 0) {
// Time the popup was opened // Time the popup was opened
_openTime = getMillis(); _openTime = g_system->getMillis();
} }
} }
@ -178,7 +178,7 @@ void PopUpDialog::handleMouseUp(int x, int y, int button, int clickCount) {
// Mouse was released. If it wasn't moved much since the original mouse down, // Mouse was released. If it wasn't moved much since the original mouse down,
// let the popup stay open. If it did move, assume the user made his selection. // let the popup stay open. If it did move, assume the user made his selection.
int dist = (_clickX - x) * (_clickX - x) + (_clickY - y) * (_clickY - y); int dist = (_clickX - x) * (_clickX - x) + (_clickY - y) * (_clickY - y);
if (dist > 3 * 3 || getMillis() - _openTime > 300) { if (dist > 3 * 3 || g_system->getMillis() - _openTime > 300) {
setResult(_selection); setResult(_selection);
close(); close();
} }

View file

@ -175,7 +175,7 @@ void AboutDialog::addLine(const char *str) {
void AboutDialog::open() { void AboutDialog::open() {
_scrollTime = getMillis() + kScrollStartDelay; _scrollTime = g_system->getMillis() + kScrollStartDelay;
_scrollPos = 0; _scrollPos = 0;
_willClose = false; _willClose = false;
@ -253,7 +253,7 @@ void AboutDialog::drawDialog() {
} }
void AboutDialog::handleTickle() { void AboutDialog::handleTickle() {
const uint32 t = getMillis(); const uint32 t = g_system->getMillis();
int scrollOffset = ((int)t - (int)_scrollTime) / kScrollMillisPerPixel; int scrollOffset = ((int)t - (int)_scrollTime) / kScrollMillisPerPixel;
if (scrollOffset > 0) { if (scrollOffset > 0) {
int modifiers = g_system->getEventManager()->getModifierState(); int modifiers = g_system->getEventManager()->getModifierState();

View file

@ -77,7 +77,7 @@ bool EditableWidget::tryInsertChar(byte c, int pos) {
} }
void EditableWidget::handleTickle() { void EditableWidget::handleTickle() {
uint32 time = getMillis(); uint32 time = g_system->getMillis();
if (_caretTime < time) { if (_caretTime < time) {
_caretTime = time + kCaretBlinkTime; _caretTime = time + kCaretBlinkTime;
drawCaret(_caretVisible); drawCaret(_caretVisible);
@ -287,7 +287,7 @@ bool EditableWidget::adjustOffset() {
} }
void EditableWidget::makeCaretVisible() { void EditableWidget::makeCaretVisible() {
_caretTime = getMillis() + kCaretBlinkTime; _caretTime = g_system->getMillis() + kCaretBlinkTime;
_caretVisible = true; _caretVisible = true;
drawCaret(false); drawCaret(false);
} }

View file

@ -110,12 +110,12 @@ void MessageDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
TimedMessageDialog::TimedMessageDialog(const Common::String &message, uint32 duration) TimedMessageDialog::TimedMessageDialog(const Common::String &message, uint32 duration)
: MessageDialog(message, 0, 0) { : MessageDialog(message, 0, 0) {
_timer = getMillis() + duration; _timer = g_system->getMillis() + duration;
} }
void TimedMessageDialog::handleTickle() { void TimedMessageDialog::handleTickle() {
MessageDialog::handleTickle(); MessageDialog::handleTickle();
if (getMillis() > _timer) if (g_system->getMillis() > _timer)
close(); close();
} }

View file

@ -40,10 +40,6 @@ GuiObject::~GuiObject() {
_firstWidget = 0; _firstWidget = 0;
} }
uint32 GuiObject::getMillis() {
return g_system->getMillis();
}
void GuiObject::reflowLayout() { void GuiObject::reflowLayout() {
if (!_name.empty()) { if (!_name.empty()) {
if (!g_gui.xmlEval()->getWidgetData(_name, _x, _y, _w, _h)) { if (!g_gui.xmlEval()->getWidgetData(_name, _x, _y, _w, _h)) {

View file

@ -86,10 +86,6 @@ public:
protected: protected:
virtual void releaseFocus() = 0; virtual void releaseFocus() = 0;
// Convenience alias for OSystem::getMillis().
// This is a bit hackish, of course :-).
uint32 getMillis();
}; };
} // End of namespace GUI } // End of namespace GUI