- protected:
- int m_IndentLeft, m_IndentRight, m_IndentTop, m_IndentBottom;
- // indentation of subcells. There is always m_Indent pixels
- // big space between given border of the container and the subcells
- // it m_Indent < 0 it is in PERCENTS, otherwise it is in pixels
- int m_MinHeight, m_MinHeightAlign;
- // minimal height.
- int m_MaxLineWidth;
- // maximal widht of line. Filled during Layout()
- wxHtmlCell *m_Cells, *m_LastCell;
- // internal cells, m_Cells points to the first of them, m_LastCell to the last one.
- // (LastCell is needed only to speed-up InsertCell)
- int m_AlignHor, m_AlignVer;
- // alignment horizontal and vertical (left, center, right)
- int m_WidthFloat, m_WidthFloatUnits;
- // width float is used in adjustWidth
- bool m_UseBkColour;
- wxColour m_BkColour;
- // background color of this container
- bool m_UseBorder;
- wxColour m_BorderColour1, m_BorderColour2;
- // borders color of this container
-
- public:
- wxHtmlContainerCell(wxHtmlContainerCell *parent);
- ~wxHtmlContainerCell() {if (m_Cells) delete m_Cells;}
-
- virtual void Layout(int w);
- virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
- virtual void DrawInvisible(wxDC& dc, int x, int y);
-
- void InsertCell(wxHtmlCell *cell);
- // insert cell at the end of m_Cells list
- void SetAlignHor(int al) {m_AlignHor = al;}
- int GetAlignHor() const {return m_AlignHor;}
- void SetAlignVer(int al) {m_AlignVer = al;}
- // sets horizontal/vertical alignment
- int GetAlignVer() const {return m_AlignVer;}
- void SetIndent(int i, int what, int units = HTML_UNITS_PIXELS);
- // sets left-border indentation. units is one of HTML_UNITS_* constants
- // what is combination of HTML_INDENT_*
- int GetIndent(int ind) const;
- // returns the indentation. ind is one of HTML_INDENT_* constants
- int GetIndentUnits(int ind) const;
- // returns type of value returned by GetIndent(ind)
- void SetAlign(const wxHtmlTag& tag);
- // sets alignment info based on given tag's params
- void SetWidthFloat(int w, int units) {m_WidthFloat = w; m_WidthFloatUnits = units;}
- void SetWidthFloat(const wxHtmlTag& tag);
- // sets floating width adjustment
- // (examples : 32 percent of parent container,
- // -15 pixels percent (this means 100 % - 15 pixels)
- void SetMinHeight(int h, int align = HTML_ALIGN_TOP) {m_MinHeight = h; m_MinHeightAlign = align;}
- // sets minimal height of this container.
- int GetMaxLineWidth() const {return m_MaxLineWidth;}
- // returns maximal line width in this container.
- // Call to this method is valid only after calling
- // Layout()
- void SetBackgroundColour(const wxColour& clr) {m_UseBkColour = TRUE; m_BkColour = clr;}
- void SetBorder(const wxColour& clr1, const wxColour& clr2) {m_UseBorder = TRUE; m_BorderColour1 = clr1, m_BorderColour2 = clr2;}
- virtual wxString GetLink(int x = 0, int y = 0) const;
- virtual const wxHtmlCell* Find(int condition, const void* param) const;
- virtual void OnMouseClick(wxWindow *parent, int x, int y, bool left, bool middle, bool right);
-
- wxHtmlCell* GetFirstCell() {return m_Cells;}
- // returns pointer to the first cell in container or NULL
+public:
+ wxHtmlContainerCell(wxHtmlContainerCell *parent);
+ ~wxHtmlContainerCell();
+
+ virtual void Layout(int w);
+ virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2,
+ wxHtmlRenderingInfo& info);
+ virtual void DrawInvisible(wxDC& dc, int x, int y,
+ wxHtmlRenderingInfo& info);
+ virtual bool AdjustPagebreak(int *pagebreak, int *known_pagebreaks = NULL, int number_of_pages = 0) const;
+
+ // insert cell at the end of m_Cells list
+ void InsertCell(wxHtmlCell *cell);
+
+ // sets horizontal/vertical alignment
+ void SetAlignHor(int al) {m_AlignHor = al; m_LastLayout = -1;}
+ int GetAlignHor() const {return m_AlignHor;}
+ void SetAlignVer(int al) {m_AlignVer = al; m_LastLayout = -1;}
+ int GetAlignVer() const {return m_AlignVer;}
+
+ // sets left-border indentation. units is one of wxHTML_UNITS_* constants
+ // what is combination of wxHTML_INDENT_*
+ void SetIndent(int i, int what, int units = wxHTML_UNITS_PIXELS);
+ // returns the indentation. ind is one of wxHTML_INDENT_* constants
+ int GetIndent(int ind) const;
+ // returns type of value returned by GetIndent(ind)
+ int GetIndentUnits(int ind) const;
+
+ // sets alignment info based on given tag's params
+ void SetAlign(const wxHtmlTag& tag);
+ // sets floating width adjustment
+ // (examples : 32 percent of parent container,
+ // -15 pixels percent (this means 100 % - 15 pixels)
+ void SetWidthFloat(int w, int units) {m_WidthFloat = w; m_WidthFloatUnits = units; m_LastLayout = -1;}
+ void SetWidthFloat(const wxHtmlTag& tag, double pixel_scale = 1.0);
+ // sets minimal height of this container.
+ void SetMinHeight(int h, int align = wxHTML_ALIGN_TOP) {m_MinHeight = h; m_MinHeightAlign = align; m_LastLayout = -1;}
+
+ void SetBackgroundColour(const wxColour& clr) {m_UseBkColour = TRUE; m_BkColour = clr;}
+ // returns background colour (of wxNullColour if none set), so that widgets can
+ // adapt to it:
+ wxColour GetBackgroundColour();
+ void SetBorder(const wxColour& clr1, const wxColour& clr2) {m_UseBorder = TRUE; m_BorderColour1 = clr1, m_BorderColour2 = clr2;}
+ virtual wxHtmlLinkInfo* GetLink(int x = 0, int y = 0) const;
+ virtual const wxHtmlCell* Find(int condition, const void* param) const;
+ virtual void OnMouseClick(wxWindow *parent, int x, int y, const wxMouseEvent& event);
+
+ virtual wxHtmlCell* GetFirstChild() const { return m_Cells; }
+#if WXWIN_COMPATIBILITY_2_4
+ wxDEPRECATED( wxHtmlCell* GetFirstCell() const );
+#endif
+
+ // see comment in wxHtmlCell about this method
+ virtual bool IsTerminalCell() const { return FALSE; }
+
+ virtual wxHtmlCell *FindCellByPos(wxCoord x, wxCoord y,
+ unsigned flags = wxHTML_FIND_EXACT) const;
+
+ virtual wxHtmlCell *GetFirstTerminal() const;
+ virtual wxHtmlCell *GetLastTerminal() const;
+
+
+ // Removes indentation on top or bottom of the container (i.e. above or
+ // below first/last terminal cell). For internal use only.
+ void RemoveExtraSpacing(bool top, bool bottom);
+
+protected:
+ void UpdateRenderingStatePre(wxHtmlRenderingInfo& info,
+ wxHtmlCell *cell) const;
+ void UpdateRenderingStatePost(wxHtmlRenderingInfo& info,
+ wxHtmlCell *cell) const;
+
+protected:
+ int m_IndentLeft, m_IndentRight, m_IndentTop, m_IndentBottom;
+ // indentation of subcells. There is always m_Indent pixels
+ // big space between given border of the container and the subcells
+ // it m_Indent < 0 it is in PERCENTS, otherwise it is in pixels
+ int m_MinHeight, m_MinHeightAlign;
+ // minimal height.
+ wxHtmlCell *m_Cells, *m_LastCell;
+ // internal cells, m_Cells points to the first of them, m_LastCell to the last one.
+ // (LastCell is needed only to speed-up InsertCell)
+ int m_AlignHor, m_AlignVer;
+ // alignment horizontal and vertical (left, center, right)
+ int m_WidthFloat, m_WidthFloatUnits;
+ // width float is used in adjustWidth
+ bool m_UseBkColour;
+ wxColour m_BkColour;
+ // background color of this container
+ bool m_UseBorder;
+ wxColour m_BorderColour1, m_BorderColour2;
+ // borders color of this container
+ int m_LastLayout;
+ // if != -1 then call to Layout may be no-op
+ // if previous call to Layout has same argument
+
+ DECLARE_NO_COPY_CLASS(wxHtmlContainerCell)