class WXDLLIMPEXP_RICHTEXT wxRichTextListStyleDefinition;
class WXDLLIMPEXP_RICHTEXT wxRichTextEvent;
class WXDLLIMPEXP_RICHTEXT wxRichTextRenderer;
+class WXDLLIMPEXP_RICHTEXT wxRichTextBuffer;
/*!
* Flags determining the available space, passed to Layout
// the rect passed to Layout.
#define wxRICHTEXT_LAYOUT_SPECIFIED_RECT 0x10
+/*!
+ * Flags to pass to Draw
+ */
+
+// Ignore paragraph cache optimization, e.g. for printing purposes
+// where one line may be drawn higher (on the next page) compared
+// with the previous line
+#define wxRICHTEXT_DRAW_IGNORE_CACHE 0x01
+
/*!
* Flags returned from hit-testing
*/
void SetDescent(int descent) { m_descent = descent; }
int GetDescent() const { return m_descent; }
+ /// Gets the containing buffer
+ wxRichTextBuffer* GetBuffer() const;
+
// Operations
/// Clone the object
void Reference() { m_refCount ++; }
void Dereference();
- /// Convert units in tends of a millimetre to device units
- static int ConvertTenthsMMToPixels(wxDC& dc, int units);
+ /// Convert units in tenths of a millimetre to device units
+ int ConvertTenthsMMToPixels(wxDC& dc, int units);
+ static int ConvertTenthsMMToPixels(int ppi, int units);
protected:
wxSize m_size;
/// Initialisation
void Init();
- /// Clears the buffer and resets the command processor
- virtual void Clear();
-
- /// The same as Clear, and adds an empty paragraph.
- virtual void Reset();
+ /// Clears the buffer, adds an empty paragraph, and clears the command processor.
+ virtual void ResetAndClearCommands();
/// Load a file
virtual bool LoadFile(const wxString& filename, int type = wxRICHTEXT_TYPE_ANY);
/// Factor to multiply by character height to get a reasonable bullet size
static float GetBulletProportion() { return sm_bulletProportion; }
static void SetBulletProportion(float prop) { sm_bulletProportion = prop; }
+
+ /// Scale factor for calculating dimensions
+ double GetScale() const { return m_scale; }
+ void SetScale(double scale) { m_scale = scale; }
+
protected:
/// Command processor
/// Factor to multiply by character height to get a reasonable bullet size
static float sm_bulletProportion;
+
+ /// Scaling factor in use: needed to calculate correct dimensions when printing
+ double m_scale;
};
/*!
DECLARE_CLASS(wxRichTextFileHandler)
public:
wxRichTextFileHandler(const wxString& name = wxEmptyString, const wxString& ext = wxEmptyString, int type = 0)
- : m_name(name), m_extension(ext), m_type(type), m_visible(true), m_flags(0)
+ : m_name(name), m_extension(ext), m_type(type), m_flags(0), m_visible(true)
{ }
#if wxUSE_STREAMS