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 "htmlcell.h"
14 #include "wx/wxprec.h"
18 #if wxUSE_HTML && wxUSE_STREAMS
26 #include "wx/colour.h"
30 #include "wx/html/htmlcell.h"
31 #include "wx/html/htmlwin.h"
32 #include "wx/settings.h"
36 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
40 wxHtmlCell::wxHtmlCell() : wxObject()
44 m_Width
= m_Height
= m_Descent
= 0;
45 m_CanLiveOnPagebreak
= TRUE
;
49 wxHtmlCell::~wxHtmlCell()
55 void wxHtmlCell::OnMouseClick(wxWindow
*parent
, int x
, int y
,
56 const wxMouseEvent
& event
)
58 wxHtmlLinkInfo
*lnk
= GetLink(x
, y
);
61 wxHtmlLinkInfo
lnk2(*lnk
);
62 lnk2
.SetEvent(&event
);
63 lnk2
.SetHtmlCell(this);
65 // note : this cast is legal because parent is *always* wxHtmlWindow
66 wxStaticCast(parent
, wxHtmlWindow
)->OnLinkClicked(lnk2
);
72 bool wxHtmlCell::AdjustPagebreak(int *pagebreak
, int* WXUNUSED(known_pagebreaks
), int WXUNUSED(number_of_pages
)) const
74 if ((!m_CanLiveOnPagebreak
) &&
75 m_PosY
< *pagebreak
&& m_PosY
+ m_Height
> *pagebreak
)
86 void wxHtmlCell::SetLink(const wxHtmlLinkInfo
& link
)
88 if (m_Link
) delete m_Link
;
90 if (link
.GetHref() != wxEmptyString
)
91 m_Link
= new wxHtmlLinkInfo(link
);
96 void wxHtmlCell::Layout(int WXUNUSED(w
))
103 void wxHtmlCell::GetHorizontalConstraints(int *left
, int *right
) const
108 *right
= m_PosX
+ m_Width
;
113 const wxHtmlCell
* wxHtmlCell::Find(int WXUNUSED(condition
), const void* WXUNUSED(param
)) const
119 wxHtmlCell
*wxHtmlCell::FindCellByPos(wxCoord x
, wxCoord y
,
120 unsigned flags
) const
122 if ( x
>= 0 && x
< m_Width
&& y
>= 0 && y
< m_Height
)
124 return wxConstCast(this, wxHtmlCell
);
128 if ((flags
& wxHTML_FIND_NEAREST_AFTER
) &&
129 (y
< 0 || (y
== 0 && x
<= 0)))
130 return wxConstCast(this, wxHtmlCell
);
131 else if ((flags
& wxHTML_FIND_NEAREST_BEFORE
) &&
132 (y
> m_Height
-1 || (y
== m_Height
-1 && x
>= m_Width
)))
133 return wxConstCast(this, wxHtmlCell
);
140 wxPoint
wxHtmlCell::GetAbsPos() const
142 wxPoint
p(m_PosX
, m_PosY
);
143 for (wxHtmlCell
*parent
= m_Parent
; parent
; parent
= parent
->m_Parent
)
145 p
.x
+= parent
->m_PosX
;
146 p
.y
+= parent
->m_PosY
;
152 //-----------------------------------------------------------------------------
154 //-----------------------------------------------------------------------------
156 wxHtmlWordCell::wxHtmlWordCell(const wxString
& word
, wxDC
& dc
) : wxHtmlCell()
159 dc
.GetTextExtent(m_Word
, &m_Width
, &m_Height
, &m_Descent
);
160 SetCanLiveOnPagebreak(FALSE
);
165 void wxHtmlWordCell::Draw(wxDC
& dc
, int x
, int y
,
166 int WXUNUSED(view_y1
), int WXUNUSED(view_y2
),
167 wxHtmlRenderingState
& state
)
169 if (state
.GetSelectionState() != wxHTML_SEL_OUT
&&
170 dc
.GetBackgroundMode() != wxSOLID
)
172 dc
.SetBackgroundMode(wxSOLID
);
173 dc
.SetTextBackground(
174 wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT
));
175 dc
.SetTextForeground(
176 wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT
));
178 else if (state
.GetSelectionState() == wxHTML_SEL_OUT
&&
179 dc
.GetBackgroundMode() == wxSOLID
)
181 dc
.SetBackgroundMode(wxTRANSPARENT
);
182 dc
.SetTextForeground(state
.GetFgColour());
183 dc
.SetTextBackground(state
.GetBgColour());
186 dc
.DrawText(m_Word
, x
+ m_PosX
, y
+ m_PosY
);
191 //-----------------------------------------------------------------------------
192 // wxHtmlContainerCell
193 //-----------------------------------------------------------------------------
196 wxHtmlContainerCell::wxHtmlContainerCell(wxHtmlContainerCell
*parent
) : wxHtmlCell()
198 m_Cells
= m_LastCell
= NULL
;
200 if (m_Parent
) m_Parent
->InsertCell(this);
201 m_AlignHor
= wxHTML_ALIGN_LEFT
;
202 m_AlignVer
= wxHTML_ALIGN_BOTTOM
;
203 m_IndentLeft
= m_IndentRight
= m_IndentTop
= m_IndentBottom
= 0;
204 m_WidthFloat
= 100; m_WidthFloatUnits
= wxHTML_UNITS_PERCENT
;
205 m_UseBkColour
= FALSE
;
208 m_MinHeightAlign
= wxHTML_ALIGN_TOP
;
212 wxHtmlContainerCell::~wxHtmlContainerCell()
214 wxHtmlCell
*cell
= m_Cells
;
217 wxHtmlCell
*cellNext
= cell
->GetNext();
225 void wxHtmlContainerCell::SetIndent(int i
, int what
, int units
)
227 int val
= (units
== wxHTML_UNITS_PIXELS
) ? i
: -i
;
228 if (what
& wxHTML_INDENT_LEFT
) m_IndentLeft
= val
;
229 if (what
& wxHTML_INDENT_RIGHT
) m_IndentRight
= val
;
230 if (what
& wxHTML_INDENT_TOP
) m_IndentTop
= val
;
231 if (what
& wxHTML_INDENT_BOTTOM
) m_IndentBottom
= val
;
237 int wxHtmlContainerCell::GetIndent(int ind
) const
239 if (ind
& wxHTML_INDENT_LEFT
) return m_IndentLeft
;
240 else if (ind
& wxHTML_INDENT_RIGHT
) return m_IndentRight
;
241 else if (ind
& wxHTML_INDENT_TOP
) return m_IndentTop
;
242 else if (ind
& wxHTML_INDENT_BOTTOM
) return m_IndentBottom
;
243 else return -1; /* BUG! Should not be called... */
249 int wxHtmlContainerCell::GetIndentUnits(int ind
) const
252 if (ind
& wxHTML_INDENT_LEFT
) p
= m_IndentLeft
< 0;
253 else if (ind
& wxHTML_INDENT_RIGHT
) p
= m_IndentRight
< 0;
254 else if (ind
& wxHTML_INDENT_TOP
) p
= m_IndentTop
< 0;
255 else if (ind
& wxHTML_INDENT_BOTTOM
) p
= m_IndentBottom
< 0;
256 if (p
) return wxHTML_UNITS_PERCENT
;
257 else return wxHTML_UNITS_PIXELS
;
262 bool wxHtmlContainerCell::AdjustPagebreak(int *pagebreak
, int* known_pagebreaks
, int number_of_pages
) const
264 if (!m_CanLiveOnPagebreak
)
265 return wxHtmlCell::AdjustPagebreak(pagebreak
, known_pagebreaks
, number_of_pages
);
269 wxHtmlCell
*c
= GetFirstCell();
271 int pbrk
= *pagebreak
- m_PosY
;
275 if (c
->AdjustPagebreak(&pbrk
, known_pagebreaks
, number_of_pages
))
280 *pagebreak
= pbrk
+ m_PosY
;
287 void wxHtmlContainerCell::Layout(int w
)
289 wxHtmlCell::Layout(w
);
291 if (m_LastLayout
== w
) return;
293 // VS: Any attempt to layout with negative or zero width leads to hell,
294 // but we can't ignore such attempts completely, since it sometimes
295 // happen (e.g. when trying how small a table can be). The best thing we
296 // can do is to set the width of child cells to zero
300 for (wxHtmlCell
*cell
= m_Cells
; cell
; cell
= cell
->GetNext())
302 // this does two things: it recursively calls this code on all
303 // child contrainers and resets children's position to (0,0)
307 wxHtmlCell
*cell
= m_Cells
, *line
= m_Cells
;
308 long xpos
= 0, ypos
= m_IndentTop
;
309 int xdelta
= 0, ybasicpos
= 0, ydiff
;
310 int s_width
, s_indent
;
311 int ysizeup
= 0, ysizedown
= 0;
312 int MaxLineWidth
= 0;
322 if (m_WidthFloatUnits
== wxHTML_UNITS_PERCENT
)
324 if (m_WidthFloat
< 0) m_Width
= (100 + m_WidthFloat
) * w
/ 100;
325 else m_Width
= m_WidthFloat
* w
/ 100;
329 if (m_WidthFloat
< 0) m_Width
= w
+ m_WidthFloat
;
330 else m_Width
= m_WidthFloat
;
335 int l
= (m_IndentLeft
< 0) ? (-m_IndentLeft
* m_Width
/ 100) : m_IndentLeft
;
336 int r
= (m_IndentRight
< 0) ? (-m_IndentRight
* m_Width
/ 100) : m_IndentRight
;
337 for (wxHtmlCell
*cell
= m_Cells
; cell
; cell
= cell
->GetNext())
338 cell
->Layout(m_Width
- (l
+ r
));
347 // adjust indentation:
348 s_indent
= (m_IndentLeft
< 0) ? (-m_IndentLeft
* m_Width
/ 100) : m_IndentLeft
;
349 s_width
= m_Width
- s_indent
- ((m_IndentRight
< 0) ? (-m_IndentRight
* m_Width
/ 100) : m_IndentRight
);
356 case wxHTML_ALIGN_TOP
: ybasicpos
= 0; break;
357 case wxHTML_ALIGN_BOTTOM
: ybasicpos
= - cell
->GetHeight(); break;
358 case wxHTML_ALIGN_CENTER
: ybasicpos
= - cell
->GetHeight() / 2; break;
360 ydiff
= cell
->GetHeight() + ybasicpos
;
362 if (cell
->GetDescent() + ydiff
> ysizedown
) ysizedown
= cell
->GetDescent() + ydiff
;
363 if (ybasicpos
+ cell
->GetDescent() < -ysizeup
) ysizeup
= - (ybasicpos
+ cell
->GetDescent());
365 cell
->SetPos(xpos
, ybasicpos
+ cell
->GetDescent());
366 xpos
+= cell
->GetWidth();
367 cell
= cell
->GetNext();
370 // force new line if occured:
371 if ((cell
== NULL
) || (xpos
+ cell
->GetWidth() > s_width
))
373 if (xpos
> MaxLineWidth
) MaxLineWidth
= xpos
;
374 if (ysizeup
< 0) ysizeup
= 0;
375 if (ysizedown
< 0) ysizedown
= 0;
376 switch (m_AlignHor
) {
377 case wxHTML_ALIGN_LEFT
:
378 case wxHTML_ALIGN_JUSTIFY
:
381 case wxHTML_ALIGN_RIGHT
:
382 xdelta
= 0 + (s_width
- xpos
);
384 case wxHTML_ALIGN_CENTER
:
385 xdelta
= 0 + (s_width
- xpos
) / 2;
388 if (xdelta
< 0) xdelta
= 0;
393 if (m_AlignHor
!= wxHTML_ALIGN_JUSTIFY
|| cell
== NULL
)
396 line
->SetPos(line
->GetPosX() + xdelta
,
397 ypos
+ line
->GetPosY());
398 line
= line
->GetNext();
403 int step
= (s_width
- xpos
);
404 if (step
< 0) step
= 0;
406 if (xcnt
> 0) while (line
!= cell
)
408 line
->SetPos(line
->GetPosX() + s_indent
+
409 (counter
++ * step
/ xcnt
),
410 ypos
+ line
->GetPosY());
411 line
= line
->GetNext();
418 ysizeup
= ysizedown
= 0;
423 // setup height & width, depending on container layout:
424 m_Height
= ypos
+ (ysizedown
+ ysizeup
) + m_IndentBottom
;
426 if (m_Height
< m_MinHeight
)
428 if (m_MinHeightAlign
!= wxHTML_ALIGN_TOP
)
430 int diff
= m_MinHeight
- m_Height
;
431 if (m_MinHeightAlign
== wxHTML_ALIGN_CENTER
) diff
/= 2;
435 cell
->SetPos(cell
->GetPosX(), cell
->GetPosY() + diff
);
436 cell
= cell
->GetNext();
439 m_Height
= m_MinHeight
;
442 MaxLineWidth
+= s_indent
+ ((m_IndentRight
< 0) ? (-m_IndentRight
* m_Width
/ 100) : m_IndentRight
);
443 if (m_Width
< MaxLineWidth
) m_Width
= MaxLineWidth
;
448 void wxHtmlContainerCell::UpdateRenderingStatePre(wxHtmlRenderingState
& state
,
449 wxHtmlCell
*cell
) const
451 wxHtmlSelection
*s
= state
.GetSelection();
453 if (s
->GetFromCell() == cell
|| s
->GetToCell() == cell
)
455 state
.SetSelectionState(wxHTML_SEL_CHANGING
);
459 void wxHtmlContainerCell::UpdateRenderingStatePost(wxHtmlRenderingState
& state
,
460 wxHtmlCell
*cell
) const
462 wxHtmlSelection
*s
= state
.GetSelection();
464 if (s
->GetToCell() == cell
)
465 state
.SetSelectionState(wxHTML_SEL_OUT
);
466 else if (s
->GetFromCell() == cell
)
467 state
.SetSelectionState(wxHTML_SEL_IN
);
470 #define mMin(a, b) (((a) < (b)) ? (a) : (b))
471 #define mMax(a, b) (((a) < (b)) ? (b) : (a))
473 void wxHtmlContainerCell::Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
,
474 wxHtmlRenderingState
& state
)
476 // container visible, draw it:
477 if ((y
+ m_PosY
<= view_y2
) && (y
+ m_PosY
+ m_Height
> view_y1
))
481 wxBrush myb
= wxBrush(m_BkColour
, wxSOLID
);
483 int real_y1
= mMax(y
+ m_PosY
, view_y1
);
484 int real_y2
= mMin(y
+ m_PosY
+ m_Height
- 1, view_y2
);
487 dc
.SetPen(*wxTRANSPARENT_PEN
);
488 dc
.DrawRectangle(x
+ m_PosX
, real_y1
, m_Width
, real_y2
- real_y1
+ 1);
493 wxPen
mypen1(m_BorderColour1
, 1, wxSOLID
);
494 wxPen
mypen2(m_BorderColour2
, 1, wxSOLID
);
497 dc
.DrawLine(x
+ m_PosX
, y
+ m_PosY
, x
+ m_PosX
, y
+ m_PosY
+ m_Height
- 1);
498 dc
.DrawLine(x
+ m_PosX
, y
+ m_PosY
, x
+ m_PosX
+ m_Width
, y
+ m_PosY
);
500 dc
.DrawLine(x
+ m_PosX
+ m_Width
- 1, y
+ m_PosY
, x
+ m_PosX
+ m_Width
- 1, y
+ m_PosY
+ m_Height
- 1);
501 dc
.DrawLine(x
+ m_PosX
, y
+ m_PosY
+ m_Height
- 1, x
+ m_PosX
+ m_Width
, y
+ m_PosY
+ m_Height
- 1);
506 // draw container's contents:
507 for (wxHtmlCell
*cell
= m_Cells
; cell
; cell
= cell
->GetNext())
509 UpdateRenderingStatePre(state
, cell
);
511 x
+ m_PosX
, y
+ m_PosY
, view_y1
, view_y2
,
513 UpdateRenderingStatePost(state
, cell
);
517 // container invisible, just proceed font+color changing:
520 DrawInvisible(dc
, x
, y
, state
);
526 void wxHtmlContainerCell::DrawInvisible(wxDC
& dc
, int x
, int y
,
527 wxHtmlRenderingState
& state
)
531 for (wxHtmlCell
*cell
= m_Cells
; cell
; cell
= cell
->GetNext())
533 UpdateRenderingStatePre(state
, cell
);
534 cell
->DrawInvisible(dc
, x
+ m_PosX
, y
+ m_PosY
, state
);
535 UpdateRenderingStatePost(state
, cell
);
541 wxColour
wxHtmlContainerCell::GetBackgroundColour()
551 wxHtmlLinkInfo
*wxHtmlContainerCell::GetLink(int x
, int y
) const
553 wxHtmlCell
*cell
= FindCellByPos(x
, y
);
555 // VZ: I don't know if we should pass absolute or relative coords to
556 // wxHtmlCell::GetLink()? As the base class version just ignores them
557 // anyhow, it hardly matters right now but should still be clarified
558 return cell
? cell
->GetLink(x
, y
) : NULL
;
563 void wxHtmlContainerCell::InsertCell(wxHtmlCell
*f
)
565 if (!m_Cells
) m_Cells
= m_LastCell
= f
;
568 m_LastCell
->SetNext(f
);
570 if (m_LastCell
) while (m_LastCell
->GetNext()) m_LastCell
= m_LastCell
->GetNext();
578 void wxHtmlContainerCell::SetAlign(const wxHtmlTag
& tag
)
580 if (tag
.HasParam(wxT("ALIGN")))
582 wxString alg
= tag
.GetParam(wxT("ALIGN"));
584 if (alg
== wxT("CENTER"))
585 SetAlignHor(wxHTML_ALIGN_CENTER
);
586 else if (alg
== wxT("LEFT"))
587 SetAlignHor(wxHTML_ALIGN_LEFT
);
588 else if (alg
== wxT("JUSTIFY"))
589 SetAlignHor(wxHTML_ALIGN_JUSTIFY
);
590 else if (alg
== wxT("RIGHT"))
591 SetAlignHor(wxHTML_ALIGN_RIGHT
);
598 void wxHtmlContainerCell::SetWidthFloat(const wxHtmlTag
& tag
, double pixel_scale
)
600 if (tag
.HasParam(wxT("WIDTH")))
603 wxString wd
= tag
.GetParam(wxT("WIDTH"));
605 if (wd
[wd
.Length()-1] == wxT('%'))
607 wxSscanf(wd
.c_str(), wxT("%i%%"), &wdi
);
608 SetWidthFloat(wdi
, wxHTML_UNITS_PERCENT
);
612 wxSscanf(wd
.c_str(), wxT("%i"), &wdi
);
613 SetWidthFloat((int)(pixel_scale
* (double)wdi
), wxHTML_UNITS_PIXELS
);
621 const wxHtmlCell
* wxHtmlContainerCell::Find(int condition
, const void* param
) const
625 const wxHtmlCell
*r
= NULL
;
627 for (wxHtmlCell
*cell
= m_Cells
; cell
; cell
= cell
->GetNext())
629 r
= cell
->Find(condition
, param
);
637 wxHtmlCell
*wxHtmlContainerCell::FindCellByPos(wxCoord x
, wxCoord y
,
638 unsigned flags
) const
640 if ( flags
& wxHTML_FIND_EXACT
)
642 for ( const wxHtmlCell
*cell
= m_Cells
; cell
; cell
= cell
->GetNext() )
644 int cx
= cell
->GetPosX(),
645 cy
= cell
->GetPosY();
647 if ( (cx
<= x
) && (cx
+ cell
->GetWidth() > x
) &&
648 (cy
<= y
) && (cy
+ cell
->GetHeight() > y
) )
650 return cell
->FindCellByPos(x
- cx
, y
- cy
, flags
);
654 else if ( flags
& wxHTML_FIND_NEAREST_AFTER
)
658 for ( const wxHtmlCell
*cell
= m_Cells
; cell
; cell
= cell
->GetNext() )
660 y2
= cell
->GetPosY() + cell
->GetHeight() - 1;
661 if (y2
< y
|| (y2
== y
&& cell
->GetPosX()+cell
->GetWidth()-1 < x
))
663 c
= cell
->FindCellByPos(x
- cell
->GetPosX(), y
- cell
->GetPosY(),
668 else if ( flags
& wxHTML_FIND_NEAREST_BEFORE
)
671 for ( const wxHtmlCell
*cell
= m_Cells
; cell
; cell
= cell
->GetNext() )
673 if (cell
->GetPosY() > y
||
674 (cell
->GetPosY() == y
&& cell
->GetPosX() > x
))
676 c
= cell
->FindCellByPos(x
- cell
->GetPosX(), y
- cell
->GetPosY(),
686 void wxHtmlContainerCell::OnMouseClick(wxWindow
*parent
, int x
, int y
, const wxMouseEvent
& event
)
688 wxHtmlCell
*cell
= FindCellByPos(x
, y
);
690 cell
->OnMouseClick(parent
, x
, y
, event
);
695 void wxHtmlContainerCell::GetHorizontalConstraints(int *left
, int *right
) const
697 int cleft
= m_PosX
+ m_Width
, cright
= m_PosX
; // worst case
700 for (wxHtmlCell
*cell
= m_Cells
; cell
; cell
= cell
->GetNext())
702 cell
->GetHorizontalConstraints(&l
, &r
);
709 cleft
-= (m_IndentLeft
< 0) ? (-m_IndentLeft
* m_Width
/ 100) : m_IndentLeft
;
710 cright
+= (m_IndentRight
< 0) ? (-m_IndentRight
* m_Width
/ 100) : m_IndentRight
;
719 wxHtmlCell
*wxHtmlContainerCell::GetFirstTerminal() const
722 return m_Cells
->GetFirstTerminal();
727 wxHtmlCell
*wxHtmlContainerCell::GetLastTerminal() const
732 for (c
= m_Cells
; c
->GetNext(); c
= c
->GetNext()) {}
742 // --------------------------------------------------------------------------
744 // --------------------------------------------------------------------------
746 void wxHtmlColourCell::Draw(wxDC
& dc
,
748 int WXUNUSED(view_y1
), int WXUNUSED(view_y2
),
749 wxHtmlRenderingState
& state
)
751 DrawInvisible(dc
, x
, y
, state
);
754 void wxHtmlColourCell::DrawInvisible(wxDC
& dc
,
755 int WXUNUSED(x
), int WXUNUSED(y
),
756 wxHtmlRenderingState
& state
)
758 if (m_Flags
& wxHTML_CLR_FOREGROUND
)
760 state
.SetFgColour(m_Colour
);
761 if (state
.GetSelectionState() != wxHTML_SEL_IN
)
762 dc
.SetTextForeground(m_Colour
);
764 if (m_Flags
& wxHTML_CLR_BACKGROUND
)
766 state
.SetBgColour(m_Colour
);
767 if (state
.GetSelectionState() != wxHTML_SEL_IN
)
768 dc
.SetTextBackground(m_Colour
);
769 dc
.SetBackground(wxBrush(m_Colour
, wxSOLID
));
776 // ---------------------------------------------------------------------------
778 // ---------------------------------------------------------------------------
780 void wxHtmlFontCell::Draw(wxDC
& dc
,
781 int WXUNUSED(x
), int WXUNUSED(y
),
782 int WXUNUSED(view_y1
), int WXUNUSED(view_y2
),
783 wxHtmlRenderingState
& WXUNUSED(state
))
788 void wxHtmlFontCell::DrawInvisible(wxDC
& dc
, int WXUNUSED(x
), int WXUNUSED(y
),
789 wxHtmlRenderingState
& WXUNUSED(state
))
801 // ---------------------------------------------------------------------------
803 // ---------------------------------------------------------------------------
805 wxHtmlWidgetCell::wxHtmlWidgetCell(wxWindow
*wnd
, int w
)
809 m_Wnd
->GetSize(&sx
, &sy
);
810 m_Width
= sx
, m_Height
= sy
;
815 void wxHtmlWidgetCell::Draw(wxDC
& WXUNUSED(dc
),
816 int WXUNUSED(x
), int WXUNUSED(y
),
817 int WXUNUSED(view_y1
), int WXUNUSED(view_y2
),
818 wxHtmlRenderingState
& WXUNUSED(state
))
820 int absx
= 0, absy
= 0, stx
, sty
;
821 wxHtmlCell
*c
= this;
825 absx
+= c
->GetPosX();
826 absy
+= c
->GetPosY();
830 ((wxScrolledWindow
*)(m_Wnd
->GetParent()))->GetViewStart(&stx
, &sty
);
831 m_Wnd
->SetSize(absx
- wxHTML_SCROLL_STEP
* stx
, absy
- wxHTML_SCROLL_STEP
* sty
, m_Width
, m_Height
);
836 void wxHtmlWidgetCell::DrawInvisible(wxDC
& WXUNUSED(dc
),
837 int WXUNUSED(x
), int WXUNUSED(y
),
838 wxHtmlRenderingState
& WXUNUSED(state
))
840 int absx
= 0, absy
= 0, stx
, sty
;
841 wxHtmlCell
*c
= this;
845 absx
+= c
->GetPosX();
846 absy
+= c
->GetPosY();
850 ((wxScrolledWindow
*)(m_Wnd
->GetParent()))->GetViewStart(&stx
, &sty
);
851 m_Wnd
->SetSize(absx
- wxHTML_SCROLL_STEP
* stx
, absy
- wxHTML_SCROLL_STEP
* sty
, m_Width
, m_Height
);
856 void wxHtmlWidgetCell::Layout(int w
)
858 if (m_WidthFloat
!= 0)
860 m_Width
= (w
* m_WidthFloat
) / 100;
861 m_Wnd
->SetSize(m_Width
, m_Height
);
864 wxHtmlCell::Layout(w
);