I’m trying to make a control that can have arbitrary amount child controls.
by default when you keep adding content to it’s horizontal box sizer, any content that doesn’t fit will be added out of view, off the edge on the right.
Is there a way I can reverse it so that adding content on the right instead pushes off items on the left out of view.
so for instance if I had 6 child controls 1, 2, 3, 4, 5, 6 and the control only has enough room for 4 controls, where [ and ] is the viewable area.
By default the view would look like [1234]56 but I want to get it to look like 12[3456] So when adding another item it will look like 123[4567] instead of [1234]567.
I have kind of got this behaviour by making the control derive from a wx.lib.scrolledpanel.ScrolledPanel and calling SetupScrolling when I add or remove a child, but doing this I get a scroll bar which I don’t seem to be able to hide. Is there a way to hide the scroll bars? or just a different way I can achieve this?
I’m trying to make a control that can have arbitrary amount child controls.
by default when you keep adding content to it’s horizontal box sizer, any content that doesn’t fit will be added out of view, off the edge on the right.
Is there a way I can reverse it so that adding content on the right instead pushes off items on the left out of view.
so for instance if I had 6 child controls 1, 2, 3, 4, 5, 6 and the control only has enough room for 4 controls, where [ and ] is the viewable area.
By default the view would look like [1234]56 but I want to get it to look like 12[3456] So when adding another item it will look like 123[4567] instead of [1234]567.
I have kind of got this behaviour by making the control derive from a wx.lib.scrolledpanel.ScrolledPanel and calling SetupScrolling when I add or remove a child, but doing this I get a scroll bar which I don’t seem to be able to hide. Is there a way to hide the scroll bars? or just a different way I can achieve this?
In case anyone is interested I found a solution to this.
I right aligned the content, with a stretch spacer to the left.
I monitored the width of the content versus the width of the space I have and Hide the spacer when the content is wider, then show it once it becomes narrow enough to fit again.
I’m trying to make a control that can have arbitrary amount child controls.
by default when you keep adding content to it’s horizontal box sizer, any content that doesn’t fit will be added out of view, off the edge on the right.
Is there a way I can reverse it so that adding content on the right instead pushes off items on the left out of view.
so for instance if I had 6 child controls 1, 2, 3, 4, 5, 6 and the control only has enough room for 4 controls, where [ and ] is the viewable area.
By default the view would look like [1234]56 but I want to get it to look like 12[3456] So when adding another item it will look like 123[4567] instead of [1234]567.
I have kind of got this behaviour by making the control derive from a wx.lib.scrolledpanel.ScrolledPanel and calling SetupScrolling when I add or remove a child, but doing this I get a scroll bar which I don’t seem to be able to hide. Is there a way to hide the scroll bars? or just a different way I can achieve this?
In case anyone is interested I found a solution to this.
I right aligned the content, with a stretch spacer to the left.
sorry, got myself confused. This should read
I right aligned the content, with a stretch spacer to the right
···
On 14 November 2013 11:54, Paul Wiseman <poalman@gmail.com> wrote:
I monitored the width of the content versus the width of the space I have
and Hide the spacer when the content is wider, then show it once it becomes
narrow enough to fit again.
On 15 October 2013 14:13, Paul Wiseman <poalman@gmail.com> wrote:
SetupScrolling and ScrollChildIntoView with the end element *
On 15 October 2013 14:11, Paul Wiseman <poalman@gmail.com> wrote:
Hey all,
I'm trying to make a control that can have arbitrary amount child
controls.
by default when you keep adding content to it's horizontal box sizer,
any content that doesn't fit will be added out of view, off the edge on the
right.
Is there a way I can reverse it so that adding content on the right
instead pushes off items on the left out of view.
so for instance if I had 6 child controls 1, 2, 3, 4, 5, 6 and the
control only has enough room for 4 controls, where [ and ] is the viewable
area.
By default the view would look like [1234]56 but I want to get it to
look like 12[3456] So when adding another item it will look like 123[4567]
instead of [1234]567.
I have kind of got this behaviour by making the control derive from a
wx.lib.scrolledpanel.ScrolledPanel and calling SetupScrolling when I add or
remove a child, but doing this I get a scroll bar which I don't seem to be
able to hide. Is there a way to hide the scroll bars? or just a different
way I can achieve this?