{
m_tmpMouseMoved = FALSE;
m_tmpLastLink = wxEmptyString;
- m_tmpCanDraw = TRUE;
+ m_tmpCanDrawLocks = 0;
m_FS = new wxFileSystem();
m_RelatedStatusBar = -1;
m_RelatedFrame = NULL;
m_OpenedPage = m_OpenedAnchor = m_OpenedPageTitle = wxEmptyString;
m_Parser -> SetDC(dc);
if (m_Cell) {
- delete m_Cell;
- m_Cell = NULL;
+ delete m_Cell;
+ m_Cell = NULL;
}
m_Cell = (wxHtmlContainerCell*) m_Parser -> Parse(source);
delete dc;
m_Cell -> SetIndent(m_Borders, wxHTML_INDENT_ALL, wxHTML_UNITS_PIXELS);
m_Cell -> SetAlignHor(wxHTML_ALIGN_CENTER);
CreateLayout();
- Refresh();
+ if (m_tmpCanDrawLocks == 0) Refresh();
return TRUE;
}
SetCursor(*wxHOURGLASS_CURSOR);
wxYield();
- m_tmpCanDraw = FALSE;
+ m_tmpCanDrawLocks++;
if (m_HistoryOn && (m_HistoryPos != -1)) { // store scroll position into history item
int x, y;
ViewStart(&x, &y);
if (location[0] == '#') { // local anchor
wxString anch = location.Mid(1) /*1 to end*/;
- m_tmpCanDraw = TRUE;
+ m_tmpCanDrawLocks--;
rt_val = ScrollToAnchor(anch);
}
wxString err;
err.Printf(_("The browser is unable to open requested location :\n\n%s"), WXSTRINGCAST location);
- m_tmpCanDraw = TRUE;
+ m_tmpCanDrawLocks--;
Refresh();
wxMessageBox(err, "Error");
node = node -> GetNext();
}
if (src == wxEmptyString) {
- if (m_DefaultFilter == NULL) m_DefaultFilter = GetDefaultFilter();
- src = m_DefaultFilter -> ReadFile(*f);
- }
+ if (m_DefaultFilter == NULL) m_DefaultFilter = GetDefaultFilter();
+ src = m_DefaultFilter -> ReadFile(*f);
+ }
m_FS -> ChangePathTo(f -> GetLocation());
rt_val = SetPage(src);
m_OpenedPage = f -> GetLocation();
if (f -> GetAnchor() != wxEmptyString) {
- m_tmpCanDraw = TRUE;
+// m_tmpCanDrawLocks--;
ScrollToAnchor(f -> GetAnchor());
- m_tmpCanDraw = FALSE;
+// m_tmpCanDrawLocks++;
}
delete f;
SetCursor(*wxSTANDARD_CURSOR);
- m_tmpCanDraw = TRUE;
+ wxYield();
+ m_tmpCanDrawLocks--;
Refresh();
return rt_val;
}
#endif
GetClientSize(&ClientWidth, &ClientHeight);
m_Cell -> Layout(ClientWidth);
- if (ClientHeight < m_Cell -> GetHeight()) {
+ if (ClientHeight < m_Cell -> GetHeight()) {
SetScrollbars(wxHTML_SCROLL_STEP, wxHTML_SCROLL_STEP,
m_Cell -> GetWidth() / wxHTML_SCROLL_STEP,
m_Cell -> GetHeight() / wxHTML_SCROLL_STEP
/*cheat: top-level frag is always container*/);
}
- else { /* we fit into window, no need for scrollbars */
- SetScrollbars(1, 1, 0, 0); // disable...
- GetClientSize(&ClientWidth, &ClientHeight);
- m_Cell -> Layout(ClientWidth); // ...and relayout
- }
+ else { /* we fit into window, no need for scrollbars */
+ SetScrollbars(1, 1, 0, 0); // disable...
+ GetClientSize(&ClientWidth, &ClientHeight);
+ m_Cell -> Layout(ClientWidth); // ...and relayout
+ }
}
}
l = m_History[m_HistoryPos].GetPage();
a = m_History[m_HistoryPos].GetAnchor();
m_HistoryOn = FALSE;
+ m_tmpCanDrawLocks++;
if (a == wxEmptyString) LoadPage(l);
else LoadPage(l + "#" + a);
m_HistoryOn = TRUE;
Scroll(0, m_History[m_HistoryPos].GetPos());
+// wxYield();
+ m_tmpCanDrawLocks--;
Refresh();
return TRUE;
}
l = m_History[m_HistoryPos].GetPage();
a = m_History[m_HistoryPos].GetAnchor();
m_HistoryOn = FALSE;
+ m_tmpCanDrawLocks++;
if (a == wxEmptyString) LoadPage(l);
else LoadPage(l + "#" + a);
m_HistoryOn = TRUE;
Scroll(0, m_History[m_HistoryPos].GetPos());
+// wxYield();
+ m_tmpCanDrawLocks--;
Refresh();
return TRUE;
}
wxRegionIterator upd(GetUpdateRegion()); // get the update rect list
int v_y, v_h;
- if (!m_tmpCanDraw) return;
+ if (m_tmpCanDrawLocks > 0) return;
dc.SetMapMode(wxMM_TEXT);
#if defined(_MSC_VER) && (_MSC_VER == 1200)
::SetMapMode((HDC)dc.GetHDC(), MM_TEXT);