How to put in wxListCtrl item a wxPanel?

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
dkaip
Super wx Problem Solver
Super wx Problem Solver
Posts: 334
Joined: Wed Jan 20, 2010 1:15 pm

How to put in wxListCtrl item a wxPanel?

Post by dkaip »

I have wxListCtrl and in cells i whant to put wxPanel Objects.
Is that possible?

Code: Select all

class MyPanel1 : public wxPanel 
----------------
    MyPanel1* cp[100];
  for(int i=0; i<10; i++)
    {
        cp[i]=new MyPanel1(this);
        m_listCtrl1->SetItem(i, 0, cp[i]  );
    }
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: How to put in wxListCtrl item a wxPanel?

Post by eranon »

Unless mistake (not digged around wxListCtrl) I don't think it's easily possible with the wxListCtrl. For this, I would go with wxGrid (supporting custom renderers).

Two links:
- Similar question (for wxPython): http://wxpython-users.1045709.n5.nabble ... 57311.html
- Comparison of table-oriented controls: http://www.tt-solutions.com/img/slides/tables_comp.pdf
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: How to put in wxListCtrl item a wxPanel?

Post by PB »

dkaip wrote:I have wxListCtrl and in cells i whant to put wxPanel Objects.
Is that possible?
You may not be aware of it, but there is nice online documentation for wxWidgets at http://docs.wxwidgets.org/. There you can look at the interface of individual classes. The documentation should answer most of "is it possible" questions rater quick. For example, you could learn there is no wxListCtrl (or inherited) method that would allow manipulating its items as if it were wxWindows.
lfjking
Earned some good credits
Earned some good credits
Posts: 102
Joined: Mon Nov 14, 2016 1:35 pm

Re: How to put in wxListCtrl item a wxPanel?

Post by lfjking »

I understand that what you need is wxVScrolledWindow
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How to put in wxListCtrl item a wxPanel?

Post by doublemax »

dkaip, can you explain what you want to achieve? If you only have a small number of panels, you could put them all in a vertical boxsizer.
Use the source, Luke!
Post Reply