don't allow editing listbox entries; better handling of scrollbar styles (#9084)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54322 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-06-21 16:59:26 +00:00
parent 4e2a377838
commit 0f5a779f12

View File

@@ -143,6 +143,8 @@ The listbox contents are sorted in alphabetical order.
// Add the single column // Add the single column
NSTableColumn *tableColumn = [[NSTableColumn alloc] initWithIdentifier:nil]; NSTableColumn *tableColumn = [[NSTableColumn alloc] initWithIdentifier:nil];
[GetNSTableView() addTableColumn: tableColumn]; [GetNSTableView() addTableColumn: tableColumn];
// By default, entries should not be editable
[tableColumn setEditable:NO];
[tableColumn release]; [tableColumn release];
[GetNSTableView() sizeToFit]; [GetNSTableView() sizeToFit];
@@ -154,13 +156,25 @@ The listbox contents are sorted in alphabetical order.
CocoaCreateNSScrollView(); CocoaCreateNSScrollView();
SetInitialFrameRect(pos,size); SetInitialFrameRect(pos,size);
[m_wxCocoaScrollView->GetNSScrollView() setHasVerticalScroller:YES]; if ((style & wxLB_NEEDED_SB) || (style & wxLB_ALWAYS_SB))
// Pre-10.3: Always show vertical scroller, never show horizontal scroller
// Post-10.3: Show scrollers dynamically (turn them both on, set auto-hide)
if([m_wxCocoaScrollView->GetNSScrollView() respondsToSelector:@selector(setAutohidesScrollers:)])
{ {
[m_wxCocoaScrollView->GetNSScrollView() setHasHorizontalScroller:YES]; [m_wxCocoaScrollView->GetNSScrollView() setHasVerticalScroller: YES];
[m_wxCocoaScrollView->GetNSScrollView() setAutohidesScrollers:YES]; }
if (style & wxLB_HSCROLL)
{
[m_wxCocoaScrollView->GetNSScrollView() setHasHorizontalScroller: YES];
}
// We can't set auto-hiding individually for horizontal/vertical scrollers,
// so we have settled on always allowing hiding for both unless the vertical
// setting is "always show".
if (((style & wxLB_NEEDED_SB) || (style & wxLB_HSCROLL)) && !(style & wxLB_ALWAYS_SB))
{
if ([m_wxCocoaScrollView->GetNSScrollView() respondsToSelector:@selector(setAutohidesScrollers:)])
{
[m_wxCocoaScrollView->GetNSScrollView() setAutohidesScrollers: YES];
}
} }
// Set up extended/multiple selection flags // Set up extended/multiple selection flags