Hi all,
again another issue related to wx2.9, that was working in wx2.8...
I've made a scrabble game, as you can see in the following picture, the grid is on left, and the info panel with a score grid is on the right.
Those panels are in sizers with a GROW attribute and the proportion are 10 for the game grid, 7 for the right panel.
In the previous verion of my software (running with wx2., that was working well, the game grid was displayed in big, with a proportion of 10/7 compared to the info panel to the right.
The score grid that is in the info panel was truncated, and a horizontal scrallbar appeared to be abled to move in order to see the whole grid.
That is want I want.
But now, I'm with wx2.9, and the score grid is always rendered in big, that is to say there is no horizontal scrollbar, and no way to reduce the grid size. All columns are always displayed.... Even if my panel has a grow attributes.
How must I do to force the grid to be partially displayed with a horizontal scrollbar that let me scoll on the whole grid width ?
Thanks a lot.
Horizontal scrollbar with a grid in wx2.9 ? Topic is solved
-
- Super wx Problem Solver
- Posts: 323
- Joined: Sun Jun 08, 2008 11:59 am
- Location: Bordeaux, France
Horizontal scrollbar with a grid in wx2.9 ?
OS: Ubuntu 11.10
Compiler: g++ 4.6.1 (Eclipse CDT Indigo)
wxWidgets: 2.9.3
Compiler: g++ 4.6.1 (Eclipse CDT Indigo)
wxWidgets: 2.9.3
Re: Horizontal scrollbar with a grid in wx2.9 ?
I don't think this has anything to do with wxGrid, there is a change in sizer behavior in wx2.9.x
From docs/changes.txt:
I personally didn't like this change, as it definitely does not match my "user expectation"
From docs/changes.txt:
Code: Select all
- Sizers distribute only the extra space between the stretchable items
according to their proportions and not all available space. We believe the
new behaviour corresponds better to user expectations but if you did rely
on the old behaviour you will have to update your code to set the minimal
sizes of the sizer items to be in the same proportion as the items
proportions to return to the old behaviour.
Use the source, Luke!
-
- Super wx Problem Solver
- Posts: 323
- Joined: Sun Jun 08, 2008 11:59 am
- Location: Bordeaux, France
Re: Horizontal scrollbar with a grid in wx2.9 ?
Hi, thanks !
This means that I have to set the size of the wxGrid explicitly to the width I want ?
I already tried MyGrid::SetVirtualSize( 200, 200) but nothing happens, the grid stay in big.
I also tried to SetVirtualSize to the parent container of the grid ==> the Panel "Topping" that is in the notebook. Nothing changed too.
Can you suggest me something ?
This means that I have to set the size of the wxGrid explicitly to the width I want ?
I already tried MyGrid::SetVirtualSize( 200, 200) but nothing happens, the grid stay in big.
I also tried to SetVirtualSize to the parent container of the grid ==> the Panel "Topping" that is in the notebook. Nothing changed too.
Can you suggest me something ?
OS: Ubuntu 11.10
Compiler: g++ 4.6.1 (Eclipse CDT Indigo)
wxWidgets: 2.9.3
Compiler: g++ 4.6.1 (Eclipse CDT Indigo)
wxWidgets: 2.9.3
Re: Horizontal scrollbar with a grid in wx2.9 ?
I think you need SetMinSize() (or pass a size in the control's constructor which implicitly does the same).
Use the source, Luke!
-
- Super wx Problem Solver
- Posts: 323
- Joined: Sun Jun 08, 2008 11:59 am
- Location: Bordeaux, France
Re: Horizontal scrollbar with a grid in wx2.9 ?
Hi !
Thanks, doing this (SetMinSize) works well.
That is just sad that I have to set the wxGrid size myself and that it is not computed automatically.
Doublemax, you're right, this change in wx2.9 is not really good !!
Again thanks for the help.
Bye.
Thanks, doing this (SetMinSize) works well.
That is just sad that I have to set the wxGrid size myself and that it is not computed automatically.
Doublemax, you're right, this change in wx2.9 is not really good !!
Again thanks for the help.
Bye.
OS: Ubuntu 11.10
Compiler: g++ 4.6.1 (Eclipse CDT Indigo)
wxWidgets: 2.9.3
Compiler: g++ 4.6.1 (Eclipse CDT Indigo)
wxWidgets: 2.9.3