From a7e963c3629d5417041084d771779e201ce56e20 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 31 Aug 2006 22:43:10 +0000 Subject: [PATCH] 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 --- src/mred/wxme/wx_style.cxx | 17 ++++++++++------- src/mred/wxme/wx_style.h | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/mred/wxme/wx_style.cxx b/src/mred/wxme/wx_style.cxx index 682e22a763..815b543cb8 100644 --- a/src/mred/wxme/wx_style.cxx +++ b/src/mred/wxme/wx_style.cxx @@ -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,17 +721,20 @@ 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 (styleList) { - styleList->StyleWasChanged(target); - if (topLevel) - styleList->StyleWasChanged(NULL); + if (send_notify) { + if (styleList) { + styleList->StyleWasChanged(target); + if (topLevel) + styleList->StyleWasChanged(NULL); + } } } @@ -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); diff --git a/src/mred/wxme/wx_style.h b/src/mred/wxme/wx_style.h index 2dd623b86d..350cfb0262 100644 --- a/src/mred/wxme/wx_style.h +++ b/src/mred/wxme/wx_style.h @@ -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);