+/****************************************************************************
+REMARKS:
+Constructor for the HTML cell class to store our wxApplet windows in
+the HTML page to be rendered by wxHTML.
+****************************************************************************/
+wxHtmlAppletCell::wxHtmlAppletCell(
+ wxWindow *wnd,
+ int align)
+ : wxHtmlCell()
+{
+ int sx, sy;
+ m_Wnd = wnd;
+ m_Wnd->GetSize(&sx, &sy);
+ m_Width = sx, m_Height = sy;
+ switch (align) {
+ case wxHTML_ALIGN_TOP :
+ m_Descent = m_Height;
+ break;
+ case wxHTML_ALIGN_CENTER :
+ m_Descent = m_Height / 2;
+ break;
+ case wxHTML_ALIGN_BOTTOM :
+ default :
+ m_Descent = 0;
+ break;
+ }
+ SetCanLiveOnPagebreak(FALSE);
+}
+
+/****************************************************************************
+REMARKS:
+Implementation for the HTML cell class to store our wxApplet windows in
+the HTML page to be rendered by wxHTML.
+****************************************************************************/
+wxHtmlAppletCell::~wxHtmlAppletCell()
+{
+ delete m_Wnd;
+}
+
+/****************************************************************************
+REMARKS:
+Code to draw the html applet cell
+****************************************************************************/
+void wxHtmlAppletCell::Draw(
+ wxDC& WXUNUSED(dc),
+ int WXUNUSED(x),
+ int WXUNUSED(y),
+ int WXUNUSED(view_y1),
+ int WXUNUSED(view_y2))
+{
+ int absx = 0, absy = 0, stx, sty;
+ wxHtmlCell *c = this;
+
+ while (c) {
+ absx += c->GetPosX();
+ absy += c->GetPosY();
+ c = c->GetParent();
+ }
+ ((wxScrolledWindow*)(m_Wnd->GetParent()))->GetViewStart(&stx, &sty);
+ m_Wnd->Move(absx - wxHTML_SCROLL_STEP * stx, absy - wxHTML_SCROLL_STEP * sty);
+}
+
+/****************************************************************************
+REMARKS:
+Code to draw the html applet cell invisibly
+****************************************************************************/
+void wxHtmlAppletCell::DrawInvisible(
+ wxDC& WXUNUSED(dc),
+ int WXUNUSED(x),
+ int WXUNUSED(y))
+{
+ int absx = 0, absy = 0, stx, sty;
+ wxHtmlCell *c = this;
+
+ while (c) {
+ absx += c->GetPosX();
+ absy += c->GetPosY();
+ c = c->GetParent();
+ }
+ ((wxScrolledWindow*)(m_Wnd->GetParent()))->GetViewStart(&stx, &sty);
+ m_Wnd->Move(absx - wxHTML_SCROLL_STEP * stx, absy - wxHTML_SCROLL_STEP * sty);
+}
+
+/****************************************************************************
+REMARKS:
+Code to layout the html applet cell.
+****************************************************************************/
+void wxHtmlAppletCell::Layout(
+ int w)
+{
+ int sx, sy;
+ m_Wnd->GetSize(&sx, &sy);
+ m_Width = sx, m_Height = sy;
+ wxHtmlCell::Layout(w);
+}
+