// strdup() [libmspack-20030726], which would cause crashes in
// Unicode build when mb_str() returns temporary buffer
m_chmFileNameANSI = strdup((const char*)m_chmFileName.mb_str(wxConvFile));
-
+
// Open the archive and store it in class:
if ( (chmh = chmd->open(chmd, (char*)m_chmFileNameANSI)) )
{
*
* Finds the next file descibed by a pattern in the archive, starting
* the file given by second parameter
- *
+ *
* @param pattern The file-pattern to search for. May contain '*' and/or '?'
* @param startfrom The filename which the search should start after
* @returns The full pathname of the found file
#if wxUSE_HELP
#include "wx/tipwin.h"
#endif
-
+
#if wxUSE_LIBMSPACK
#include "wx/html/forcelnk.h"
#else
wxUnusedVar(show_wait_msg);
#endif
- if (m_helpFrame)
+ if (m_helpFrame)
m_helpFrame->RefreshLists();
return retval;
}
if (m_Config == NULL)
{
- m_Config = wxConfigBase::Get(FALSE);
+ m_Config = wxConfigBase::Get(false);
if (m_Config != NULL)
m_ConfigRoot = _T("wxWindows/wxHtmlHelpController");
}
m_helpFrame->Create(NULL, wxID_HTML_HELPFRAME, wxEmptyString, m_FrameStyle);
m_helpFrame->SetTitleFormat(m_titleFormat);
- m_helpFrame->Show(TRUE);
+ m_helpFrame->Show(true);
}
void wxHtmlHelpController::ReadCustomization(wxConfigBase* cfg, const wxString& path)
bool wxHtmlHelpController::LoadFile(const wxString& WXUNUSED(file))
{
// Don't reload the file or we'll have it appear again, presumably.
- return TRUE;
+ return true;
}
bool wxHtmlHelpController::DisplaySection(int sectionNo)
{
s_tipWindow = new wxTipWindow(wxTheApp->GetTopWindow(), text, 100, & s_tipWindow);
- return TRUE;
+ return true;
}
#endif // wxUSE_TIPWINDOW
- return FALSE;
+ return false;
}
void wxHtmlHelpController::SetFrameParameters(const wxString& title,
bool *newFrameEachTime)
{
if (newFrameEachTime)
- (* newFrameEachTime) = FALSE;
+ (* newFrameEachTime) = false;
if (size && m_helpFrame)
(* size) = m_helpFrame->GetSize();
if (pos && m_helpFrame)
bool wxHtmlHelpController::Quit()
{
DestroyHelpWindow();
- return TRUE;
+ return true;
}
// Make the help controller's frame 'modal' if
{
// So far, wxGTK only
#ifdef __WXGTK__
- bool needGrab = FALSE;
-
+ bool needGrab = false;
+
// Check if there are any modal windows present,
// in which case we need to add a grab.
for ( wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
wxDialog *dialog = wxDynamicCast(win, wxDialog);
if (dialog && dialog->IsModal())
- needGrab = TRUE;
+ needGrab = true;
}
if (needGrab && m_helpFrame)
CreateHelpWindow();
bool success = m_helpFrame->Display(x);
AddGrabIfNeeded();
- return success;
+ return success;
}
bool wxHtmlHelpController::Display(int id)
const wxChar *readptr = line;
while (*readptr != 0 && *readptr != _T('\r') && *readptr != _T('\n') &&
- writeptr != endptr)
+ writeptr != endptr)
*(writeptr++) = *(readptr++);
*writeptr = 0;
while (*readptr == _T('\r') || *readptr == _T('\n'))
readptr++;
if (*readptr == 0)
return NULL;
- else
+ else
return readptr;
}
{
wxHtmlHelpDataItem *ia2 = ia;
wxHtmlHelpDataItem *ib2 = ib;
-
+
while (ia2->level > ib2->level)
{
ia2 = ia2->parent;
{
ib2 = ib2->parent;
}
-
+
wxASSERT(ia2);
wxASSERT(ib2);
int res = wxHtmlHelpIndexCompareFunc(&ia2, &ib2);
int m_count;
wxHtmlHelpDataItem *m_parentItem;
wxHtmlBookRecord *m_book;
-
+
wxHtmlHelpDataItems *m_data;
public:
m_book = b;
m_name = m_page = wxEmptyString;
m_level = 0;
- m_id = -1;
+ m_id = wxID_ANY;
m_count = 0;
m_parentItem = NULL;
}
item->id = m_id;
item->page = m_page;
item->name = m_name;
-
+
item->book = m_book;
m_data->Add(item);
m_count++;
{
wxLogError(_("Cannot open index file: %s"), indexfile.c_str());
}
- return TRUE;
+ return true;
}
inline static void CacheWriteInt32(wxOutputStream *f, wxInt32 value)
}
inline static void CacheWriteString(wxOutputStream *f, const wxString& str)
-{
+{
const wxWX2MBbuf mbstr = str.mb_str(wxConvUTF8);
size_t len = strlen((const char*)mbstr)+1;
CacheWriteInt32(f, len);
/* load header - version info : */
version = CacheReadInt32(f);
-
+
if (version != CURRENT_CACHED_BOOK_VERSION)
{
- // NB: We can just silently return FALSE here and don't worry about
+ // NB: We can just silently return false here and don't worry about
// it anymore, because AddBookParam will load the MS project in
- // absence of (properly versioned) .cached file and automatically
+ // absence of (properly versioned) .cached file and automatically
// create new .cached file immediately afterward.
return false;
}
/* save contents : */
int len = m_contents.size();
- for (cnt = 0, i = 0; i < len; i++)
+ for (cnt = 0, i = 0; i < len; i++)
if (m_contents[i].book == book && m_contents[i].level > 0)
cnt++;
CacheWriteInt32(f, cnt);
for (i = 0; i < len; i++)
{
- if (m_contents[i].book != book || m_contents[i].level == 0)
+ if (m_contents[i].book != book || m_contents[i].level == 0)
continue;
CacheWriteInt32(f, m_contents[i].level);
CacheWriteInt32(f, m_contents[i].id);
/* save index : */
len = m_index.size();
- for (cnt = 0, i = 0; i < len; i++)
- if (m_index[i].book == book && m_index[i].level > 0)
+ for (cnt = 0, i = 0; i < len; i++)
+ if (m_index[i].book == book && m_index[i].level > 0)
cnt++;
CacheWriteInt32(f, cnt);
for (i = 0; i < len; i++)
{
- if (m_index[i].book != book || m_index[i].level == 0)
+ if (m_index[i].book != book || m_index[i].level == 0)
continue;
CacheWriteString(f, m_index[i].name);
CacheWriteString(f, m_index[i].page);
ContentsOld = m_contents.size();
if (!path.IsEmpty())
- fsys.ChangePathTo(path, TRUE);
+ fsys.ChangePathTo(path, true);
size_t booksCnt = m_bookRecords.GetCount();
for (size_t i = 0; i < booksCnt; i++)
}
bookr = new wxHtmlBookRecord(bookfile.GetLocation(), fsys.GetPath(), title, deftopic);
-
+
wxHtmlHelpDataItem *bookitem = new wxHtmlHelpDataItem;
bookitem->level = 0;
bookitem->id = 0;
{
wxFileSystem fsys;
wxString s;
- bool rt = FALSE;
+ bool rt = false;
#if wxUSE_LIBMSPACK
if (extension == wxT(".chm"))
while (!s.IsEmpty())
{
- if (AddBook(s)) rt = TRUE;
+ if (AddBook(s)) rt = true;
s = fsys.FindNext();
}
if (fi == NULL)
{
wxLogError(_("Cannot open HTML help book: %s"), book.c_str());
- return FALSE;
+ return false;
}
fsys.ChangePathTo(book);
tmp = filter.ReadFile(*fi);
lineptr = tmp.c_str();
- do
+ do
{
lineptr = ReadLine(lineptr, linebuf, 300);
-
+
for (wxChar *ch = linebuf; *ch != wxT('\0') && *ch != wxT('='); ch++)
*ch = tolower(*ch);
if (wxStrstr(linebuf, _T("charset=")) == linebuf)
charset = linebuf + wxStrlen(_T("charset="));
} while (lineptr != NULL);
-
+
wxFontEncoding enc;
if (charset == wxEmptyString) enc = wxFONTENCODING_SYSTEM;
else enc = wxFontMapper::Get()->CharsetToEncoding(charset);
#if WXWIN_COMPATIBILITY_2_4
wxHtmlContentsItem::wxHtmlContentsItem()
- : m_Level(0), m_ID(-1), m_Name(NULL), m_Page(NULL), m_Book(NULL),
+ : m_Level(0), m_ID(wxID_ANY), m_Name(NULL), m_Page(NULL), m_Book(NULL),
m_autofree(false)
{
}
int i, j;
int wrd = m_Keyword.Length();
- bool found = FALSE;
+ bool found = false;
wxHtmlFilterHTML filter;
wxString tmp = filter.ReadFile(file);
int lng = tmp.length();
tmp.LowerCase();
const wxChar *kwd = m_Keyword.c_str();
-
+
if (m_WholeWords)
{
for (i = 0; i < lng - wrd; i++)
size_t len = items.size();
wxHtmlHelpMergedIndexItem *history[128] = {NULL};
-
+
for (size_t i = 0; i < len; i++)
{
const wxHtmlHelpDataItem& item = items[i];
wxASSERT_MSG( item.level < 128, _T("nested index entries too deep") );
-
+
if (history[item.level] &&
history[item.level]->items[0]->name == item.name)
{
mi->parent = (item.level == 0) ? NULL : history[item.level - 1];
history[item.level] = mi;
merged.Add(mi);
- }
+ }
}
}
-
+
//---------------------------------------------------------------------------
// wxHtmlHelpFrame
wxHtmlHelpFrame::~wxHtmlHelpFrame()
{
delete m_mergedIndex;
-
+
// PopEventHandler(); // wxhtmlhelpcontroller (not any more!)
if (m_DataCreated)
delete m_Data;
toolBar->AddTool(wxID_HTML_PANEL, wpanelBitmap, wxNullBitmap,
- false, -1, -1, (wxObject *) NULL,
+ false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Show/hide navigation panel"));
toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_BACK, wbackBitmap, wxNullBitmap,
- false, -1, -1, (wxObject *) NULL,
+ false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Go back"));
toolBar->AddTool(wxID_HTML_FORWARD, wforwardBitmap, wxNullBitmap,
- false, -1, -1, (wxObject *) NULL,
+ false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Go forward"));
toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_UPNODE, wupnodeBitmap, wxNullBitmap,
- false, -1, -1, (wxObject *) NULL,
+ false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Go one level up in document hierarchy"));
toolBar->AddTool(wxID_HTML_UP, wupBitmap, wxNullBitmap,
- false, -1, -1, (wxObject *) NULL,
+ false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Previous page"));
toolBar->AddTool(wxID_HTML_DOWN, wdownBitmap, wxNullBitmap,
- false, -1, -1, (wxObject *) NULL,
+ false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Next page"));
if ((style & wxHF_PRINT) || (style & wxHF_OPEN_FILES))
if (style & wxHF_OPEN_FILES)
toolBar->AddTool(wxID_HTML_OPENFILE, wopenBitmap, wxNullBitmap,
- false, -1, -1, (wxObject *) NULL,
+ false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Open HTML document"));
#if wxUSE_PRINTING_ARCHITECTURE
if (style & wxHF_PRINT)
toolBar->AddTool(wxID_HTML_PRINT, wprintBitmap, wxNullBitmap,
- false, -1, -1, (wxObject *) NULL,
+ false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Print this page"));
#endif
toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_OPTIONS, woptionsBitmap, wxNullBitmap,
- false, -1, -1, (wxObject *) NULL,
+ false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Display options dialog"));
}
#endif //wxUSE_TOOLBAR
case wxHELP_SEARCH_INDEX:
{
- wxHtmlHelpMergedIndexItem* it =
+ wxHtmlHelpMergedIndexItem* it =
(wxHtmlHelpMergedIndexItem*) m_IndexList->GetClientData(0);
if (it)
DisplayIndexItem(it);
WX_CLEAR_HASH_TABLE(*m_PagesHash);
delete m_PagesHash;
}
-
+
const wxHtmlHelpDataItems& contents = m_Data->GetContentsArray();
-
+
size_t cnt = contents.size();
m_PagesHash = new wxHashTable(wxKEY_STRING, 2 * cnt);
sizer->Add(new wxStaticText(this, wxID_ANY, _("Font size:")));
sizer->Add(NormalFont = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
- wxSize(200, -1),
+ wxSize(200, wxDefaultCoord),
0, NULL, wxCB_DROPDOWN | wxCB_READONLY));
sizer->Add(FixedFont = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
- wxSize(200, -1),
+ wxSize(200, wxDefaultCoord),
0, NULL, wxCB_DROPDOWN | wxCB_READONLY));
sizer->Add(FontSize = new wxSpinCtrl(this, wxID_ANY));
ha = (wxHtmlHelpHashData*) m_PagesHash->Get(m_HtmlWin->GetOpenedPage() + wxT("#") + an);
if (ha && ha->m_Index > 0)
{
- int level =
+ int level =
m_Data->GetContentsArray()[ha->m_Index].level - 1;
int ind = ha->m_Index - 1;
- const wxHtmlHelpDataItem *it =
+ const wxHtmlHelpDataItem *it =
&m_Data->GetContentsArray()[ind];
while (ind >= 0 && it->level != level)
{
void wxHtmlHelpFrame::OnIndexSel(wxCommandEvent& WXUNUSED(event))
{
- wxHtmlHelpMergedIndexItem *it = (wxHtmlHelpMergedIndexItem*)
+ wxHtmlHelpMergedIndexItem *it = (wxHtmlHelpMergedIndexItem*)
m_IndexList->GetClientData(m_IndexList->GetSelection());
if (it)
DisplayIndexItem(it);
wxHtmlHelpMergedIndexItem *parent = index[i].parent;
while (parent)
{
- if (pos == 0 ||
+ if (pos == 0 ||
(index.Index(*(wxHtmlHelpMergedIndexItem*)m_IndexList->GetClientData(pos-1))) < index.Index(*parent))
{
m_IndexList->Insert(parent->name,
#endif
bool drawSelectionAfterCell = false;
-
+
if ( info.GetState().GetSelectionState() == wxHTML_SEL_CHANGING )
{
// Selection changing, we must draw the word piecewise:
curLineWidth += cell->GetMaxTotalWidth();
cell = cell->GetNext();
-
+
// compute length of the next word that would be added:
nextWordWidth = 0;
if (cell)
nextCell = nextCell->GetNext();
} while (nextCell && !nextCell->IsLinebreakAllowed());
}
-
+
// force new line if occured:
- if ((cell == NULL) ||
+ if ((cell == NULL) ||
(xpos + nextWordWidth > s_width && cell->IsLinebreakAllowed()))
{
if (xpos > MaxLineWidth) MaxLineWidth = xpos;
// first cell on line is not moved:
line->SetPos(line->GetPosX() + s_indent,
line->GetPosY() + ypos);
-
+
line = line->GetNext();
for ( int n = 0; line != cell; line = line->GetNext() )
{
// thus increasing our size
n++;
}
-
+
line->SetPos(line->GetPosX() + s_indent +
((n * step) / total),
line->GetPosY() + ypos);
if (curLineWidth > m_MaxTotalWidth)
m_MaxTotalWidth = curLineWidth;
-
+
m_MaxTotalWidth += s_indent + ((m_IndentRight < 0) ? (-m_IndentRight * m_Width / 100) : m_IndentRight);
MaxLineWidth += s_indent + ((m_IndentRight < 0) ? (-m_IndentRight * m_Width / 100) : m_IndentRight);
if (m_Width < MaxLineWidth) m_Width = MaxLineWidth;
if ( cell->IsFormattingCell() )
continue;
int cellY = cell->GetPosY();
- if (!( y < cellY || (y < cellY + cell->GetHeight() &&
+ if (!( y < cellY || (y < cellY + cell->GetHeight() &&
x < cell->GetPosX() + cell->GetWidth()) ))
continue;
-
+
c = cell->FindCellByPos(x - cell->GetPosX(), y - cellY, flags);
if (c) return c;
}
}
void wxHtmlContainerCell::RemoveExtraSpacing(bool top, bool bottom)
-{
+{
if ( top )
SetIndent(0, wxHTML_INDENT_TOP);
if ( bottom )
}
}
}
-
+
if ( bottom )
{
wxArrayPtrVoid arr;
for ( c = m_Cells; c; c = c->GetNext() )
arr.Add((void*)c);
-
+
for ( int i = arr.GetCount() - 1; i >= 0; i--)
{
c = (wxHtmlCell*)arr[i];
bool wxHtmlFilterPlainText::CanRead(const wxFSFile& WXUNUSED(file)) const
{
- return TRUE;
+ return true;
}
if (s == NULL) return wxEmptyString;
ReadString(doc, s, wxConvISO8859_1);
- doc.Replace(wxT("&"), wxT("&"), TRUE);
- doc.Replace(wxT("<"), wxT("<"), TRUE);
- doc.Replace(wxT(">"), wxT(">"), TRUE);
+ doc.Replace(wxT("&"), wxT("&"), true);
+ doc.Replace(wxT("<"), wxT("<"), true);
+ doc.Replace(wxT(">"), wxT(">"), true);
doc2 = wxT("<HTML><BODY><PRE>\n") + doc + wxT("\n</PRE></BODY></HTML>");
return doc2;
}
return wxEmptyString;
}
- // NB: We convert input file to wchar_t here in Unicode mode, based on
+ // NB: We convert input file to wchar_t here in Unicode mode, based on
// either Content-Type header or <meta> tags. In ANSI mode, we don't
// do it as it is done by wxHtmlParser (for this reason, we add <meta>
// tag if we used Content-Type header).
#if wxUSE_UNICODE
- int charsetPos;
+ int charsetPos;
if ((charsetPos = file.GetMimeType().Find(_T("; charset="))) != wxNOT_FOUND)
{
wxString charset = file.GetMimeType().Mid(charsetPos + 10);
{
wxHtmlWindow::AddFilter(new wxHtmlFilterHTML);
wxHtmlWindow::AddFilter(new wxHtmlFilterImage);
- return TRUE;
+ return true;
}
virtual void OnExit() {}
};
void wxHtmlParser::InitParser(const wxString& source)
{
SetSource(source);
- m_stopParsing = FALSE;
+ m_stopParsing = false;
}
void wxHtmlParser::DoneParser()
// add another tag to the tree:
else if (i < end_pos-1 && m_Source.GetChar(i+1) != wxT('/'))
- {
+ {
wxHtmlTag *chd;
if (cur)
chd = new wxHtmlTag(cur, m_Source,
}
else
i = chd->GetBeginPos();
-
+
textBeginning = i;
}
void wxHtmlParser::AddTag(const wxHtmlTag& tag)
{
wxHtmlTagHandler *h;
- bool inner = FALSE;
+ bool inner = false;
h = (wxHtmlTagHandler*) m_HandlersHash.Get(tag.GetName());
if (h)
bool wxHtmlParser::RestoreState()
{
- if (!m_SavedStates) return FALSE;
+ if (!m_SavedStates) return false;
DestroyDOMTree();
m_Source = s->m_source;
delete s;
- return TRUE;
+ return true;
}
//-----------------------------------------------------------------------------
const wxChar *c, *last;
const wxChar *in_str = input.c_str();
wxString output;
-
+
output.reserve(input.length());
for (c = in_str, last = in_str; *c != wxT('\0'); c++)
if (c - last > 0)
output.append(last, c - last);
if (++c == wxT('\0')) break;
-
+
wxString entity;
const wxChar *ent_s = c;
wxChar entity_char;
-
+
for (; (*c >= wxT('a') && *c <= wxT('z')) ||
(*c >= wxT('A') && *c <= wxT('Z')) ||
(*c >= wxT('0') && *c <= wxT('9')) ||
return GetCharForCode(code);
}
-wxFSFile *wxHtmlParser::OpenURL(wxHtmlURLType WXUNUSED(type),
+wxFSFile *wxHtmlParser::OpenURL(wxHtmlURLType WXUNUSED(type),
const wxString& url) const
{
return m_FS ? m_FS->OpenFile(url) : NULL;
-
+
}
if (tag.GetName() == _T("BODY"))
{
m_Parser->StopParsing();
- return FALSE;
+ return false;
}
if (tag.HasParam(_T("HTTP-EQUIV")) &&
m_Parser->StopParsing();
}
}
- return FALSE;
+ return false;
}
++pos;
if (src[pos] == '<')
++pos;
-
+
// see if it matches
int match_pos = 0;
while (pos < lng && match_pos < tag_len && src[pos] != '>' && src[pos] != '<') {
// Unicode build
if ((wxChar)wxToupper(src[pos]) == tagBuffer[match_pos]) {
++match_pos;
- }
+ }
else if (src[pos] == wxT(' ') || src[pos] == wxT('\n') ||
src[pos] == wxT('\r') || src[pos] == wxT('\t')) {
// need to skip over these
void wxHtmlWindow::Init()
{
- m_tmpMouseMoved = FALSE;
+ m_tmpMouseMoved = false;
m_tmpLastLink = NULL;
m_tmpLastCell = NULL;
m_tmpCanDrawLocks = 0;
m_Parser = new wxHtmlWinParser(this);
m_Parser->SetFS(m_FS);
m_HistoryPos = -1;
- m_HistoryOn = TRUE;
+ m_HistoryOn = true;
m_History = new wxHtmlHistoryArray;
m_Processors = NULL;
m_Style = 0;
if (!wxScrolledWindow::Create(parent, id, pos, size,
style | wxVSCROLL | wxHSCROLL,
name))
- return FALSE;
+ return false;
m_Style = style;
SetPage(wxT("<html><body></body></html>"));
- return TRUE;
+ return true;
}
CreateLayout();
if (m_tmpCanDrawLocks == 0)
Refresh();
- return TRUE;
+ return true;
}
bool wxHtmlWindow::AppendToPage(const wxString& source)
wxFSFile *f;
bool rt_val;
- bool needs_refresh = FALSE;
+ bool needs_refresh = false;
m_tmpCanDrawLocks++;
if (m_HistoryOn && (m_HistoryPos != -1))
delete f;
#if wxUSE_STATUSBAR
- if (m_RelatedStatusBar != -1)
+ if (m_RelatedStatusBar != -1)
m_RelatedFrame->SetStatusText(_("Done"), m_RelatedStatusBar);
#endif // wxUSE_STATUSBAR
}
if (!c)
{
wxLogWarning(_("HTML anchor %s does not exist."), anchor.c_str());
- return FALSE;
+ return false;
}
else
{
for (y = 0; c != NULL; c = c->GetParent()) y += c->GetPosY();
Scroll(-1, y / wxHTML_SCROLL_STEP);
m_OpenedAnchor = anchor;
- return TRUE;
+ return true;
}
}
{
wxString a, l;
- if (m_HistoryPos < 1) return FALSE;
+ if (m_HistoryPos < 1) return false;
// store scroll position into history item:
int x, y;
l = (*m_History)[m_HistoryPos].GetPage();
a = (*m_History)[m_HistoryPos].GetAnchor();
- m_HistoryOn = FALSE;
+ m_HistoryOn = false;
m_tmpCanDrawLocks++;
if (a == wxEmptyString) LoadPage(l);
else LoadPage(l + wxT("#") + a);
- m_HistoryOn = TRUE;
+ m_HistoryOn = true;
m_tmpCanDrawLocks--;
Scroll(0, (*m_History)[m_HistoryPos].GetPos());
Refresh();
- return TRUE;
+ return true;
}
bool wxHtmlWindow::HistoryCanBack()
{
- if (m_HistoryPos < 1) return FALSE;
- return TRUE ;
+ if (m_HistoryPos < 1) return false;
+ return true ;
}
{
wxString a, l;
- if (m_HistoryPos == -1) return FALSE;
- if (m_HistoryPos >= (int)m_History->GetCount() - 1)return FALSE;
+ if (m_HistoryPos == -1) return false;
+ if (m_HistoryPos >= (int)m_History->GetCount() - 1)return false;
m_OpenedPage = wxEmptyString; // this will disable adding new entry into history in LoadPage()
m_HistoryPos++;
l = (*m_History)[m_HistoryPos].GetPage();
a = (*m_History)[m_HistoryPos].GetAnchor();
- m_HistoryOn = FALSE;
+ m_HistoryOn = false;
m_tmpCanDrawLocks++;
if (a == wxEmptyString) LoadPage(l);
else LoadPage(l + wxT("#") + a);
- m_HistoryOn = TRUE;
+ m_HistoryOn = true;
m_tmpCanDrawLocks--;
Scroll(0, (*m_History)[m_HistoryPos].GetPos());
Refresh();
- return TRUE;
+ return true;
}
bool wxHtmlWindow::HistoryCanForward()
{
- if (m_HistoryPos == -1) return FALSE;
- if (m_HistoryPos >= (int)m_History->GetCount() - 1)return FALSE;
- return TRUE ;
+ if (m_HistoryPos == -1) return false;
+ if (m_HistoryPos >= (int)m_History->GetCount() - 1)return false;
+ return true ;
}
y * wxHTML_SCROLL_STEP + rect.GetTop(),
y * wxHTML_SCROLL_STEP + rect.GetBottom(),
rinfo);
-
-//#define DEBUG_HTML_SELECTION
+
+//#define DEBUG_HTML_SELECTION
#ifdef DEBUG_HTML_SELECTION
{
int xc, yc, x, y;
ScreenToClient(&xc, &yc);
CalcUnscrolledPosition(xc, yc, &x, &y);
wxHtmlCell *at = m_Cell->FindCellByPos(x, y);
- wxHtmlCell *before =
+ wxHtmlCell *before =
m_Cell->FindCellByPos(x, y, wxHTML_FIND_NEAREST_BEFORE);
- wxHtmlCell *after =
+ wxHtmlCell *after =
m_Cell->FindCellByPos(x, y, wxHTML_FIND_NEAREST_AFTER);
-
+
dcm.SetBrush(*wxTRANSPARENT_BRUSH);
dcm.SetPen(*wxBLACK_PEN);
if (at)
after->GetWidth()-4,after->GetHeight()-4);
}
#endif
-
+
dcm.SetDeviceOrigin(0,0);
dc.Blit(0, rect.GetTop(),
sz.x, rect.GetBottom() - rect.GetTop() + 1,
void wxHtmlWindow::OnInternalIdle()
{
wxWindow::OnInternalIdle();
-
+
if (m_tmpMouseMoved && (m_Cell != NULL))
{
#ifdef DEBUG_HTML_SELECTION
if ( !m_tmpSelFromCell )
m_tmpSelFromCell = m_Cell->FindCellByPos(
m_tmpSelFromPos.x,m_tmpSelFromPos.y);
-
+
// NB: a trick - we adjust selFromPos to be upper left or bottom
// right corner of the first cell of the selection depending
// on whether the mouse is moving to the right or to the left.
dirFromPos.y += m_tmpSelFromCell->GetHeight();
}
}
- bool goingDown = dirFromPos.y < y ||
+ bool goingDown = dirFromPos.y < y ||
(dirFromPos.y == y && dirFromPos.x < x);
// determine selection span:
OnCellMouseHover(cell, x, y);
}
- m_tmpMouseMoved = FALSE;
+ m_tmpMouseMoved = false;
}
}
wxBEGIN_PROPERTIES_TABLE(wxHtmlWindow)
/*
- TODO PROPERTIES
- style , wxHW_SCROLLBAR_AUTO
- borders , (dimension)
- url , string
- htmlcode , string
+ TODO PROPERTIES
+ style , wxHW_SCROLLBAR_AUTO
+ borders , (dimension)
+ url , string
+ htmlcode , string
*/
wxEND_PROPERTIES_TABLE()
wxBEGIN_HANDLERS_TABLE(wxHtmlWindow)
wxEND_HANDLERS_TABLE()
-wxCONSTRUCTOR_5( wxHtmlWindow , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle )
+wxCONSTRUCTOR_5( wxHtmlWindow , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle )
#else
IMPLEMENT_DYNAMIC_CLASS(wxHtmlWindow,wxScrolledWindow)
#endif
DECLARE_DYNAMIC_CLASS(wxHtmlWinModule)
public:
wxHtmlWinModule() : wxModule() {}
- bool OnInit() { return TRUE; }
+ bool OnInit() { return true; }
void OnExit() { wxHtmlWindow::CleanUpStatics(); }
};
m_Renderer = new wxHtmlDCRenderer;
m_RendererHdr = new wxHtmlDCRenderer;
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_Footers[0] = m_Footers[1] = wxEmptyString;
m_HeaderHeight = m_FooterHeight = 0;
bool wxHtmlPrintout::OnBeginDocument(int startPage, int endPage)
{
- if (!wxPrintout::OnBeginDocument(startPage, endPage)) return FALSE;
+ if (!wxPrintout::OnBeginDocument(startPage, endPage)) return false;
- return TRUE;
+ return true;
}
{
if (HasPage(page))
RenderPage(dc, page);
- return TRUE;
+ return true;
}
- else return FALSE;
+ else return false;
}
{
wxFileSystem fs;
wxFSFile *ff;
-
+
if (wxFileExists(htmlfile))
ff = fs.OpenFile(wxFileSystem::FileNameToURL(htmlfile));
else
return;
}
- bool done = FALSE;
+ bool done = false;
wxHtmlFilterHTML defaultFilter;
wxString doc;
if (h->CanRead(*ff))
{
doc = h->ReadFile(*ff);
- done = TRUE;
+ done = true;
break;
}
node = node->GetNext();
if (!done)
doc = defaultFilter.ReadFile(*ff);
-
- SetHtmlText(doc, htmlfile, FALSE);
+
+ SetHtmlText(doc, htmlfile, false);
delete ff;
}
{
pos = m_Renderer->Render((int)( ppmm_h * m_MarginLeft),
(int) (ppmm_v * (m_MarginTop + (m_HeaderHeight == 0 ? 0 : m_MarginSpace)) + m_HeaderHeight),
- pos, TRUE, INT_MAX, m_PageBreaks, m_NumPages);
+ pos, true, INT_MAX, m_PageBreaks, m_NumPages);
m_PageBreaks[++m_NumPages] = pos;
} while (pos < m_Renderer->GetTotalHeight());
}
m_Renderer->Render((int) (ppmm_h * m_MarginLeft),
(int) (ppmm_v * (m_MarginTop + (m_HeaderHeight == 0 ? 0 : m_MarginSpace)) + m_HeaderHeight),
- m_PageBreaks[page-1], FALSE, m_PageBreaks[page]-m_PageBreaks[page-1]);
+ m_PageBreaks[page-1], false, m_PageBreaks[page]-m_PageBreaks[page-1]);
m_RendererHdr->SetDC(dc, (double)ppiPrinterY / (double)ppiScreenY);
if (m_Headers[page % 2] != wxEmptyString)
m_PageSetupData = new wxPageSetupDialogData;
m_Headers[0] = m_Headers[1] = m_Footers[0] = m_Footers[1] = wxEmptyString;
- m_PageSetupData->EnableMargins(TRUE);
+ m_PageSetupData->EnableMargins(true);
m_PageSetupData->SetMarginTopLeft(wxPoint(25, 25));
m_PageSetupData->SetMarginBottomRight(wxPoint(25, 25));
bool wxHtmlEasyPrinting::PreviewText(const wxString &htmltext, const wxString &basepath)
{
wxHtmlPrintout *p1 = CreatePrintout();
- p1->SetHtmlText(htmltext, basepath, TRUE);
+ p1->SetHtmlText(htmltext, basepath, true);
wxHtmlPrintout *p2 = CreatePrintout();
- p2->SetHtmlText(htmltext, basepath, TRUE);
+ p2->SetHtmlText(htmltext, basepath, true);
return DoPreview(p1, p2);
}
bool wxHtmlEasyPrinting::PrintText(const wxString &htmltext, const wxString &basepath)
{
wxHtmlPrintout *p = CreatePrintout();
- p->SetHtmlText(htmltext, basepath, TRUE);
+ p->SetHtmlText(htmltext, basepath, true);
bool ret = DoPrint(p);
delete p;
return ret;
if (!preview->Ok())
{
delete preview;
- return FALSE;
+ return false;
}
wxPreviewFrame *frame = new wxPreviewFrame(preview, m_ParentWindow,
wxPoint(100, 100), wxSize(650, 500));
frame->Centre(wxBOTH);
frame->Initialize();
- frame->Show(TRUE);
- return TRUE;
+ frame->Show(true);
+ return true;
}
wxPrintDialogData printDialogData(*GetPrintData());
wxPrinter printer(&printDialogData);
- if (!printer.Print(m_ParentWindow, printout, TRUE))
+ if (!printer.Print(m_ParentWindow, printout, true))
{
- return FALSE;
+ return false;
}
(*GetPrintData()) = printer.GetPrintDialogData().GetPrintData();
- return TRUE;
+ return true;
}
wxPrintDialogData printDialogData(*GetPrintData());
wxPrintDialog printerDialog(m_ParentWindow, &printDialogData);
- printerDialog.GetPrintDialogData().SetSetupDialog(TRUE);
+ printerDialog.GetPrintDialogData().SetSetupDialog(true);
if (printerDialog.ShowModal() == wxID_OK)
(*GetPrintData()) = printerDialog.GetPrintDialogData().GetPrintData();
DECLARE_DYNAMIC_CLASS(wxHtmlPrintingModule)
public:
wxHtmlPrintingModule() : wxModule() {}
- bool OnInit() { return TRUE; }
+ bool OnInit() { return true; }
void OnExit() { wxHtmlPrintout::CleanUpStatics(); }
};
}
m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
- return TRUE;
+ return true;
}
else if (tag.GetName() == wxT("DT"))
{
c = m_WParser->OpenContainer();
c->SetAlignHor(wxHTML_ALIGN_LEFT);
c->SetMinHeight(m_WParser->GetCharHeight());
- return FALSE;
+ return false;
}
else // "DD"
{
m_WParser->CloseContainer();
c = m_WParser->OpenContainer();
c->SetIndent(5 * m_WParser->GetCharWidth(), wxHTML_INDENT_LEFT);
- return FALSE;
+ return false;
}
}
while (tk.HasMoreTokens())
{
- if ((index = m_Faces.Index(tk.GetNextToken(), FALSE)) != wxNOT_FOUND)
+ if ((index = m_Faces.Index(tk.GetNextToken(), false)) != wxNOT_FOUND)
{
m_WParser->SetFontFace(m_Faces[index]);
m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
m_WParser->SetActualColor(oldclr);
m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(oldclr));
}
- return TRUE;
+ return true;
}
TAG_HANDLER_END(FONT)
{
int underlined = m_WParser->GetFontUnderlined();
- m_WParser->SetFontUnderlined(TRUE);
+ m_WParser->SetFontUnderlined(true);
m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
m_WParser->SetFontUnderlined(underlined);
m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
- return TRUE;
+ return true;
}
TAG_HANDLER_END(FACES_U)
{
int bold = m_WParser->GetFontBold();
- m_WParser->SetFontBold(TRUE);
+ m_WParser->SetFontBold(true);
m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
m_WParser->SetFontBold(bold);
m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
- return TRUE;
+ return true;
}
TAG_HANDLER_END(FACES_B)
{
int italic = m_WParser->GetFontItalic();
- m_WParser->SetFontItalic(TRUE);
+ m_WParser->SetFontItalic(true);
m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
m_WParser->SetFontItalic(italic);
m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
- return TRUE;
+ return true;
}
TAG_HANDLER_END(FACES_I)
{
int fixed = m_WParser->GetFontFixed();
- m_WParser->SetFontFixed(TRUE);
+ m_WParser->SetFontFixed(true);
m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
m_WParser->SetFontFixed(fixed);
m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
- return TRUE;
+ return true;
}
TAG_HANDLER_END(FACES_TT)
old_f = m_WParser->GetFontFixed();
old_al = m_WParser->GetAlign();
- m_WParser->SetFontBold(TRUE);
- m_WParser->SetFontItalic(FALSE);
- m_WParser->SetFontUnderlined(FALSE);
- m_WParser->SetFontFixed(FALSE);
+ m_WParser->SetFontBold(true);
+ m_WParser->SetFontItalic(false);
+ m_WParser->SetFontUnderlined(false);
+ m_WParser->SetFontFixed(false);
if (tag.GetName() == wxT("H1"))
m_WParser->SetFontSize(7);
else if (tag.GetName() == wxT("H4"))
{
m_WParser->SetFontSize(5);
- m_WParser->SetFontItalic(TRUE);
- m_WParser->SetFontBold(FALSE);
+ m_WParser->SetFontItalic(true);
+ m_WParser->SetFontBold(false);
}
else if (tag.GetName() == wxT("H5"))
m_WParser->SetFontSize(4);
else if (tag.GetName() == wxT("H6"))
{
m_WParser->SetFontSize(4);
- m_WParser->SetFontItalic(TRUE);
- m_WParser->SetFontBold(FALSE);
+ m_WParser->SetFontItalic(true);
+ m_WParser->SetFontBold(false);
}
c = m_WParser->GetContainer();
c = m_WParser->GetContainer();
c->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
- return TRUE;
+ return true;
}
TAG_HANDLER_END(Hx)
m_WParser->SetFontSize(oldsize);
m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
- return TRUE;
+ return true;
}
TAG_HANDLER_END(BIGSMALL)
m_WParser->CloseContainer();
m_WParser->OpenContainer();
- return FALSE;
+ return false;
}
TAG_HANDLER_END(HR)
wxString x = incoords, y;
type = t;
- while ((i = x.Find( ',' )) != -1)
+ while ((i = x.Find( ',' )) != wxNOT_FOUND)
{
coords.Add( (int)(pixel_scale * (double)wxAtoi( x.Left( i ).c_str())) );
x = x.Mid( i + 1 );
{
public:
wxHtmlImageCell(wxWindow *window,
- wxFSFile *input, int w = -1, int h = -1,
+ wxFSFile *input, int w = wxDefaultCoord, int h = wxDefaultCoord,
double scale = 1.0, int align = wxHTML_ALIGN_BOTTOM,
const wxString& mapname = wxEmptyString);
~wxHtmlImageCell();
{
m_window = window ? wxStaticCast(window, wxScrolledWindow) : NULL;
m_scale = scale;
- m_showFrame = FALSE;
+ m_showFrame = false;
m_bitmap = NULL;
m_bmpW = w;
m_bmpH = h;
m_imageMap = NULL;
m_mapName = mapname;
- SetCanLiveOnPagebreak(FALSE);
+ SetCanLiveOnPagebreak(false);
#if wxUSE_GIF && wxUSE_TIMER
m_gifDecoder = NULL;
m_gifTimer = NULL;
- m_physX = m_physY = -1;
+ m_physX = m_physY = wxDefaultCoord;
#endif
if ( m_bmpW && m_bmpH )
if ( s )
{
- bool readImg = TRUE;
+ bool readImg = true;
#if wxUSE_GIF && wxUSE_TIMER
if ( (input->GetLocation().Matches(wxT("*.gif")) ||
input->GetLocation().Matches(wxT("*.GIF"))) && m_window )
{
- m_gifDecoder = new wxGIFDecoder(s, TRUE);
+ m_gifDecoder = new wxGIFDecoder(s, true);
if ( m_gifDecoder->ReadGIF() == wxGIF_OK )
{
wxImage img;
if ( m_gifDecoder->ConvertToImage(&img) )
SetImage(img);
- readImg = FALSE;
+ readImg = false;
if ( m_gifDecoder->IsAnimation() )
{
m_gifTimer = new wxGIFTimer(this);
- m_gifTimer->Start(m_gifDecoder->GetDelay(), TRUE);
+ m_gifTimer->Start(m_gifDecoder->GetDelay(), true);
}
else
{
}
else // input==NULL, use "broken image" bitmap
{
- if ( m_bmpW == -1 && m_bmpH == -1 )
+ if ( m_bmpW == wxDefaultCoord && m_bmpH == wxDefaultCoord )
{
m_bmpW = 29;
m_bmpH = 31;
}
else
{
- m_showFrame = TRUE;
- if ( m_bmpW == -1 ) m_bmpW = 31;
- if ( m_bmpH == -1 ) m_bmpH = 33;
+ m_showFrame = true;
+ if ( m_bmpW == wxDefaultCoord ) m_bmpW = 31;
+ if ( m_bmpH == wxDefaultCoord ) m_bmpH = 33;
}
- m_bitmap =
+ m_bitmap =
new wxBitmap(wxArtProvider::GetBitmap(wxART_MISSING_IMAGE));
}
}
ww = img.GetWidth();
hh = img.GetHeight();
- if ( m_bmpW == -1 )
+ if ( m_bmpW == wxDefaultCoord )
m_bmpW = ww;
- if ( m_bmpH == -1 )
+ if ( m_bmpH == wxDefaultCoord )
m_bmpH = hh;
// Only scale the bitmap at the rendering stage,
{
wxImage img;
- m_gifDecoder->GoNextFrame(TRUE);
+ m_gifDecoder->GoNextFrame(true);
- if ( m_physX == -1 )
+ if ( m_physX == wxDefaultCoord )
{
m_physX = m_physY = 0;
for (wxHtmlCell *cell = this; cell; cell = cell->GetParent())
wxMemoryDC dc;
dc.SelectObject(*m_bitmap);
dc.DrawBitmap(bmp, m_gifDecoder->GetLeft(), m_gifDecoder->GetTop(),
- TRUE /* use mask */);
+ true /* use mask */);
}
else
SetImage(img);
m_window->Refresh(img.HasMask(), &rect);
}
- timer->Start(m_gifDecoder->GetDelay(), TRUE);
+ timer->Start(m_gifDecoder->GetDelay(), true);
}
void wxHtmlImageCell::Layout(int w)
{
wxHtmlCell::Layout(w);
- m_physX = m_physY = -1;
+ m_physX = m_physY = wxDefaultCoord;
}
#endif
imageScaleX = (double) m_bmpW / (double) m_bitmap->GetWidth();
if (m_bmpH != m_bitmap->GetHeight())
imageScaleY = (double) m_bmpH / (double) m_bitmap->GetHeight();
-
+
double us_x, us_y;
dc.GetUserScale(&us_x, &us_y);
dc.SetUserScale(us_x * m_scale * imageScaleX, us_y * m_scale * imageScaleY);
dc.DrawBitmap(*m_bitmap, (int) ((x + m_PosX) / (m_scale*imageScaleX)),
- (int) ((y + m_PosY) / (m_scale*imageScaleY)), TRUE);
+ (int) ((y + m_PosY) / (m_scale*imageScaleY)), true);
dc.SetUserScale(us_x, us_y);
}
}
{
if (tag.HasParam(wxT("SRC")))
{
- int w = -1, h = -1;
+ int w = wxDefaultCoord, h = wxDefaultCoord;
int al;
wxFSFile *str;
wxString tmp = tag.GetParam(wxT("SRC"));
}
}
- return FALSE;
+ return false;
}
TAG_HANDLER_END(IMG)
// When we are counting pages, 'known_pagebreaks' is non-NULL.
// That's the only time we change 'pagebreak'. Otherwise, pages
// were already counted, 'known_pagebreaks' is NULL, and we don't
- // do anything except return FALSE.
+ // do anything except return false.
//
- // We also simply return FALSE if the 'pagebreak' argument is
+ // We also simply return false if the 'pagebreak' argument is
// less than (vertically above) or the same as the current
// vertical position. Otherwise we'd be setting a pagebreak above
// the current cell, which is incorrect, or duplicating a
// pagebreak that has already been set.
if(NULL == known_pagebreaks || *pagebreak <= m_PosY)
{
- return FALSE;
+ return false;
}
// m_PosY is only the vertical offset from the parent. The pagebreak
// Add a pagebreak only if there isn't one already set here.
if(NULL != where)
{
- return FALSE;
+ return false;
}
else
{
*pagebreak = m_PosY;
- return TRUE;
+ return true;
}
}
}
m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
m_WParser->GetContainer()->SetAlign(tag);
- return FALSE;
+ return false;
}
TAG_HANDLER_END(P)
c->SetAlignHor(al);
c->SetAlign(tag);
c->SetMinHeight(m_WParser->GetCharHeight());
- return FALSE;
+ return false;
}
TAG_HANDLER_END(BR)
else
c->SetAlignHor(old);
- return TRUE;
+ return true;
}
- else return FALSE;
+ else return false;
}
TAG_HANDLER_END(CENTER)
{
if(tag.HasParam(wxT("STYLE")))
{
- if(tag.GetParam(wxT("STYLE")).IsSameAs(wxT("PAGE-BREAK-BEFORE:ALWAYS"), FALSE))
+ if(tag.GetParam(wxT("STYLE")).IsSameAs(wxT("PAGE-BREAK-BEFORE:ALWAYS"), false))
{
m_WParser->CloseContainer();
m_WParser->OpenContainer()->InsertCell(new wxHtmlPageBreakCell);
m_WParser->CloseContainer();
m_WParser->OpenContainer();
- return FALSE;
+ return false;
}
else
{
// Treat other STYLE parameters here when they're supported.
- return FALSE;
+ return false;
}
}
else if(tag.HasParam(wxT("ALIGN")))
if (wfr)
{
wxString title = m_WParser->GetSource()->Mid(
- tag.GetBeginPos(),
+ tag.GetBeginPos(),
tag.GetEndPos1()-tag.GetBeginPos());
#if !wxUSE_UNICODE
wxCSConv conv(m_WParser->GetInputEncoding());
wfr->OnSetTitle(title);
}
}
- return TRUE;
+ return true;
}
TAG_HANDLER_END(TITLE)
if (m_WParser->GetWindow() != NULL)
m_WParser->GetWindow()->SetBackgroundColour(clr);
}
- return FALSE;
+ return false;
}
TAG_HANDLER_END(BODY)
c->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_BOTTOM);
m_WParser->CloseContainer();
m_WParser->OpenContainer();
- return TRUE;
+ return true;
}
TAG_HANDLER_END(BLOCKQUOTE)
virtual const wxHtmlCell* Find(int condition, const void* param) const
{
- if ((condition == wxHTML_COND_ISANCHOR) &&
+ if ((condition == wxHTML_COND_ISANCHOR) &&
(m_AnchorName == (*((const wxString*)param))))
{
return this;
if (tag.HasParam( wxT("TARGET") )) target = tag.GetParam( wxT("TARGET") );
m_WParser->SetActualColor(m_WParser->GetLinkColor());
m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(m_WParser->GetLinkColor()));
- m_WParser->SetFontUnderlined(TRUE);
+ m_WParser->SetFontUnderlined(true);
m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
m_WParser->SetLink(wxHtmlLinkInfo(name, target));
m_WParser->SetActualColor(oldclr);
m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(oldclr));
- return TRUE;
+ return true;
}
- else return FALSE;
+ else return false;
}
TAG_HANDLER_END(A)
wxHtmlRenderingInfo& WXUNUSED(info))
{
dc.SetBrush(m_Brush);
- dc.DrawEllipse(x + m_PosX + m_Width / 3, y + m_PosY + m_Height / 3,
+ dc.DrawEllipse(x + m_PosX + m_Width / 3, y + m_PosY + m_Height / 3,
(m_Width / 3), (m_Width / 3));
}
virtual ~wxHtmlListCell();
void AddRow(wxHtmlContainerCell *mark, wxHtmlContainerCell *cont);
virtual void Layout(int w);
-
+
DECLARE_NO_COPY_CLASS(wxHtmlListCell)
};
void wxHtmlListCell::ComputeMinMaxWidths()
{
if (m_NumRows == 0) return;
-
+
m_MaxTotalWidth = 0;
m_Width = 0;
{
public:
wxHtmlListcontentCell(wxHtmlContainerCell *p) : wxHtmlContainerCell(p) {}
- virtual void Layout(int w) {
+ virtual void Layout(int w) {
// Reset top indentation, fixes <li><p>
SetIndent(0, wxHTML_INDENT_TOP);
wxHtmlContainerCell::Layout(w);
m_List->AddRow(mark, c);
c = m_WParser->OpenContainer();
m_WParser->SetContainer(new wxHtmlListcontentCell(c));
-
+
if (m_Numbering != 0) m_Numbering++;
}
wxHtmlListCell *oldList = m_List;
m_List = new wxHtmlListCell(c);
m_List->SetIndent(2 * m_WParser->GetCharWidth(), wxHTML_INDENT_LEFT);
-
+
ParseInner(tag);
m_WParser->SetContainer(oldcont);
m_Numbering = oldnum;
m_List = oldList;
- return TRUE;
+ return true;
}
return false;
fsize = m_WParser->GetFontSize();
c = m_WParser->GetContainer();
- m_WParser->SetFontUnderlined(FALSE);
- m_WParser->SetFontBold(FALSE);
- m_WParser->SetFontItalic(FALSE);
- m_WParser->SetFontFixed(TRUE);
+ m_WParser->SetFontUnderlined(false);
+ m_WParser->SetFontBold(false);
+ m_WParser->SetFontItalic(false);
+ m_WParser->SetFontFixed(true);
m_WParser->SetFontSize(3);
c->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
m_WParser->SetFontSize(fsize);
c->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
- return TRUE;
+ return true;
}
TAG_HANDLER_END(PRE)
{
// VS: Ignore styles for now. We must have this handler present,
// because CSS style text would be rendered verbatim otherwise
- return TRUE;
+ return true;
}
TAG_HANDLER_END(STYLE)
void wxHtmlTableCell::ComputeMinMaxWidths()
{
- if (m_NumCols == 0 || m_ColsInfo[0].minWidth != -1) return;
+ if (m_NumCols == 0 || m_ColsInfo[0].minWidth != wxDefaultCoord) return;
m_MaxTotalWidth = 0;
int percentage = 0;
m_WParser->CloseContainer();
m_Table = oldt;
- return TRUE;
+ return true;
}
m_WParser->OpenContainer();
}
}
- return FALSE;
+ return false;
}
TAG_HANDLER_END(TABLE)
m_Container = NULL;
m_DC = NULL;
m_CharHeight = m_CharWidth = 0;
- m_UseLink = FALSE;
+ m_UseLink = false;
#if !wxUSE_UNICODE
m_EncConv = NULL;
m_InputEnc = wxFONTENCODING_ISO8859_1;
static int default_sizes[7] =
{
wxHTML_FONT_SIZE_1,
- wxHTML_FONT_SIZE_2,
- wxHTML_FONT_SIZE_3,
- wxHTML_FONT_SIZE_4,
- wxHTML_FONT_SIZE_5,
- wxHTML_FONT_SIZE_6,
- wxHTML_FONT_SIZE_7
+ wxHTML_FONT_SIZE_2,
+ wxHTML_FONT_SIZE_3,
+ wxHTML_FONT_SIZE_4,
+ wxHTML_FONT_SIZE_5,
+ wxHTML_FONT_SIZE_6,
+ wxHTML_FONT_SIZE_7
};
-
+
if (sizes == NULL) sizes = default_sizes;
int i, j, k, l, m;
const wxString& fixed_face)
{
wxFont defaultFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
-
+
int f_sizes[7];
if (size == -1)
size = defaultFont.GetPointSize();
f_sizes[5] = int(size * 1.6);
f_sizes[6] = int(size * 1.8);
- wxString normal = normal_face.empty() ?
+ wxString normal = normal_face.empty() ?
defaultFont.GetFaceName() : normal_face;
-
+
SetFonts(normal, fixed_face, f_sizes);
}
of differences under X and win
*/
- m_UseLink = FALSE;
+ m_UseLink = false;
m_Link = wxHtmlLinkInfo( wxT(""), wxT("") );
m_LinkColor.Set(0, 0, 0xFF);
m_ActualColor.Set(0, 0, 0);
m_Align = wxHTML_ALIGN_LEFT;
- m_tmpLastWasSpace = FALSE;
+ m_tmpLastWasSpace = false;
m_lastWordCell = NULL;
OpenContainer();
m_Container->InsertCell(c);
((wxHtmlWordCell*)c)->SetPreviousWord(m_lastWordCell);
m_lastWordCell = (wxHtmlWordCell*)c;
- m_tmpLastWasSpace = TRUE;
+ m_tmpLastWasSpace = true;
}
}
m_Container->InsertCell(c);
((wxHtmlWordCell*)c)->SetPreviousWord(m_lastWordCell);
m_lastWordCell = (wxHtmlWordCell*)c;
- m_tmpLastWasSpace = FALSE;
+ m_tmpLastWasSpace = false;
}
}
{
m_Container = new wxHtmlContainerCell(m_Container);
m_Container->SetAlignHor(m_Align);
- m_tmpLastWasSpace = TRUE;
+ m_tmpLastWasSpace = true;
/* to avoid space being first character in paragraph */
return m_Container;
}
wxHtmlContainerCell* wxHtmlWinParser::SetContainer(wxHtmlContainerCell *c)
{
- m_tmpLastWasSpace = TRUE;
+ m_tmpLastWasSpace = true;
/* to avoid space being first character in paragraph */
return m_Container = c;
}
ff ? wxMODERN : wxSWISS,
fi ? wxITALIC : wxNORMAL,
fb ? wxBOLD : wxNORMAL,
- fu ? TRUE : FALSE, face
+ fu ? true : false, face
#if wxUSE_UNICODE
);
#else
m_OutputEnc = enc;
// alternatives?
- else if (wxFontMapper::Get()->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, FALSE) &&
- wxFontMapper::Get()->GetAltForEncoding(enc, &altfix, m_FontFaceFixed, FALSE) &&
+ else if (wxFontMapper::Get()->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, false) &&
+ wxFontMapper::Get()->GetAltForEncoding(enc, &altfix, m_FontFaceFixed, false) &&
altnorm == altfix)
m_OutputEnc = altnorm;
// at least normal face?
else if (availnorm)
m_OutputEnc = enc;
- else if (wxFontMapper::Get()->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, FALSE))
+ else if (wxFontMapper::Get()->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, false))
m_OutputEnc = altnorm;
else
bool wxHtmlTagsModule::OnInit()
{
wxHtmlWinParser::AddModule(this);
- return TRUE;
+ return true;
}
void wxHtmlTagsModule::OnExit()