suppress unneeded style-list notifications; addresses a problem when loading the first non-text file into DrScheme, especially after a ;arge text file is already in a buffer

svn: r4208
This commit is contained in:
Matthew Flatt 2006-08-31 22:43:10 +00:00
parent d8a72d982f
commit a7e963c362
2 changed files with 11 additions and 8 deletions

View File

@ -568,7 +568,7 @@ wxStyle::~wxStyle()
}
void wxStyle::Update(wxStyle *basic, wxStyle *target,
Bool propogate, Bool topLevel)
Bool propogate, Bool topLevel, Bool send_notify)
{
int size;
int fontid;
@ -721,19 +721,22 @@ void wxStyle::Update(wxStyle *basic, wxStyle *target,
target->pen = wxThePenList->FindOrCreatePen(foreground, 0, wxSOLID);
target->brush = wxTheBrushList->FindOrCreateBrush(background, wxSOLID);
if (propogate)
if (propogate) {
for (node = children->First(); node; node = node->Next()) {
wxStyle *stl;
stl = (wxStyle *)node->Data();
stl->Update(NULL, NULL, TRUE, FALSE);
}
}
if (send_notify) {
if (styleList) {
styleList->StyleWasChanged(target);
if (topLevel)
styleList->StyleWasChanged(NULL);
}
}
}
char *wxStyle::GetName()
{
@ -1077,7 +1080,7 @@ wxStyle *wxStyleList::FindOrCreateStyle(wxStyle *baseStyle,
style->baseStyle = baseStyle;
baseStyle->children->Append(style);
style->Update();
style->Update(NULL, NULL, FALSE, FALSE, FALSE); /* No need to propagate/notify, because we just created it. */
Append(style);

View File

@ -154,7 +154,7 @@ class wxStyle : public wxObject
wxList *children;
void Update(wxStyle *basic = NULL, wxStyle *target = NULL,
Bool propogate = TRUE, Bool topLevel = TRUE);
Bool propogate = TRUE, Bool topLevel = TRUE, Bool send_notify = TRUE);
void ResetTextMetrics(wxDC *dc);