c++ - Displaying a large string in wxDataViewListCtrl -


how display long string in cell of wxdataviewlistctrl. have not found in documentation way when selecting cell or adding scrolling. maybe exist way user able changed length of columns? appreciated.

mcve:

#include "wx/wx.h" #include <wx/dataview.h>  class myapp : public wxapp     {     public:         virtual bool oninit() wxoverride;     };  wximplement_app(myapp);  class myframe : public wxframe      {     public:         myframe(const wxstring& title) : wxframe(nullptr, wxid_any, title)             {             wxboxsizer* topsizer = new wxboxsizer(wxhorizontal);             wxdataviewlistctrl* lc = new wxdataviewlistctrl(this, wxid_any);             lc->appendtextcolumn("first");             lc->appendtextcolumn("second");             lc->appendtextcolumn("third");             auto randstring = [](std::size_t size)                 {                 wxstring charset = "01234567890abcdefghijklmnopqrstuvwxyz";                 wxstring str = wxstring(size,' ');                 (size_t = 0; < size; i++)                      str[i] = charset[rand() % charset.size()];                 return str;                 };             (int i=0;i<10;i++)                 {                 wxvector<wxvariant> vec;                 vec.push_back(randstring(20));                 vec.push_back(wxstring::format("%d", i));                 vec.push_back(randstring(25));                 lc->appenditem( vec );                 }              topsizer->add(lc, 1,wxexpand | wxall, 5 );             this->setsizer(topsizer);             this->fitinside();              this->layout();             }         ~myframe(void)             {             }     };  bool myapp::oninit()     {     if ( !wxapp::oninit() )         return false;      myframe *frame = new myframe("mcve");     frame->show(true);     return true;     } 

image

i guess you're looking wxdataviewrenderer::disableellipsize() can used avoid using ellipsis (...) when string long fit. of course, going truncate string instead, not better.

if want show string in full, have ensure columns wide enough.


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -