From be0ac1819a2c393108d77302764f0b1c943fe76c Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Mon, 26 Jun 2006 00:39:32 +0000
Subject: [PATCH] added SetModified() for people who find it easier to
 understand than MarkDirty/DiscardEdits (patch 1504449)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39835 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/text.tex | 11 +++++++++++
 include/wx/textctrl.h  |  7 +++++++
 2 files changed, 18 insertions(+)

diff --git a/docs/latex/wx/text.tex b/docs/latex/wx/text.tex
index e93b8103e3..5fff392027 100644
--- a/docs/latex/wx/text.tex
+++ b/docs/latex/wx/text.tex
@@ -1158,6 +1158,17 @@ Note that under GTK+, this function may only be used with single line text contr
 Only implemented in wxMSW/wxGTK starting with wxWidgets 2.3.2.
 
 
+\membersection{wxTextCtrl::SetModified}\label{wxtextctrlsetmodified}
+
+\func{void}{SetModified}{\param{bool }{modified}}
+
+Marks the control as being modified by the user or not.
+
+\wxheading{See also}
+
+\helpref{MarkDirty}{wxtextctrlmarkdirty}, \helpref{DiscardEdits}{wxtextctrldiscardedits}
+
+
 \membersection{wxTextCtrl::SetSelection}\label{wxtextctrlsetselection}
 
 \func{virtual void}{SetSelection}{\param{long}{ from}, \param{long}{ to}}
diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h
index 5a0d79ce65..4afe415c68 100644
--- a/include/wx/textctrl.h
+++ b/include/wx/textctrl.h
@@ -331,6 +331,13 @@ public:
     // sets/clears the dirty flag
     virtual void MarkDirty() = 0;
     virtual void DiscardEdits() = 0;
+    void SetModified(bool modified)
+    {
+        if ( modified )
+            MarkDirty();
+        else
+            DiscardEdits();
+    }
 
     // set the max number of characters which may be entered in a single line
     // text control
-- 
2.47.2

