home *** CD-ROM | disk | FTP | other *** search
- //
- // $Id: Application.cc,v 1.2 2000/06/06 09:31:09 sergey Exp $
- //
-
- #include <Pilot.h>
- #include "Application.h"
- #include "Form.h"
-
-
- namespace UI
- {
- void Application::run(Form& mainForm, long eventLoopDelay)
- {
- mainForm.create();
- FrmPopupForm(mainForm.formID());
-
- eventLoop(eventLoopDelay);
-
- mainForm.destroy(); // do it here due to the problems with static variables
- }
-
- void Application::eventLoop(long delay)
- {
- Word error;
- EventType event;
-
- do
- {
- EvtGetEvent(&event, delay);
-
- if (SysHandleEvent(&event))
- continue;
-
- if (MenuHandleEvent(NULL, &event, &error))
- continue;
-
- FrmDispatchEvent(&event);
- }
- while (event.eType != appStopEvent);
- }
- }
- // namespace UI
-