]>
git.saurik.com Git - wxWidgets.git/blob - src/html/htmlcell.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxHtmlCell - basic element of HTML output
4 // Author: Vaclav Slavik
6 // Copyright: (c) 1999 Vaclav Slavik
7 // Licence: wxWindows Licence
8 /////////////////////////////////////////////////////////////////////////////
11 #pragma implementation
14 #include "wx/wxprec.h"
18 #if wxUSE_HTML && wxUSE_STREAMS
28 #include "wx/html/htmlcell.h"
29 #include "wx/html/htmlwin.h"
33 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
37 wxHtmlCell::wxHtmlCell() : wxObject()
41 m_Width
= m_Height
= m_Descent
= 0;
42 m_CanLiveOnPagebreak
= TRUE
;
46 wxHtmlCell::~wxHtmlCell()
48 if (m_Link
) delete m_Link
;
49 if (m_Next
) delete m_Next
;
53 void wxHtmlCell::OnMouseClick(wxWindow
*parent
, int x
, int y
,
54 const wxMouseEvent
& event
)
56 wxHtmlLinkInfo
*lnk
= GetLink(x
, y
);
59 wxHtmlLinkInfo
lnk2(*lnk
);
60 lnk2
.SetEvent(&event
);
61 lnk2
.SetHtmlCell(this);
62 ((wxHtmlWindow
*)parent
)->OnLinkClicked(lnk2
);
63 // note : this overcasting is legal because parent is *always* wxHtmlWindow
69 bool wxHtmlCell::AdjustPagebreak(int *pagebreak
) const
71 if ((!m_CanLiveOnPagebreak
) &&
72 m_PosY
< *pagebreak
&& m_PosY
+ m_Height
> *pagebreak
)
75 if (m_Next
!= NULL
) m_Next
->AdjustPagebreak(pagebreak
);
81 if (m_Next
!= NULL
) return m_Next
->AdjustPagebreak(pagebreak
);
88 void wxHtmlCell::SetLink(const wxHtmlLinkInfo
& link
)
90 if (m_Link
) delete m_Link
;
92 if (link
.GetHref() != wxEmptyString
)
93 m_Link
= new wxHtmlLinkInfo(link
);
98 void wxHtmlCell::Layout(int w
)
101 if (m_Next
) m_Next
->Layout(w
);
105 void wxHtmlCell::Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
)
107 if (m_Next
) m_Next
->Draw(dc
, x
, y
, view_y1
, view_y2
);
112 void wxHtmlCell::DrawInvisible(wxDC
& dc
, int x
, int y
)
114 if (m_Next
) m_Next
->DrawInvisible(dc
, x
, y
);
119 const wxHtmlCell
* wxHtmlCell::Find(int condition
, const void* param
) const
121 if (m_Next
) return m_Next
->Find(condition
, param
);
127 //-----------------------------------------------------------------------------
129 //-----------------------------------------------------------------------------
131 wxHtmlWordCell::wxHtmlWordCell(const wxString
& word
, wxDC
& dc
) : wxHtmlCell()
135 if (m_Word
.Find(wxT('&')) != -1)
137 #define ESCSEQ(escape, subst) \
138 { _T("&") _T(escape) _T(";"), _T("&") _T(escape) _T(" "), _T("&") _T(escape), _T(subst) }
139 static wxChar
* substitutions
[][4] =
141 ESCSEQ("quot", "\""),
143 ESCSEQ("#8220", "\""),
144 ESCSEQ("#8221", "\""),
150 ESCSEQ("#94", "^"), /* ^ */
154 ESCSEQ("iexcl", "!"),
156 ESCSEQ("cent", "¢"/* ¢ */),
157 ESCSEQ("#162", "¢"/* ¢ */),
159 ESCSEQ("trade", "(TM)"),
160 ESCSEQ("#153", "(TM)"),
161 ESCSEQ("#8482", "(TM)"),
165 ESCSEQ("brkbar", "¦"),
172 ESCSEQ("copy", "©"), /* © */
176 ESCSEQ("laquo", "«"), /* « */
181 ESCSEQ("reg", "®"), /* ® */
184 ESCSEQ("deg", "°"), /* ° */
186 ESCSEQ("plusm", "±"), /* ± */
189 ESCSEQ("acute", "´"),
191 ESCSEQ("macron", "¯"),
193 ESCSEQ("micro", "µ"), /* µ */
195 ESCSEQ("para", "¶"), /* ¶ */
198 ESCSEQ("ordm", "º"), /* º */
200 ESCSEQ("raquo", "»"), /* » */
203 ESCSEQ("iquest", "¿"), /* ¿ */
205 ESCSEQ("Agrave", "\300"/* À */),
206 ESCSEQ("#193", "\300"/* À */),
208 ESCSEQ("Acirc", "\302"/* Â */),
209 ESCSEQ("Atilde", "\303"/* Ã */),
210 ESCSEQ("Auml", "\304"/* Ä */),
211 ESCSEQ("Aring", " "),
212 ESCSEQ("AElig", " "),
213 ESCSEQ("Ccedil", "\347"/* ç */),
214 ESCSEQ("Egrave", "\310"/* È */),
215 ESCSEQ("Eacute", "\311"/* É */),
216 ESCSEQ("Ecirc", "\312"/* Ê */),
217 ESCSEQ("Euml", "\313"/* Ë */),
218 ESCSEQ("Igrave", "\314"/* Ì */),
220 ESCSEQ("Icirc", "\316"/* Î */),
221 ESCSEQ("Iuml", "\317"/* Ï */),
223 ESCSEQ("Ntilde", "\321"/* Ñ */),
224 ESCSEQ("Ograve", "\322"/* Ò */),
226 ESCSEQ("Ocirc", "\324"/* Ô */),
227 ESCSEQ("Otilde", "\325"/* Õ */),
228 ESCSEQ("Ouml", "\326"/* Ö */),
230 ESCSEQ("Oslash", " "),
231 ESCSEQ("Ugrave", "\331"/* Ù */),
233 ESCSEQ("Ucirc", " "),
234 ESCSEQ("Uuml", "\334"/* Ü */),
236 ESCSEQ("szlig", "\247"/* § */),
237 ESCSEQ("agrave","\340"/* à */),
238 ESCSEQ("aacute", "\341"/* á */),
239 ESCSEQ("acirc", "\342"/* â */),
240 ESCSEQ("atilde", "\343"/* ã */),
241 ESCSEQ("auml", "\344"/* ä */),
242 ESCSEQ("aring", "a"),
243 ESCSEQ("aelig", "ae"),
244 ESCSEQ("ccedil", "\347"/* ç */),
245 ESCSEQ("egrave", "\350"/* è */),
246 ESCSEQ("eacute", "\351"/* é */),
247 ESCSEQ("ecirc", "\352"/* ê */),
248 ESCSEQ("euml", "\353"/* ë */),
249 ESCSEQ("igrave", "\354"/* ì */),
250 ESCSEQ("iacute", "\355"/* í */),
251 ESCSEQ("icirc", " "),
252 ESCSEQ("iuml", "\357"/* ï */),
254 ESCSEQ("ntilde", "\361"/* ñ */),
255 ESCSEQ("ograve", "\362"/* ò */),
256 ESCSEQ("oacute", "\363"/* ó */),
257 ESCSEQ("ocirc", "\364"/* ô */),
258 ESCSEQ("otilde", "\365"/* õ */),
259 ESCSEQ("ouml", "\366"/* ö */),
260 ESCSEQ("divide", " "),
261 ESCSEQ("oslash", " "),
262 ESCSEQ("ugrave", "\371"/* ù */),
263 ESCSEQ("uacute", "\372"/* ú */),
264 ESCSEQ("ucirc", "\373"/* û */),
265 ESCSEQ("uuml", "\374"/* ü */),
269 /* this one should ALWAYS stay the last one!!! */
276 for (int i
= 0; substitutions
[i
][0] != NULL
; i
++)
278 m_Word
.Replace(substitutions
[i
][0], substitutions
[i
][3], TRUE
);
279 m_Word
.Replace(substitutions
[i
][1], substitutions
[i
][3], TRUE
);
280 m_Word
.Replace(substitutions
[i
][2], substitutions
[i
][3], TRUE
);
284 dc
.GetTextExtent(m_Word
, &m_Width
, &m_Height
, &m_Descent
);
285 SetCanLiveOnPagebreak(FALSE
);
290 void wxHtmlWordCell::Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
)
292 dc
.DrawText(m_Word
, x
+ m_PosX
, y
+ m_PosY
);
293 wxHtmlCell::Draw(dc
, x
, y
, view_y1
, view_y2
);
298 //-----------------------------------------------------------------------------
299 // wxHtmlContainerCell
300 //-----------------------------------------------------------------------------
303 wxHtmlContainerCell::wxHtmlContainerCell(wxHtmlContainerCell
*parent
) : wxHtmlCell()
305 m_Cells
= m_LastCell
= NULL
;
307 if (m_Parent
) m_Parent
->InsertCell(this);
308 m_AlignHor
= wxHTML_ALIGN_LEFT
;
309 m_AlignVer
= wxHTML_ALIGN_BOTTOM
;
310 m_IndentLeft
= m_IndentRight
= m_IndentTop
= m_IndentBottom
= 0;
311 m_WidthFloat
= 100; m_WidthFloatUnits
= wxHTML_UNITS_PERCENT
;
312 m_UseBkColour
= FALSE
;
315 m_MinHeightAlign
= wxHTML_ALIGN_TOP
;
319 wxHtmlContainerCell::~wxHtmlContainerCell()
321 if (m_Cells
) delete m_Cells
;
326 void wxHtmlContainerCell::SetIndent(int i
, int what
, int units
)
328 int val
= (units
== wxHTML_UNITS_PIXELS
) ? i
: -i
;
329 if (what
& wxHTML_INDENT_LEFT
) m_IndentLeft
= val
;
330 if (what
& wxHTML_INDENT_RIGHT
) m_IndentRight
= val
;
331 if (what
& wxHTML_INDENT_TOP
) m_IndentTop
= val
;
332 if (what
& wxHTML_INDENT_BOTTOM
) m_IndentBottom
= val
;
338 int wxHtmlContainerCell::GetIndent(int ind
) const
340 if (ind
& wxHTML_INDENT_LEFT
) return m_IndentLeft
;
341 else if (ind
& wxHTML_INDENT_RIGHT
) return m_IndentRight
;
342 else if (ind
& wxHTML_INDENT_TOP
) return m_IndentTop
;
343 else if (ind
& wxHTML_INDENT_BOTTOM
) return m_IndentBottom
;
344 else return -1; /* BUG! Should not be called... */
350 int wxHtmlContainerCell::GetIndentUnits(int ind
) const
353 if (ind
& wxHTML_INDENT_LEFT
) p
= m_IndentLeft
< 0;
354 else if (ind
& wxHTML_INDENT_RIGHT
) p
= m_IndentRight
< 0;
355 else if (ind
& wxHTML_INDENT_TOP
) p
= m_IndentTop
< 0;
356 else if (ind
& wxHTML_INDENT_BOTTOM
) p
= m_IndentBottom
< 0;
357 if (p
) return wxHTML_UNITS_PERCENT
;
358 else return wxHTML_UNITS_PIXELS
;
363 bool wxHtmlContainerCell::AdjustPagebreak(int *pagebreak
) const
365 if (!m_CanLiveOnPagebreak
)
366 return wxHtmlCell::AdjustPagebreak(pagebreak
);
370 wxHtmlCell
*c
= GetFirstCell();
372 int pbrk
= *pagebreak
- m_PosY
;
376 if (c
->AdjustPagebreak(&pbrk
)) rt
= TRUE
;
379 if (rt
) *pagebreak
= pbrk
+ m_PosY
;
386 void wxHtmlContainerCell::Layout(int w
)
388 if (m_LastLayout
== w
)
390 wxHtmlCell::Layout(w
);
394 wxHtmlCell
*cell
= m_Cells
, *line
= m_Cells
;
395 long xpos
= 0, ypos
= m_IndentTop
;
396 int xdelta
= 0, ybasicpos
= 0, ydiff
;
397 int s_width
, s_indent
;
398 int ysizeup
= 0, ysizedown
= 0;
399 int MaxLineWidth
= 0;
409 if (m_WidthFloatUnits
== wxHTML_UNITS_PERCENT
)
411 if (m_WidthFloat
< 0) m_Width
= (100 + m_WidthFloat
) * w
/ 100;
412 else m_Width
= m_WidthFloat
* w
/ 100;
416 if (m_WidthFloat
< 0) m_Width
= w
+ m_WidthFloat
;
417 else m_Width
= m_WidthFloat
;
422 int l
= (m_IndentLeft
< 0) ? (-m_IndentLeft
* m_Width
/ 100) : m_IndentLeft
;
423 int r
= (m_IndentRight
< 0) ? (-m_IndentRight
* m_Width
/ 100) : m_IndentRight
;
424 m_Cells
->Layout(m_Width
- (l
+ r
));
433 // adjust indentation:
434 s_indent
= (m_IndentLeft
< 0) ? (-m_IndentLeft
* m_Width
/ 100) : m_IndentLeft
;
435 s_width
= m_Width
- s_indent
- ((m_IndentRight
< 0) ? (-m_IndentRight
* m_Width
/ 100) : m_IndentRight
);
442 case wxHTML_ALIGN_TOP
: ybasicpos
= 0; break;
443 case wxHTML_ALIGN_BOTTOM
: ybasicpos
= - cell
->GetHeight(); break;
444 case wxHTML_ALIGN_CENTER
: ybasicpos
= - cell
->GetHeight() / 2; break;
446 ydiff
= cell
->GetHeight() + ybasicpos
;
448 if (cell
->GetDescent() + ydiff
> ysizedown
) ysizedown
= cell
->GetDescent() + ydiff
;
449 if (ybasicpos
+ cell
->GetDescent() < -ysizeup
) ysizeup
= - (ybasicpos
+ cell
->GetDescent());
451 cell
->SetPos(xpos
, ybasicpos
+ cell
->GetDescent());
452 xpos
+= cell
->GetWidth();
453 cell
= cell
->GetNext();
456 // force new line if occured:
457 if ((cell
== NULL
) || (xpos
+ cell
->GetWidth() > s_width
))
459 if (xpos
> MaxLineWidth
) MaxLineWidth
= xpos
;
460 if (ysizeup
< 0) ysizeup
= 0;
461 if (ysizedown
< 0) ysizedown
= 0;
462 switch (m_AlignHor
) {
463 case wxHTML_ALIGN_LEFT
:
464 case wxHTML_ALIGN_JUSTIFY
:
467 case wxHTML_ALIGN_RIGHT
:
468 xdelta
= 0 + (s_width
- xpos
);
470 case wxHTML_ALIGN_CENTER
:
471 xdelta
= 0 + (s_width
- xpos
) / 2;
474 if (xdelta
< 0) xdelta
= 0;
479 if (m_AlignHor
!= wxHTML_ALIGN_JUSTIFY
|| cell
== NULL
)
482 line
->SetPos(line
->GetPosX() + xdelta
,
483 ypos
+ line
->GetPosY());
484 line
= line
->GetNext();
489 int step
= (s_width
- xpos
);
490 if (step
< 0) step
= 0;
492 if (xcnt
> 0) while (line
!= cell
)
494 line
->SetPos(line
->GetPosX() + s_indent
+
495 (counter
++ * step
/ xcnt
),
496 ypos
+ line
->GetPosY());
497 line
= line
->GetNext();
504 ysizeup
= ysizedown
= 0;
509 // setup height & width, depending on container layout:
510 m_Height
= ypos
+ (ysizedown
+ ysizeup
) + m_IndentBottom
;
512 if (m_Height
< m_MinHeight
)
514 if (m_MinHeightAlign
!= wxHTML_ALIGN_TOP
)
516 int diff
= m_MinHeight
- m_Height
;
517 if (m_MinHeightAlign
== wxHTML_ALIGN_CENTER
) diff
/= 2;
521 cell
->SetPos(cell
->GetPosX(), cell
->GetPosY() + diff
);
522 cell
= cell
->GetNext();
525 m_Height
= m_MinHeight
;
528 MaxLineWidth
+= s_indent
+ ((m_IndentRight
< 0) ? (-m_IndentRight
* m_Width
/ 100) : m_IndentRight
);
529 if (m_Width
< MaxLineWidth
) m_Width
= MaxLineWidth
;
533 wxHtmlCell::Layout(w
);
537 #define mMin(a, b) (((a) < (b)) ? (a) : (b))
538 #define mMax(a, b) (((a) < (b)) ? (b) : (a))
540 void wxHtmlContainerCell::Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
)
542 // container visible, draw it:
543 if ((y
+ m_PosY
< view_y2
) && (y
+ m_PosY
+ m_Height
> view_y1
))
548 wxBrush myb
= wxBrush(m_BkColour
, wxSOLID
);
550 int real_y1
= mMax(y
+ m_PosY
, view_y1
);
551 int real_y2
= mMin(y
+ m_PosY
+ m_Height
- 1, view_y2
);
554 dc
.SetPen(*wxTRANSPARENT_PEN
);
555 dc
.DrawRectangle(x
+ m_PosX
, real_y1
, m_Width
, real_y2
- real_y1
+ 1);
560 wxPen
mypen1(m_BorderColour1
, 1, wxSOLID
);
561 wxPen
mypen2(m_BorderColour2
, 1, wxSOLID
);
564 dc
.DrawLine(x
+ m_PosX
, y
+ m_PosY
, x
+ m_PosX
, y
+ m_PosY
+ m_Height
- 1);
565 dc
.DrawLine(x
+ m_PosX
, y
+ m_PosY
, x
+ m_PosX
+ m_Width
- 1, y
+ m_PosY
);
567 dc
.DrawLine(x
+ m_PosX
+ m_Width
- 1, y
+ m_PosY
, x
+ m_PosX
+ m_Width
- 1, y
+ m_PosY
+ m_Height
- 1);
568 dc
.DrawLine(x
+ m_PosX
, y
+ m_PosY
+ m_Height
- 1, x
+ m_PosX
+ m_Width
- 1, y
+ m_PosY
+ m_Height
- 1);
571 if (m_Cells
) m_Cells
->Draw(dc
, x
+ m_PosX
, y
+ m_PosY
, view_y1
, view_y2
);
573 // container invisible, just proceed font+color changing:
576 if (m_Cells
) m_Cells
->DrawInvisible(dc
, x
+ m_PosX
, y
+ m_PosY
);
579 wxHtmlCell::Draw(dc
, x
, y
, view_y1
, view_y2
);
584 void wxHtmlContainerCell::DrawInvisible(wxDC
& dc
, int x
, int y
)
586 if (m_Cells
) m_Cells
->DrawInvisible(dc
, x
+ m_PosX
, y
+ m_PosY
);
587 wxHtmlCell::DrawInvisible(dc
, x
, y
);
592 wxHtmlLinkInfo
*wxHtmlContainerCell::GetLink(int x
, int y
) const
594 wxHtmlCell
*c
= m_Cells
;
599 cx
= c
->GetPosX(), cy
= c
->GetPosY();
600 cw
= c
->GetWidth(), ch
= c
->GetHeight();
601 if ((x
>= cx
) && (x
< cx
+ cw
) && (y
>= cy
) && (y
< cy
+ ch
))
602 return c
->GetLink(x
- cx
, y
- cy
);
610 void wxHtmlContainerCell::InsertCell(wxHtmlCell
*f
)
612 if (!m_Cells
) m_Cells
= m_LastCell
= f
;
615 m_LastCell
->SetNext(f
);
617 if (m_LastCell
) while (m_LastCell
->GetNext()) m_LastCell
= m_LastCell
->GetNext();
625 void wxHtmlContainerCell::SetAlign(const wxHtmlTag
& tag
)
627 if (tag
.HasParam(wxT("ALIGN")))
629 wxString alg
= tag
.GetParam(wxT("ALIGN"));
631 if (alg
== wxT("CENTER"))
632 SetAlignHor(wxHTML_ALIGN_CENTER
);
633 else if (alg
== wxT("LEFT"))
634 SetAlignHor(wxHTML_ALIGN_LEFT
);
635 else if (alg
== wxT("JUSTIFY"))
636 SetAlignHor(wxHTML_ALIGN_JUSTIFY
);
637 else if (alg
== wxT("RIGHT"))
638 SetAlignHor(wxHTML_ALIGN_RIGHT
);
645 void wxHtmlContainerCell::SetWidthFloat(const wxHtmlTag
& tag
, double pixel_scale
)
647 if (tag
.HasParam(wxT("WIDTH")))
650 wxString wd
= tag
.GetParam(wxT("WIDTH"));
652 if (wd
[wd
.Length()-1] == wxT('%'))
654 wxSscanf(wd
.c_str(), wxT("%i%%"), &wdi
);
655 SetWidthFloat(wdi
, wxHTML_UNITS_PERCENT
);
659 wxSscanf(wd
.c_str(), wxT("%i"), &wdi
);
660 SetWidthFloat((int)(pixel_scale
* (double)wdi
), wxHTML_UNITS_PIXELS
);
668 const wxHtmlCell
* wxHtmlContainerCell::Find(int condition
, const void* param
) const
670 const wxHtmlCell
*r
= NULL
;
674 r
= m_Cells
->Find(condition
, param
);
678 return wxHtmlCell::Find(condition
, param
);
683 void wxHtmlContainerCell::OnMouseClick(wxWindow
*parent
, int x
, int y
, const wxMouseEvent
& event
)
687 wxHtmlCell
*c
= m_Cells
;
690 if ( (c
->GetPosX() <= x
) &&
691 (c
->GetPosY() <= y
) &&
692 (c
->GetPosX() + c
->GetWidth() > x
) &&
693 (c
->GetPosY() + c
->GetHeight() > y
))
695 c
->OnMouseClick(parent
, x
- c
->GetPosX(), y
- c
->GetPosY(), event
);
707 //--------------------------------------------------------------------------------
709 //--------------------------------------------------------------------------------
711 void wxHtmlColourCell::Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
)
713 if (m_Flags
& wxHTML_CLR_FOREGROUND
)
714 dc
.SetTextForeground(m_Colour
);
715 if (m_Flags
& wxHTML_CLR_BACKGROUND
)
717 dc
.SetBackground(wxBrush(m_Colour
, wxSOLID
));
718 dc
.SetTextBackground(m_Colour
);
720 wxHtmlCell::Draw(dc
, x
, y
, view_y1
, view_y2
);
723 void wxHtmlColourCell::DrawInvisible(wxDC
& dc
, int x
, int y
)
725 if (m_Flags
& wxHTML_CLR_FOREGROUND
)
726 dc
.SetTextForeground(m_Colour
);
727 if (m_Flags
& wxHTML_CLR_BACKGROUND
)
729 dc
.SetBackground(wxBrush(m_Colour
, wxSOLID
));
730 dc
.SetTextBackground(m_Colour
);
732 wxHtmlCell::DrawInvisible(dc
, x
, y
);
738 //--------------------------------------------------------------------------------
740 //--------------------------------------------------------------------------------
742 void wxHtmlFontCell::Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
)
745 wxHtmlCell::Draw(dc
, x
, y
, view_y1
, view_y2
);
748 void wxHtmlFontCell::DrawInvisible(wxDC
& dc
, int x
, int y
)
751 wxHtmlCell::DrawInvisible(dc
, x
, y
);
761 //--------------------------------------------------------------------------------
763 //--------------------------------------------------------------------------------
765 wxHtmlWidgetCell::wxHtmlWidgetCell(wxWindow
*wnd
, int w
)
769 m_Wnd
->GetSize(&sx
, &sy
);
770 m_Width
= sx
, m_Height
= sy
;
775 void wxHtmlWidgetCell::Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
)
777 int absx
= 0, absy
= 0, stx
, sty
;
778 wxHtmlCell
*c
= this;
782 absx
+= c
->GetPosX();
783 absy
+= c
->GetPosY();
787 ((wxScrolledWindow
*)(m_Wnd
->GetParent()))->ViewStart(&stx
, &sty
);
788 m_Wnd
->SetSize(absx
- wxHTML_SCROLL_STEP
* stx
, absy
- wxHTML_SCROLL_STEP
* sty
, m_Width
, m_Height
);
790 wxHtmlCell::Draw(dc
, x
, y
, view_y1
, view_y2
);
795 void wxHtmlWidgetCell::DrawInvisible(wxDC
& dc
, int x
, int y
)
797 int absx
= 0, absy
= 0, stx
, sty
;
798 wxHtmlCell
*c
= this;
802 absx
+= c
->GetPosX();
803 absy
+= c
->GetPosY();
807 ((wxScrolledWindow
*)(m_Wnd
->GetParent()))->ViewStart(&stx
, &sty
);
808 m_Wnd
->SetSize(absx
- wxHTML_SCROLL_STEP
* stx
, absy
- wxHTML_SCROLL_STEP
* sty
, m_Width
, m_Height
);
810 wxHtmlCell::DrawInvisible(dc
, x
, y
);
815 void wxHtmlWidgetCell::Layout(int w
)
817 if (m_WidthFloat
!= 0)
819 m_Width
= (w
* m_WidthFloat
) / 100;
820 m_Wnd
->SetSize(m_Width
, m_Height
);
823 wxHtmlCell::Layout(w
);