X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3396739da180ef3f8d006f11f8a13a9e0df7d88d..f2b099261f9e46d65f1fbcfd2a35aa816d5a2818:/include/wx/textctrl.h?ds=sidebyside diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index a2e06b2cbd..f26cb8aa10 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -214,7 +214,7 @@ enum wxTextAttrFlags wxTEXT_ATTR_PARAGRAPH = \ (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|\ wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|wxTEXT_ATTR_LINE_SPACING|\ - wxTEXT_ATTR_BULLET|wxTEXT_ATTR_PARAGRAPH_STYLE_NAME|wxTEXT_ATTR_LIST_STYLE_NAME|wxTEXT_ATTR_OUTLINE_LEVEL), + wxTEXT_ATTR_BULLET|wxTEXT_ATTR_PARAGRAPH_STYLE_NAME|wxTEXT_ATTR_LIST_STYLE_NAME|wxTEXT_ATTR_OUTLINE_LEVEL|wxTEXT_ATTR_PAGE_BREAK), wxTEXT_ATTR_ALL = (wxTEXT_ATTR_CHARACTER|wxTEXT_ATTR_PARAGRAPH) }; @@ -298,8 +298,8 @@ public: // Equality test bool operator== (const wxTextAttr& attr) const; - // Partial equality test taking flags into account - bool EqPartial(const wxTextAttr& attr, int flags) const; + // Partial equality test + bool EqPartial(const wxTextAttr& attr) const; // Get attributes from font. bool GetFontAttributes(const wxFont& font, int flags = wxTEXT_ATTR_FONT); @@ -379,8 +379,8 @@ public: int GetOutlineLevel() const { return m_outlineLevel; } // accessors - bool HasTextColour() const { return m_colText.Ok() && HasFlag(wxTEXT_ATTR_TEXT_COLOUR) ; } - bool HasBackgroundColour() const { return m_colBack.Ok() && HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) ; } + bool HasTextColour() const { return m_colText.IsOk() && HasFlag(wxTEXT_ATTR_TEXT_COLOUR) ; } + bool HasBackgroundColour() const { return m_colBack.IsOk() && HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) ; } bool HasAlignment() const { return (m_textAlignment != wxTEXT_ALIGNMENT_DEFAULT) && HasFlag(wxTEXT_ATTR_ALIGNMENT) ; } bool HasTabs() const { return HasFlag(wxTEXT_ATTR_TABS) ; } bool HasLeftIndent() const { return HasFlag(wxTEXT_ATTR_LEFT_INDENT); } @@ -411,6 +411,8 @@ public: bool HasOutlineLevel() const { return HasFlag(wxTEXT_ATTR_OUTLINE_LEVEL); } bool HasFlag(long flag) const { return (m_flags & flag) != 0; } + void RemoveFlag(long flag) { m_flags &= ~flag; } + void AddFlag(long flag) { m_flags |= flag; } // Is this a character style? bool IsCharacterStyle() const { return HasFlag(wxTEXT_ATTR_CHARACTER); } @@ -422,11 +424,11 @@ public: return GetFlags() == 0; } - // Merges the given attributes. Does not affect 'this'. If compareWith + // Merges the given attributes. If compareWith // is non-NULL, then it will be used to mask out those attributes that are the same in style // and compareWith, for situations where we don't want to explicitly set inherited attributes. bool Apply(const wxTextAttr& style, const wxTextAttr* compareWith = NULL); - + // merges the attributes of the base and the overlay objects and returns // the result; the parameter attributes take precedence // @@ -665,11 +667,6 @@ public: virtual bool EmulateKeyPress(const wxKeyEvent& event); - // generate the wxEVT_COMMAND_TEXT_UPDATED event, like SetValue() does and - // return true if the event was processed - static bool SendTextUpdatedEvent(wxWindow *win); - bool SendTextUpdatedEvent() { return SendTextUpdatedEvent(this); } - // do the window-specific processing after processing the update event virtual void DoUpdateWindowUI(wxUpdateUIEvent& event); @@ -705,6 +702,18 @@ public: wxTextEntry::SetValue(value); } + // wxWindow overrides + virtual wxVisualAttributes GetDefaultAttributes() const + { + return GetClassDefaultAttributes(GetWindowVariant()); + } + + static wxVisualAttributes + GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL) + { + return GetCompositeControlsDefaultAttributes(variant); + } + protected: // override streambuf method #if wxHAS_TEXT_WINDOW_STREAM @@ -714,7 +723,6 @@ protected: virtual bool DoLoadFile(const wxString& file, int fileType); virtual bool DoSaveFile(const wxString& file, int fileType); -private: // implement the wxTextEntry pure virtual method virtual wxWindow *GetEditableWindow() { return this; }