How to know the size of row label or col label?
How to know the size of row label or col label?
Hi,
About cell, we can use CellToRect(int row, int col), but what about row label or col label?
Thanks!
About cell, we can use CellToRect(int row, int col), but what about row label or col label?
Thanks!
Re: How to know the size of row label or col label?
I assume you're talking about wxGrid.
Code: Select all
GetColLabelSize () const
GetColSize (int col) const
GetRowLabelSize () const
GetRowSize (int row) const
Use the source, Luke!
Re: How to know the size of row label or col label?
If I want to know coordinates of one of row/col label, is there this kind of member function?doublemax wrote: ↑Fri Apr 12, 2019 8:43 am I assume you're talking about wxGrid.Code: Select all
GetColLabelSize () const GetColSize (int col) const GetRowLabelSize () const GetRowSize (int row) const
CellToRect can get position in logical coordinates of cell.
Thanks!
Re: How to know the size of row label or col label?
I don't think so. What for do you need this information?
Use the source, Luke!
Re: How to know the size of row label or col label?
It's for a very special purpose. I want to know the position of row/col label, then stick a widget to overlap it.
for example, to overlap one of col label:
Code: Select all
const int c_GridLineSize = 1;
int cell_width = GetColWidth(col);
int colheader_height = GetColLabelSize();
int skippedWidth = 0;
for (int i = 0; i < col; i++) {
skippedWidth += GetColWidth(i);
}
win->Move(skippedWidth+c_GridLineSize , c_GridLineSize);
win->SetSize(cell_width-2*c_GridLineSize,colheader_height-2*c_GridLineSize);
Thanks!
Re: How to know the size of row label or col label?
the parent of win is GetGridColLabelWindow()
Re: How to know the size of row label or col label?
Another question, no way to drag move row label?
Re: How to know the size of row label or col label?
Hi,
I believe there is a renderer specifically for row/col label...
Thank you.
Why?shawnee wrote: ↑Fri Apr 12, 2019 2:23 pmIt's for a very special purpose. I want to know the position of row/col label, then stick a widget to overlap it.
for example, to overlap one of col label:it's almost ok, but the grid line between two col labels is always overlapped, can not be shown. I don't know why, suppose the size of win should be right.Code: Select all
const int c_GridLineSize = 1; int cell_width = GetColWidth(col); int colheader_height = GetColLabelSize(); int skippedWidth = 0; for (int i = 0; i < col; i++) { skippedWidth += GetColWidth(i); } win->Move(skippedWidth+c_GridLineSize , c_GridLineSize); win->SetSize(cell_width-2*c_GridLineSize,colheader_height-2*c_GridLineSize);
Thanks!
I believe there is a renderer specifically for row/col label...
Thank you.