Page 1 of 1

Creating a spawnable dashboard

Posted: Mon Aug 12, 2019 8:21 am
by tjbell
I'm developing a dashboard containing several columns (inside a wxBoxSizer). Each column has a number of other fields showing lines of information relating to different users. I need to be able to add, remove and update each column regularly in response to detecting which users are registered etc. but I can't figure out the best way to implement a class to represent a user.

I need to be able to 'spawn' and delete new columns easily (i.e. create instances of wxStaticBoxSizer) with all of the other widgets inside.

Would the best way be to create a class to inherit from wxStaticBoxSizer (to represent a column) and add everything to that, or does wxWidgets provide a cleaner way to manage instances of UI components?

Thanks in advance?

Re: Creating a spawnable dashboard

Posted: Mon Aug 12, 2019 3:41 pm
by doublemax
Would the best way be to create a class to inherit from wxStaticBoxSizer (to represent a column) and add everything to that...
That's the usual way to go. Derive from wxPanel (or any other class that might fit better).
or does wxWidgets provide a cleaner way to manage instances of UI components?
No. Just taking advantage of subclassing should be sufficient.