+bool wxHtmlCell::AdjustPagebreak(int *pagebreak)
+{
+
+ if ((!m_CanLiveOnPagebreak) &&
+ m_PosY < *pagebreak && m_PosY + m_Height >= *pagebreak) {
+ *pagebreak = m_PosY;
+ if (m_Next != NULL) m_Next -> AdjustPagebreak(pagebreak);
+ return TRUE;
+ }
+
+ else {
+ if (m_Next != NULL) return m_Next -> AdjustPagebreak(pagebreak);
+ else return FALSE;
+ }
+}
+
+
+
+
//-----------------------------------------------------------------------------
// wxHtmlWordCell
//-----------------------------------------------------------------------------
m_Word.Replace(">", ">", TRUE);
m_Word.Replace("&", "&", TRUE);
dc.GetTextExtent(m_Word, &m_Width, &m_Height, &m_Descent);
+ SetCanLiveOnPagebreak(FALSE);
}
+bool wxHtmlContainerCell::AdjustPagebreak(int *pagebreak)
+{
+ if (!m_CanLiveOnPagebreak)
+ return wxHtmlCell::AdjustPagebreak(pagebreak);
+ else {
+ wxHtmlCell *c = GetFirstCell();
+ bool rt = FALSE;
+
+ while (c) {
+ if (c -> AdjustPagebreak(pagebreak)) rt = TRUE;
+ c = c -> GetNext();
+ }
+ return rt;
+ }
+}
+
+
+
void wxHtmlContainerCell::Layout(int w)
{
wxHtmlCell *cell = m_Cells, *line = m_Cells;
int ysizeup = 0, ysizedown = 0;
/*
-
+
WIDTH ADJUSTING :
-
+
*/
if (m_WidthFloatUnits == HTML_UNITS_PERCENT) {
/*
LAYOUTING :
-
+
*/
// adjust indentation:
s_width = m_Width - s_indent - ((m_IndentRight < 0) ? (-m_IndentRight * m_Width / 100) : m_IndentRight);
m_MaxLineWidth = 0;
-
+
// my own layouting:
while (cell != NULL) {
switch (m_AlignVer) {
const wxHtmlCell* wxHtmlContainerCell::Find(int condition, const void* param) const
{
const wxHtmlCell *r = NULL;
-
+
if (m_Cells) {
r = m_Cells -> Find(condition, param);
if (r) return r;
c = c -> GetParent();
}
-/*
((wxScrolledWindow*)(m_Wnd -> GetParent())) -> ViewStart(&stx, &sty);
m_Wnd -> SetSize(absx - HTML_SCROLL_STEP * stx, absy - HTML_SCROLL_STEP * sty, m_Width, m_Height);
-*/
-
- m_Wnd -> SetSize(absx, absy, m_Width, m_Height);
wxHtmlCell::Draw(dc, x, y, view_y1, view_y2);
}
absy += c -> GetPosY();
c = c -> GetParent();
}
-
-/*
+
((wxScrolledWindow*)(m_Wnd -> GetParent())) -> ViewStart(&stx, &sty);
m_Wnd -> SetSize(absx - HTML_SCROLL_STEP * stx, absy - HTML_SCROLL_STEP * sty, m_Width, m_Height);
-*/
- m_Wnd -> SetSize(absx, absy, m_Width, m_Height);
-
wxHtmlCell::DrawInvisible(dc, x, y);
}