fix and changes

* win32 compilation fix
* add buttons to miniwindow
* dispatcher events fixes
* ui fixes
This commit is contained in:
Eduardo Bart
2012-03-27 15:14:35 -03:00
parent 060c1cf8e7
commit 8ea154016b
24 changed files with 129 additions and 81 deletions

View File

@@ -35,7 +35,7 @@ void EventDispatcher::flush()
m_scheduledEventList.pop();
}
void EventDispatcher::poll()
void EventDispatcher::poll(bool allEvents)
{
while(!m_scheduledEventList.empty()) {
ScheduledEventPtr scheduledEvent = m_scheduledEventList.top();
@@ -45,12 +45,16 @@ void EventDispatcher::poll()
scheduledEvent->execute();
}
m_pollEventsSize = m_eventList.size();
for(int i=0;i<m_pollEventsSize;++i) {
EventPtr event = m_eventList.front();
m_eventList.pop_front();
event->execute();
}
do {
m_pollEventsSize = m_eventList.size();
if(m_pollEventsSize == 0)
break;
for(int i=0;i<m_pollEventsSize;++i) {
EventPtr event = m_eventList.front();
m_eventList.pop_front();
event->execute();
}
} while(allEvents);
}
ScheduledEventPtr EventDispatcher::scheduleEvent(const SimpleCallback& callback, int delay)

View File

@@ -73,7 +73,7 @@ class EventDispatcher
{
public:
void flush();
void poll();
void poll(bool allEvents = false);
EventPtr addEvent(const SimpleCallback& callback, bool pushFront = false);
ScheduledEventPtr scheduleEvent(const SimpleCallback& callback, int delay);