X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/211dfeddfca5c5992db510bdaa72226bf2013c05..a333f34d91ae845d39ca8a833290e9a1c3d04749:/src/html/m_list.cpp diff --git a/src/html/m_list.cpp b/src/html/m_list.cpp index c7d7aca7ea..4050ee9cc0 100644 --- a/src/html/m_list.cpp +++ b/src/html/m_list.cpp @@ -6,7 +6,7 @@ // Copyright: (c) 1999 Vaclav Slavik // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation #endif @@ -16,7 +16,7 @@ #include "wx/defs.h" #if wxUSE_HTML && wxUSE_STREAMS -#ifdef __BORDLANDC__ +#ifdef __BORLANDC__ #pragma hdrstop #endif @@ -43,22 +43,28 @@ class wxHtmlListmarkCell : public wxHtmlCell wxBrush m_Brush; public: wxHtmlListmarkCell(wxDC *dc, const wxColour& clr); - 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, + wxHtmlRenderingInfo& info); + + DECLARE_NO_COPY_CLASS(wxHtmlListmarkCell) }; wxHtmlListmarkCell::wxHtmlListmarkCell(wxDC* dc, const wxColour& clr) : wxHtmlCell(), m_Brush(clr, wxSOLID) { - m_Width = dc->GetCharWidth(); + m_Width = dc->GetCharHeight(); m_Height = dc->GetCharHeight(); m_Descent = 0; } -void wxHtmlListmarkCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) +void wxHtmlListmarkCell::Draw(wxDC& dc, int x, int y, + int WXUNUSED(view_y1), int WXUNUSED(view_y2), + wxHtmlRenderingInfo& WXUNUSED(info)) { dc.SetBrush(m_Brush); - dc.DrawEllipse(x + m_PosX + m_Width / 4, y + m_PosY + m_Height / 4, m_Width / 2, m_Width / 2); + dc.DrawEllipse(x + m_PosX + m_Width / 3, y + m_PosY + m_Height / 3, + (m_Width / 3), (m_Width / 3)); } @@ -94,11 +100,15 @@ TAG_HANDLER_BEGIN(OLULLI, "OL,UL,LI") c = m_WParser->OpenContainer(); c->SetWidthFloat(2 * m_WParser->GetCharWidth(), wxHTML_UNITS_PIXELS); - c->SetAlignHor(wxHTML_ALIGN_RIGHT); if (m_Numbering == 0) + { + // Centering gives more space after the bullet + c->SetAlignHor(wxHTML_ALIGN_CENTER); c->InsertCell(new wxHtmlListmarkCell(m_WParser->GetDC(), m_WParser->GetActualColor())); + } else { + c->SetAlignHor(wxHTML_ALIGN_RIGHT); wxString mark; mark.Printf(wxT("%i."), m_Numbering); c->InsertCell(new wxHtmlWordCell(mark, *(m_WParser->GetDC()))); @@ -125,7 +135,7 @@ TAG_HANDLER_BEGIN(OLULLI, "OL,UL,LI") else m_Numbering = 1; c = m_WParser->GetContainer(); - if (c->GetFirstCell() != NULL) + if (c->GetFirstChild() != NULL) { m_WParser->CloseContainer(); m_WParser->OpenContainer();