]>
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", "\""),
148 ESCSEQ("#94", "^"), /* ^ */
152 ESCSEQ("iexcl", "!"),
154 ESCSEQ("cent", "¢"/* ¢ */),
155 ESCSEQ("#162", "¢"/* ¢ */),
157 ESCSEQ("trade", "(TM)"),
158 ESCSEQ("#153", "(TM)"),
162 ESCSEQ("brkbar", "¦"),
169 ESCSEQ("copy", "©"), /* © */
173 ESCSEQ("laquo", "«"), /* « */
178 ESCSEQ("reg", "®"), /* ® */
181 ESCSEQ("deg", "°"), /* ° */
183 ESCSEQ("plusm", "±"), /* ± */
186 ESCSEQ("acute", "´"),
188 ESCSEQ("macron", "¯"),
190 ESCSEQ("micro", "µ"), /* µ */
192 ESCSEQ("para", "¶"), /* ¶ */
195 ESCSEQ("ordm", "º"), /* º */
197 ESCSEQ("raquo", "»"), /* » */
200 ESCSEQ("iquest", "¿"), /* ¿ */
202 ESCSEQ("Agrave", "\300"/* À */),
203 ESCSEQ("#193", "\300"/* À */),
205 ESCSEQ("Acirc", "\302"/* Â */),
206 ESCSEQ("Atilde", "\303"/* Ã */),
207 ESCSEQ("Auml", "\304"/* Ä */),
208 ESCSEQ("Aring", " "),
209 ESCSEQ("AElig", " "),
210 ESCSEQ("Ccedil", "\347"/* ç */),
211 ESCSEQ("Egrave", "\310"/* È */),
212 ESCSEQ("Eacute", "\311"/* É */),
213 ESCSEQ("Ecirc", "\312"/* Ê */),
214 ESCSEQ("Euml", "\313"/* Ë */),
215 ESCSEQ("Igrave", "\314"/* Ì */),
217 ESCSEQ("Icirc", "\316"/* Î */),
218 ESCSEQ("Iuml", "\317"/* Ï */),
220 ESCSEQ("Ntilde", "\321"/* Ñ */),
221 ESCSEQ("Ograve", "\322"/* Ò */),
223 ESCSEQ("Ocirc", "\324"/* Ô */),
224 ESCSEQ("Otilde", "\325"/* Õ */),
225 ESCSEQ("Ouml", "\326"/* Ö */),
227 ESCSEQ("Oslash", " "),
228 ESCSEQ("Ugrave", "\331"/* Ù */),
230 ESCSEQ("Ucirc", " "),
231 ESCSEQ("Uuml", "\334"/* Ü */),
233 ESCSEQ("szlig", "\247"/* § */),
234 ESCSEQ("agrave;","à"),
235 ESCSEQ("aacute", "\341"/* á */),
236 ESCSEQ("acirc", "\342"/* â */),
237 ESCSEQ("atilde", "\343"/* ã */),
238 ESCSEQ("auml", "\344"/* ä */),
239 ESCSEQ("aring", "a"),
240 ESCSEQ("aelig", "ae"),
241 ESCSEQ("ccedil", "\347"/* ç */),
242 ESCSEQ("egrave", "\350"/* è */),
243 ESCSEQ("eacute", "\351"/* é */),
244 ESCSEQ("ecirc", "\352"/* ê */),
245 ESCSEQ("euml", "\353"/* ë */),
246 ESCSEQ("igrave", "\354"/* ì */),
247 ESCSEQ("iacute", "\355"/* í */),
248 ESCSEQ("icirc", " "),
249 ESCSEQ("iuml", "\357"/* ï */),
251 ESCSEQ("ntilde", "\361"/* ñ */),
252 ESCSEQ("ograve", "\362"/* ò */),
253 ESCSEQ("oacute", "\363"/* ó */),
254 ESCSEQ("ocirc", "\364"/* ô */),
255 ESCSEQ("otilde", "\365"/* õ */),
256 ESCSEQ("ouml", "\366"/* ö */),
257 ESCSEQ("divide", " "),
258 ESCSEQ("oslash", " "),
259 ESCSEQ("ugrave", "\371"/* ù */),
260 ESCSEQ("uacute", "\372"/* ú */),
261 ESCSEQ("ucirc", "\373"/* û */),
262 ESCSEQ("uuml", "\374"/* ü */),
266 /* this one should ALWAYS stay the last one!!! */
273 for (int i
= 0; substitutions
[i
][0] != NULL
; i
++)
275 m_Word
.Replace(substitutions
[i
][0], substitutions
[i
][3], TRUE
);
276 m_Word
.Replace(substitutions
[i
][1], substitutions
[i
][3], TRUE
);
277 m_Word
.Replace(substitutions
[i
][2], substitutions
[i
][3], TRUE
);
281 dc
.GetTextExtent(m_Word
, &m_Width
, &m_Height
, &m_Descent
);
282 SetCanLiveOnPagebreak(FALSE
);
287 void wxHtmlWordCell::Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
)
289 dc
.DrawText(m_Word
, x
+ m_PosX
, y
+ m_PosY
);
290 wxHtmlCell::Draw(dc
, x
, y
, view_y1
, view_y2
);
295 //-----------------------------------------------------------------------------
296 // wxHtmlContainerCell
297 //-----------------------------------------------------------------------------
300 wxHtmlContainerCell::wxHtmlContainerCell(wxHtmlContainerCell
*parent
) : wxHtmlCell()
302 m_Cells
= m_LastCell
= NULL
;
304 if (m_Parent
) m_Parent
->InsertCell(this);
305 m_AlignHor
= wxHTML_ALIGN_LEFT
;
306 m_AlignVer
= wxHTML_ALIGN_BOTTOM
;
307 m_IndentLeft
= m_IndentRight
= m_IndentTop
= m_IndentBottom
= 0;
308 m_WidthFloat
= 100; m_WidthFloatUnits
= wxHTML_UNITS_PERCENT
;
309 m_UseBkColour
= FALSE
;
312 m_MinHeightAlign
= wxHTML_ALIGN_TOP
;
316 wxHtmlContainerCell::~wxHtmlContainerCell()
318 if (m_Cells
) delete m_Cells
;
323 void wxHtmlContainerCell::SetIndent(int i
, int what
, int units
)
325 int val
= (units
== wxHTML_UNITS_PIXELS
) ? i
: -i
;
326 if (what
& wxHTML_INDENT_LEFT
) m_IndentLeft
= val
;
327 if (what
& wxHTML_INDENT_RIGHT
) m_IndentRight
= val
;
328 if (what
& wxHTML_INDENT_TOP
) m_IndentTop
= val
;
329 if (what
& wxHTML_INDENT_BOTTOM
) m_IndentBottom
= val
;
335 int wxHtmlContainerCell::GetIndent(int ind
) const
337 if (ind
& wxHTML_INDENT_LEFT
) return m_IndentLeft
;
338 else if (ind
& wxHTML_INDENT_RIGHT
) return m_IndentRight
;
339 else if (ind
& wxHTML_INDENT_TOP
) return m_IndentTop
;
340 else if (ind
& wxHTML_INDENT_BOTTOM
) return m_IndentBottom
;
341 else return -1; /* BUG! Should not be called... */
347 int wxHtmlContainerCell::GetIndentUnits(int ind
) const
350 if (ind
& wxHTML_INDENT_LEFT
) p
= m_IndentLeft
< 0;
351 else if (ind
& wxHTML_INDENT_RIGHT
) p
= m_IndentRight
< 0;
352 else if (ind
& wxHTML_INDENT_TOP
) p
= m_IndentTop
< 0;
353 else if (ind
& wxHTML_INDENT_BOTTOM
) p
= m_IndentBottom
< 0;
354 if (p
) return wxHTML_UNITS_PERCENT
;
355 else return wxHTML_UNITS_PIXELS
;
360 bool wxHtmlContainerCell::AdjustPagebreak(int *pagebreak
) const
362 if (!m_CanLiveOnPagebreak
)
363 return wxHtmlCell::AdjustPagebreak(pagebreak
);
367 wxHtmlCell
*c
= GetFirstCell();
369 int pbrk
= *pagebreak
- m_PosY
;
373 if (c
->AdjustPagebreak(&pbrk
)) rt
= TRUE
;
376 if (rt
) *pagebreak
= pbrk
+ m_PosY
;
383 void wxHtmlContainerCell::Layout(int w
)
385 if (m_LastLayout
== w
)
387 wxHtmlCell::Layout(w
);
391 wxHtmlCell
*cell
= m_Cells
, *line
= m_Cells
;
392 long xpos
= 0, ypos
= m_IndentTop
;
393 int xdelta
= 0, ybasicpos
= 0, ydiff
;
394 int s_width
, s_indent
;
395 int ysizeup
= 0, ysizedown
= 0;
396 int MaxLineWidth
= 0;
406 if (m_WidthFloatUnits
== wxHTML_UNITS_PERCENT
)
408 if (m_WidthFloat
< 0) m_Width
= (100 + m_WidthFloat
) * w
/ 100;
409 else m_Width
= m_WidthFloat
* w
/ 100;
413 if (m_WidthFloat
< 0) m_Width
= w
+ m_WidthFloat
;
414 else m_Width
= m_WidthFloat
;
419 int l
= (m_IndentLeft
< 0) ? (-m_IndentLeft
* m_Width
/ 100) : m_IndentLeft
;
420 int r
= (m_IndentRight
< 0) ? (-m_IndentRight
* m_Width
/ 100) : m_IndentRight
;
421 m_Cells
->Layout(m_Width
- (l
+ r
));
430 // adjust indentation:
431 s_indent
= (m_IndentLeft
< 0) ? (-m_IndentLeft
* m_Width
/ 100) : m_IndentLeft
;
432 s_width
= m_Width
- s_indent
- ((m_IndentRight
< 0) ? (-m_IndentRight
* m_Width
/ 100) : m_IndentRight
);
439 case wxHTML_ALIGN_TOP
: ybasicpos
= 0; break;
440 case wxHTML_ALIGN_BOTTOM
: ybasicpos
= - cell
->GetHeight(); break;
441 case wxHTML_ALIGN_CENTER
: ybasicpos
= - cell
->GetHeight() / 2; break;
443 ydiff
= cell
->GetHeight() + ybasicpos
;
445 if (cell
->GetDescent() + ydiff
> ysizedown
) ysizedown
= cell
->GetDescent() + ydiff
;
446 if (ybasicpos
+ cell
->GetDescent() < -ysizeup
) ysizeup
= - (ybasicpos
+ cell
->GetDescent());
448 cell
->SetPos(xpos
, ybasicpos
+ cell
->GetDescent());
449 xpos
+= cell
->GetWidth();
450 cell
= cell
->GetNext();
453 // force new line if occured:
454 if ((cell
== NULL
) || (xpos
+ cell
->GetWidth() > s_width
))
456 if (xpos
> MaxLineWidth
) MaxLineWidth
= xpos
;
457 if (ysizeup
< 0) ysizeup
= 0;
458 if (ysizedown
< 0) ysizedown
= 0;
459 switch (m_AlignHor
) {
460 case wxHTML_ALIGN_LEFT
:
461 case wxHTML_ALIGN_JUSTIFY
:
464 case wxHTML_ALIGN_RIGHT
:
465 xdelta
= 0 + (s_width
- xpos
);
467 case wxHTML_ALIGN_CENTER
:
468 xdelta
= 0 + (s_width
- xpos
) / 2;
471 if (xdelta
< 0) xdelta
= 0;
476 if (m_AlignHor
!= wxHTML_ALIGN_JUSTIFY
|| cell
== NULL
)
479 line
->SetPos(line
->GetPosX() + xdelta
,
480 ypos
+ line
->GetPosY());
481 line
= line
->GetNext();
486 int step
= (s_width
- xpos
);
487 if (step
< 0) step
= 0;
489 if (xcnt
> 0) while (line
!= cell
)
491 line
->SetPos(line
->GetPosX() + s_indent
+
492 (counter
++ * step
/ xcnt
),
493 ypos
+ line
->GetPosY());
494 line
= line
->GetNext();
501 ysizeup
= ysizedown
= 0;
506 // setup height & width, depending on container layout:
507 m_Height
= ypos
+ (ysizedown
+ ysizeup
) + m_IndentBottom
;
509 if (m_Height
< m_MinHeight
)
511 if (m_MinHeightAlign
!= wxHTML_ALIGN_TOP
)
513 int diff
= m_MinHeight
- m_Height
;
514 if (m_MinHeightAlign
== wxHTML_ALIGN_CENTER
) diff
/= 2;
518 cell
->SetPos(cell
->GetPosX(), cell
->GetPosY() + diff
);
519 cell
= cell
->GetNext();
522 m_Height
= m_MinHeight
;
525 MaxLineWidth
+= s_indent
+ ((m_IndentRight
< 0) ? (-m_IndentRight
* m_Width
/ 100) : m_IndentRight
);
526 if (m_Width
< MaxLineWidth
) m_Width
= MaxLineWidth
;
530 wxHtmlCell::Layout(w
);
534 #define mMin(a, b) (((a) < (b)) ? (a) : (b))
535 #define mMax(a, b) (((a) < (b)) ? (b) : (a))
537 void wxHtmlContainerCell::Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
)
539 // container visible, draw it:
540 if ((y
+ m_PosY
< view_y2
) && (y
+ m_PosY
+ m_Height
> view_y1
))
545 wxBrush myb
= wxBrush(m_BkColour
, wxSOLID
);
547 int real_y1
= mMax(y
+ m_PosY
, view_y1
);
548 int real_y2
= mMin(y
+ m_PosY
+ m_Height
- 1, view_y2
);
551 dc
.SetPen(*wxTRANSPARENT_PEN
);
552 dc
.DrawRectangle(x
+ m_PosX
, real_y1
, m_Width
, real_y2
- real_y1
+ 1);
557 wxPen
mypen1(m_BorderColour1
, 1, wxSOLID
);
558 wxPen
mypen2(m_BorderColour2
, 1, wxSOLID
);
561 dc
.DrawLine(x
+ m_PosX
, y
+ m_PosY
, x
+ m_PosX
, y
+ m_PosY
+ m_Height
- 1);
562 dc
.DrawLine(x
+ m_PosX
, y
+ m_PosY
, x
+ m_PosX
+ m_Width
- 1, y
+ m_PosY
);
564 dc
.DrawLine(x
+ m_PosX
+ m_Width
- 1, y
+ m_PosY
, x
+ m_PosX
+ m_Width
- 1, y
+ m_PosY
+ m_Height
- 1);
565 dc
.DrawLine(x
+ m_PosX
, y
+ m_PosY
+ m_Height
- 1, x
+ m_PosX
+ m_Width
- 1, y
+ m_PosY
+ m_Height
- 1);
568 if (m_Cells
) m_Cells
->Draw(dc
, x
+ m_PosX
, y
+ m_PosY
, view_y1
, view_y2
);
570 // container invisible, just proceed font+color changing:
573 if (m_Cells
) m_Cells
->DrawInvisible(dc
, x
+ m_PosX
, y
+ m_PosY
);
576 wxHtmlCell::Draw(dc
, x
, y
, view_y1
, view_y2
);
581 void wxHtmlContainerCell::DrawInvisible(wxDC
& dc
, int x
, int y
)
583 if (m_Cells
) m_Cells
->DrawInvisible(dc
, x
+ m_PosX
, y
+ m_PosY
);
584 wxHtmlCell::DrawInvisible(dc
, x
, y
);
589 wxHtmlLinkInfo
*wxHtmlContainerCell::GetLink(int x
, int y
) const
591 wxHtmlCell
*c
= m_Cells
;
596 cx
= c
->GetPosX(), cy
= c
->GetPosY();
597 cw
= c
->GetWidth(), ch
= c
->GetHeight();
598 if ((x
>= cx
) && (x
< cx
+ cw
) && (y
>= cy
) && (y
< cy
+ ch
))
599 return c
->GetLink(x
- cx
, y
- cy
);
607 void wxHtmlContainerCell::InsertCell(wxHtmlCell
*f
)
609 if (!m_Cells
) m_Cells
= m_LastCell
= f
;
612 m_LastCell
->SetNext(f
);
614 if (m_LastCell
) while (m_LastCell
->GetNext()) m_LastCell
= m_LastCell
->GetNext();
622 void wxHtmlContainerCell::SetAlign(const wxHtmlTag
& tag
)
624 if (tag
.HasParam(wxT("ALIGN")))
626 wxString alg
= tag
.GetParam(wxT("ALIGN"));
628 if (alg
== wxT("CENTER"))
629 SetAlignHor(wxHTML_ALIGN_CENTER
);
630 else if (alg
== wxT("LEFT"))
631 SetAlignHor(wxHTML_ALIGN_LEFT
);
632 else if (alg
== wxT("JUSTIFY"))
633 SetAlignHor(wxHTML_ALIGN_JUSTIFY
);
634 else if (alg
== wxT("RIGHT"))
635 SetAlignHor(wxHTML_ALIGN_RIGHT
);
642 void wxHtmlContainerCell::SetWidthFloat(const wxHtmlTag
& tag
, double pixel_scale
)
644 if (tag
.HasParam(wxT("WIDTH")))
647 wxString wd
= tag
.GetParam(wxT("WIDTH"));
649 if (wd
[wd
.Length()-1] == wxT('%'))
651 wxSscanf(wd
.c_str(), wxT("%i%%"), &wdi
);
652 SetWidthFloat(wdi
, wxHTML_UNITS_PERCENT
);
656 wxSscanf(wd
.c_str(), wxT("%i"), &wdi
);
657 SetWidthFloat((int)(pixel_scale
* (double)wdi
), wxHTML_UNITS_PIXELS
);
665 const wxHtmlCell
* wxHtmlContainerCell::Find(int condition
, const void* param
) const
667 const wxHtmlCell
*r
= NULL
;
671 r
= m_Cells
->Find(condition
, param
);
675 return wxHtmlCell::Find(condition
, param
);
680 void wxHtmlContainerCell::OnMouseClick(wxWindow
*parent
, int x
, int y
, const wxMouseEvent
& event
)
684 wxHtmlCell
*c
= m_Cells
;
687 if ( (c
->GetPosX() <= x
) &&
688 (c
->GetPosY() <= y
) &&
689 (c
->GetPosX() + c
->GetWidth() > x
) &&
690 (c
->GetPosY() + c
->GetHeight() > y
))
692 c
->OnMouseClick(parent
, x
- c
->GetPosX(), y
- c
->GetPosY(), event
);
704 //--------------------------------------------------------------------------------
706 //--------------------------------------------------------------------------------
708 void wxHtmlColourCell::Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
)
710 if (m_Flags
& wxHTML_CLR_FOREGROUND
)
711 dc
.SetTextForeground(m_Colour
);
712 if (m_Flags
& wxHTML_CLR_BACKGROUND
)
714 dc
.SetBackground(wxBrush(m_Colour
, wxSOLID
));
715 dc
.SetTextBackground(m_Colour
);
717 wxHtmlCell::Draw(dc
, x
, y
, view_y1
, view_y2
);
720 void wxHtmlColourCell::DrawInvisible(wxDC
& dc
, int x
, int y
)
722 if (m_Flags
& wxHTML_CLR_FOREGROUND
)
723 dc
.SetTextForeground(m_Colour
);
724 if (m_Flags
& wxHTML_CLR_BACKGROUND
)
726 dc
.SetBackground(wxBrush(m_Colour
, wxSOLID
));
727 dc
.SetTextBackground(m_Colour
);
729 wxHtmlCell::DrawInvisible(dc
, x
, y
);
735 //--------------------------------------------------------------------------------
737 //--------------------------------------------------------------------------------
739 void wxHtmlFontCell::Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
)
742 wxHtmlCell::Draw(dc
, x
, y
, view_y1
, view_y2
);
745 void wxHtmlFontCell::DrawInvisible(wxDC
& dc
, int x
, int y
)
748 wxHtmlCell::DrawInvisible(dc
, x
, y
);
758 //--------------------------------------------------------------------------------
760 //--------------------------------------------------------------------------------
762 wxHtmlWidgetCell::wxHtmlWidgetCell(wxWindow
*wnd
, int w
)
766 m_Wnd
->GetSize(&sx
, &sy
);
767 m_Width
= sx
, m_Height
= sy
;
772 void wxHtmlWidgetCell::Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
)
774 int absx
= 0, absy
= 0, stx
, sty
;
775 wxHtmlCell
*c
= this;
779 absx
+= c
->GetPosX();
780 absy
+= c
->GetPosY();
784 ((wxScrolledWindow
*)(m_Wnd
->GetParent()))->ViewStart(&stx
, &sty
);
785 m_Wnd
->SetSize(absx
- wxHTML_SCROLL_STEP
* stx
, absy
- wxHTML_SCROLL_STEP
* sty
, m_Width
, m_Height
);
787 wxHtmlCell::Draw(dc
, x
, y
, view_y1
, view_y2
);
792 void wxHtmlWidgetCell::DrawInvisible(wxDC
& dc
, int x
, int y
)
794 int absx
= 0, absy
= 0, stx
, sty
;
795 wxHtmlCell
*c
= this;
799 absx
+= c
->GetPosX();
800 absy
+= c
->GetPosY();
804 ((wxScrolledWindow
*)(m_Wnd
->GetParent()))->ViewStart(&stx
, &sty
);
805 m_Wnd
->SetSize(absx
- wxHTML_SCROLL_STEP
* stx
, absy
- wxHTML_SCROLL_STEP
* sty
, m_Width
, m_Height
);
807 wxHtmlCell::DrawInvisible(dc
, x
, y
);
812 void wxHtmlWidgetCell::Layout(int w
)
814 if (m_WidthFloat
!= 0)
816 m_Width
= (w
* m_WidthFloat
) / 100;
817 m_Wnd
->SetSize(m_Width
, m_Height
);
820 wxHtmlCell::Layout(w
);