From aa8e9a36c47673613f080d7578e771fe62261ef1 Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Sun, 21 Jul 2002 18:51:04 +0000
Subject: [PATCH] added (and documented) trivial but useful IsSingleLine() and
 IsMultiLine() text control methods

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

diff --git a/docs/latex/wx/text.tex b/docs/latex/wx/text.tex
index 7c576bb75b..1e7459ff47 100644
--- a/docs/latex/wx/text.tex
+++ b/docs/latex/wx/text.tex
@@ -567,6 +567,28 @@ read-only mode by a previous call to
 Returns {\tt TRUE} if the text has been modified by user. Note that calling 
 \helpref{SetValue}{wxtextctrlsetvalue} doesn't make the control modified.
 
+\membersection{wxTextCtrl::IsMultiLine}\label{wxtextctrlismultiline}
+
+\constfunc{bool}{IsMultiLine}{\void}
+
+Returns {\tt TRUE} if this is a multi line edit control and {\tt FALSE}
+otherwise.
+
+\wxheading{See also}
+
+\helpref{IsSingleLine}{wxtextctrlissingleline}
+
+\membersection{wxTextCtrl::IsSingleLine}\label{wxtextctrlissingleline}
+
+\constfunc{bool}{IsSingleLine}{\void}
+
+Returns {\tt TRUE} if this is a single line edit control and {\tt FALSE}
+otherwise.
+
+\wxheading{See also}
+
+\helpref{IsMultiLine}{wxtextctrlissingleline}
+
 \membersection{wxTextCtrl::LoadFile}\label{wxtextctrlloadfile}
 
 \func{bool}{LoadFile}{\param{const wxString\& }{ filename}}
diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h
index f3a0c2a0bd..56646fa242 100644
--- a/include/wx/textctrl.h
+++ b/include/wx/textctrl.h
@@ -174,6 +174,10 @@ public:
     virtual bool IsModified() const = 0;
     virtual bool IsEditable() const = 0;
 
+    // more readable flag testing methods
+    bool IsSingleLine() const { return !(GetWindowStyle() & wxTE_MULTILINE); }
+    bool IsMultiLine() const { return !IsSingleLine(); }
+
     // If the return values from and to are the same, there is no selection.
     virtual void GetSelection(long* from, long* to) const = 0;
 
-- 
2.50.0

