- I used to have a method called ParamDialog::Refresh() that reread all the

parameter values associated with the dialog and updated the wxWindows
  controls.  At the time I didn't realize that I was overriding
  wxWindow::Refresh() which repaints the window.  Later, I renamed the method
  to CopyParamToGui() to make it more clear, but many of the callers in
  wxmain.cc continued to call Refresh(), which now reverted to the parent class
  wxWindow::Refresh().  Since there was no compile error I didn't notice for a
  while, but it caused the ParamDialogs to repaint themselves constantly but
  never actually change their values.  This is now fixed by changing those
  method calls to CopyParamToGui().
This commit is contained in:
Bryce Denney 2002-09-22 04:36:09 +00:00
parent 85a7d1dad8
commit adeb5331f6

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////
// $Id: wxmain.cc,v 1.54 2002-09-22 02:43:37 bdenney Exp $
// $Id: wxmain.cc,v 1.55 2002-09-22 04:36:09 bdenney Exp $
/////////////////////////////////////////////////////////////////
//
// wxmain.cc implements the wxWindows frame, toolbar, menus, and dialogs.
@ -704,7 +704,7 @@ void MyFrame::OnShowCpu(wxCommandEvent& WXUNUSED(event))
#endif
showCpu->Init ();
} else {
showCpu->Refresh ();
showCpu->CopyParamToGui ();
}
showCpu->Show (TRUE);
}
@ -717,7 +717,7 @@ void MyFrame::OnShowKeyboard(wxCommandEvent& WXUNUSED(event))
showKbd->AddParam (SIM->get_param (BXP_KBD_PARAMETERS));
showKbd->Init ();
} else {
showKbd->Refresh ();
showKbd->CopyParamToGui ();
}
showKbd->Show (TRUE);
}
@ -726,7 +726,7 @@ void MyFrame::OnShowKeyboard(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnDebugLog(wxCommandEvent& WXUNUSED(event))
{
wxASSERT (showDebugLog != NULL);
showDebugLog->Refresh ();
showDebugLog->CopyParamToGui ();
showDebugLog->Show (TRUE);
}
@ -1361,8 +1361,8 @@ bool MyFrame::WantRefresh () {
}
void MyFrame::RefreshDialogs () {
if (showCpu!=NULL && showCpu->IsShowing ()) showCpu->Refresh ();
if (showKbd!=NULL && showKbd->IsShowing ()) showKbd->Refresh ();
if (showCpu!=NULL && showCpu->IsShowing ()) showCpu->CopyParamToGui ();
if (showKbd!=NULL && showKbd->IsShowing ()) showKbd->CopyParamToGui ();
}
//////////////////////////////////////////////////////////////////////