Hi,
I'm looking for a way to create a toolbox like gimp : a table of button, and a second part for action linked to the pressed button.
I created a panel with wxgridsizer or wxflexgridsizer, but the problem is when I resize this panel, the buttons table alignement does not changes.
I would like to know how doing a floating button table in a panel, as gimp do, to obtain this :
- the original buttons table is a matrix of 3x4 buttons
- after growing the panel, the matrix can become just a matrix of 1x1 or 1x2, it depends of the new size of the panel
- reversly, if the size go down, the matrix have to become 10x1 for example.
I tried many things, but right now, I have no more idea
If someone have an idea, thanks in advance !
tkd
Toolbox like Gimp
-
- Moderator
- Posts: 19163
- Joined: Fri Apr 21, 2006 8:03 pm
- Location: $FCE2
If you're using wxWidgets 2.9.x you can use wxWrapSizer:
http://docs.wxwidgets.org/trunk/classwx_wrap_sizer.html
If you want to stay with wx 2.8.x you'd have to implement that behavior yourself.
http://docs.wxwidgets.org/trunk/classwx_wrap_sizer.html
If you want to stay with wx 2.8.x you'd have to implement that behavior yourself.
Use the source, Luke!
-
- In need of some credit
- Posts: 2
- Joined: Tue Mar 23, 2010 10:57 am
Toolbox like Gimp
doublemax wrote:If you're using wxWidgets 2.9.x you can use wxWrapSizer:
http://docs.wxwidgets.org/trunk/classwx_wrap_sizer.html
If you want to stay with wx 2.8.x you'd have to implement that behavior yourself.
Hi,
unfortunatly, I have to stay with wx 2.8.
I can implement it by myself, but I don't understand exactly how to start. Do you have an indication to help me pl ?
Thanks in advance
tkd
-
- Moderator
- Posts: 19163
- Joined: Fri Apr 21, 2006 8:03 pm
- Location: $FCE2
-
- Site Admin
- Posts: 6695
- Joined: Thu Sep 28, 2006 12:23 am
-
- Moderator
- Posts: 19163
- Joined: Fri Apr 21, 2006 8:03 pm
- Location: $FCE2
Yeah. Important thing that i forgot to mention: You have to do this whenever the control gets resized, either recreating the whole sizer layout, or dynamically detaching/attaching the buttons to the different sizers. Not really a trivial task.
So maybe you should consider switching to 2.9.x
So maybe you should consider switching to 2.9.x
Use the source, Luke!