// HINT: if this handling is not enough for you you should use
// wxHtmlBinderCell
- virtual bool AdjustPagebreak(int *pagebreak);
+ virtual bool AdjustPagebreak(int *pagebreak) const;
// This method used to adjust pagebreak position. The parameter is
// variable that contains y-coordinate of page break (= horizontal line that
// should not be crossed by words, images etc.). If this cell cannot be divided
class WXDLLEXPORT wxHtmlWordCell : public wxHtmlCell
{
- protected:
- wxString m_Word;
-
public:
wxHtmlWordCell(const wxString& word, wxDC& dc);
void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
+
+ protected:
+ wxString m_Word;
};
class WXDLLEXPORT wxHtmlContainerCell : public wxHtmlCell
{
- 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);
- virtual bool AdjustPagebreak(int *pagebreak);
+ virtual bool AdjustPagebreak(int *pagebreak) const;
void InsertCell(wxHtmlCell *cell);
// insert cell at the end of m_Cells list
- void SetAlignHor(int al) {m_AlignHor = al;}
+ void SetAlignHor(int al) {m_AlignHor = al; m_LastLayout = -1;}
int GetAlignHor() const {return m_AlignHor;}
- void SetAlignVer(int al) {m_AlignVer = al;}
+ void SetAlignVer(int al) {m_AlignVer = al; m_LastLayout = -1;}
// sets horizontal/vertical alignment
int GetAlignVer() const {return m_AlignVer;}
void SetIndent(int i, int what, int units = wxHTML_UNITS_PIXELS);
// 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(int w, int units) {m_WidthFloat = w; m_WidthFloatUnits = units; m_LastLayout = -1;}
void SetWidthFloat(const wxHtmlTag& tag, double pixel_scale = 1.0);
// sets floating width adjustment
// (examples : 32 percent of parent container,
// -15 pixels percent (this means 100 % - 15 pixels)
- void SetMinHeight(int h, int align = wxHTML_ALIGN_TOP) {m_MinHeight = h; m_MinHeightAlign = align;}
+ void SetMinHeight(int h, int align = wxHTML_ALIGN_TOP) {m_MinHeight = h; m_MinHeightAlign = align; m_LastLayout = -1;}
// sets minimal height of this container.
int GetMaxLineWidth() const {return m_MaxLineWidth;}
// returns maximal line width in this container.
virtual const wxHtmlCell* Find(int condition, const void* param) const;
virtual void OnMouseClick(wxWindow *parent, int x, int y, const wxMouseEvent& event);
- wxHtmlCell* GetFirstCell() {return m_Cells;}
+ wxHtmlCell* GetFirstCell() const {return m_Cells;}
// returns pointer to the first cell in container or NULL
+
+ 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
+ int m_LastLayout;
+ // if != -1 then call to Layout may be no-op
+ // if previous call to Layout has same argument
};
class WXDLLEXPORT wxHtmlColourCell : public wxHtmlCell
{
public:
- wxColour m_Colour;
- unsigned m_Flags;
-
wxHtmlColourCell(const wxColour& clr, int flags = wxHTML_CLR_FOREGROUND) : wxHtmlCell() {m_Colour = clr; m_Flags = flags;}
virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
virtual void DrawInvisible(wxDC& dc, int x, int y);
+
+ protected:
+ wxColour m_Colour;
+ unsigned m_Flags;
};
class WXDLLEXPORT wxHtmlFontCell : public wxHtmlCell
{
public:
- wxFont m_Font;
-
wxHtmlFontCell(wxFont *font) : wxHtmlCell() { m_Font = (*font); }
virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
virtual void DrawInvisible(wxDC& dc, int x, int y);
+
+ protected:
+ wxFont m_Font;
};
class WXDLLEXPORT wxHtmlWidgetCell : public wxHtmlCell
{
- protected:
- wxWindow* m_Wnd;
- int m_WidthFloat;
- // width float is used in adjustWidth (it is in percents)
-
public:
wxHtmlWidgetCell(wxWindow *wnd, int w = 0);
// !!! wnd must have correct parent!
virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
virtual void DrawInvisible(wxDC& dc, int x, int y);
virtual void Layout(int w);
+
+ protected:
+ wxWindow* m_Wnd;
+ int m_WidthFloat;
+ // width float is used in adjustWidth (it is in percents)
};
{
public:
wxHtmlLinkInfo() : wxObject()
- { m_Href = m_Target = wxEmptyString; m_Event = NULL; }
+ { m_Href = m_Target = wxEmptyString; m_Event = NULL, m_Cell = NULL; }
wxHtmlLinkInfo(const wxString& href, const wxString& target = wxEmptyString) : wxObject()
- { m_Href = href; m_Target = target; m_Event = NULL; }
+ { m_Href = href; m_Target = target; m_Event = NULL, m_Cell = NULL; }
wxHtmlLinkInfo(const wxHtmlLinkInfo& l)
- { m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event; }
+ { m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event, m_Cell = l.m_Cell; }
wxHtmlLinkInfo& operator=(const wxHtmlLinkInfo& l)
- { m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event; return *this; }
+ { m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event, m_Cell = l.m_Cell; return *this; }
void SetEvent(const wxMouseEvent *e) { m_Event = e; }
+ void SetHtmlCell(const wxHtmlCell *e) { m_Cell = e; }
wxString GetHref() const { return m_Href; }
wxString GetTarget() const { return m_Target; }
const wxMouseEvent* GetEvent() const { return m_Event; }
+ const wxHtmlCell* GetHtmlCell() const { return m_Cell; }
private:
wxString m_Href, m_Target;
const wxMouseEvent *m_Event;
+ const wxHtmlCell *m_Cell;
};