Use generic implementation of wxDataViewCtrl on OSX

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Anil8753
Experienced Solver
Experienced Solver
Posts: 93
Joined: Sat Jan 16, 2016 5:57 am
Location: India

Use generic implementation of wxDataViewCtrl on OSX

Post by Anil8753 »

By default wxDataViewCtrl has native implementation under OSX. How can I use generic implementation of wxDataViewCtrl under OSX. I do not want to make any changes in wxWidgets Code. I would prefer a macro or some specific header.

I defined wxUSE_GENERICDATAVIEWCTRL macro, It could not help.

Also I am thinking how I can use both native and generic implementation at the same time.
User avatar
doublemax
Moderator
Moderator
Posts: 19158
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Use generic implementation of wxDataViewCtrl on OSX

Post by doublemax »

Also I am thinking how I can use both native and generic implementation at the same time.
That's probably impossible as the generic wxDataViewCtrl uses the same class name (and not something like wxGenericDataViewCtrl).

For the same reason i think changing the wxHAS_GENERIC_DATAVIEWCTRL definition in /include/wx/dataview.h might work, but only when you rebuild the wxWidgets libraries afterwards.
Use the source, Luke!
Anil8753
Experienced Solver
Experienced Solver
Posts: 93
Joined: Sat Jan 16, 2016 5:57 am
Location: India

Re: Use generic implementation of wxDataViewCtrl on OSX

Post by Anil8753 »

tried wxHAS_GENERIC_DATAVIEWCTRL /include/wx/dataview.h for OSX. Got lots of linking errors
User avatar
doublemax
Moderator
Moderator
Posts: 19158
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Use generic implementation of wxDataViewCtrl on OSX

Post by doublemax »

tried wxHAS_GENERIC_DATAVIEWCTRL /include/wx/dataview.h for OSX. Got lots of linking errors
Did you rebuild wxWidgets afterwards? If yes, the sources are obviously not designed to use the generic wxDataViewCtrl under OSX. Theoretically it should be possible to make it work, but you'll have to fight through the errors yourself and possible change some more wx files for that.
Use the source, Luke!
Anil8753
Experienced Solver
Experienced Solver
Posts: 93
Joined: Sat Jan 16, 2016 5:57 am
Location: India

Re: Use generic implementation of wxDataViewCtrl on OSX

Post by Anil8753 »

Sorry not the linking error, they are compilation errors:

Code: Select all

./src/osx/dataview_osx.cpp:101:38: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
  noFailureFlag = m_DataViewCtrlPtr->GetDataViewPeer()->Add(parent,item);
                  ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:112:38: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
  noFailureFlag = m_DataViewCtrlPtr->GetDataViewPeer()->Add(parent,items);
                  ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:123:26: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
  if (m_DataViewCtrlPtr->GetDataViewPeer()->Update(GetOwner()->GetParent(item),item))
      ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:153:28: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
    if (m_DataViewCtrlPtr->GetDataViewPeer()->Update(GetOwner()->GetParent(items[indexItem]),items[indexItem]))
        ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:178:22: error: no member named 'SetDeleting' in 'wxDataViewCtrl'
  m_DataViewCtrlPtr->SetDeleting(true);
  ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:179:38: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
  noFailureFlag = m_DataViewCtrlPtr->GetDataViewPeer()->Remove(parent,item);
                  ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:181:22: error: no member named 'SetDeleting' in 'wxDataViewCtrl'
  m_DataViewCtrlPtr->SetDeleting(false);
  ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:197:22: error: no member named 'SetDeleting' in 'wxDataViewCtrl'
  m_DataViewCtrlPtr->SetDeleting(true);
  ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:199:38: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
  noFailureFlag = m_DataViewCtrlPtr->GetDataViewPeer()->Remove(parent,items);
                  ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:201:22: error: no member named 'SetDeleting' in 'wxDataViewCtrl'
  m_DataViewCtrlPtr->SetDeleting(false);
  ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:212:26: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
  if (m_DataViewCtrlPtr->GetDataViewPeer()->Update(GetOwner()->GetParent(item),item))
      ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:233:29: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
  return m_DataViewCtrlPtr->GetDataViewPeer()->Reload();
         ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:238:22: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
  m_DataViewCtrlPtr->GetDataViewPeer()->Resort();
  ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:252:55: error: no member named 'GetColumnPtr' in 'wxDataViewCtrl'; did you mean 'GetColumnAt'?
          wxDataViewColumn* column(m_DataViewCtrlPtr->GetColumnPtr(col));
                                                      ^~~~~~~~~~~~
                                                      GetColumnAt
./include/wx/generic/dataview.h:248:23: note: 'GetColumnAt' declared here
    wxDataViewColumn *GetColumnAt(unsigned int pos) const;
                      ^
./src/osx/dataview_osx.cpp:267:28: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
        m_DataViewCtrlPtr->GetDataViewPeer()->SetRowHeight(item,height);
        ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:287:57: error: no member named 'GetColumnPtr' in 'wxDataViewCtrl'; did you mean 'GetColumnAt'?
            wxDataViewColumn* column(m_DataViewCtrlPtr->GetColumnPtr(col));
                                                        ^~~~~~~~~~~~
                                                        GetColumnAt
./include/wx/generic/dataview.h:248:23: note: 'GetColumnAt' declared here
    wxDataViewColumn *GetColumnAt(unsigned int pos) const;
                      ^
./src/osx/dataview_osx.cpp:302:30: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
          m_DataViewCtrlPtr->GetDataViewPeer()->SetRowHeight(items[itemIndex],height);
          ~~~~~~~~~~~~~~~~~  ^
./src/osx/dataview_osx.cpp:312:53: error: no member named 'GetColumnPtr' in 'wxDataViewCtrl'; did you mean 'GetColumnAt'?
      wxDataViewColumn *column = m_DataViewCtrlPtr->GetColumnPtr(col);
                                                    ^~~~~~~~~~~~
                                                    GetColumnAt
./include/wx/generic/dataview.h:248:23: note: 'GetColumnAt' declared here
    wxDataViewColumn *GetColumnAt(unsigned int pos) const;
                      ^
./src/osx/dataview_osx.cpp:314:20: error: no member named 'GetWidthVariable' in 'wxDataViewColumn'
      if ( column->GetWidthVariable() == wxCOL_WIDTH_AUTOSIZE )
           ~~~~~~  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [advdll_dataview_osx.o] Error 1
Anil8753
Experienced Solver
Experienced Solver
Posts: 93
Joined: Sat Jan 16, 2016 5:57 am
Location: India

Re: Use generic implementation of wxDataViewCtrl on OSX

Post by Anil8753 »

Sorry Fixed!!!


We need to build wxWidgets with both
wxHAS_GENERIC_DATAVIEWCTRL
wxUSE_GENERICDATAVIEWCTRL


only wxHAS_GENERIC_DATAVIEWCTRL will not work
Post Reply