How to fix the wxListctrl right position

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
wxKevin
Earned a small fee
Earned a small fee
Posts: 21
Joined: Fri Jun 09, 2017 7:45 am

How to fix the wxListctrl right position

Post by wxKevin »

friend, When I dragged the colume, how to make the whole wxListCtrl not big, just the current colume bigger, next to the colume smaller?

Thanks
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How to fix the wxListctrl right position

Post by doublemax »

That's the default behavior, resizing a column should never resize the outer frame. Where do you see that behavior?
Use the source, Luke!
wxKevin
Earned a small fee
Earned a small fee
Posts: 21
Joined: Fri Jun 09, 2017 7:45 am

Re: How to fix the wxListctrl right position

Post by wxKevin »

On the mail client (foxmail), this requirement is this: colume1 & colume2 total width unchanged, if dragged colume1 larger, then colume2 should become smaller, and vice versa is the same. what should I do

Thank you
wxKevin
Earned a small fee
Earned a small fee
Posts: 21
Joined: Fri Jun 09, 2017 7:45 am

Re: How to fix the wxListctrl right position

Post by wxKevin »

Sorry, the word is wrong, 'colume' should be changed to 'column'
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How to fix the wxListctrl right position

Post by doublemax »

Unfortunately there is no easy way to do this, like just setting a flag.

In order to achieve that, you'd have to keep track of the width of the currently dragged column and change the width of the adjacent column accordingly.

E.g. if column 0 is made four pixels wider, you'll have to make the width of column 1 four pixels smaller.
Use the source, Luke!
Post Reply