]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxLB_NO_SB style and implementation for wxMSW (closes #10991)
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 17 Jul 2009 14:36:30 +0000 (14:36 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 17 Jul 2009 14:36:30 +0000 (14:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/defs.h
interface/wx/listbox.h
src/msw/listbox.cpp

index 75dbb047dfdc0964fba59f06d51c354c24194175..394eb63f5d84411d6fc2b7e7eaffac47ed151c6e 100644 (file)
@@ -383,6 +383,7 @@ All (GUI):
 - Added wxDC::CopyAttributes() and use it in wxBufferedDC.
 - Added wxTextWrapper helper class useful for wrapping lines of text.
 - Added EVT_DATAVIEW_CACHE_HINT() event (Trigve).
+- Added wxLB_NO_SB style (implemented for MSW only; Dario Senic).
 
 GTK:
 
index 28daf3ef1cb5423c6faaf4bb2fcdc7b4c1888366..639508a86cbd991d019e278e94cb222a4d3a30df 100644 (file)
@@ -1709,9 +1709,10 @@ enum wxBorder
 #define wxLB_MULTIPLE       0x0040
 #define wxLB_EXTENDED       0x0080
 /*  wxLB_OWNERDRAW is Windows-only */
+#define wxLB_NEEDED_SB      0x0000
 #define wxLB_OWNERDRAW      0x0100
-#define wxLB_NEEDED_SB      0x0200
-#define wxLB_ALWAYS_SB      0x0400
+#define wxLB_ALWAYS_SB      0x0200
+#define wxLB_NO_SB          0x0400
 #define wxLB_HSCROLL        wxHSCROLL
 /*  always show an entire number of rows */
 #define wxLB_INT_HEIGHT     0x0800
index fa39ac5dbaa22c0418ccb7a5a4833a31df03ed5e..14e8af65de9bf2bd1b571b2ed8be312f116b1325 100644 (file)
@@ -39,6 +39,8 @@
         Always show a vertical scrollbar.
     @style{wxLB_NEEDED_SB}
         Only create a vertical scrollbar if needed.
+    @style{wxLB_NO_SB}
+        Don't create vertical scrollbar (wxMSW only).
     @style{wxLB_SORT}
         The listbox contents are sorted in alphabetical order.
     @endStyleTable
index 84634d3088dc02fce0ceaead97dbddc56e897d02..a06a7af8726d6d83c962a55cbf10fe9756cc90d3 100644 (file)
@@ -77,6 +77,7 @@ wxBEGIN_FLAGS( wxListBoxStyle )
     wxFLAGS_MEMBER(wxLB_HSCROLL)
     wxFLAGS_MEMBER(wxLB_ALWAYS_SB)
     wxFLAGS_MEMBER(wxLB_NEEDED_SB)
+    wxFLAGS_MEMBER(wxLB_NO_SB)
     wxFLAGS_MEMBER(wxLB_SORT)
 
 wxEND_FLAGS( wxListBoxStyle )
@@ -207,10 +208,6 @@ WXDWORD wxListBox::MSWGetStyle(long style, WXDWORD *exstyle) const
 {
     WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle);
 
-    // always show the vertical scrollbar if necessary -- otherwise it is
-    // impossible to use the control with the mouse
-    msStyle |= WS_VSCROLL;
-
     // we always want to get the notifications
     msStyle |= LBS_NOTIFY;
 
@@ -226,8 +223,16 @@ WXDWORD wxListBox::MSWGetStyle(long style, WXDWORD *exstyle) const
     else if ( style & wxLB_EXTENDED )
         msStyle |= LBS_EXTENDEDSEL;
 
-    if ( m_windowStyle & wxLB_ALWAYS_SB )
-        msStyle |= LBS_DISABLENOSCROLL;
+    wxASSERT_MSG( !(style & wxLB_ALWAYS_SB) || !(style & wxLB_NO_SB),
+                  _T( "Conflicting styles wxLB_ALWAYS_SB and wxLB_NO_SB." ) );
+
+    if ( !(style & wxLB_NO_SB) )
+    {
+        msStyle |= WS_VSCROLL;
+        if ( style & wxLB_ALWAYS_SB )
+            msStyle |= LBS_DISABLENOSCROLL;
+    }
+
     if ( m_windowStyle & wxLB_HSCROLL )
         msStyle |= WS_HSCROLL;
     if ( m_windowStyle & wxLB_SORT )