void Window::Draw( void ) { DrawBack(); Widget *wd = widgets; while ( wd ) { if ( !wd->Hidden() ) wd->Draw(); wd = wd->next; } }
GUI_Status Window::HandleEvent( const SDL_Event &event ) { if ( ((flags & WIN_CLOSE_ESC) && (event.type == SDL_KEYDOWN) && (event.key.keysym.sym == SDLK_ESCAPE)) || ((flags & WIN_CLOSE_UNFOCUS) && (event.type == SDL_MOUSEBUTTONDOWN) && !Contains( event.button.x, event.button.y )) ) return GUI_CLOSE; GUI_Status rc = GUI_OK; Widget *wd = widgets; while ( wd ) { if ( !wd->Hidden() && !wd->Disabled() ) { GUI_Status wrc = wd->HandleEvent( event ); if ( wrc != GUI_OK ) rc = wrc; } wd = wd->next; } return rc; }