Hello,
Since there is a setColumnWidth, is there a chance of me talking somebody into adding a getColumnWidth into CGUITable.cpp?
The following code works:
[code]
u32 CGUITable::getColumnWidth(s32 columnIndex) const
{
if(columnIndex >= 0 && columnIndex < (s32)columns.size() )
{
return (u32)columns[columnIndex].width;
}
return 0;
}
[/code]
Regards,
Brian
Addition of IGUITable::getColumnWidth to CGUITable.cpp???
-
- Posts: 45
- Joined: Wed Oct 29, 2008 6:03 pm
-
- Posts: 45
- Joined: Wed Oct 29, 2008 6:03 pm
Hello,
Since there is a theoretical possibility of a column returning a 0 width, I modified the code so that a -1 is returned if a column doesn't exist. Also, since I re-typed this, as I tested it on another computer, it turns out that I forgot to capitalize "Columns" in my last post.
[code]
s32 CGUITable::getColumnWidth(s32 columnIndex) const
{
if(columnIndex >= 0 && columnIndex < (s32)Columns.size() )
{
return (u32)Columns[columnIndex].width;
}
return -1;
}
[/code]
Regards,
Brian
Since there is a theoretical possibility of a column returning a 0 width, I modified the code so that a -1 is returned if a column doesn't exist. Also, since I re-typed this, as I tested it on another computer, it turns out that I forgot to capitalize "Columns" in my last post.
[code]
s32 CGUITable::getColumnWidth(s32 columnIndex) const
{
if(columnIndex >= 0 && columnIndex < (s32)Columns.size() )
{
return (u32)Columns[columnIndex].width;
}
return -1;
}
[/code]
Regards,
Brian
Ok, I've added that function in trunk.
edit: Just noting in case you wonder:
columnIndex is u32 as in setter (Irrlicht switched at some time to using u32 throughout for indices, a topic discussed elsewhere...)
And returning 0 is fine and we should return u32 as this is an u32 value.
edit: Just noting in case you wonder:
columnIndex is u32 as in setter (Irrlicht switched at some time to using u32 throughout for indices, a topic discussed elsewhere...)
And returning 0 is fine and we should return u32 as this is an u32 value.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
what about getColumnLength ?
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
-
- Posts: 45
- Joined: Wed Oct 29, 2008 6:03 pm
I was, in fact, being sarcastic
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
I was sure of that the first few times, but by now I started wondering ;-)ent1ty wrote:I was, in fact, being sarcastic
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm