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:
parent
d8a72d982f
commit
a7e963c362
|
@ -568,7 +568,7 @@ wxStyle::~wxStyle()
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStyle::Update(wxStyle *basic, wxStyle *target,
|
void wxStyle::Update(wxStyle *basic, wxStyle *target,
|
||||||
Bool propogate, Bool topLevel)
|
Bool propogate, Bool topLevel, Bool send_notify)
|
||||||
{
|
{
|
||||||
int size;
|
int size;
|
||||||
int fontid;
|
int fontid;
|
||||||
|
@ -721,19 +721,22 @@ void wxStyle::Update(wxStyle *basic, wxStyle *target,
|
||||||
target->pen = wxThePenList->FindOrCreatePen(foreground, 0, wxSOLID);
|
target->pen = wxThePenList->FindOrCreatePen(foreground, 0, wxSOLID);
|
||||||
target->brush = wxTheBrushList->FindOrCreateBrush(background, wxSOLID);
|
target->brush = wxTheBrushList->FindOrCreateBrush(background, wxSOLID);
|
||||||
|
|
||||||
if (propogate)
|
if (propogate) {
|
||||||
for (node = children->First(); node; node = node->Next()) {
|
for (node = children->First(); node; node = node->Next()) {
|
||||||
wxStyle *stl;
|
wxStyle *stl;
|
||||||
stl = (wxStyle *)node->Data();
|
stl = (wxStyle *)node->Data();
|
||||||
stl->Update(NULL, NULL, TRUE, FALSE);
|
stl->Update(NULL, NULL, TRUE, FALSE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (send_notify) {
|
||||||
if (styleList) {
|
if (styleList) {
|
||||||
styleList->StyleWasChanged(target);
|
styleList->StyleWasChanged(target);
|
||||||
if (topLevel)
|
if (topLevel)
|
||||||
styleList->StyleWasChanged(NULL);
|
styleList->StyleWasChanged(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
char *wxStyle::GetName()
|
char *wxStyle::GetName()
|
||||||
{
|
{
|
||||||
|
@ -1077,7 +1080,7 @@ wxStyle *wxStyleList::FindOrCreateStyle(wxStyle *baseStyle,
|
||||||
style->baseStyle = baseStyle;
|
style->baseStyle = baseStyle;
|
||||||
baseStyle->children->Append(style);
|
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);
|
Append(style);
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ class wxStyle : public wxObject
|
||||||
wxList *children;
|
wxList *children;
|
||||||
|
|
||||||
void Update(wxStyle *basic = NULL, wxStyle *target = NULL,
|
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);
|
void ResetTextMetrics(wxDC *dc);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user