cleanup - reformatting, pt 2

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38648 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Surovell
2006-04-10 04:45:25 +00:00
parent cee24bf7ab
commit 520b09fcda

View File

@@ -35,8 +35,8 @@ END_EVENT_TABLE()
class wxMacListControl : public wxMacControl
{
public:
wxMacListControl( wxListBox *peer ) :
wxMacControl( peer )
wxMacListControl( wxListBox *peer )
: wxMacControl( peer )
{
}
@@ -60,9 +60,7 @@ public:
virtual void MacScrollTo( int n ) = 0;
wxListBox * GetPeer() const
{
return (wxListBox*)m_peer;
}
{ return (wxListBox*)m_peer; }
};
#if 0
@@ -169,10 +167,10 @@ private:
const short kTextColumnId = 1024;
const short kCheckboxColumnId = 1025;
// new databrowserbased version
// new DataBrowser-based version
// because of the limited insert
// functionality of DataBrowser,
// we just introduce id s corresponding
// we just introduce IDs corresponding
// to the line number
DataBrowserItemDataUPP gDataBrowserItemDataUPP = NULL;
@@ -233,6 +231,7 @@ pascal void wxMacDataBrowserListControl::DataBrowserItemNotificationProc(
event.SetInt( i );
event.SetExtraLong( list->HasMultipleSelection() ? message == kDataBrowserItemSelected : true );
wxPostEvent( list->GetEventHandler(), event );
// direct notification is not always having the listbox GetSelection() having in synch with event
// list->GetEventHandler()->ProcessEvent(event);
}
@@ -240,9 +239,12 @@ pascal void wxMacDataBrowserListControl::DataBrowserItemNotificationProc(
}
}
static pascal OSStatus ListBoxGetSetItemData(ControlRef browser,
DataBrowserItemID itemID, DataBrowserPropertyID property,
DataBrowserItemDataRef itemData, Boolean changeValue)
static pascal OSStatus ListBoxGetSetItemData(
ControlRef browser,
DataBrowserItemID itemID,
DataBrowserPropertyID property,
DataBrowserItemDataRef itemData,
Boolean changeValue )
{
OSStatus err = errDataBrowserPropertyNotSupported;
@@ -258,26 +260,28 @@ static pascal OSStatus ListBoxGetSetItemData(ControlRef browser,
switch (property)
{
case kTextColumnId:
if ( ref )
if ( ref != 0 )
{
int i = itemID - 1;
if (i >= 0 && i < (int)list->GetCount())
{
wxMacCFStringHolder cf( list->GetString( i ), list->GetFont().GetEncoding() );
verify_noerr( ::SetDataBrowserItemDataText( itemData, cf ) );
err = ::SetDataBrowserItemDataText( itemData, cf );
verify_noerr( err );
err = noErr;
}
}
break;
case kCheckboxColumnId:
if ( ref )
if ( ref != 0 )
{
wxCheckListBox *list = wxDynamicCast( (wxObject*)ref, wxCheckListBox );
int i = itemID - 1;
if (i >= 0 && (unsigned int) i < list->GetCount())
{
verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData, list->IsChecked( i ) ? kThemeButtonOn : kThemeButtonOff ) );
err = ::SetDataBrowserItemDataButtonValue( itemData, list->IsChecked( i ) ? kThemeButtonOn : kThemeButtonOff );
verify_noerr( err );
err = noErr;
}
}
@@ -297,7 +301,7 @@ static pascal OSStatus ListBoxGetSetItemData(ControlRef browser,
switch (property)
{
case kCheckboxColumnId:
if ( ref )
if ( ref != 0 )
{
wxCheckListBox *list = wxDynamicCast( (wxObject*)ref, wxCheckListBox );
int i = itemID - 1;
@@ -305,7 +309,8 @@ static pascal OSStatus ListBoxGetSetItemData(ControlRef browser,
{
// we have to change this behind the back, since Check() would be triggering another update round
bool newVal = !list->IsChecked( i );
verify_noerr( ::SetDataBrowserItemDataButtonValue( itemData, newVal ? kThemeButtonOn : kThemeButtonOff ) );
err = ::SetDataBrowserItemDataButtonValue( itemData, newVal ? kThemeButtonOn : kThemeButtonOff );
verify_noerr( err );
err = noErr;
list->m_checks[i] = newVal;
@@ -403,7 +408,6 @@ wxMacDataBrowserListControl::wxMacDataBrowserListControl( wxListBox *peer, const
columnDesc.headerBtnDesc.minimumWidth = 0;
columnDesc.headerBtnDesc.maximumWidth = 10000;
columnDesc.propertyDesc.propertyID = kTextColumnId;
columnDesc.propertyDesc.propertyType = kDataBrowserTextType;
columnDesc.propertyDesc.propertyFlags = kDataBrowserTableViewSelectionColumn;
@@ -776,7 +780,8 @@ wxListBox::wxListBox()
m_noItems = 0;
}
bool wxListBox::Create(wxWindow *parent,
bool wxListBox::Create(
wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
@@ -792,7 +797,8 @@ bool wxListBox::Create(wxWindow *parent,
style, validator, name );
}
bool wxListBox::Create(wxWindow *parent,
bool wxListBox::Create(
wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
@@ -805,7 +811,7 @@ bool wxListBox::Create(wxWindow *parent,
m_macIsUserPane = false;
wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED),
_T("only one of listbox selection modes can be specified") );
wxT("only a single listbox selection mode can be specified") );
if ( !wxListBoxBase::Create( parent, id, pos, size, style & ~(wxHSCROLL | wxVSCROLL), validator, name ) )
return false;
@@ -920,7 +926,7 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
{
#if wxUSE_OWNER_DRAWN
wxASSERT_MSG(clientData[i] == NULL,
wxT("Can't use client data with owner-drawn listboxes"));
wxT("Cannot use client data with owner-drawn listboxes"));
#else
Append( choices[i], clientData[i] );
#endif
@@ -1015,7 +1021,7 @@ void wxListBox::DoSetItemClientData(unsigned int n, void *clientData)
{
// client data must be pointer to wxOwnerDrawn, otherwise we would crash
// in OnMeasure/OnDraw.
wxFAIL_MSG(wxT("Can't use client data with owner-drawn listboxes"));
wxFAIL_MSG(wxT("Cannot use client data with owner-drawn listboxes"));
}
#endif