show as many items as possible on macOS 10.13+

on these systems scrollbars on comboboxes are not always shown, even if the system is configured to do so, in these cases show all possible to avoid the impression of a limited subset

see https://github.com/wxWidgets/wxWidgets/pull/1534/files
This commit is contained in:
Stefan Csomor
2019-11-05 22:42:18 +01:00
parent 21063a7850
commit 014f04b437

View File

@@ -20,6 +20,7 @@
#include "wx/dcclient.h"
#endif
#include "wx/osx/private/available.h"
#include "wx/osx/cocoa/private/textimpl.h"
// work in progress
@@ -347,7 +348,10 @@ wxWidgetImplType* wxWidgetImpl::CreateComboBox( wxComboBox* wxpeer,
{
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxNSComboBox* v = [[wxNSComboBox alloc] initWithFrame:r];
[v setNumberOfVisibleItems:13];
if (WX_IS_MACOS_AVAILABLE(10, 13))
[v setNumberOfVisibleItems:999];
else
[v setNumberOfVisibleItems:13];
if (style & wxCB_READONLY)
[v setEditable:NO];
wxNSComboBoxControl* c = new wxNSComboBoxControl( wxpeer, v );