spacing and font size for cells in wxGrid

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
ask
In need of some credit
In need of some credit
Posts: 7
Joined: Sun Jul 29, 2007 3:39 pm

spacing and font size for cells in wxGrid

Post by ask »

I have problem building wxSheet on my WinXP + wx 2.8.7, so I had to use wxGrid for my case. What do you think the easiest way to change font size of the cells and set spacing for them?
dynamoman
Knows some wx things
Knows some wx things
Posts: 32
Joined: Sun Aug 26, 2007 2:38 pm

Post by dynamoman »

for the spacing I use setColSize, since the fitting options didnt work for me. And for the font, I think the best one(and maybe the only one) is SetCellFont, the advantage of these functions is that you can set the size or font of every column and cell, it may be more lines of code, but you have a nice way to customize every column and cell.
ask
In need of some credit
In need of some credit
Posts: 7
Joined: Sun Jul 29, 2007 3:39 pm

Post by ask »

yeah, changing font is ok. and for the spacing, I added custom renderer and made the rect smaller, so the spacing appeared.

now I'm trying to find a way to make text editor in cell go to the next line by Enter, and not by Ctrl+Enter. And I want to find a combobox which allows to add it's values on the fly, like textctrl+combobox in once device.

any ideas how to solve the matter?
ask
In need of some credit
In need of some credit
Posts: 7
Joined: Sun Jul 29, 2007 3:39 pm

Post by ask »

by the way, does anybody knows how is it possible to change the color of the border not for the cells of the grid, but for the border of the labels of the grid. I've found only how to change background color and font color/size of the label, but not the border.
dynamoman
Knows some wx things
Knows some wx things
Posts: 32
Joined: Sun Aug 26, 2007 2:38 pm

Post by dynamoman »

the borders AFAIK cant be changed, I just recently tried to asociate a renderer to a border but it seems it cant be done, I tried reading the docs and asking and it seems like it cant be done, and for the other question about the shift-Enter, I think you have to extend wxCellEditor, but I have never tried that, maybe in the sample app there is some useful info for that.
ask
In need of some credit
In need of some credit
Posts: 7
Joined: Sun Jul 29, 2007 3:39 pm

Post by ask »

I thought about using wxGridCellEditor but there is not key event handler...
Post Reply