- GetClientSize(&ClientWidth, &ClientHeight);
- m_Cell -> Layout(ClientWidth);
- if (m_Scrollable)
- SetScrollbars(HTML_SCROLL_STEP, HTML_SCROLL_STEP,
- m_Cell -> GetWidth() / HTML_SCROLL_STEP,
- m_Cell -> GetHeight() / HTML_SCROLL_STEP
- /*cheat: top-level frag is always container*/ );
+
+ if (m_Style == wxHW_SCROLLBAR_NEVER) {
+ SetScrollbars(wxHTML_SCROLL_STEP, 1, m_Cell -> GetWidth() / wxHTML_SCROLL_STEP, 0); // always off
+ GetClientSize(&ClientWidth, &ClientHeight);
+ m_Cell -> Layout(ClientWidth);
+ }
+
+ else {
+ GetClientSize(&ClientWidth, &ClientHeight);
+ m_Cell -> Layout(ClientWidth);
+ if (ClientHeight < m_Cell -> GetHeight() + GetCharHeight()) {
+ SetScrollbars(
+ wxHTML_SCROLL_STEP, wxHTML_SCROLL_STEP,
+ m_Cell -> GetWidth() / wxHTML_SCROLL_STEP,
+ (m_Cell -> GetHeight() + GetCharHeight()) / wxHTML_SCROLL_STEP
+ /*cheat: top-level frag is always container*/);
+ }
+ else { /* we fit into window, no need for scrollbars */
+ SetScrollbars(wxHTML_SCROLL_STEP, 1, m_Cell -> GetWidth() / wxHTML_SCROLL_STEP, 0); // disable...
+ GetClientSize(&ClientWidth, &ClientHeight);
+ m_Cell -> Layout(ClientWidth); // ...and relayout
+ }
+ }