X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/60ebcb8a491cf5132a326490cd148dcba384f729..b43914a8be2258de608a7127ac43f00b65631b15:/src/osx/carbon/listbox.cpp diff --git a/src/osx/carbon/listbox.cpp b/src/osx/carbon/listbox.cpp index f688c91dd1..55cf9e6e07 100644 --- a/src/osx/carbon/listbox.cpp +++ b/src/osx/carbon/listbox.cpp @@ -30,12 +30,12 @@ // list box control implementation // ============================================================================ -wxWidgetImplType* wxWidgetImpl::CreateListBox( wxWindowMac* wxpeer, - wxWindowMac* WXUNUSED(parent), - wxWindowID WXUNUSED(id), - const wxPoint& pos, +wxWidgetImplType* wxWidgetImpl::CreateListBox( wxWindowMac* wxpeer, + wxWindowMac* WXUNUSED(parent), + wxWindowID WXUNUSED(id), + const wxPoint& pos, const wxSize& size, - long style, + long style, long WXUNUSED(extraStyle)) { wxMacDataBrowserListControl* control = new wxMacDataBrowserListControl( wxpeer, pos, size, style ); @@ -175,7 +175,7 @@ OSStatus wxMacListBoxItem::GetSetData(wxMacDataItemBrowserControl *owner , wxListBox *list = wxDynamicCast( owner->GetWXPeer() , wxListBox ); wxMacDataBrowserCellValue valueholder(itemData); list->GetValueCallback( n , col, valueholder ); - + err = noErr; } else @@ -191,7 +191,7 @@ OSStatus wxMacListBoxItem::GetSetData(wxMacDataItemBrowserControl *owner , } } - + } else { @@ -226,7 +226,7 @@ OSStatus wxMacListBoxItem::GetSetData(wxMacDataItemBrowserControl *owner , { err = wxMacDataItem::GetSetData(owner, property, itemData, changeValue); } - + return err; } @@ -261,7 +261,7 @@ wxMacDataBrowserListControl::wxMacDataBrowserListControl( wxWindow *peer, const : wxMacDataItemBrowserControl( peer, pos, size, style ) { m_nextColumnId = 0 ; - + OSStatus err = noErr; m_clientDataItemsType = wxClientData_None; if ( style & wxLB_SORT ) @@ -351,7 +351,7 @@ void wxMacDataBrowserListControl::ItemNotification( { wxListBox *list = wxDynamicCast( GetWXPeer() , wxListBox ); wxCHECK_RET( list != NULL , wxT("Listbox expected")); - + if (list->HasMultipleSelection() && (message == kDataBrowserSelectionSetChanged) && (!list->MacGetBlockEvents())) { list->CalcAndSendEvent(); @@ -361,14 +361,14 @@ void wxMacDataBrowserListControl::ItemNotification( if ((message == kDataBrowserSelectionSetChanged) && (!list->MacGetBlockEvents())) { wxCommandEvent event( wxEVT_COMMAND_LISTBOX_SELECTED, list->GetId() ); - + int sel = list->GetSelection(); if ((sel < 0) || (sel > (int) list->GetCount())) // OS X can select an item below the last item (why?) return; list->HandleLineEvent( sel, false ); return; } - + // call super for item level(wxMacDataItem->Notification) callback processing wxMacDataItemBrowserControl::ItemNotification( itemID, message, itemData); } @@ -385,7 +385,7 @@ wxWindow * wxMacDataBrowserListControl::GetPeer() const // List Methods // -wxMacDataBrowserColumn* wxMacDataBrowserListControl::DoInsertColumn( unsigned int pos, DataBrowserPropertyID property, +wxMacDataBrowserColumn* wxMacDataBrowserListControl::DoInsertColumn( unsigned int pos, DataBrowserPropertyID property, const wxString& title, bool editable, DataBrowserPropertyType colType, SInt16 just, int width ) { @@ -419,7 +419,7 @@ wxMacDataBrowserColumn* wxMacDataBrowserListControl::DoInsertColumn( unsigned in columnDesc.propertyDesc.propertyFlags = kDataBrowserListViewSortableColumn; columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewTypeSelectColumn; columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewNoGapForIconInHeaderButton; - + if ( editable ) columnDesc.propertyDesc.propertyFlags |= kDataBrowserPropertyIsMutable; @@ -431,38 +431,38 @@ wxMacDataBrowserColumn* wxMacDataBrowserListControl::DoInsertColumn( unsigned in } wxMacDataBrowserColumn *col = new wxMacDataBrowserColumn( property, colType, editable ); - + m_columns.Insert( col, pos ); - + return col; } -wxListWidgetColumn* wxMacDataBrowserListControl::InsertTextColumn( unsigned pos, const wxString& title, bool editable, - wxAlignment just, int defaultWidth) +wxListWidgetColumn* wxMacDataBrowserListControl::InsertTextColumn( unsigned pos, const wxString& title, bool editable, + wxAlignment just, int defaultWidth) { DataBrowserPropertyID property = kMinColumnId + m_nextColumnId++; - + SInt16 j = teFlushLeft; if ( just & wxALIGN_RIGHT ) j = teFlushRight; else if ( just & wxALIGN_CENTER_HORIZONTAL ) j = teCenter; - - return DoInsertColumn( pos, property, title, editable, kDataBrowserTextType, just, defaultWidth ); + + return DoInsertColumn( pos, property, title, editable, kDataBrowserTextType, just, defaultWidth ); } -wxListWidgetColumn* wxMacDataBrowserListControl::InsertCheckColumn( unsigned pos , const wxString& title, bool editable, - wxAlignment just, int defaultWidth ) +wxListWidgetColumn* wxMacDataBrowserListControl::InsertCheckColumn( unsigned pos , const wxString& title, bool editable, + wxAlignment just, int defaultWidth ) { DataBrowserPropertyID property = kMinColumnId + m_nextColumnId++; - + SInt16 j = teFlushLeft; if ( just & wxALIGN_RIGHT ) j = teFlushRight; else if ( just & wxALIGN_CENTER_HORIZONTAL ) j = teCenter; - - return DoInsertColumn( pos, property, title, editable, kDataBrowserCheckboxType, just, defaultWidth ); + + return DoInsertColumn( pos, property, title, editable, kDataBrowserCheckboxType, just, defaultWidth ); } wxMacDataBrowserColumn* wxMacDataBrowserListControl::GetColumnFromProperty( DataBrowserPropertyID property) @@ -470,7 +470,7 @@ wxMacDataBrowserColumn* wxMacDataBrowserListControl::GetColumnFromProperty( Data for ( unsigned int i = 0; i < m_columns.size() ; ++ i ) if ( m_columns[i]->GetProperty() == property ) return m_columns[i]; - + return NULL; } @@ -579,15 +579,15 @@ void wxMacDataBrowserListControl::ListScrollTo( unsigned int n ) RevealItem( item , kDataBrowserRevealWithoutSelecting ); } - -void wxMacDataBrowserListControl::UpdateLine( unsigned int n, wxListWidgetColumn* col ) + +void wxMacDataBrowserListControl::UpdateLine( unsigned int n, wxListWidgetColumn* col ) { wxMacDataBrowserColumn* dbcol = dynamic_cast (col); wxMacDataItem * item = (wxMacDataItem*) GetItemFromLine( n ); UpdateItem(wxMacDataBrowserRootContainer, item, dbcol ? dbcol->GetProperty() : kDataBrowserNoItem ); } -void wxMacDataBrowserListControl::UpdateLineToEnd( unsigned int n) +void wxMacDataBrowserListControl::UpdateLineToEnd( unsigned int n) { // with databrowser inserting does not need updating the entire model, it's done by databrowser itself wxMacDataItem * item = (wxMacDataItem*) GetItemFromLine( n ); @@ -607,8 +607,8 @@ void wxMacDataBrowserCellValue::Set( const wxString& value ) SetDataBrowserItemDataText( m_data, (CFStringRef) cf); } -void wxMacDataBrowserCellValue::Set( int value ) -{ +void wxMacDataBrowserCellValue::Set( int value ) +{ SetDataBrowserItemDataValue( m_data, value ); } @@ -616,15 +616,15 @@ void wxMacDataBrowserCellValue::Check( bool check ) { SetDataBrowserItemDataButtonValue( m_data, check ? kThemeButtonOn : kThemeButtonOff); } - -int wxMacDataBrowserCellValue::GetIntValue() const + +int wxMacDataBrowserCellValue::GetIntValue() const { SInt32 value; GetDataBrowserItemDataValue( m_data, &value ); return value; } -wxString wxMacDataBrowserCellValue::GetStringValue() const +wxString wxMacDataBrowserCellValue::GetStringValue() const { CFStringRef value; GetDataBrowserItemDataText ( m_data, &value );