X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5cb0b827f11ccf2a8e570b3b361a1daf0e5eed76..65887bd0f15e2ed92f130dd7bca91636527e1540:/include/wx/richtext/richtextbuffer.h?ds=sidebyside diff --git a/include/wx/richtext/richtextbuffer.h b/include/wx/richtext/richtextbuffer.h index 2249f4bdfc..c1ba9cb454 100644 --- a/include/wx/richtext/richtextbuffer.h +++ b/include/wx/richtext/richtextbuffer.h @@ -74,10 +74,14 @@ #define wxRichTextAttr wxTextAttr #define wxTextAttrEx wxTextAttr -// Setting wxRICHTEXT_USE_OWN_CARET to 1 implements a non-flashing -// cursor reliably without using wxClientDC in case there +// Setting wxRICHTEXT_USE_OWN_CARET to 1 implements a +// caret reliably without using wxClientDC in case there // are platform-specific problems with the generic caret. +#if defined(__WXGTK__) || defined(__WXMAC__) +#define wxRICHTEXT_USE_OWN_CARET 1 +#else #define wxRICHTEXT_USE_OWN_CARET 0 +#endif // Switch off for binary compatibility, on for faster drawing // Note: this seems to be buggy (overzealous use of extents) so @@ -91,7 +95,7 @@ extern WXDLLIMPEXP_RICHTEXT const wxChar wxRichTextLineBreakChar; /*! - * File types + * File types in wxRichText context. */ enum wxRichTextFileType { @@ -145,17 +149,23 @@ class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextBuffer; /*! * Flags returned from hit-testing */ +enum wxRichTextHitTestFlags +{ + // The point was not on this object + wxRICHTEXT_HITTEST_NONE = 0x01, + + // The point was before the position returned from HitTest + wxRICHTEXT_HITTEST_BEFORE = 0x02, -// The point was not on this object -#define wxRICHTEXT_HITTEST_NONE 0x01 -// The point was before the position returned from HitTest -#define wxRICHTEXT_HITTEST_BEFORE 0x02 -// The point was after the position returned from HitTest -#define wxRICHTEXT_HITTEST_AFTER 0x04 -// The point was on the position returned from HitTest -#define wxRICHTEXT_HITTEST_ON 0x08 -// The point was on space outside content -#define wxRICHTEXT_HITTEST_OUTSIDE 0x10 + // The point was after the position returned from HitTest + wxRICHTEXT_HITTEST_AFTER = 0x04, + + // The point was on the position returned from HitTest + wxRICHTEXT_HITTEST_ON = 0x08, + + // The point was on space outside content + wxRICHTEXT_HITTEST_OUTSIDE = 0x10 +}; /*! * Flags for GetRangeSize @@ -267,7 +277,7 @@ public: void operator =(const wxRichTextRange& range) { m_start = range.m_start; m_end = range.m_end; } bool operator ==(const wxRichTextRange& range) const { return (m_start == range.m_start && m_end == range.m_end); } - bool operator !=(const wxRichTextRange& range) const { return (m_start != range.m_start && m_end != range.m_end); } + bool operator !=(const wxRichTextRange& range) const { return (m_start != range.m_start || m_end != range.m_end); } wxRichTextRange operator -(const wxRichTextRange& range) const { return wxRichTextRange(m_start - range.m_start, m_end - range.m_end); } wxRichTextRange operator +(const wxRichTextRange& range) const { return wxRichTextRange(m_start + range.m_start, m_end + range.m_end); } @@ -699,7 +709,7 @@ public: virtual int GetParagraphLength(long paragraphNumber) const; /// Get the number of paragraphs - virtual int GetParagraphCount() const { return GetChildCount(); } + virtual int GetParagraphCount() const { return static_cast(GetChildCount()); } /// Get the number of visible lines virtual int GetLineCount() const; @@ -974,7 +984,7 @@ public: // Implementation /// Apply paragraph styles such as centering to the wrapped lines - virtual void ApplyParagraphStyle(const wxTextAttr& attr, const wxRect& rect); + virtual void ApplyParagraphStyle(const wxTextAttr& attr, const wxRect& rect, wxDC& dc); /// Insert text at the given position virtual bool InsertText(long pos, const wxString& text); @@ -1899,7 +1909,7 @@ class WXDLLIMPEXP_RICHTEXT wxRichTextBufferDataObject: public wxDataObjectSimple public: // ctor doesn't copy the pointer, so it shouldn't go away while this object // is alive - wxRichTextBufferDataObject(wxRichTextBuffer* richTextBuffer = (wxRichTextBuffer*) NULL); + wxRichTextBufferDataObject(wxRichTextBuffer* richTextBuffer = NULL); virtual ~wxRichTextBufferDataObject(); // after a call to this function, the buffer is owned by the caller and it