Implement wxLB_NO_SB style

See https://github.com/wxWidgets/wxWidgets/pull/346
This commit is contained in:
Paul Cornett 2016-11-19 08:36:26 -08:00
parent 2326ca72f1
commit d24fbc7808
2 changed files with 9 additions and 10 deletions

View File

@ -46,7 +46,7 @@
@style{wxLB_NEEDED_SB}
Only create a vertical scrollbar if needed.
@style{wxLB_NO_SB}
Don't create vertical scrollbar (wxMSW only).
Don't create vertical scrollbar (wxMSW and wxGTK only).
@style{wxLB_SORT}
The listbox contents are sorted in alphabetical order.
@endStyleTable

View File

@ -275,16 +275,15 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
m_widget = gtk_scrolled_window_new( NULL, NULL );
g_object_ref(m_widget);
GtkPolicyType vPolicy = GTK_POLICY_AUTOMATIC;
if (style & wxLB_ALWAYS_SB)
{
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget),
GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS );
}
else
{
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
}
vPolicy = GTK_POLICY_ALWAYS;
else if (style & wxLB_NO_SB)
vPolicy = GTK_POLICY_NEVER;
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(m_widget),
GTK_POLICY_AUTOMATIC, vPolicy);
GTKScrolledWindowSetBorder(m_widget, style);