HTML_xxxx constants changed to wxHTML_xxxx (with backward compatibility through WXWIN_COMPATIBILITY_2)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4036 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -61,7 +61,6 @@ protected:
|
|||||||
WX_DECLARE_EXPORTED_OBJARRAY(wxHtmlBookRecord, wxHtmlBookRecArray);
|
WX_DECLARE_EXPORTED_OBJARRAY(wxHtmlBookRecord, wxHtmlBookRecArray);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
short int m_Level;
|
short int m_Level;
|
||||||
|
@@ -84,7 +84,7 @@ class WXDLLEXPORT wxHtmlCell : public wxObject
|
|||||||
// Condition is unique condition identifier (see htmldefs.h)
|
// Condition is unique condition identifier (see htmldefs.h)
|
||||||
// (user-defined condition IDs should start from 10000)
|
// (user-defined condition IDs should start from 10000)
|
||||||
// and param is optional parameter
|
// and param is optional parameter
|
||||||
// Example : m_Cell -> Find(HTML_COND_ISANCHOR, "news");
|
// Example : m_Cell -> Find(wxHTML_COND_ISANCHOR, "news");
|
||||||
// returns pointer to anchor news
|
// returns pointer to anchor news
|
||||||
|
|
||||||
virtual void OnMouseClick(wxWindow *parent, int x, int y, bool left, bool middle, bool right);
|
virtual void OnMouseClick(wxWindow *parent, int x, int y, bool left, bool middle, bool right);
|
||||||
@@ -200,11 +200,11 @@ class WXDLLEXPORT wxHtmlContainerCell : public wxHtmlCell
|
|||||||
void SetAlignVer(int al) {m_AlignVer = al;}
|
void SetAlignVer(int al) {m_AlignVer = al;}
|
||||||
// sets horizontal/vertical alignment
|
// sets horizontal/vertical alignment
|
||||||
int GetAlignVer() const {return m_AlignVer;}
|
int GetAlignVer() const {return m_AlignVer;}
|
||||||
void SetIndent(int i, int what, int units = HTML_UNITS_PIXELS);
|
void SetIndent(int i, int what, int units = wxHTML_UNITS_PIXELS);
|
||||||
// sets left-border indentation. units is one of HTML_UNITS_* constants
|
// sets left-border indentation. units is one of wxHTML_UNITS_* constants
|
||||||
// what is combination of HTML_INDENT_*
|
// what is combination of wxHTML_INDENT_*
|
||||||
int GetIndent(int ind) const;
|
int GetIndent(int ind) const;
|
||||||
// returns the indentation. ind is one of HTML_INDENT_* constants
|
// returns the indentation. ind is one of wxHTML_INDENT_* constants
|
||||||
int GetIndentUnits(int ind) const;
|
int GetIndentUnits(int ind) const;
|
||||||
// returns type of value returned by GetIndent(ind)
|
// returns type of value returned by GetIndent(ind)
|
||||||
void SetAlign(const wxHtmlTag& tag);
|
void SetAlign(const wxHtmlTag& tag);
|
||||||
@@ -214,7 +214,7 @@ class WXDLLEXPORT wxHtmlContainerCell : public wxHtmlCell
|
|||||||
// sets floating width adjustment
|
// sets floating width adjustment
|
||||||
// (examples : 32 percent of parent container,
|
// (examples : 32 percent of parent container,
|
||||||
// -15 pixels percent (this means 100 % - 15 pixels)
|
// -15 pixels percent (this means 100 % - 15 pixels)
|
||||||
void SetMinHeight(int h, int align = HTML_ALIGN_TOP) {m_MinHeight = h; m_MinHeightAlign = align;}
|
void SetMinHeight(int h, int align = wxHTML_ALIGN_TOP) {m_MinHeight = h; m_MinHeightAlign = align;}
|
||||||
// sets minimal height of this container.
|
// sets minimal height of this container.
|
||||||
int GetMaxLineWidth() const {return m_MaxLineWidth;}
|
int GetMaxLineWidth() const {return m_MaxLineWidth;}
|
||||||
// returns maximal line width in this container.
|
// returns maximal line width in this container.
|
||||||
@@ -245,7 +245,7 @@ class WXDLLEXPORT wxHtmlColourCell : public wxHtmlCell
|
|||||||
wxColour m_Colour;
|
wxColour m_Colour;
|
||||||
unsigned m_Flags;
|
unsigned m_Flags;
|
||||||
|
|
||||||
wxHtmlColourCell(wxColour clr, int flags = HTML_CLR_FOREGROUND) : wxHtmlCell() {m_Colour = clr; m_Flags = flags;}
|
wxHtmlColourCell(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 Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
|
||||||
virtual void DrawInvisible(wxDC& dc, int x, int y);
|
virtual void DrawInvisible(wxDC& dc, int x, int y);
|
||||||
};
|
};
|
||||||
|
@@ -20,13 +20,13 @@
|
|||||||
// Describes alignment of text etc. in containers
|
// Describes alignment of text etc. in containers
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
|
||||||
#define HTML_ALIGN_LEFT 0x0000
|
#define wxHTML_ALIGN_LEFT 0x0000
|
||||||
#define HTML_ALIGN_RIGHT 0x0002
|
#define wxHTML_ALIGN_RIGHT 0x0002
|
||||||
|
|
||||||
#define HTML_ALIGN_TOP 0x0004
|
#define wxHTML_ALIGN_TOP 0x0004
|
||||||
#define HTML_ALIGN_BOTTOM 0x0008
|
#define wxHTML_ALIGN_BOTTOM 0x0008
|
||||||
|
|
||||||
#define HTML_ALIGN_CENTER 0x0001
|
#define wxHTML_ALIGN_CENTER 0x0001
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -35,8 +35,8 @@
|
|||||||
// Used by wxHtmlColourCell to determine clr of what is changing
|
// Used by wxHtmlColourCell to determine clr of what is changing
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
|
||||||
#define HTML_CLR_FOREGROUND 0x0001
|
#define wxHTML_CLR_FOREGROUND 0x0001
|
||||||
#define HTML_CLR_BACKGROUND 0x0002
|
#define wxHTML_CLR_BACKGROUND 0x0002
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -45,8 +45,8 @@
|
|||||||
// Used to specify units
|
// Used to specify units
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
|
||||||
#define HTML_UNITS_PIXELS 0x0001
|
#define wxHTML_UNITS_PIXELS 0x0001
|
||||||
#define HTML_UNITS_PERCENT 0x0002
|
#define wxHTML_UNITS_PERCENT 0x0002
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -55,14 +55,14 @@
|
|||||||
// Used to specify indetation relatives
|
// Used to specify indetation relatives
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
|
||||||
#define HTML_INDENT_LEFT 0x0010
|
#define wxHTML_INDENT_LEFT 0x0010
|
||||||
#define HTML_INDENT_RIGHT 0x0020
|
#define wxHTML_INDENT_RIGHT 0x0020
|
||||||
#define HTML_INDENT_TOP 0x0040
|
#define wxHTML_INDENT_TOP 0x0040
|
||||||
#define HTML_INDENT_BOTTOM 0x0080
|
#define wxHTML_INDENT_BOTTOM 0x0080
|
||||||
|
|
||||||
#define HTML_INDENT_HORIZONTAL HTML_INDENT_LEFT | HTML_INDENT_RIGHT
|
#define wxHTML_INDENT_HORIZONTAL wxHTML_INDENT_LEFT | wxHTML_INDENT_RIGHT
|
||||||
#define HTML_INDENT_VERTICAL HTML_INDENT_TOP | HTML_INDENT_BOTTOM
|
#define wxHTML_INDENT_VERTICAL wxHTML_INDENT_TOP | wxHTML_INDENT_BOTTOM
|
||||||
#define HTML_INDENT_ALL HTML_INDENT_VERTICAL | HTML_INDENT_HORIZONTAL
|
#define wxHTML_INDENT_ALL wxHTML_INDENT_VERTICAL | wxHTML_INDENT_HORIZONTAL
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -72,14 +72,14 @@
|
|||||||
// Identifiers of wxHtmlCell's Find() conditions
|
// Identifiers of wxHtmlCell's Find() conditions
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
|
||||||
#define HTML_COND_ISANCHOR 1
|
#define wxHTML_COND_ISANCHOR 1
|
||||||
// Finds the anchor of 'param' name (pointer to wxString).
|
// Finds the anchor of 'param' name (pointer to wxString).
|
||||||
|
|
||||||
#define HTML_COND_ISIMAGEMAP 2
|
#define wxHTML_COND_ISIMAGEMAP 2
|
||||||
// Finds imagemap of 'param' name (pointer to wxString).
|
// Finds imagemap of 'param' name (pointer to wxString).
|
||||||
// (used exclusively by m_image.cpp)
|
// (used exclusively by m_image.cpp)
|
||||||
|
|
||||||
#define HTML_COND_USER 10000
|
#define wxHTML_COND_USER 10000
|
||||||
// User-defined conditions should start from this number
|
// User-defined conditions should start from this number
|
||||||
|
|
||||||
|
|
||||||
@@ -88,14 +88,47 @@
|
|||||||
// wxHTML internal constants
|
// wxHTML internal constants
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
|
||||||
#define HTML_SCROLL_STEP 16
|
#define wxHTML_SCROLL_STEP 16
|
||||||
/* size of one scroll step of wxHtmlWindow in pixels */
|
/* size of one scroll step of wxHtmlWindow in pixels */
|
||||||
#define HTML_BUFLEN 1024
|
#define wxHTML_BUFLEN 1024
|
||||||
/* size of temporary buffer used during parsing */
|
/* size of temporary buffer used during parsing */
|
||||||
#define HTML_REALLOC_STEP 32
|
#define wxHTML_REALLOC_STEP 32
|
||||||
/* steps of array reallocation */
|
/* steps of array reallocation */
|
||||||
#define HTML_PRINT_MAX_PAGES 999
|
#define wxHTML_PRINT_MAX_PAGES 999
|
||||||
/* maximum number of pages printable via html printing */
|
/* maximum number of pages printable via html printing */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if WXWIN_COMPATIBILITY_2
|
||||||
|
|
||||||
|
#define HTML_ALIGN_LEFT wxHTML_ALIGN_LEFT
|
||||||
|
#define HTML_ALIGN_RIGHT wxHTML_ALIGN_RIGHT
|
||||||
|
#define HTML_ALIGN_TOP wxHTML_ALIGN_TOP
|
||||||
|
#define HTML_ALIGN_BOTTOM wxHTML_ALIGN_BOTTOM
|
||||||
|
#define HTML_ALIGN_CENTER wxHTML_ALIGN_CENTER
|
||||||
|
#define HTML_CLR_FOREGROUND wxHTML_CLR_FOREGROUND
|
||||||
|
#define HTML_CLR_BACKGROUND wxHTML_CLR_BACKGROUND
|
||||||
|
#define HTML_UNITS_PIXELS wxHTML_UNITS_PIXELS
|
||||||
|
#define HTML_UNITS_PERCENT wxHTML_UNITS_PERCENT
|
||||||
|
#define HTML_INDENT_LEFT wxHTML_INDENT_LEFT
|
||||||
|
#define HTML_INDENT_RIGHT wxHTML_INDENT_RIGHT
|
||||||
|
#define HTML_INDENT_TOP wxHTML_INDENT_TOP
|
||||||
|
#define HTML_INDENT_BOTTOM wxHTML_INDENT_BOTTOM
|
||||||
|
#define HTML_INDENT_HORIZONTAL wxHTML_INDENT_HORIZONTAL
|
||||||
|
#define HTML_INDENT_VERTICAL wxHTML_INDENT_VERTICAL
|
||||||
|
#define HTML_INDENT_ALL wxHTML_INDENT_ALL
|
||||||
|
#define HTML_COND_ISANCHOR wxHTML_COND_ISANCHOR
|
||||||
|
#define HTML_COND_ISIMAGEMAP wxHTML_COND_ISIMAGEMAP
|
||||||
|
#define HTML_COND_USER wxHTML_COND_USER
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@@ -140,7 +140,7 @@ class wxHtmlPrintout : public wxPrintout
|
|||||||
bool OnPrintPage(int page);
|
bool OnPrintPage(int page);
|
||||||
bool HasPage(int page);
|
bool HasPage(int page);
|
||||||
void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo);
|
void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo);
|
||||||
bool OnBeginDocument(int start, int end);
|
void OnBeginPrinting();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ class wxHtmlPrintout : public wxPrintout
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int m_NumPages;
|
int m_NumPages;
|
||||||
int m_PageBreaks[HTML_PRINT_MAX_PAGES];
|
int m_PageBreaks[wxHTML_PRINT_MAX_PAGES];
|
||||||
|
|
||||||
wxString m_Document, m_BasePath;
|
wxString m_Document, m_BasePath;
|
||||||
bool m_BasePathIsDir;
|
bool m_BasePathIsDir;
|
||||||
|
@@ -123,8 +123,8 @@ bool HP_TagHandler::HandleTag(const wxHtmlTag& tag)
|
|||||||
m_Name = m_Page = wxEmptyString;
|
m_Name = m_Page = wxEmptyString;
|
||||||
ParseInner(tag);
|
ParseInner(tag);
|
||||||
if (m_Page != wxEmptyString) {
|
if (m_Page != wxEmptyString) {
|
||||||
if (m_ItemsCnt % HTML_REALLOC_STEP == 0)
|
if (m_ItemsCnt % wxHTML_REALLOC_STEP == 0)
|
||||||
m_Items = (wxHtmlContentsItem*) realloc(m_Items, (m_ItemsCnt + HTML_REALLOC_STEP) * sizeof(wxHtmlContentsItem));
|
m_Items = (wxHtmlContentsItem*) realloc(m_Items, (m_ItemsCnt + wxHTML_REALLOC_STEP) * sizeof(wxHtmlContentsItem));
|
||||||
m_Items[m_ItemsCnt].m_Level = m_Level;
|
m_Items[m_ItemsCnt].m_Level = m_Level;
|
||||||
m_Items[m_ItemsCnt].m_ID = m_ID;
|
m_Items[m_ItemsCnt].m_ID = m_ID;
|
||||||
m_Items[m_ItemsCnt].m_Page = new char[m_Page.Length() + 1];
|
m_Items[m_ItemsCnt].m_Page = new char[m_Page.Length() + 1];
|
||||||
@@ -248,7 +248,7 @@ bool wxHtmlHelpData::LoadCachedBook(wxHtmlBookRecord *book, wxInputStream *f)
|
|||||||
f -> Read(&x, sizeof(x));
|
f -> Read(&x, sizeof(x));
|
||||||
st = m_ContentsCnt;
|
st = m_ContentsCnt;
|
||||||
m_ContentsCnt += x;
|
m_ContentsCnt += x;
|
||||||
m_Contents = (wxHtmlContentsItem*) realloc(m_Contents, (m_ContentsCnt / HTML_REALLOC_STEP + 1) * HTML_REALLOC_STEP * sizeof(wxHtmlContentsItem));
|
m_Contents = (wxHtmlContentsItem*) realloc(m_Contents, (m_ContentsCnt / wxHTML_REALLOC_STEP + 1) * wxHTML_REALLOC_STEP * sizeof(wxHtmlContentsItem));
|
||||||
for (i = st; i < m_ContentsCnt; i++) {
|
for (i = st; i < m_ContentsCnt; i++) {
|
||||||
f -> Read(&x, sizeof(x));
|
f -> Read(&x, sizeof(x));
|
||||||
m_Contents[i].m_Level = x;
|
m_Contents[i].m_Level = x;
|
||||||
@@ -268,7 +268,7 @@ bool wxHtmlHelpData::LoadCachedBook(wxHtmlBookRecord *book, wxInputStream *f)
|
|||||||
f -> Read(&x, sizeof(x));
|
f -> Read(&x, sizeof(x));
|
||||||
st = m_IndexCnt;
|
st = m_IndexCnt;
|
||||||
m_IndexCnt += x;
|
m_IndexCnt += x;
|
||||||
m_Index = (wxHtmlContentsItem*) realloc(m_Index, (m_IndexCnt / HTML_REALLOC_STEP + 1) * HTML_REALLOC_STEP * sizeof(wxHtmlContentsItem));
|
m_Index = (wxHtmlContentsItem*) realloc(m_Index, (m_IndexCnt / wxHTML_REALLOC_STEP + 1) * wxHTML_REALLOC_STEP * sizeof(wxHtmlContentsItem));
|
||||||
for (i = st; i < m_IndexCnt; i++) {
|
for (i = st; i < m_IndexCnt; i++) {
|
||||||
f -> Read(&x, sizeof(x));
|
f -> Read(&x, sizeof(x));
|
||||||
m_Index[i].m_Name = new char[x];
|
m_Index[i].m_Name = new char[x];
|
||||||
@@ -352,8 +352,8 @@ bool wxHtmlHelpData::AddBookParam(const wxString& title, const wxString& contfil
|
|||||||
|
|
||||||
bookr = new wxHtmlBookRecord(path+'/', title, deftopic);
|
bookr = new wxHtmlBookRecord(path+'/', title, deftopic);
|
||||||
|
|
||||||
if (m_ContentsCnt % HTML_REALLOC_STEP == 0)
|
if (m_ContentsCnt % wxHTML_REALLOC_STEP == 0)
|
||||||
m_Contents = (wxHtmlContentsItem*) realloc(m_Contents, (m_ContentsCnt + HTML_REALLOC_STEP) * sizeof(wxHtmlContentsItem));
|
m_Contents = (wxHtmlContentsItem*) realloc(m_Contents, (m_ContentsCnt + wxHTML_REALLOC_STEP) * sizeof(wxHtmlContentsItem));
|
||||||
m_Contents[m_ContentsCnt].m_Level = 0;
|
m_Contents[m_ContentsCnt].m_Level = 0;
|
||||||
m_Contents[m_ContentsCnt].m_ID = 0;
|
m_Contents[m_ContentsCnt].m_ID = 0;
|
||||||
m_Contents[m_ContentsCnt].m_Page = new char[deftopic.Length() + 1];
|
m_Contents[m_ContentsCnt].m_Page = new char[deftopic.Length() + 1];
|
||||||
|
@@ -101,35 +101,35 @@ wxHtmlContainerCell::wxHtmlContainerCell(wxHtmlContainerCell *parent) : wxHtmlCe
|
|||||||
m_Cells = m_LastCell = NULL;
|
m_Cells = m_LastCell = NULL;
|
||||||
m_Parent = parent;
|
m_Parent = parent;
|
||||||
if (m_Parent) m_Parent -> InsertCell(this);
|
if (m_Parent) m_Parent -> InsertCell(this);
|
||||||
m_AlignHor = HTML_ALIGN_LEFT;
|
m_AlignHor = wxHTML_ALIGN_LEFT;
|
||||||
m_AlignVer = HTML_ALIGN_BOTTOM;
|
m_AlignVer = wxHTML_ALIGN_BOTTOM;
|
||||||
m_IndentLeft = m_IndentRight = m_IndentTop = m_IndentBottom = 0;
|
m_IndentLeft = m_IndentRight = m_IndentTop = m_IndentBottom = 0;
|
||||||
m_WidthFloat = 100; m_WidthFloatUnits = HTML_UNITS_PERCENT;
|
m_WidthFloat = 100; m_WidthFloatUnits = wxHTML_UNITS_PERCENT;
|
||||||
m_UseBkColour = FALSE;
|
m_UseBkColour = FALSE;
|
||||||
m_UseBorder = FALSE;
|
m_UseBorder = FALSE;
|
||||||
m_MinHeight = m_MaxLineWidth = 0;
|
m_MinHeight = m_MaxLineWidth = 0;
|
||||||
m_MinHeightAlign = HTML_ALIGN_TOP;
|
m_MinHeightAlign = wxHTML_ALIGN_TOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void wxHtmlContainerCell::SetIndent(int i, int what, int units)
|
void wxHtmlContainerCell::SetIndent(int i, int what, int units)
|
||||||
{
|
{
|
||||||
int val = (units == HTML_UNITS_PIXELS) ? i : -i;
|
int val = (units == wxHTML_UNITS_PIXELS) ? i : -i;
|
||||||
if (what & HTML_INDENT_LEFT) m_IndentLeft = val;
|
if (what & wxHTML_INDENT_LEFT) m_IndentLeft = val;
|
||||||
if (what & HTML_INDENT_RIGHT) m_IndentRight = val;
|
if (what & wxHTML_INDENT_RIGHT) m_IndentRight = val;
|
||||||
if (what & HTML_INDENT_TOP) m_IndentTop = val;
|
if (what & wxHTML_INDENT_TOP) m_IndentTop = val;
|
||||||
if (what & HTML_INDENT_BOTTOM) m_IndentBottom = val;
|
if (what & wxHTML_INDENT_BOTTOM) m_IndentBottom = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int wxHtmlContainerCell::GetIndent(int ind) const
|
int wxHtmlContainerCell::GetIndent(int ind) const
|
||||||
{
|
{
|
||||||
if (ind & HTML_INDENT_LEFT) return m_IndentLeft;
|
if (ind & wxHTML_INDENT_LEFT) return m_IndentLeft;
|
||||||
else if (ind & HTML_INDENT_RIGHT) return m_IndentRight;
|
else if (ind & wxHTML_INDENT_RIGHT) return m_IndentRight;
|
||||||
else if (ind & HTML_INDENT_TOP) return m_IndentTop;
|
else if (ind & wxHTML_INDENT_TOP) return m_IndentTop;
|
||||||
else if (ind & HTML_INDENT_BOTTOM) return m_IndentBottom;
|
else if (ind & wxHTML_INDENT_BOTTOM) return m_IndentBottom;
|
||||||
else return -1; /* BUG! Should not be called... */
|
else return -1; /* BUG! Should not be called... */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,12 +139,12 @@ int wxHtmlContainerCell::GetIndent(int ind) const
|
|||||||
int wxHtmlContainerCell::GetIndentUnits(int ind) const
|
int wxHtmlContainerCell::GetIndentUnits(int ind) const
|
||||||
{
|
{
|
||||||
bool p = FALSE;
|
bool p = FALSE;
|
||||||
if (ind & HTML_INDENT_LEFT) p = m_IndentLeft < 0;
|
if (ind & wxHTML_INDENT_LEFT) p = m_IndentLeft < 0;
|
||||||
else if (ind & HTML_INDENT_RIGHT) p = m_IndentRight < 0;
|
else if (ind & wxHTML_INDENT_RIGHT) p = m_IndentRight < 0;
|
||||||
else if (ind & HTML_INDENT_TOP) p = m_IndentTop < 0;
|
else if (ind & wxHTML_INDENT_TOP) p = m_IndentTop < 0;
|
||||||
else if (ind & HTML_INDENT_BOTTOM) p = m_IndentBottom < 0;
|
else if (ind & wxHTML_INDENT_BOTTOM) p = m_IndentBottom < 0;
|
||||||
if (p) return HTML_UNITS_PERCENT;
|
if (p) return wxHTML_UNITS_PERCENT;
|
||||||
else return HTML_UNITS_PIXELS;
|
else return wxHTML_UNITS_PIXELS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ void wxHtmlContainerCell::Layout(int w)
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (m_WidthFloatUnits == HTML_UNITS_PERCENT) {
|
if (m_WidthFloatUnits == wxHTML_UNITS_PERCENT) {
|
||||||
if (m_WidthFloat < 0) m_Width = (100 + m_WidthFloat) * w / 100;
|
if (m_WidthFloat < 0) m_Width = (100 + m_WidthFloat) * w / 100;
|
||||||
else m_Width = m_WidthFloat * w / 100;
|
else m_Width = m_WidthFloat * w / 100;
|
||||||
}
|
}
|
||||||
@@ -214,9 +214,9 @@ void wxHtmlContainerCell::Layout(int w)
|
|||||||
// my own layouting:
|
// my own layouting:
|
||||||
while (cell != NULL) {
|
while (cell != NULL) {
|
||||||
switch (m_AlignVer) {
|
switch (m_AlignVer) {
|
||||||
case HTML_ALIGN_TOP : ybasicpos = 0; break;
|
case wxHTML_ALIGN_TOP : ybasicpos = 0; break;
|
||||||
case HTML_ALIGN_BOTTOM : ybasicpos = - cell -> GetHeight(); break;
|
case wxHTML_ALIGN_BOTTOM : ybasicpos = - cell -> GetHeight(); break;
|
||||||
case HTML_ALIGN_CENTER : ybasicpos = - cell -> GetHeight() / 2; break;
|
case wxHTML_ALIGN_CENTER : ybasicpos = - cell -> GetHeight() / 2; break;
|
||||||
}
|
}
|
||||||
ydiff = cell -> GetHeight() + ybasicpos;
|
ydiff = cell -> GetHeight() + ybasicpos;
|
||||||
|
|
||||||
@@ -233,9 +233,9 @@ void wxHtmlContainerCell::Layout(int w)
|
|||||||
if (ysizeup < 0) ysizeup = 0;
|
if (ysizeup < 0) ysizeup = 0;
|
||||||
if (ysizedown < 0) ysizedown = 0;
|
if (ysizedown < 0) ysizedown = 0;
|
||||||
switch (m_AlignHor) {
|
switch (m_AlignHor) {
|
||||||
case HTML_ALIGN_LEFT : xdelta = 0; break;
|
case wxHTML_ALIGN_LEFT : xdelta = 0; break;
|
||||||
case HTML_ALIGN_RIGHT : xdelta = 0 + (s_width - xpos); break;
|
case wxHTML_ALIGN_RIGHT : xdelta = 0 + (s_width - xpos); break;
|
||||||
case HTML_ALIGN_CENTER : xdelta = 0 + (s_width - xpos) / 2; break;
|
case wxHTML_ALIGN_CENTER : xdelta = 0 + (s_width - xpos) / 2; break;
|
||||||
}
|
}
|
||||||
if (xdelta < 0) xdelta = 0;
|
if (xdelta < 0) xdelta = 0;
|
||||||
xdelta += s_indent;
|
xdelta += s_indent;
|
||||||
@@ -257,9 +257,9 @@ void wxHtmlContainerCell::Layout(int w)
|
|||||||
m_Height = ypos + (ysizedown + ysizeup) + m_IndentBottom;
|
m_Height = ypos + (ysizedown + ysizeup) + m_IndentBottom;
|
||||||
|
|
||||||
if (m_Height < m_MinHeight) {
|
if (m_Height < m_MinHeight) {
|
||||||
if (m_MinHeightAlign != HTML_ALIGN_TOP) {
|
if (m_MinHeightAlign != wxHTML_ALIGN_TOP) {
|
||||||
int diff = m_MinHeight - m_Height;
|
int diff = m_MinHeight - m_Height;
|
||||||
if (m_MinHeightAlign == HTML_ALIGN_CENTER) diff /= 2;
|
if (m_MinHeightAlign == wxHTML_ALIGN_CENTER) diff /= 2;
|
||||||
cell = m_Cells;
|
cell = m_Cells;
|
||||||
while (cell) {
|
while (cell) {
|
||||||
cell -> SetPos(cell -> GetPosX(), cell -> GetPosY() + diff);
|
cell -> SetPos(cell -> GetPosX(), cell -> GetPosY() + diff);
|
||||||
@@ -363,11 +363,11 @@ void wxHtmlContainerCell::SetAlign(const wxHtmlTag& tag)
|
|||||||
wxString alg = tag.GetParam("ALIGN");
|
wxString alg = tag.GetParam("ALIGN");
|
||||||
alg.MakeUpper();
|
alg.MakeUpper();
|
||||||
if (alg == "CENTER")
|
if (alg == "CENTER")
|
||||||
SetAlignHor(HTML_ALIGN_CENTER);
|
SetAlignHor(wxHTML_ALIGN_CENTER);
|
||||||
else if (alg == "LEFT")
|
else if (alg == "LEFT")
|
||||||
SetAlignHor(HTML_ALIGN_LEFT);
|
SetAlignHor(wxHTML_ALIGN_LEFT);
|
||||||
else if (alg == "RIGHT")
|
else if (alg == "RIGHT")
|
||||||
SetAlignHor(HTML_ALIGN_RIGHT);
|
SetAlignHor(wxHTML_ALIGN_RIGHT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,11 +381,11 @@ void wxHtmlContainerCell::SetWidthFloat(const wxHtmlTag& tag)
|
|||||||
|
|
||||||
if (wd[wd.Length()-1] == '%') {
|
if (wd[wd.Length()-1] == '%') {
|
||||||
sscanf(wd.c_str(), "%i%%", &wdi);
|
sscanf(wd.c_str(), "%i%%", &wdi);
|
||||||
SetWidthFloat(wdi, HTML_UNITS_PERCENT);
|
SetWidthFloat(wdi, wxHTML_UNITS_PERCENT);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sscanf(wd.c_str(), "%i", &wdi);
|
sscanf(wd.c_str(), "%i", &wdi);
|
||||||
SetWidthFloat(wdi, HTML_UNITS_PIXELS);
|
SetWidthFloat(wdi, wxHTML_UNITS_PIXELS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -433,9 +433,9 @@ void wxHtmlContainerCell::OnMouseClick(wxWindow *parent, int x, int y, bool left
|
|||||||
|
|
||||||
void wxHtmlColourCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2)
|
void wxHtmlColourCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2)
|
||||||
{
|
{
|
||||||
if (m_Flags & HTML_CLR_FOREGROUND)
|
if (m_Flags & wxHTML_CLR_FOREGROUND)
|
||||||
dc.SetTextForeground(m_Colour);
|
dc.SetTextForeground(m_Colour);
|
||||||
if (m_Flags & HTML_CLR_BACKGROUND) {
|
if (m_Flags & wxHTML_CLR_BACKGROUND) {
|
||||||
dc.SetBackground(wxBrush(m_Colour, wxSOLID));
|
dc.SetBackground(wxBrush(m_Colour, wxSOLID));
|
||||||
dc.SetTextBackground(m_Colour);
|
dc.SetTextBackground(m_Colour);
|
||||||
}
|
}
|
||||||
@@ -444,9 +444,9 @@ void wxHtmlColourCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2)
|
|||||||
|
|
||||||
void wxHtmlColourCell::DrawInvisible(wxDC& dc, int x, int y)
|
void wxHtmlColourCell::DrawInvisible(wxDC& dc, int x, int y)
|
||||||
{
|
{
|
||||||
if (m_Flags & HTML_CLR_FOREGROUND)
|
if (m_Flags & wxHTML_CLR_FOREGROUND)
|
||||||
dc.SetTextForeground(m_Colour);
|
dc.SetTextForeground(m_Colour);
|
||||||
if (m_Flags & HTML_CLR_BACKGROUND) {
|
if (m_Flags & wxHTML_CLR_BACKGROUND) {
|
||||||
dc.SetBackground(wxBrush(m_Colour, wxSOLID));
|
dc.SetBackground(wxBrush(m_Colour, wxSOLID));
|
||||||
dc.SetTextBackground(m_Colour);
|
dc.SetTextBackground(m_Colour);
|
||||||
}
|
}
|
||||||
@@ -505,7 +505,7 @@ void wxHtmlWidgetCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
((wxScrolledWindow*)(m_Wnd -> GetParent())) -> ViewStart(&stx, &sty);
|
((wxScrolledWindow*)(m_Wnd -> GetParent())) -> ViewStart(&stx, &sty);
|
||||||
m_Wnd -> SetSize(absx - HTML_SCROLL_STEP * stx, absy - HTML_SCROLL_STEP * sty, m_Width, m_Height);
|
m_Wnd -> SetSize(absx - wxHTML_SCROLL_STEP * stx, absy - wxHTML_SCROLL_STEP * sty, m_Width, m_Height);
|
||||||
|
|
||||||
wxHtmlCell::Draw(dc, x, y, view_y1, view_y2);
|
wxHtmlCell::Draw(dc, x, y, view_y1, view_y2);
|
||||||
}
|
}
|
||||||
@@ -524,7 +524,7 @@ void wxHtmlWidgetCell::DrawInvisible(wxDC& dc, int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
((wxScrolledWindow*)(m_Wnd -> GetParent())) -> ViewStart(&stx, &sty);
|
((wxScrolledWindow*)(m_Wnd -> GetParent())) -> ViewStart(&stx, &sty);
|
||||||
m_Wnd -> SetSize(absx - HTML_SCROLL_STEP * stx, absy - HTML_SCROLL_STEP * sty, m_Width, m_Height);
|
m_Wnd -> SetSize(absx - wxHTML_SCROLL_STEP * stx, absy - wxHTML_SCROLL_STEP * sty, m_Width, m_Height);
|
||||||
|
|
||||||
wxHtmlCell::DrawInvisible(dc, x, y);
|
wxHtmlCell::DrawInvisible(dc, x, y);
|
||||||
}
|
}
|
||||||
|
@@ -69,11 +69,11 @@ void wxHtmlParser::DoneParser()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define HTML_MAX_BUFLEN 1024
|
#define wxHTML_MAX_BUFLEN 1024
|
||||||
|
|
||||||
void wxHtmlParser::DoParsing(int begin_pos, int end_pos)
|
void wxHtmlParser::DoParsing(int begin_pos, int end_pos)
|
||||||
{
|
{
|
||||||
char temp[HTML_BUFLEN], c;
|
char temp[wxHTML_BUFLEN], c;
|
||||||
int i;
|
int i;
|
||||||
int templen;
|
int templen;
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ void wxHtmlParser::DoParsing(int begin_pos, int end_pos)
|
|||||||
// continue building word:
|
// continue building word:
|
||||||
if (c != '<') {
|
if (c != '<') {
|
||||||
temp[templen++] = c;
|
temp[templen++] = c;
|
||||||
if (templen == HTML_BUFLEN-1) {
|
if (templen == wxHTML_BUFLEN-1) {
|
||||||
temp[templen] = 0;
|
temp[templen] = 0;
|
||||||
AddText(temp);
|
AddText(temp);
|
||||||
templen = 0;
|
templen = 0;
|
||||||
|
@@ -116,8 +116,8 @@ bool wxHtmlWindow::SetPage(const wxString& source)
|
|||||||
}
|
}
|
||||||
m_Cell = (wxHtmlContainerCell*) m_Parser -> Parse(source);
|
m_Cell = (wxHtmlContainerCell*) m_Parser -> Parse(source);
|
||||||
delete dc;
|
delete dc;
|
||||||
m_Cell -> SetIndent(m_Borders, HTML_INDENT_ALL, HTML_UNITS_PIXELS);
|
m_Cell -> SetIndent(m_Borders, wxHTML_INDENT_ALL, wxHTML_UNITS_PIXELS);
|
||||||
m_Cell -> SetAlignHor(HTML_ALIGN_CENTER);
|
m_Cell -> SetAlignHor(wxHTML_ALIGN_CENTER);
|
||||||
CreateLayout();
|
CreateLayout();
|
||||||
Refresh();
|
Refresh();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -218,13 +218,13 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
|
|||||||
|
|
||||||
bool wxHtmlWindow::ScrollToAnchor(const wxString& anchor)
|
bool wxHtmlWindow::ScrollToAnchor(const wxString& anchor)
|
||||||
{
|
{
|
||||||
const wxHtmlCell *c = m_Cell -> Find(HTML_COND_ISANCHOR, &anchor);
|
const wxHtmlCell *c = m_Cell -> Find(wxHTML_COND_ISANCHOR, &anchor);
|
||||||
if (!c) return FALSE;
|
if (!c) return FALSE;
|
||||||
else {
|
else {
|
||||||
int y;
|
int y;
|
||||||
|
|
||||||
for (y = 0; c != NULL; c = c -> GetParent()) y += c -> GetPosY();
|
for (y = 0; c != NULL; c = c -> GetParent()) y += c -> GetPosY();
|
||||||
Scroll(-1, y / HTML_SCROLL_STEP);
|
Scroll(-1, y / wxHTML_SCROLL_STEP);
|
||||||
m_OpenedAnchor = anchor;
|
m_OpenedAnchor = anchor;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -265,9 +265,9 @@ void wxHtmlWindow::CreateLayout()
|
|||||||
GetClientSize(&ClientWidth, &ClientHeight);
|
GetClientSize(&ClientWidth, &ClientHeight);
|
||||||
m_Cell -> Layout(ClientWidth);
|
m_Cell -> Layout(ClientWidth);
|
||||||
if (ClientHeight < m_Cell -> GetHeight()) {
|
if (ClientHeight < m_Cell -> GetHeight()) {
|
||||||
SetScrollbars(HTML_SCROLL_STEP, HTML_SCROLL_STEP,
|
SetScrollbars(wxHTML_SCROLL_STEP, wxHTML_SCROLL_STEP,
|
||||||
m_Cell -> GetWidth() / HTML_SCROLL_STEP,
|
m_Cell -> GetWidth() / wxHTML_SCROLL_STEP,
|
||||||
m_Cell -> GetHeight() / HTML_SCROLL_STEP
|
m_Cell -> GetHeight() / wxHTML_SCROLL_STEP
|
||||||
/*cheat: top-level frag is always container*/);
|
/*cheat: top-level frag is always container*/);
|
||||||
}
|
}
|
||||||
else { /* we fit into window, no need for scrollbars */
|
else { /* we fit into window, no need for scrollbars */
|
||||||
@@ -430,7 +430,7 @@ void wxHtmlWindow::OnDraw(wxDC& dc)
|
|||||||
while (upd) {
|
while (upd) {
|
||||||
v_y = upd.GetY();
|
v_y = upd.GetY();
|
||||||
v_h = upd.GetH();
|
v_h = upd.GetH();
|
||||||
if (m_Cell) m_Cell -> Draw(dc, 0, 0, y * HTML_SCROLL_STEP + v_y, y * HTML_SCROLL_STEP + v_h + v_y);
|
if (m_Cell) m_Cell -> Draw(dc, 0, 0, y * wxHTML_SCROLL_STEP + v_y, y * wxHTML_SCROLL_STEP + v_h + v_y);
|
||||||
upd++;
|
upd++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -452,8 +452,8 @@ void wxHtmlWindow::OnKeyDown(wxKeyEvent& event)
|
|||||||
int sty, szy, cliy;
|
int sty, szy, cliy;
|
||||||
|
|
||||||
ViewStart(&dummy, &sty);
|
ViewStart(&dummy, &sty);
|
||||||
GetClientSize(&dummy, &cliy); cliy /= HTML_SCROLL_STEP;
|
GetClientSize(&dummy, &cliy); cliy /= wxHTML_SCROLL_STEP;
|
||||||
GetVirtualSize(&dummy, &szy); szy /= HTML_SCROLL_STEP;
|
GetVirtualSize(&dummy, &szy); szy /= wxHTML_SCROLL_STEP;
|
||||||
|
|
||||||
switch (event.KeyCode()) {
|
switch (event.KeyCode()) {
|
||||||
case WXK_PAGEUP :
|
case WXK_PAGEUP :
|
||||||
@@ -490,7 +490,7 @@ void wxHtmlWindow::OnMouseEvent(wxMouseEvent& event)
|
|||||||
wxPoint pos;
|
wxPoint pos;
|
||||||
wxString lnk;
|
wxString lnk;
|
||||||
|
|
||||||
ViewStart(&sx, &sy); sx *= HTML_SCROLL_STEP; sy *= HTML_SCROLL_STEP;
|
ViewStart(&sx, &sy); sx *= wxHTML_SCROLL_STEP; sy *= wxHTML_SCROLL_STEP;
|
||||||
pos = event.GetPosition();
|
pos = event.GetPosition();
|
||||||
|
|
||||||
if (m_Cell)
|
if (m_Cell)
|
||||||
@@ -509,7 +509,7 @@ void wxHtmlWindow::OnIdle(wxIdleEvent& event)
|
|||||||
int x, y;
|
int x, y;
|
||||||
wxString lnk;
|
wxString lnk;
|
||||||
|
|
||||||
ViewStart(&sx, &sy); sx *= HTML_SCROLL_STEP; sy *= HTML_SCROLL_STEP;
|
ViewStart(&sx, &sy); sx *= wxHTML_SCROLL_STEP; sy *= wxHTML_SCROLL_STEP;
|
||||||
wxGetMousePosition(&x, &y);
|
wxGetMousePosition(&x, &y);
|
||||||
ScreenToClient(&x, &y);
|
ScreenToClient(&x, &y);
|
||||||
lnk = m_Cell -> GetLink(sx + x, sy + y);
|
lnk = m_Cell -> GetLink(sx + x, sy + y);
|
||||||
|
@@ -96,7 +96,7 @@ void wxHtmlDCRenderer::SetHtmlText(const wxString& html, const wxString& basepat
|
|||||||
m_FS -> ChangePathTo(basepath, isdir);
|
m_FS -> ChangePathTo(basepath, isdir);
|
||||||
m_DC -> SetUserScale(1.0, 1.0);
|
m_DC -> SetUserScale(1.0, 1.0);
|
||||||
m_Cells = (wxHtmlContainerCell*) m_Parser -> Parse(html);
|
m_Cells = (wxHtmlContainerCell*) m_Parser -> Parse(html);
|
||||||
m_Cells -> SetIndent(0, HTML_INDENT_ALL, HTML_UNITS_PIXELS);
|
m_Cells -> SetIndent(0, wxHTML_INDENT_ALL, wxHTML_UNITS_PIXELS);
|
||||||
m_Cells -> Layout(m_Width);
|
m_Cells -> Layout(m_Width);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ wxHtmlPrintout::wxHtmlPrintout(const wxString& title) : wxPrintout(title)
|
|||||||
{
|
{
|
||||||
m_Renderer = new wxHtmlDCRenderer;
|
m_Renderer = new wxHtmlDCRenderer;
|
||||||
m_RendererHdr = new wxHtmlDCRenderer;
|
m_RendererHdr = new wxHtmlDCRenderer;
|
||||||
m_NumPages = HTML_PRINT_MAX_PAGES;
|
m_NumPages = wxHTML_PRINT_MAX_PAGES;
|
||||||
m_Document = m_BasePath = wxEmptyString; m_BasePathIsDir = TRUE;
|
m_Document = m_BasePath = wxEmptyString; m_BasePathIsDir = TRUE;
|
||||||
m_Headers[0] = m_Headers[1] = wxEmptyString;
|
m_Headers[0] = m_Headers[1] = wxEmptyString;
|
||||||
m_Footers[0] = m_Footers[1] = wxEmptyString;
|
m_Footers[0] = m_Footers[1] = wxEmptyString;
|
||||||
@@ -181,12 +181,12 @@ wxHtmlPrintout::~wxHtmlPrintout()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool wxHtmlPrintout::OnBeginDocument(int start, int end)
|
void wxHtmlPrintout::OnBeginPrinting()
|
||||||
{
|
{
|
||||||
int pageWidth, pageHeight, mm_w, mm_h;
|
int pageWidth, pageHeight, mm_w, mm_h;
|
||||||
float ppmm_h, ppmm_v;
|
float ppmm_h, ppmm_v;
|
||||||
|
|
||||||
if (!wxPrintout::OnBeginDocument(start, end)) return FALSE;
|
wxPrintout::OnBeginPrinting();
|
||||||
|
|
||||||
GetPageSizePixels(&pageWidth, &pageHeight);
|
GetPageSizePixels(&pageWidth, &pageHeight);
|
||||||
GetPageSizeMM(&mm_w, &mm_h);
|
GetPageSizeMM(&mm_w, &mm_h);
|
||||||
@@ -225,8 +225,6 @@ bool wxHtmlPrintout::OnBeginDocument(int start, int end)
|
|||||||
);
|
);
|
||||||
m_Renderer -> SetHtmlText(m_Document, m_BasePath, m_BasePathIsDir);
|
m_Renderer -> SetHtmlText(m_Document, m_BasePath, m_BasePathIsDir);
|
||||||
CountPages();
|
CountPages();
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -245,9 +243,9 @@ bool wxHtmlPrintout::OnPrintPage(int page)
|
|||||||
void wxHtmlPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo)
|
void wxHtmlPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo)
|
||||||
{
|
{
|
||||||
*minPage = 1;
|
*minPage = 1;
|
||||||
*maxPage = HTML_PRINT_MAX_PAGES;
|
*maxPage = wxHTML_PRINT_MAX_PAGES;
|
||||||
*selPageFrom = 1;
|
*selPageFrom = 1;
|
||||||
*selPageTo = 1;
|
*selPageTo = wxHTML_PRINT_MAX_PAGES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -480,7 +478,7 @@ void wxHtmlEasyPrinting::DoPreview(wxHtmlPrintout *printout1, wxHtmlPrintout *pr
|
|||||||
else {
|
else {
|
||||||
wxPreviewFrame *frame = new wxPreviewFrame(preview, m_Frame,
|
wxPreviewFrame *frame = new wxPreviewFrame(preview, m_Frame,
|
||||||
m_Name + _(" Preview"),
|
m_Name + _(" Preview"),
|
||||||
wxPoint(100, 100), wxSize(500, 500));
|
wxPoint(100, 100), wxSize(650, 500));
|
||||||
frame -> Centre(wxBOTH);
|
frame -> Centre(wxBOTH);
|
||||||
frame -> Initialize();
|
frame -> Initialize();
|
||||||
frame -> Show(TRUE);
|
frame -> Show(TRUE);
|
||||||
|
@@ -154,7 +154,7 @@ TAG_HANDLER_BEGIN(Hx, "H1,H2,H3,H4,H5,H6")
|
|||||||
|
|
||||||
c -> SetAlign(tag);
|
c -> SetAlign(tag);
|
||||||
c -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont()));
|
c -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont()));
|
||||||
c -> SetIndent(m_WParser -> GetCharHeight(), HTML_INDENT_TOP);
|
c -> SetIndent(m_WParser -> GetCharHeight(), wxHTML_INDENT_TOP);
|
||||||
m_WParser -> SetAlign(c -> GetAlignHor());
|
m_WParser -> SetAlign(c -> GetAlignHor());
|
||||||
|
|
||||||
ParseInner(tag);
|
ParseInner(tag);
|
||||||
@@ -170,7 +170,7 @@ TAG_HANDLER_BEGIN(Hx, "H1,H2,H3,H4,H5,H6")
|
|||||||
m_WParser -> CloseContainer();
|
m_WParser -> CloseContainer();
|
||||||
m_WParser -> OpenContainer();
|
m_WParser -> OpenContainer();
|
||||||
c = m_WParser -> GetContainer();
|
c = m_WParser -> GetContainer();
|
||||||
c -> SetIndent(m_WParser -> GetCharHeight(), HTML_INDENT_TOP);
|
c -> SetIndent(m_WParser -> GetCharHeight(), wxHTML_INDENT_TOP);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -75,8 +75,8 @@ TAG_HANDLER_BEGIN(HR, "HR")
|
|||||||
m_WParser -> CloseContainer();
|
m_WParser -> CloseContainer();
|
||||||
c = m_WParser -> OpenContainer();
|
c = m_WParser -> OpenContainer();
|
||||||
|
|
||||||
c -> SetIndent(m_WParser -> GetCharHeight(), HTML_INDENT_VERTICAL);
|
c -> SetIndent(m_WParser -> GetCharHeight(), wxHTML_INDENT_VERTICAL);
|
||||||
c -> SetAlignHor(HTML_ALIGN_CENTER);
|
c -> SetAlignHor(wxHTML_ALIGN_CENTER);
|
||||||
c -> SetAlign(tag);
|
c -> SetAlign(tag);
|
||||||
c -> SetWidthFloat(tag);
|
c -> SetWidthFloat(tag);
|
||||||
if (tag.HasParam("SIZE") && tag.ScanParam("SIZE", "%i", &sz) == 1) {}
|
if (tag.HasParam("SIZE") && tag.ScanParam("SIZE", "%i", &sz) == 1) {}
|
||||||
|
@@ -220,7 +220,7 @@ wxString wxHtmlImageMapAreaCell::GetLink( int x, int y ) const
|
|||||||
// wxHtmlImageMapCell
|
// wxHtmlImageMapCell
|
||||||
// 0-width, 0-height cell that represents map from imagemaps
|
// 0-width, 0-height cell that represents map from imagemaps
|
||||||
// it is always placed before wxHtmlImageMapAreaCells
|
// it is always placed before wxHtmlImageMapAreaCells
|
||||||
// It responds to Find(HTML_COND_ISIMAGEMAP)
|
// It responds to Find(wxHTML_COND_ISIMAGEMAP)
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@@ -251,7 +251,7 @@ wxString wxHtmlImageMapCell::GetLink( int x, int y ) const
|
|||||||
|
|
||||||
const wxHtmlCell *wxHtmlImageMapCell::Find( int cond, const void *param ) const
|
const wxHtmlCell *wxHtmlImageMapCell::Find( int cond, const void *param ) const
|
||||||
{
|
{
|
||||||
if (cond == HTML_COND_ISIMAGEMAP)
|
if (cond == wxHTML_COND_ISIMAGEMAP)
|
||||||
{
|
{
|
||||||
if (m_Name == *((wxString*)(param)))
|
if (m_Name == *((wxString*)(param)))
|
||||||
return this;
|
return this;
|
||||||
@@ -275,7 +275,7 @@ class wxHtmlImageCell : public wxHtmlCell
|
|||||||
wxHtmlImageMapCell *m_ImageMap;
|
wxHtmlImageMapCell *m_ImageMap;
|
||||||
wxString m_MapName;
|
wxString m_MapName;
|
||||||
|
|
||||||
wxHtmlImageCell(wxFSFile *input, int w = -1, int h = -1, int align = HTML_ALIGN_BOTTOM, wxString mapname = wxEmptyString);
|
wxHtmlImageCell(wxFSFile *input, int w = -1, int h = -1, int align = wxHTML_ALIGN_BOTTOM, wxString mapname = wxEmptyString);
|
||||||
~wxHtmlImageCell() {if (m_Image) delete m_Image;}
|
~wxHtmlImageCell() {if (m_Image) delete m_Image;}
|
||||||
void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
|
void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
|
||||||
virtual wxString GetLink( int x = 0, int y = 0 ) const;
|
virtual wxString GetLink( int x = 0, int y = 0 ) const;
|
||||||
@@ -311,11 +311,11 @@ wxHtmlImageCell::wxHtmlImageCell(wxFSFile *input, int w, int h, int align, wxStr
|
|||||||
delete img;
|
delete img;
|
||||||
}
|
}
|
||||||
switch (align) {
|
switch (align) {
|
||||||
case HTML_ALIGN_TOP :
|
case wxHTML_ALIGN_TOP :
|
||||||
m_Descent = m_Height; break;
|
m_Descent = m_Height; break;
|
||||||
case HTML_ALIGN_CENTER :
|
case wxHTML_ALIGN_CENTER :
|
||||||
m_Descent = m_Height / 2; break;
|
m_Descent = m_Height / 2; break;
|
||||||
case HTML_ALIGN_BOTTOM : default :
|
case wxHTML_ALIGN_BOTTOM : default :
|
||||||
m_Descent = 0; break;
|
m_Descent = 0; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,7 +347,7 @@ wxString wxHtmlImageCell::GetLink( int x, int y ) const
|
|||||||
p = p->GetParent();
|
p = p->GetParent();
|
||||||
}
|
}
|
||||||
p = op;
|
p = op;
|
||||||
wxHtmlCell *cell = (wxHtmlCell*)p->Find( HTML_COND_ISIMAGEMAP, (const void*)(&m_MapName));
|
wxHtmlCell *cell = (wxHtmlCell*)p->Find( wxHTML_COND_ISIMAGEMAP, (const void*)(&m_MapName));
|
||||||
if (!cell)
|
if (!cell)
|
||||||
{
|
{
|
||||||
((wxString&)m_MapName).Clear();
|
((wxString&)m_MapName).Clear();
|
||||||
@@ -384,12 +384,12 @@ TAG_HANDLER_BEGIN(IMG, "IMG, MAP, AREA")
|
|||||||
str = m_WParser -> GetFS() -> OpenFile(tmp);
|
str = m_WParser -> GetFS() -> OpenFile(tmp);
|
||||||
if (tag.HasParam("WIDTH")) tag.ScanParam("WIDTH", "%i", &w);
|
if (tag.HasParam("WIDTH")) tag.ScanParam("WIDTH", "%i", &w);
|
||||||
if (tag.HasParam("HEIGHT")) tag.ScanParam("HEIGHT", "%i", &h);
|
if (tag.HasParam("HEIGHT")) tag.ScanParam("HEIGHT", "%i", &h);
|
||||||
al = HTML_ALIGN_BOTTOM;
|
al = wxHTML_ALIGN_BOTTOM;
|
||||||
if (tag.HasParam("ALIGN")) {
|
if (tag.HasParam("ALIGN")) {
|
||||||
wxString alstr = tag.GetParam("ALIGN");
|
wxString alstr = tag.GetParam("ALIGN");
|
||||||
alstr.MakeUpper(); // for the case alignment was in ".."
|
alstr.MakeUpper(); // for the case alignment was in ".."
|
||||||
if (alstr == "TEXTTOP") al = HTML_ALIGN_TOP;
|
if (alstr == "TEXTTOP") al = wxHTML_ALIGN_TOP;
|
||||||
else if ((alstr == "CENTER") || (alstr == "ABSCENTER")) al = HTML_ALIGN_CENTER;
|
else if ((alstr == "CENTER") || (alstr == "ABSCENTER")) al = wxHTML_ALIGN_CENTER;
|
||||||
}
|
}
|
||||||
if (tag.HasParam("USEMAP"))
|
if (tag.HasParam("USEMAP"))
|
||||||
{
|
{
|
||||||
|
@@ -38,7 +38,7 @@ TAG_HANDLER_BEGIN(P, "P")
|
|||||||
m_WParser -> CloseContainer();
|
m_WParser -> CloseContainer();
|
||||||
m_WParser -> OpenContainer();
|
m_WParser -> OpenContainer();
|
||||||
}
|
}
|
||||||
m_WParser -> GetContainer() -> SetIndent(m_WParser -> GetCharHeight(), HTML_INDENT_TOP);
|
m_WParser -> GetContainer() -> SetIndent(m_WParser -> GetCharHeight(), wxHTML_INDENT_TOP);
|
||||||
m_WParser -> GetContainer() -> SetAlign(tag);
|
m_WParser -> GetContainer() -> SetAlign(tag);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -72,13 +72,13 @@ TAG_HANDLER_BEGIN(CENTER, "CENTER")
|
|||||||
int old = m_WParser -> GetAlign();
|
int old = m_WParser -> GetAlign();
|
||||||
wxHtmlContainerCell *c = m_WParser -> GetContainer();
|
wxHtmlContainerCell *c = m_WParser -> GetContainer();
|
||||||
|
|
||||||
m_WParser -> SetAlign(HTML_ALIGN_CENTER);
|
m_WParser -> SetAlign(wxHTML_ALIGN_CENTER);
|
||||||
if (c -> GetFirstCell() != NULL) {
|
if (c -> GetFirstCell() != NULL) {
|
||||||
m_WParser -> CloseContainer();
|
m_WParser -> CloseContainer();
|
||||||
m_WParser -> OpenContainer();
|
m_WParser -> OpenContainer();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
c -> SetAlignHor(HTML_ALIGN_CENTER);
|
c -> SetAlignHor(wxHTML_ALIGN_CENTER);
|
||||||
|
|
||||||
if (tag.HasEnding()) {
|
if (tag.HasEnding()) {
|
||||||
ParseInner(tag);
|
ParseInner(tag);
|
||||||
@@ -183,7 +183,7 @@ TAG_HANDLER_BEGIN(BODY, "BODY")
|
|||||||
if (tag.HasParam("BGCOLOR")) {
|
if (tag.HasParam("BGCOLOR")) {
|
||||||
if (tag.ScanParam("BGCOLOR", "#%lX", &tmp) == 1) {
|
if (tag.ScanParam("BGCOLOR", "#%lX", &tmp) == 1) {
|
||||||
clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF));
|
clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF));
|
||||||
m_WParser -> GetContainer() -> InsertCell(new wxHtmlColourCell(clr, HTML_CLR_BACKGROUND));
|
m_WParser -> GetContainer() -> InsertCell(new wxHtmlColourCell(clr, wxHTML_CLR_BACKGROUND));
|
||||||
if (m_WParser -> GetWindow() != NULL)
|
if (m_WParser -> GetWindow() != NULL)
|
||||||
m_WParser -> GetWindow() -> SetBackgroundColour(clr);
|
m_WParser -> GetWindow() -> SetBackgroundColour(clr);
|
||||||
}
|
}
|
||||||
@@ -203,15 +203,15 @@ TAG_HANDLER_BEGIN(BLOCKQUOTE, "BLOCKQUOTE")
|
|||||||
|
|
||||||
m_WParser -> CloseContainer();
|
m_WParser -> CloseContainer();
|
||||||
c = m_WParser -> OpenContainer();
|
c = m_WParser -> OpenContainer();
|
||||||
if (c -> GetAlignHor() == HTML_ALIGN_RIGHT)
|
if (c -> GetAlignHor() == wxHTML_ALIGN_RIGHT)
|
||||||
c -> SetIndent(5 * m_WParser -> GetCharWidth(), HTML_INDENT_RIGHT);
|
c -> SetIndent(5 * m_WParser -> GetCharWidth(), wxHTML_INDENT_RIGHT);
|
||||||
else
|
else
|
||||||
c -> SetIndent(5 * m_WParser -> GetCharWidth(), HTML_INDENT_LEFT);
|
c -> SetIndent(5 * m_WParser -> GetCharWidth(), wxHTML_INDENT_LEFT);
|
||||||
c -> SetIndent(m_WParser -> GetCharHeight(), HTML_INDENT_TOP);
|
c -> SetIndent(m_WParser -> GetCharHeight(), wxHTML_INDENT_TOP);
|
||||||
m_WParser -> OpenContainer();
|
m_WParser -> OpenContainer();
|
||||||
ParseInner(tag);
|
ParseInner(tag);
|
||||||
c = m_WParser -> CloseContainer();
|
c = m_WParser -> CloseContainer();
|
||||||
c -> SetIndent(m_WParser -> GetCharHeight(), HTML_INDENT_BOTTOM);
|
c -> SetIndent(m_WParser -> GetCharHeight(), wxHTML_INDENT_BOTTOM);
|
||||||
m_WParser -> CloseContainer();
|
m_WParser -> CloseContainer();
|
||||||
m_WParser -> OpenContainer();
|
m_WParser -> OpenContainer();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@@ -40,7 +40,7 @@ class wxHtmlAnchorCell : public wxHtmlCell
|
|||||||
wxHtmlAnchorCell(const wxString& name) : wxHtmlCell() {m_AnchorName = name;}
|
wxHtmlAnchorCell(const wxString& name) : wxHtmlCell() {m_AnchorName = name;}
|
||||||
virtual const wxHtmlCell* Find(int condition, const void* param) const
|
virtual const wxHtmlCell* Find(int condition, const void* param) const
|
||||||
{
|
{
|
||||||
if ((condition == HTML_COND_ISANCHOR) && (m_AnchorName == (*((const wxString*)param))))
|
if ((condition == wxHTML_COND_ISANCHOR) && (m_AnchorName == (*((const wxString*)param))))
|
||||||
return this;
|
return this;
|
||||||
else
|
else
|
||||||
return wxHtmlCell::Find(condition, param);
|
return wxHtmlCell::Find(condition, param);
|
||||||
|
@@ -92,8 +92,8 @@ TAG_HANDLER_BEGIN(OLULLI, "OL,UL,LI")
|
|||||||
m_WParser -> CloseContainer();
|
m_WParser -> CloseContainer();
|
||||||
|
|
||||||
c = m_WParser -> OpenContainer();
|
c = m_WParser -> OpenContainer();
|
||||||
c -> SetWidthFloat(2 * m_WParser -> GetCharWidth(), HTML_UNITS_PIXELS);
|
c -> SetWidthFloat(2 * m_WParser -> GetCharWidth(), wxHTML_UNITS_PIXELS);
|
||||||
c -> SetAlignHor(HTML_ALIGN_RIGHT);
|
c -> SetAlignHor(wxHTML_ALIGN_RIGHT);
|
||||||
if (m_Numbering == 0)
|
if (m_Numbering == 0)
|
||||||
c -> InsertCell(new wxHtmlListmarkCell(m_WParser -> GetDC(), m_WParser -> GetActualColor()));
|
c -> InsertCell(new wxHtmlListmarkCell(m_WParser -> GetDC(), m_WParser -> GetActualColor()));
|
||||||
else {
|
else {
|
||||||
@@ -104,8 +104,8 @@ TAG_HANDLER_BEGIN(OLULLI, "OL,UL,LI")
|
|||||||
m_WParser -> CloseContainer();
|
m_WParser -> CloseContainer();
|
||||||
|
|
||||||
c = m_WParser -> OpenContainer();
|
c = m_WParser -> OpenContainer();
|
||||||
c -> SetIndent(m_WParser -> GetCharWidth() / 4, HTML_INDENT_LEFT);
|
c -> SetIndent(m_WParser -> GetCharWidth() / 4, wxHTML_INDENT_LEFT);
|
||||||
c -> SetWidthFloat(-2 * m_WParser -> GetCharWidth(), HTML_UNITS_PIXELS);
|
c -> SetWidthFloat(-2 * m_WParser -> GetCharWidth(), wxHTML_UNITS_PIXELS);
|
||||||
|
|
||||||
m_WParser -> OpenContainer();
|
m_WParser -> OpenContainer();
|
||||||
|
|
||||||
@@ -127,9 +127,9 @@ TAG_HANDLER_BEGIN(OLULLI, "OL,UL,LI")
|
|||||||
m_WParser -> OpenContainer();
|
m_WParser -> OpenContainer();
|
||||||
c = m_WParser -> GetContainer();
|
c = m_WParser -> GetContainer();
|
||||||
}
|
}
|
||||||
c -> SetAlignHor(HTML_ALIGN_LEFT);
|
c -> SetAlignHor(wxHTML_ALIGN_LEFT);
|
||||||
c -> SetIndent(2 * m_WParser -> GetCharWidth(), HTML_INDENT_LEFT);
|
c -> SetIndent(2 * m_WParser -> GetCharWidth(), wxHTML_INDENT_LEFT);
|
||||||
m_WParser -> OpenContainer() -> SetAlignVer(HTML_ALIGN_TOP);
|
m_WParser -> OpenContainer() -> SetAlignVer(wxHTML_ALIGN_TOP);
|
||||||
|
|
||||||
m_WParser -> OpenContainer();
|
m_WParser -> OpenContainer();
|
||||||
m_WParser -> OpenContainer();
|
m_WParser -> OpenContainer();
|
||||||
|
@@ -124,8 +124,8 @@ TAG_HANDLER_BEGIN(PRE, "PRE")
|
|||||||
|
|
||||||
m_WParser -> CloseContainer();
|
m_WParser -> CloseContainer();
|
||||||
c = m_WParser -> OpenContainer();
|
c = m_WParser -> OpenContainer();
|
||||||
c -> SetAlignHor(HTML_ALIGN_LEFT);
|
c -> SetAlignHor(wxHTML_ALIGN_LEFT);
|
||||||
c -> SetIndent(m_WParser -> GetCharHeight(), HTML_INDENT_VERTICAL);
|
c -> SetIndent(m_WParser -> GetCharHeight(), wxHTML_INDENT_VERTICAL);
|
||||||
|
|
||||||
m_WParser -> SetFontUnderlined(FALSE);
|
m_WParser -> SetFontUnderlined(FALSE);
|
||||||
m_WParser -> SetFontBold(FALSE);
|
m_WParser -> SetFontBold(FALSE);
|
||||||
|
@@ -157,7 +157,7 @@ void wxHtmlTableCell::ReallocCols(int cols)
|
|||||||
m_ColsInfo = (colStruct*) realloc(m_ColsInfo, sizeof(colStruct) * cols);
|
m_ColsInfo = (colStruct*) realloc(m_ColsInfo, sizeof(colStruct) * cols);
|
||||||
for (j = m_NumCols; j < cols; j++) {
|
for (j = m_NumCols; j < cols; j++) {
|
||||||
m_ColsInfo[j].width = 0;
|
m_ColsInfo[j].width = 0;
|
||||||
m_ColsInfo[j].units = HTML_UNITS_PERCENT;
|
m_ColsInfo[j].units = wxHTML_UNITS_PERCENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_NumCols = cols;
|
m_NumCols = cols;
|
||||||
@@ -211,7 +211,7 @@ void wxHtmlTableCell::AddCell(wxHtmlContainerCell *cell, const wxHtmlTag& tag)
|
|||||||
m_CellInfo[r][c].rowspan = 1;
|
m_CellInfo[r][c].rowspan = 1;
|
||||||
m_CellInfo[r][c].flag = cellUsed;
|
m_CellInfo[r][c].flag = cellUsed;
|
||||||
m_CellInfo[r][c].minheight = 0;
|
m_CellInfo[r][c].minheight = 0;
|
||||||
m_CellInfo[r][c].valign = HTML_ALIGN_TOP;
|
m_CellInfo[r][c].valign = wxHTML_ALIGN_TOP;
|
||||||
|
|
||||||
/* scan for parameters: */
|
/* scan for parameters: */
|
||||||
|
|
||||||
@@ -222,11 +222,11 @@ void wxHtmlTableCell::AddCell(wxHtmlContainerCell *cell, const wxHtmlTag& tag)
|
|||||||
|
|
||||||
if (wd[wd.Length()-1] == '%') {
|
if (wd[wd.Length()-1] == '%') {
|
||||||
sscanf(wd.c_str(), "%i%%", &m_ColsInfo[c].width);
|
sscanf(wd.c_str(), "%i%%", &m_ColsInfo[c].width);
|
||||||
m_ColsInfo[c].units = HTML_UNITS_PERCENT;
|
m_ColsInfo[c].units = wxHTML_UNITS_PERCENT;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sscanf(wd.c_str(), "%i", &m_ColsInfo[c].width);
|
sscanf(wd.c_str(), "%i", &m_ColsInfo[c].width);
|
||||||
m_ColsInfo[c].units = HTML_UNITS_PIXELS;
|
m_ColsInfo[c].units = wxHTML_UNITS_PIXELS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -265,12 +265,12 @@ void wxHtmlTableCell::AddCell(wxHtmlContainerCell *cell, const wxHtmlTag& tag)
|
|||||||
wxString valign;
|
wxString valign;
|
||||||
if (tag.HasParam("VALIGN")) valign = tag.GetParam("VALIGN"); else valign = m_tValign;
|
if (tag.HasParam("VALIGN")) valign = tag.GetParam("VALIGN"); else valign = m_tValign;
|
||||||
valign.MakeUpper();
|
valign.MakeUpper();
|
||||||
if (valign == "TOP") m_CellInfo[r][c].valign = HTML_ALIGN_TOP;
|
if (valign == "TOP") m_CellInfo[r][c].valign = wxHTML_ALIGN_TOP;
|
||||||
else if (valign == "BOTTOM") m_CellInfo[r][c].valign = HTML_ALIGN_BOTTOM;
|
else if (valign == "BOTTOM") m_CellInfo[r][c].valign = wxHTML_ALIGN_BOTTOM;
|
||||||
else m_CellInfo[r][c].valign = HTML_ALIGN_CENTER;
|
else m_CellInfo[r][c].valign = wxHTML_ALIGN_CENTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
cell -> SetIndent(m_Padding, HTML_INDENT_ALL, HTML_UNITS_PIXELS);
|
cell -> SetIndent(m_Padding, wxHTML_INDENT_ALL, wxHTML_UNITS_PIXELS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -285,7 +285,7 @@ void wxHtmlTableCell::Layout(int w)
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (m_WidthFloatUnits == HTML_UNITS_PERCENT) {
|
if (m_WidthFloatUnits == wxHTML_UNITS_PERCENT) {
|
||||||
if (m_WidthFloat < 0) m_Width = (100 + m_WidthFloat) * w / 100;
|
if (m_WidthFloat < 0) m_Width = (100 + m_WidthFloat) * w / 100;
|
||||||
else m_Width = m_WidthFloat * w / 100;
|
else m_Width = m_WidthFloat * w / 100;
|
||||||
}
|
}
|
||||||
@@ -309,12 +309,12 @@ void wxHtmlTableCell::Layout(int w)
|
|||||||
|
|
||||||
// 1a. setup fixed-width columns:
|
// 1a. setup fixed-width columns:
|
||||||
for (i = 0; i < m_NumCols; i++)
|
for (i = 0; i < m_NumCols; i++)
|
||||||
if (m_ColsInfo[i].units == HTML_UNITS_PIXELS)
|
if (m_ColsInfo[i].units == wxHTML_UNITS_PIXELS)
|
||||||
wpix -= (m_ColsInfo[i].pixwidth = m_ColsInfo[i].width);
|
wpix -= (m_ColsInfo[i].pixwidth = m_ColsInfo[i].width);
|
||||||
|
|
||||||
// 1b. setup floating-width columns:
|
// 1b. setup floating-width columns:
|
||||||
for (i = 0; i < m_NumCols; i++)
|
for (i = 0; i < m_NumCols; i++)
|
||||||
if ((m_ColsInfo[i].units == HTML_UNITS_PERCENT) && (m_ColsInfo[i].width != 0))
|
if ((m_ColsInfo[i].units == wxHTML_UNITS_PERCENT) && (m_ColsInfo[i].width != 0))
|
||||||
wtemp += (m_ColsInfo[i].pixwidth = m_ColsInfo[i].width * wpix / 100);
|
wtemp += (m_ColsInfo[i].pixwidth = m_ColsInfo[i].width * wpix / 100);
|
||||||
wpix -= wtemp;
|
wpix -= wtemp;
|
||||||
|
|
||||||
@@ -411,7 +411,7 @@ TAG_HANDLER_BEGIN(TABLE, "TABLE,TR,TD,TH")
|
|||||||
{
|
{
|
||||||
m_Table = NULL;
|
m_Table = NULL;
|
||||||
m_tAlign = m_rAlign = wxEmptyString;
|
m_tAlign = m_rAlign = wxEmptyString;
|
||||||
m_OldAlign = HTML_ALIGN_LEFT;
|
m_OldAlign = wxHTML_ALIGN_LEFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -460,7 +460,7 @@ TAG_HANDLER_BEGIN(TABLE, "TABLE,TR,TD,TH")
|
|||||||
m_WParser -> OpenContainer();
|
m_WParser -> OpenContainer();
|
||||||
|
|
||||||
if (tag.GetName() == "TH") /*header style*/ {
|
if (tag.GetName() == "TH") /*header style*/ {
|
||||||
m_WParser -> SetAlign(HTML_ALIGN_CENTER);
|
m_WParser -> SetAlign(wxHTML_ALIGN_CENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -469,8 +469,8 @@ TAG_HANDLER_BEGIN(TABLE, "TABLE,TR,TD,TH")
|
|||||||
als = m_rAlign;
|
als = m_rAlign;
|
||||||
if (tag.HasParam("ALIGN")) als = tag.GetParam("ALIGN");
|
if (tag.HasParam("ALIGN")) als = tag.GetParam("ALIGN");
|
||||||
als.MakeUpper();
|
als.MakeUpper();
|
||||||
if (als == "RIGHT") m_WParser -> SetAlign(HTML_ALIGN_RIGHT);
|
if (als == "RIGHT") m_WParser -> SetAlign(wxHTML_ALIGN_RIGHT);
|
||||||
else if (als == "CENTER") m_WParser -> SetAlign(HTML_ALIGN_CENTER);
|
else if (als == "CENTER") m_WParser -> SetAlign(wxHTML_ALIGN_CENTER);
|
||||||
}
|
}
|
||||||
m_WParser -> OpenContainer();
|
m_WParser -> OpenContainer();
|
||||||
}
|
}
|
||||||
|
@@ -106,7 +106,7 @@ void wxHtmlWinParser::InitParser(const wxString& source)
|
|||||||
m_Link = "";
|
m_Link = "";
|
||||||
m_LinkColor.Set(0, 0, 0xFF);
|
m_LinkColor.Set(0, 0, 0xFF);
|
||||||
m_ActualColor.Set(0, 0, 0);
|
m_ActualColor.Set(0, 0, 0);
|
||||||
m_Align = HTML_ALIGN_LEFT;
|
m_Align = wxHTML_ALIGN_LEFT;
|
||||||
m_tmpLastWasSpace = FALSE;
|
m_tmpLastWasSpace = FALSE;
|
||||||
|
|
||||||
OpenContainer();
|
OpenContainer();
|
||||||
@@ -132,7 +132,7 @@ wxObject* wxHtmlWinParser::GetProduct()
|
|||||||
|
|
||||||
CloseContainer();
|
CloseContainer();
|
||||||
OpenContainer();
|
OpenContainer();
|
||||||
GetContainer() -> SetIndent(m_CharHeight, HTML_INDENT_TOP);
|
GetContainer() -> SetIndent(m_CharHeight, wxHTML_INDENT_TOP);
|
||||||
top = m_Container;
|
top = m_Container;
|
||||||
while (top -> GetParent()) top = top -> GetParent();
|
while (top -> GetParent()) top = top -> GetParent();
|
||||||
return top;
|
return top;
|
||||||
@@ -166,7 +166,7 @@ void wxHtmlWinParser::AddText(const char* txt)
|
|||||||
{
|
{
|
||||||
wxHtmlCell *c;
|
wxHtmlCell *c;
|
||||||
int i = 0, x, lng = strlen(txt);
|
int i = 0, x, lng = strlen(txt);
|
||||||
char temp[HTML_BUFLEN];
|
char temp[wxHTML_BUFLEN];
|
||||||
register char d;
|
register char d;
|
||||||
int templen = 0;
|
int templen = 0;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user