]> git.saurik.com Git - wxWidgets.git/commitdiff
added and documented wxTE_NOHIDESEL
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 18 Oct 2001 00:53:35 +0000 (00:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 18 Oct 2001 00:53:35 +0000 (00:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12048 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/text.tex
include/wx/textctrl.h
src/msw/textctrl.cpp

index 724f33a98c4e807961cfededc7040a628b47b01e..529a451b7929914d91cc2b761cffad27bae4de47 100644 (file)
@@ -36,6 +36,9 @@ style is ignored under other platforms.}
 \twocolitem{\windowstyle{wxTE\_AUTO\_URL}}{Highlight the URLs and generate the
 wxTextUrlEvents when mouse events occur over them. This style is supported
 under Win32 only and requires wxTE\_RICH.}
+\twocolitem{\windowstyle{wxTE\_NOHIDESEL}}{By default, the Windows text control
+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. No effect under GTK+.}
 \end{twocollist}
 
index d0b8ad3ff750140632e4c83d64d3d21dec3513f9..fe3046b45c0dd6ec8798a4f321978f44fee35c58 100644 (file)
@@ -84,6 +84,10 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
 // this is for Win32 richedit controls only so far
 #define wxTE_AUTO_URL       0x1000
 
+// by default, the Windows text control doesn't show the selection when it
+// doesn't have focus - use this style to force it to always show it
+#define wxTE_NOHIDESEL      0x2000
+
 // ----------------------------------------------------------------------------
 // wxTextAttr: a structure containing the visual attributes of a text
 // ----------------------------------------------------------------------------
index 0de8b105d56145bad059dcec0a3239e9679bf602..d3b91d242bc7ee980a8a3241a7795b51cc830236 100644 (file)
@@ -200,21 +200,27 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
             msStyle |= WS_VSCROLL;
         m_windowStyle |= wxTE_PROCESS_ENTER;
     }
-    else
+    else // !multiline
+    {
+        // there is really no reason to not have this style for single line
+        // text controls
         msStyle |= ES_AUTOHSCROLL;
+    }
 
-    if (m_windowStyle & wxHSCROLL)
-        msStyle |= (WS_HSCROLL | ES_AUTOHSCROLL);
+    if ( m_windowStyle & wxHSCROLL )
+        msStyle |= WS_HSCROLL | ES_AUTOHSCROLL;
 
-    if (m_windowStyle & wxTE_READONLY)
+    if ( m_windowStyle & wxTE_READONLY )
         msStyle |= ES_READONLY;
 
-    if (m_windowStyle & wxTE_PASSWORD) // hidden input
+    if ( m_windowStyle & wxTE_PASSWORD )
         msStyle |= ES_PASSWORD;
 
-   if (m_windowStyle & wxTE_AUTO_SCROLL)
-        msStyle |=  ES_AUTOHSCROLL;
+    if ( m_windowStyle & wxTE_AUTO_SCROLL )
+        msStyle |= ES_AUTOHSCROLL;
 
+    if ( m_windowStyle & wxTE_NOHIDESEL )
+        msStyle |= ES_NOHIDESEL;
 
     // we always want the characters and the arrows
     m_lDlgCode = DLGC_WANTCHARS | DLGC_WANTARROWS;