void CColorMappingDlg::SetView(CFracticeView *View) { if (View == m_View) return; // nothing to do bool PrevEnab = m_View != NULL; m_View = View; Update(); bool Enable = View != NULL; if (Enable != PrevEnab) // if enable changed EnableCtrls(Enable); }
int TopWindow::Run(bool appmodal) { GuiLock __; LLOG("TopWindow::Run() <- " << typeid(*this).name()); LLOG("Focus = " << UPP::Name(GetFocusCtrl())); if(!IsOpen()) Open(); if(!IsVisible()) Show(); bool pinloop = inloop; int pexitcode = exitcode; exitcode = Null; Vector<Ctrl *> es; if(appmodal) es = GetTopCtrls(); else { Vector<Ctrl *> ws = GetTopCtrls(); for(int i = 0; i < ws.GetCount(); i++) if(ws[i]->InLoop()) es.Add(ws[i]); Ctrl *mw = GetMainWindow(); if(mw) GatherWindowTree(mw, ws, es); } Vector< Ptr<Ctrl> > disabled = DisableCtrls(es, this); #ifdef _DEBUG for(int d = 0; d < disabled.GetCount(); d++) LLOG("DisableCtrls[" << d << "] = " << UPP::Name(disabled[d])); LLOG("Running EventLoop in " << UPP::Name(this)); #endif EventLoop(this); #ifdef _DEBUG LLOG("Finished EventLoop in " << UPP::Name(this)); for(int e = 0; e < disabled.GetCount(); e++) LLOG("EnableCtrls[" << e << "] = " << UPP::Name(disabled[e])); #endif EnableCtrls(disabled); if(IsNull(exitcode)) { WhenClose(); if(IsNull(exitcode)) DefaultBreak(); } int q = exitcode; inloop = pinloop; exitcode = pexitcode; LLOG("TopWindow::Run() = " << q << " -> " << typeid(*this).name()); #ifdef GUI_WIN LLOG("Focus = " << UPP::Name(GetFocusCtrl()) << ", raw " << (void *)::GetFocus()); #endif return q; }