fixed warnings, reformatted braces
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41441 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -330,7 +330,8 @@ void wxListCtrl::SetWindowStyleFlag(long flag)
|
|||||||
{
|
{
|
||||||
m_windowStyle = flag;
|
m_windowStyle = flag;
|
||||||
|
|
||||||
if (m_genericImpl){
|
if (m_genericImpl)
|
||||||
|
{
|
||||||
m_genericImpl->SetWindowStyleFlag(flag);
|
m_genericImpl->SetWindowStyleFlag(flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,7 +339,8 @@ void wxListCtrl::SetWindowStyleFlag(long flag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxListCtrl::DoSetSize( int x, int y, int width, int height, int sizeFlags ){
|
void wxListCtrl::DoSetSize( int x, int y, int width, int height, int sizeFlags )
|
||||||
|
{
|
||||||
wxControl::DoSetSize(x, y, width, height, sizeFlags);
|
wxControl::DoSetSize(x, y, width, height, sizeFlags);
|
||||||
|
|
||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
@@ -391,7 +393,8 @@ int wxListCtrl::GetColumnCount() const
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->GetColumnCount();
|
return m_genericImpl->GetColumnCount();
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
UInt32 count;
|
UInt32 count;
|
||||||
m_dbImpl->GetColumnCount(&count);
|
m_dbImpl->GetColumnCount(&count);
|
||||||
return count;
|
return count;
|
||||||
@@ -406,7 +409,8 @@ int wxListCtrl::GetColumnWidth(int col) const
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->GetColumnWidth(col);
|
return m_genericImpl->GetColumnWidth(col);
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
return m_dbImpl->GetColumnWidth(col);
|
return m_dbImpl->GetColumnWidth(col);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -423,13 +427,16 @@ bool wxListCtrl::SetColumnWidth(int col, int width)
|
|||||||
// to the entire window width; investigate why
|
// to the entire window width; investigate why
|
||||||
// this is.
|
// this is.
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
int mywidth = width;
|
int mywidth = width;
|
||||||
if (width == wxLIST_AUTOSIZE || width == wxLIST_AUTOSIZE_USEHEADER)
|
if (width == wxLIST_AUTOSIZE || width == wxLIST_AUTOSIZE_USEHEADER)
|
||||||
mywidth = 150;
|
mywidth = 150;
|
||||||
|
|
||||||
if (col == -1){
|
if (col == -1)
|
||||||
for (int column = 0; column < GetColumnCount(); column++){
|
{
|
||||||
|
for (int column = 0; column < GetColumnCount(); column++)
|
||||||
|
{
|
||||||
m_dbImpl->SetColumnWidth(col, mywidth);
|
m_dbImpl->SetColumnWidth(col, mywidth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -451,7 +458,8 @@ int wxListCtrl::GetCountPerPage() const
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->GetCountPerPage();
|
return m_genericImpl->GetCountPerPage();
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@@ -694,7 +702,8 @@ wxSize wxListCtrl::GetItemSpacing() const
|
|||||||
|
|
||||||
void wxListCtrl::SetItemTextColour( long item, const wxColour &col )
|
void wxListCtrl::SetItemTextColour( long item, const wxColour &col )
|
||||||
{
|
{
|
||||||
if (m_genericImpl){
|
if (m_genericImpl)
|
||||||
|
{
|
||||||
m_genericImpl->SetItemTextColour(item, col);
|
m_genericImpl->SetItemTextColour(item, col);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -709,7 +718,8 @@ wxColour wxListCtrl::GetItemTextColour( long item ) const
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->GetItemTextColour(item);
|
return m_genericImpl->GetItemTextColour(item);
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
wxListItem info;
|
wxListItem info;
|
||||||
if (GetItem(info))
|
if (GetItem(info))
|
||||||
return info.GetTextColour();
|
return info.GetTextColour();
|
||||||
@@ -719,7 +729,8 @@ wxColour wxListCtrl::GetItemTextColour( long item ) const
|
|||||||
|
|
||||||
void wxListCtrl::SetItemBackgroundColour( long item, const wxColour &col )
|
void wxListCtrl::SetItemBackgroundColour( long item, const wxColour &col )
|
||||||
{
|
{
|
||||||
if (m_genericImpl){
|
if (m_genericImpl)
|
||||||
|
{
|
||||||
m_genericImpl->SetItemBackgroundColour(item, col);
|
m_genericImpl->SetItemBackgroundColour(item, col);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -735,7 +746,8 @@ wxColour wxListCtrl::GetItemBackgroundColour( long item ) const
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->GetItemBackgroundColour(item);
|
return m_genericImpl->GetItemBackgroundColour(item);
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
wxListItem info;
|
wxListItem info;
|
||||||
if (GetItem(info))
|
if (GetItem(info))
|
||||||
return info.GetBackgroundColour();
|
return info.GetBackgroundColour();
|
||||||
@@ -745,7 +757,8 @@ wxColour wxListCtrl::GetItemBackgroundColour( long item ) const
|
|||||||
|
|
||||||
void wxListCtrl::SetItemFont( long item, const wxFont &f )
|
void wxListCtrl::SetItemFont( long item, const wxFont &f )
|
||||||
{
|
{
|
||||||
if (m_genericImpl){
|
if (m_genericImpl)
|
||||||
|
{
|
||||||
m_genericImpl->SetItemFont(item, f);
|
m_genericImpl->SetItemFont(item, f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -761,7 +774,8 @@ wxFont wxListCtrl::GetItemFont( long item ) const
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->GetItemFont(item);
|
return m_genericImpl->GetItemFont(item);
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
wxListItem info;
|
wxListItem info;
|
||||||
if (GetItem(info))
|
if (GetItem(info))
|
||||||
return info.GetFont();
|
return info.GetFont();
|
||||||
@@ -791,12 +805,15 @@ wxColour wxListCtrl::GetTextColour() const
|
|||||||
// TODO: we need owner drawn list items to customize text color.
|
// TODO: we need owner drawn list items to customize text color.
|
||||||
if (m_dbImpl)
|
if (m_dbImpl)
|
||||||
return *wxBLACK;
|
return *wxBLACK;
|
||||||
|
|
||||||
|
return wxNullColour;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sets the text colour of the listview
|
// Sets the text colour of the listview
|
||||||
void wxListCtrl::SetTextColour(const wxColour& col)
|
void wxListCtrl::SetTextColour(const wxColour& col)
|
||||||
{
|
{
|
||||||
if (m_genericImpl){
|
if (m_genericImpl)
|
||||||
|
{
|
||||||
m_genericImpl->SetTextColour(col);
|
m_genericImpl->SetTextColour(col);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -854,12 +871,12 @@ wxImageList *wxListCtrl::GetImageList(int which) const
|
|||||||
|
|
||||||
void wxListCtrl::SetImageList(wxImageList *imageList, int which)
|
void wxListCtrl::SetImageList(wxImageList *imageList, int which)
|
||||||
{
|
{
|
||||||
if (m_genericImpl){
|
if (m_genericImpl)
|
||||||
|
{
|
||||||
m_genericImpl->SetImageList(imageList, which);
|
m_genericImpl->SetImageList(imageList, which);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int flags = 0;
|
|
||||||
if ( which == wxIMAGE_LIST_NORMAL )
|
if ( which == wxIMAGE_LIST_NORMAL )
|
||||||
{
|
{
|
||||||
if (m_ownsImageListNormal) delete m_imageListNormal;
|
if (m_ownsImageListNormal) delete m_imageListNormal;
|
||||||
@@ -882,7 +899,8 @@ void wxListCtrl::SetImageList(wxImageList *imageList, int which)
|
|||||||
|
|
||||||
void wxListCtrl::AssignImageList(wxImageList *imageList, int which)
|
void wxListCtrl::AssignImageList(wxImageList *imageList, int which)
|
||||||
{
|
{
|
||||||
if (m_genericImpl){
|
if (m_genericImpl)
|
||||||
|
{
|
||||||
m_genericImpl->AssignImageList(imageList, which);
|
m_genericImpl->AssignImageList(imageList, which);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -914,7 +932,8 @@ bool wxListCtrl::DeleteItem(long item)
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->DeleteItem(item);
|
return m_genericImpl->DeleteItem(item);
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
m_dbImpl->MacDelete(item);
|
m_dbImpl->MacDelete(item);
|
||||||
wxListEvent event( wxEVT_COMMAND_LIST_DELETE_ITEM, GetId() );
|
wxListEvent event( wxEVT_COMMAND_LIST_DELETE_ITEM, GetId() );
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
@@ -931,7 +950,8 @@ bool wxListCtrl::DeleteAllItems()
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->DeleteAllItems();
|
return m_genericImpl->DeleteAllItems();
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
m_dbImpl->MacClear();
|
m_dbImpl->MacClear();
|
||||||
wxListEvent event( wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, GetId() );
|
wxListEvent event( wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, GetId() );
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
@@ -946,10 +966,12 @@ bool wxListCtrl::DeleteAllColumns()
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->DeleteAllColumns();
|
return m_genericImpl->DeleteAllColumns();
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
UInt32 cols;
|
UInt32 cols;
|
||||||
m_dbImpl->GetColumnCount(&cols);
|
m_dbImpl->GetColumnCount(&cols);
|
||||||
for (UInt32 col = 0; col < cols; col++){
|
for (UInt32 col = 0; col < cols; col++)
|
||||||
|
{
|
||||||
DeleteColumn(col);
|
DeleteColumn(col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -963,7 +985,8 @@ bool wxListCtrl::DeleteColumn(int col)
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->DeleteColumn(col);
|
return m_genericImpl->DeleteColumn(col);
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
OSStatus err = m_dbImpl->RemoveColumn(col);
|
OSStatus err = m_dbImpl->RemoveColumn(col);
|
||||||
return err == noErr;
|
return err == noErr;
|
||||||
}
|
}
|
||||||
@@ -974,12 +997,14 @@ bool wxListCtrl::DeleteColumn(int col)
|
|||||||
// Clears items, and columns if there are any.
|
// Clears items, and columns if there are any.
|
||||||
void wxListCtrl::ClearAll()
|
void wxListCtrl::ClearAll()
|
||||||
{
|
{
|
||||||
if (m_genericImpl){
|
if (m_genericImpl)
|
||||||
|
{
|
||||||
m_genericImpl->ClearAll();
|
m_genericImpl->ClearAll();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
DeleteAllItems();
|
DeleteAllItems();
|
||||||
DeleteAllColumns();
|
DeleteAllColumns();
|
||||||
}
|
}
|
||||||
@@ -990,7 +1015,8 @@ wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass)
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->EditLabel(item, textControlClass);
|
return m_genericImpl->EditLabel(item, textControlClass);
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
wxMacDataItem* id = m_dbImpl->GetItemFromLine(item);
|
wxMacDataItem* id = m_dbImpl->GetItemFromLine(item);
|
||||||
verify_noerr( SetDataBrowserEditItem(m_dbImpl->GetControlRef(), (DataBrowserItemID)id, kMinColumnId) );
|
verify_noerr( SetDataBrowserEditItem(m_dbImpl->GetControlRef(), (DataBrowserItemID)id, kMinColumnId) );
|
||||||
}
|
}
|
||||||
@@ -1015,10 +1041,13 @@ bool wxListCtrl::EnsureVisible(long item)
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->EnsureVisible(item);
|
return m_genericImpl->EnsureVisible(item);
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
wxMacDataItem* dataItem = m_dbImpl->GetItemFromLine(item);
|
wxMacDataItem* dataItem = m_dbImpl->GetItemFromLine(item);
|
||||||
m_dbImpl->RevealItem(dataItem, kDataBrowserRevealWithoutSelecting);
|
m_dbImpl->RevealItem(dataItem, kDataBrowserRevealWithoutSelecting);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find an item whose label matches this string, starting from the item after 'start'
|
// Find an item whose label matches this string, starting from the item after 'start'
|
||||||
@@ -1081,7 +1110,8 @@ long wxListCtrl::InsertItem(wxListItem& info)
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->InsertItem(info);
|
return m_genericImpl->InsertItem(info);
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
int count = GetItemCount();
|
int count = GetItemCount();
|
||||||
|
|
||||||
if (info.m_itemId > count)
|
if (info.m_itemId > count)
|
||||||
@@ -1142,13 +1172,15 @@ long wxListCtrl::InsertColumn(long col, wxListItem& item)
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->InsertColumn(col, item);
|
return m_genericImpl->InsertColumn(col, item);
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
if ( !(item.GetMask() & wxLIST_MASK_WIDTH) )
|
if ( !(item.GetMask() & wxLIST_MASK_WIDTH) )
|
||||||
item.SetWidth(150);
|
item.SetWidth(150);
|
||||||
|
|
||||||
DataBrowserPropertyType type = kDataBrowserTextType;
|
DataBrowserPropertyType type = kDataBrowserTextType;
|
||||||
wxImageList* imageList = GetImageList(wxIMAGE_LIST_SMALL);
|
wxImageList* imageList = GetImageList(wxIMAGE_LIST_SMALL);
|
||||||
if (imageList && imageList->GetImageCount() > 0){
|
if (imageList && imageList->GetImageCount() > 0)
|
||||||
|
{
|
||||||
wxBitmap bmp = imageList->GetBitmap(0);
|
wxBitmap bmp = imageList->GetBitmap(0);
|
||||||
if (bmp.Ok())
|
if (bmp.Ok())
|
||||||
type = kDataBrowserIconAndTextType;
|
type = kDataBrowserIconAndTextType;
|
||||||
@@ -1156,7 +1188,8 @@ long wxListCtrl::InsertColumn(long col, wxListItem& item)
|
|||||||
|
|
||||||
fprintf(stderr, "Flush is %d\n", item.GetAlign());
|
fprintf(stderr, "Flush is %d\n", item.GetAlign());
|
||||||
SInt16 just = teFlushDefault;
|
SInt16 just = teFlushDefault;
|
||||||
if (item.GetMask() & wxLIST_MASK_FORMAT){
|
if (item.GetMask() & wxLIST_MASK_FORMAT)
|
||||||
|
{
|
||||||
if (item.GetAlign() == wxLIST_FORMAT_LEFT)
|
if (item.GetAlign() == wxLIST_FORMAT_LEFT)
|
||||||
just = teFlushLeft;
|
just = teFlushLeft;
|
||||||
else if (item.GetAlign() == wxLIST_FORMAT_CENTER)
|
else if (item.GetAlign() == wxLIST_FORMAT_CENTER)
|
||||||
@@ -1208,7 +1241,8 @@ bool wxListCtrl::ScrollList(int dx, int dy)
|
|||||||
if (m_genericImpl)
|
if (m_genericImpl)
|
||||||
return m_genericImpl->ScrollList(dx, dy);
|
return m_genericImpl->ScrollList(dx, dy);
|
||||||
|
|
||||||
if (m_dbImpl){
|
if (m_dbImpl)
|
||||||
|
{
|
||||||
m_dbImpl->SetScrollPosition(dx, dy);
|
m_dbImpl->SetScrollPosition(dx, dy);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -1265,7 +1299,8 @@ void wxListCtrl::SetItemCount(long count)
|
|||||||
{
|
{
|
||||||
wxASSERT_MSG( IsVirtual(), _T("this is for virtual controls only") );
|
wxASSERT_MSG( IsVirtual(), _T("this is for virtual controls only") );
|
||||||
|
|
||||||
if (m_genericImpl){
|
if (m_genericImpl)
|
||||||
|
{
|
||||||
m_genericImpl->SetItemCount(count);
|
m_genericImpl->SetItemCount(count);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1275,7 +1310,8 @@ void wxListCtrl::SetItemCount(long count)
|
|||||||
|
|
||||||
void wxListCtrl::RefreshItem(long item)
|
void wxListCtrl::RefreshItem(long item)
|
||||||
{
|
{
|
||||||
if (m_genericImpl){
|
if (m_genericImpl)
|
||||||
|
{
|
||||||
m_genericImpl->RefreshItem(item);
|
m_genericImpl->RefreshItem(item);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1287,7 +1323,8 @@ void wxListCtrl::RefreshItem(long item)
|
|||||||
|
|
||||||
void wxListCtrl::RefreshItems(long itemFrom, long itemTo)
|
void wxListCtrl::RefreshItems(long itemFrom, long itemTo)
|
||||||
{
|
{
|
||||||
if (m_genericImpl){
|
if (m_genericImpl)
|
||||||
|
{
|
||||||
m_genericImpl->RefreshItems(itemFrom, itemTo);
|
m_genericImpl->RefreshItems(itemFrom, itemTo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1335,7 +1372,8 @@ void wxMacListCtrlItem::Notification(wxMacDataItemBrowserControl *owner ,
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxListCtrl *list = wxDynamicCast( owner->GetPeer() , wxListCtrl );
|
wxListCtrl *list = wxDynamicCast( owner->GetPeer() , wxListCtrl );
|
||||||
if ( list ){
|
if ( list )
|
||||||
|
{
|
||||||
bool trigger = false;
|
bool trigger = false;
|
||||||
|
|
||||||
wxListEvent event( wxEVT_COMMAND_LIST_ITEM_SELECTED, list->GetId() );
|
wxListEvent event( wxEVT_COMMAND_LIST_ITEM_SELECTED, list->GetId() );
|
||||||
@@ -1410,7 +1448,8 @@ wxMacDataBrowserListCtrlControl::wxMacDataBrowserListCtrlControl( wxWindow *peer
|
|||||||
err = SetSelectionFlags( options );
|
err = SetSelectionFlags( options );
|
||||||
verify_noerr( err );
|
verify_noerr( err );
|
||||||
|
|
||||||
if ( style & wxLC_LIST ){
|
if ( style & wxLC_LIST )
|
||||||
|
{
|
||||||
InsertColumn(0, kDataBrowserIconAndTextType, wxEmptyString, -1, -1);
|
InsertColumn(0, kDataBrowserIconAndTextType, wxEmptyString, -1, -1);
|
||||||
verify_noerr( AutoSizeColumns() );
|
verify_noerr( AutoSizeColumns() );
|
||||||
}
|
}
|
||||||
@@ -1438,7 +1477,8 @@ wxMacDataBrowserListCtrlControl::wxMacDataBrowserListCtrlControl( wxWindow *peer
|
|||||||
SetDataBrowserSortOrder( m_controlRef , kDataBrowserOrderIncreasing);
|
SetDataBrowserSortOrder( m_controlRef , kDataBrowserOrderIncreasing);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( style & wxLC_VRULES ){
|
if ( style & wxLC_VRULES )
|
||||||
|
{
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
||||||
verify_noerr( DataBrowserChangeAttributes(m_controlRef, kDataBrowserAttributeListViewDrawColumnDividers, kDataBrowserAttributeNone) );
|
verify_noerr( DataBrowserChangeAttributes(m_controlRef, kDataBrowserAttributeListViewDrawColumnDividers, kDataBrowserAttributeNone) );
|
||||||
#endif
|
#endif
|
||||||
@@ -1456,7 +1496,8 @@ wxMacDataBrowserListCtrlControl::~wxMacDataBrowserListCtrlControl()
|
|||||||
void wxMacDataBrowserListCtrlControl::MacSetColumnInfo( unsigned int row, unsigned int column, wxListItem* item )
|
void wxMacDataBrowserListCtrlControl::MacSetColumnInfo( unsigned int row, unsigned int column, wxListItem* item )
|
||||||
{
|
{
|
||||||
wxMacDataItem* dataItem = GetItemFromLine(row);
|
wxMacDataItem* dataItem = GetItemFromLine(row);
|
||||||
if (item){
|
if (item)
|
||||||
|
{
|
||||||
wxMacListCtrlItem* listItem = dynamic_cast<wxMacListCtrlItem*>(dataItem);
|
wxMacListCtrlItem* listItem = dynamic_cast<wxMacListCtrlItem*>(dataItem);
|
||||||
listItem->SetColumnInfo( column, item );
|
listItem->SetColumnInfo( column, item );
|
||||||
UpdateState(dataItem, item);
|
UpdateState(dataItem, item);
|
||||||
@@ -1471,11 +1512,11 @@ void wxMacDataBrowserListCtrlControl::UpdateState(wxMacDataItem* dataItem, wxLis
|
|||||||
bool isSelectedState = (listItem->GetState() == wxLIST_STATE_SELECTED);
|
bool isSelectedState = (listItem->GetState() == wxLIST_STATE_SELECTED);
|
||||||
|
|
||||||
// toggle the selection state if wxListInfo state and actual state don't match.
|
// toggle the selection state if wxListInfo state and actual state don't match.
|
||||||
if ( isSelected != isSelectedState ){
|
if ( isSelected != isSelectedState )
|
||||||
|
{
|
||||||
DataBrowserSetOption options = kDataBrowserItemsAdd;
|
DataBrowserSetOption options = kDataBrowserItemsAdd;
|
||||||
if (!isSelectedState)
|
if (!isSelectedState)
|
||||||
options = kDataBrowserItemsRemove;
|
options = kDataBrowserItemsRemove;
|
||||||
fprintf(stderr, "state = %d, db options = %d\n", isSelectedState, options);
|
|
||||||
SetSelectedItem(dataItem, options);
|
SetSelectedItem(dataItem, options);
|
||||||
}
|
}
|
||||||
// TODO: Set column width if item width > than current column width
|
// TODO: Set column width if item width > than current column width
|
||||||
@@ -1573,7 +1614,8 @@ bool wxMacListCtrlItem::HasColumnInfo( unsigned int column )
|
|||||||
void wxMacListCtrlItem::SetColumnInfo( unsigned int column, wxListItem* item )
|
void wxMacListCtrlItem::SetColumnInfo( unsigned int column, wxListItem* item )
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( column >= m_rowItems.GetCount() ){
|
if ( column >= m_rowItems.GetCount() )
|
||||||
|
{
|
||||||
wxListItem* listItem = new wxListItem(*item);
|
wxListItem* listItem = new wxListItem(*item);
|
||||||
//listItem->SetAlign(item->GetAlign());
|
//listItem->SetAlign(item->GetAlign());
|
||||||
//listItem->SetBackgroundColour(item->GetBackgroundColour());
|
//listItem->SetBackgroundColour(item->GetBackgroundColour());
|
||||||
@@ -1625,23 +1667,28 @@ OSStatus wxMacListCtrlItem::GetSetData( wxMacDataItemBrowserControl *owner ,
|
|||||||
}
|
}
|
||||||
break ;
|
break ;
|
||||||
default :
|
default :
|
||||||
if ( property >= kMinColumnId ){
|
if ( property >= kMinColumnId )
|
||||||
|
{
|
||||||
short listColumn = property - kMinColumnId;
|
short listColumn = property - kMinColumnId;
|
||||||
|
|
||||||
if (HasColumnInfo(listColumn)){
|
if (HasColumnInfo(listColumn))
|
||||||
|
{
|
||||||
wxListItem* item = GetColumnInfo(listColumn);
|
wxListItem* item = GetColumnInfo(listColumn);
|
||||||
wxMacCFStringHolder cfStr;
|
wxMacCFStringHolder cfStr;
|
||||||
|
|
||||||
if (item->GetText()){
|
if (item->GetText())
|
||||||
|
{
|
||||||
cfStr.Assign( item->GetText(), wxLocale::GetSystemEncoding() );
|
cfStr.Assign( item->GetText(), wxLocale::GetSystemEncoding() );
|
||||||
err = ::SetDataBrowserItemDataText( itemData, cfStr );
|
err = ::SetDataBrowserItemDataText( itemData, cfStr );
|
||||||
err = noErr;
|
err = noErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int imgIndex = item->GetImage();
|
int imgIndex = item->GetImage();
|
||||||
if ( (item->GetMask() & wxLIST_MASK_IMAGE) ){
|
if ( (item->GetMask() & wxLIST_MASK_IMAGE) )
|
||||||
|
{
|
||||||
wxImageList* imageList = list->GetImageList(wxIMAGE_LIST_SMALL);
|
wxImageList* imageList = list->GetImageList(wxIMAGE_LIST_SMALL);
|
||||||
if (imageList && imageList->GetImageCount() > 0){
|
if (imageList && imageList->GetImageCount() > 0)
|
||||||
|
{
|
||||||
wxBitmap bmp = imageList->GetBitmap(imgIndex);
|
wxBitmap bmp = imageList->GetBitmap(imgIndex);
|
||||||
IconRef icon = bmp.GetBitmapData()->GetIconRef();
|
IconRef icon = bmp.GetBitmapData()->GetIconRef();
|
||||||
::SetDataBrowserItemDataIcon(itemData, icon);
|
::SetDataBrowserItemDataIcon(itemData, icon);
|
||||||
@@ -1658,10 +1705,12 @@ OSStatus wxMacListCtrlItem::GetSetData( wxMacDataItemBrowserControl *owner ,
|
|||||||
switch (property)
|
switch (property)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
if ( property >= kMinColumnId ){
|
if ( property >= kMinColumnId )
|
||||||
|
{
|
||||||
short listColumn = property - kMinColumnId;
|
short listColumn = property - kMinColumnId;
|
||||||
|
|
||||||
if (HasColumnInfo(listColumn)){
|
if (HasColumnInfo(listColumn))
|
||||||
|
{
|
||||||
// TODO probably send the 'end edit' from here, as we
|
// TODO probably send the 'end edit' from here, as we
|
||||||
// can then deal with the veto
|
// can then deal with the veto
|
||||||
CFStringRef sr ;
|
CFStringRef sr ;
|
||||||
|
Reference in New Issue
Block a user