added wxLB_NO_SB style and implementation for wxMSW (closes #10991)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2009-07-17 14:36:30 +00:00
parent 53cda845db
commit 58dcd1ae52
4 changed files with 17 additions and 8 deletions

View 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:

View 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

View 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

View 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 )
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 )