TableHeaderComponent request


#1

Hey Jules can you give us a getColumnWidth(const int columnId) method?

I know we have the restoreFromString methods in this class, but it would be really useful to me!

int TableHeaderComponent::getColumnWidth(const int columnId) const throw()
{
	const ColumnInfo* const ci = getInfoForId (columnId);
    return ci != 0 ? ci->width : 0;
}

tnx


#2

Can’t you just use getColumnPosition().getWidth() ?


#3

From tableColumnsResized(TableHeaderComponent* tableHeader) it’d be useful…

for (int i=0;igetNumColumns(true);i++)
{
int idIndex=tableHeader->getColumnIdOfIndex(i,true);
int columnSize=tableHeader->getColumnWidth(idIndex);
//do something with it here

}

#4

…yeah, but what’s wrong with:

?


#5

:oops: Shucks, I missed that…what a silly bugger I am…


#6

Another request for the same :slight_smile: : Could you make showColumnChooserMenu virtual and protected so that I can override it (showing my own native popup menu impl) ? Alternatively, add a method to lookandfeel called showPopupMenu(const PopupMenu&, int screenX, int screenY) so all PopupMenu’s work the same way?


#7

I like your L+F suggestion, but there are quite a few show() variations that would all need to be handled, and it’d be a bit messy. I’ve no objection to making that method virtual though, so will do that…