Merge branch 'dvc-markup'
Add support for using markup in wxDataViewCtrl items.
This commit is contained in:
@@ -53,6 +53,11 @@ public:
|
||||
wxDataViewTextRenderer( const wxString &varianttype = GetDefaultType(),
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
virtual ~wxDataViewTextRenderer();
|
||||
|
||||
#if wxUSE_MARKUP
|
||||
void EnableMarkup(bool enable = true);
|
||||
#endif // wxUSE_MARKUP
|
||||
|
||||
virtual bool SetValue( const wxVariant &value );
|
||||
virtual bool GetValue( wxVariant &value ) const;
|
||||
@@ -69,7 +74,11 @@ public:
|
||||
protected:
|
||||
wxString m_text;
|
||||
|
||||
protected:
|
||||
private:
|
||||
#if wxUSE_MARKUP
|
||||
class wxMarkupText *m_markupText;
|
||||
#endif // wxUSE_MARKUP
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer);
|
||||
};
|
||||
|
||||
|
@@ -15,6 +15,8 @@
|
||||
class WXDLLIMPEXP_FWD_CORE wxDC;
|
||||
class WXDLLIMPEXP_FWD_CORE wxRect;
|
||||
|
||||
class wxMarkupParserOutput;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMarkupText: allows to measure and draw the text containing markup.
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -53,6 +55,11 @@ public:
|
||||
// The same rules for mnemonics as in the ctor apply to this string.
|
||||
void SetMarkup(const wxString& markup) { m_markup = markup; }
|
||||
|
||||
// This is a convenience method which can be used with the string in which
|
||||
// mnemonics should be completely ignored, i.e. not interpreted in any way
|
||||
// but just handled as ordinary characters.
|
||||
void SetMarkupText(const wxString& markup);
|
||||
|
||||
|
||||
// Return the width and height required by the given string and optionally
|
||||
// the height of the visible part above the baseline (i.e. ascent minus
|
||||
@@ -70,6 +77,18 @@ public:
|
||||
// and set the clipping region before rendering if necessary.
|
||||
void Render(wxDC& dc, const wxRect& rect, int flags);
|
||||
|
||||
// Similar to Render(), but uses wxRendererNative::DrawItemText() instead
|
||||
// of generic wxDC::DrawLabel(), so is more suitable for use in controls
|
||||
// that already use DrawItemText() for its items.
|
||||
//
|
||||
// The meaning of the flags here is different than in the overload above:
|
||||
// they're passed to DrawItemText() and Render_ShowAccels is not supported
|
||||
// here.
|
||||
void RenderItemText(wxWindow *win,
|
||||
wxDC& dc,
|
||||
const wxRect& rect,
|
||||
int rendererFlags);
|
||||
|
||||
private:
|
||||
wxString m_markup;
|
||||
};
|
||||
|
@@ -31,6 +31,10 @@ public:
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
#if wxUSE_MARKUP
|
||||
void EnableMarkup(bool enable = true);
|
||||
#endif // wxUSE_MARKUP
|
||||
|
||||
virtual bool SetValue( const wxVariant &value ) wxOVERRIDE
|
||||
{
|
||||
return SetTextValue(value);
|
||||
@@ -58,6 +62,14 @@ protected:
|
||||
bool SetTextValue(const wxString& str);
|
||||
bool GetTextValue(wxString& str) const;
|
||||
|
||||
// Return the name of the GtkCellRendererText property to use: "text" or
|
||||
// "markup".
|
||||
const char* GetTextPropertyName() const;
|
||||
|
||||
#if wxUSE_MARKUP
|
||||
// True if we should interpret markup in our text.
|
||||
bool m_useMarkup;
|
||||
#endif // wxUSE_MARKUP
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer);
|
||||
};
|
||||
|
@@ -55,6 +55,10 @@ public:
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT);
|
||||
|
||||
#if wxUSE_MARKUP && wxOSX_USE_COCOA
|
||||
void EnableMarkup(bool enable = true);
|
||||
#endif // wxUSE_MARKUP && Cocoa
|
||||
|
||||
virtual bool MacRender();
|
||||
|
||||
virtual void OSXOnCellChanged(NSObject *value,
|
||||
@@ -62,6 +66,11 @@ public:
|
||||
unsigned col);
|
||||
|
||||
private:
|
||||
#if wxUSE_MARKUP && wxOSX_USE_COCOA
|
||||
// True if we should interpret markup in our text.
|
||||
bool m_useMarkup;
|
||||
#endif // wxUSE_MARKUP && Cocoa
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user