void _m_emit(event_code evt_code, const Arg& arg, Mfptr mfptr) { const int pos = static_cast<int>(evt_code); if (realizer_ && (method_state::not_overrided != mth_state_[pos])) { _m_bground_pre(); if (method_state::pending == mth_state_[pos]) { (realizer_->*mfptr)(graphics, arg); //Check realizer, when the window is closed in that event handler, the drawer will be //detached and realizer will be a nullptr if(realizer_) mth_state_[pos] = (realizer_->_m_overrided(evt_code) ? method_state::overrided : method_state::not_overrided); } else (realizer_->*mfptr)(graphics, arg); if (_m_lazy_decleared()) { _m_draw_dynamic_drawing_object(); _m_bground_end(); } } }
void drawer::refresh() { if(realizer_ && (refreshing_ == false)) { refreshing_ = true; _m_bground_pre(); realizer_->refresh(graphics); _m_draw_dynamic_drawing_object(); _m_bground_end(); graphics.flush(); refreshing_ = false; } }