X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1f17bf00ff1480a50a657674b974c40da82eda1..df04f800b84a71e6f1f5020fa03c2831fa87e6f2:/include/wx/private/stattext.h?ds=sidebyside diff --git a/include/wx/private/stattext.h b/include/wx/private/stattext.h index 1618315881..21742ccc83 100644 --- a/include/wx/private/stattext.h +++ b/include/wx/private/stattext.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: include/wx/private/stattext.h +// Name: wx/private/stattext.h // Purpose: Internal declarations for dlgcmn.cpp and stattextcmn.cpp // Author: Francesco Montorsi // Created: 2007-01-07 (extracted from dlgcmn.cpp) @@ -12,63 +12,6 @@ #ifndef _WX_PRIVATE_STATTEXT_H_ #define _WX_PRIVATE_STATTEXT_H_ -#include "wx/window.h" - -#if wxUSE_STATTEXT - -// ---------------------------------------------------------------------------- -// wxTextWrapper -// ---------------------------------------------------------------------------- - -// this class is used to wrap the text on word boundary: wrapping is done by -// calling OnStartLine() and OnOutputLine() functions -class wxTextWrapper -{ -public: - wxTextWrapper() { m_eol = false; } - - // win is used for getting the font, text is the text to wrap, width is the - // max line width or -1 to disable wrapping - void Wrap(wxWindow *win, const wxString& text, int widthMax); - - // we don't need it, but just to avoid compiler warnings - virtual ~wxTextWrapper() { } - -protected: - // line may be empty - virtual void OnOutputLine(const wxString& line) = 0; - - // called at the start of every new line (except the very first one) - virtual void OnNewLine() { } - -private: - // call OnOutputLine() and set m_eol to true - void DoOutputLine(const wxString& line) - { - OnOutputLine(line); - - m_eol = true; - } - - // this function is a destructive inspector: when it returns true it also - // resets the flag to false so calling it again woulnd't return true any - // more - bool IsStartOfNewLine() - { - if ( !m_eol ) - return false; - - m_eol = false; - - return true; - } - - - bool m_eol; -}; - -#endif // wxUSE_STATTEXT - enum { wxMARKUP_ENTITY_AMP, @@ -92,6 +35,6 @@ enum // wxMarkupEntities[wxMARKUP_ELEMENT_NAME][wxMARKUP_ENTITY_GT] == ">" // wxMarkupEntities[wxMARKUP_ELEMENT_VALUE][wxMARKUP_ENTITY_GT] == ">" // -extern const wxChar *wxMarkupEntities[wxMARKUP_ELEMENT_MAX][wxMARKUP_ENTITY_MAX]; +extern const wxChar *const wxMarkupEntities[wxMARKUP_ELEMENT_MAX][wxMARKUP_ENTITY_MAX]; #endif // _WX_PRIVATE_STATTEXT_H_