From 09b86e698cbe7a7d0663aceac0b2b9ea29a040f1 Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Sun, 11 Mar 2007 02:45:48 +0000
Subject: [PATCH] added support for wxTE_NO_VSCROLL (patch 1588605) and
 documented its behaviour

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44760 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/text.tex | 4 ++++
 src/gtk/textctrl.cpp   | 5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/docs/latex/wx/text.tex b/docs/latex/wx/text.tex
index 8f6cbb2e94..b137d508f9 100644
--- a/docs/latex/wx/text.tex
+++ b/docs/latex/wx/text.tex
@@ -45,6 +45,10 @@ doesn't show the selection when it doesn't have focus - use this style to force
 it to always show it. It doesn't do anything under other platforms.}
 \twocolitem{\windowstyle{wxHSCROLL}}{A horizontal scrollbar will be created and
 used, so that text won't be wrapped. No effect under wxGTK1.}
+\twocolitem{\windowstyle{wxTE\_NO\_VSCROLL}}{For multiline controls only:
+vertical scrollbar will never be created. This limits the amount of text which
+can be entered into the control to what can be displayed in it under MSW but
+not under GTK2. Currently not implemented for the other platforms.}
 \twocolitem{\windowstyle{wxTE\_LEFT}}{The text in the control will be left-justified (default).}
 \twocolitem{\windowstyle{wxTE\_CENTRE}}{The text in the control will be centered (currently wxMSW and wxGTK2 only).}
 \twocolitem{\windowstyle{wxTE\_RIGHT}}{The text in the control will be right-justified (currently wxMSW and wxGTK2 only).}
diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp
index 558d9064e5..4518dbd729 100644
--- a/src/gtk/textctrl.cpp
+++ b/src/gtk/textctrl.cpp
@@ -711,7 +711,10 @@ bool wxTextCtrl::Create( wxWindow *parent,
         // create scrolled window
         m_widget = gtk_scrolled_window_new( NULL, NULL );
         gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( m_widget ),
-                                        GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
+                                        GTK_POLICY_AUTOMATIC,
+                                        style & wxTE_NO_VSCROLL
+                                            ? GTK_POLICY_NEVER
+                                            : GTK_POLICY_AUTOMATIC );
         // for ScrollLines/Pages
         m_scrollBar[1] = (GtkRange*)((GtkScrolledWindow*)m_widget)->vscrollbar;
 
-- 
2.50.0

