wxhtmlcellinternal data structure. it represents fragments of parsed html page, the so-called cell - a word, picture, table, horizontal line and so on. it is used by wxhtmlwindow and wxhtmlwinparser to represent html page in memory. you can divide cells into two groups : visible cells with non-zero width and height and helper cells (usually with zero width and height) that perform special actions such as color or font change. derived from include files <wx/html/htmlcell.h> see also cells overview, wxhtmlcontainercell members
wxhtmlcell::wxhtmlcell
wxhtmlcell::wxhtmlcellwxhtmlcell() constructor.
wxhtmlcell::adjustpagebreakvirtual bool adjustpagebreak(int * pagebreak) this method is 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 into two pieces (each one on another page) then it moves the pagebreak few pixels up. returns true if pagebreak was modified, false otherwise usage: while (container->adjustpagebreak(&p)) {} wxhtmlcell::drawvirtual void draw(wxdc& dc, int x, int y, int view_y1, int view_y2) renders the cell. parameters dc
x,y
view_y1
view_y2
wxhtmlcell::drawinvisiblevirtual void drawinvisible(wxdc& dc, int x, int y) this method is called instead of draw when the cell is certainly out of the screen (and thus invisible). this is not nonsense - some tags (like wxhtmlcolourcell or font setter) must be drawn even if they are invisible! parameters dc
x,y
wxhtmlcell::findvirtual const wxhtmlcell* find(int condition, const void* param) returns pointer to itself if this cell matches condition (or if any of the cells following in the list matches), null otherwise. (in other words if you call top-level container's find it will return pointer to the first cell that matches the condition) it is recommended way how to obtain pointer to particular cell or to cell of some type (e.g. wxhtmlanchorcell reacts on wxhtml_cond_isanchor condition) parameters condition
param
defined conditions
wxhtmlcell::getdescentint getdescent() const returns descent value of the cell (m_descent member). see explanation:
wxhtmlcell::getfirstchildwxhtmlcell* getfirstchild() returns pointer to the first cell in the list. you can then use child's getnext method to obtain pointer to the next cell in list. note: this shouldn't be used by the end user. if you need some way of finding particular cell in the list, try find method instead.
wxhtmlcell::getheightint getheight() const returns height of the cell (m_height member).
wxhtmlcell::getidvirtual wxstring getid() const returns unique cell identifier if there is any, empty string otherwise.
wxhtmlcell::getlinkvirtual wxhtmllinkinfo* getlink(int x = 0, int y = 0) const returns hypertext link if associated with this cell or null otherwise. see wxhtmllinkinfo. (note: this makes sense only for visible tags). parameters x,y
wxhtmlcell::getmousecursorvirtual wxcursor getmousecursor(wxhtmlwindowinterface* window) returns cursor to show when mouse pointer is over the cell. parameters window
this function is new since wxwidgets version 2.7.0 (before getcursor method served a similar purpose, which is now deprecated).
wxhtmlcell::getnextwxhtmlcell* getnext() const returns pointer to the next cell in list (see htmlcell.h if you're interested in details).
wxhtmlcell::getparentwxhtmlcontainercell* getparent() const returns pointer to parent container.
wxhtmlcell::getposxint getposx() const returns x position within parent (the value is relative to parent's upper left corner). the returned value is meaningful only if parent's layout was called before!
wxhtmlcell::getposyint getposy() const returns y position within parent (the value is relative to parent's upper left corner). the returned value is meaningful only if parent's layout was called before!
wxhtmlcell::getwidthint getwidth() const returns width of the cell (m_width member).
wxhtmlcell::layoutvirtual void layout(int w) this method performs two actions:
it must be called before displaying cells structure because m_posx and m_posy are undefined (or invalid) before calling layout.
wxhtmlcell::processmouseclickvirtual bool processmouseclick(wxhtmlwindowinterface* window, const wxpoint& pos, const wxmouseevent& event) this function is simple event handler. each time the user clicks mouse button over a cell within wxhtmlwindow this method of that cell is called. default behavior is to call wxhtmlwindow::loadpage. note if you need more "advanced" event handling you should use wxhtmlbindercell instead. parameters window
pos
event
return value true if a link was clicked, false otherwise. this function is new since wxwidgets version 2.7.0 (before onmouseclick method served a similar purpose).
wxhtmlcell::setidvoid setid(const wxstring& id) sets unique cell identifier. default value is no identifier, i.e. empty string.
wxhtmlcell::setlinkvoid setlink(const wxhtmllinkinfo& link) sets the hypertext link associated with this cell. (default value is wxhtmllinkinfo("", "") (no link))
wxhtmlcell::setnextvoid setnext(wxhtmlcell *cell) sets the next cell in the list. this shouldn't be called by user - it is to be used only by wxhtmlcontainercell::insertcell.
wxhtmlcell::setparentvoid setparent(wxhtmlcontainercell *p) sets parent container of this cell. this is called from wxhtmlcontainercell::insertcell.
wxhtmlcell::setposvoid setpos(int x, int y) sets the cell's position within parent container.
|