Hello,
I have been working with columns and while the setColumnWidth method works fine, why isn't there a getColumnWidth method?
Regards,
Brian
setColumnWidth and getColumnWidth UPDATED getColumnWidth
-
reifsnyderb
- Posts: 45
- Joined: Wed Oct 29, 2008 6:03 pm
setColumnWidth and getColumnWidth UPDATED getColumnWidth
Last edited by reifsnyderb on Sun Mar 06, 2011 3:53 am, edited 1 time in total.
-
reifsnyderb
- Posts: 45
- Joined: Wed Oct 29, 2008 6:03 pm
Ok, I think the following lines of code will work if added to CGUITable.cpp
u32 CGUITable::getColumnWidth(u32 columnIndex)
{
if(columnIndex >= 0 && columnIndex < (u32)columns.size() )
{
return (u32)columns[columnIndex].width;
}
return 0;
}
However, here is the problem: I can't get Irrlicht to compile and my irritation is that I have so many hours an evening to work on my program and I really don't have time to sit down and hack Irrlicht too.
Any help will be greatly appreciated. I am using VC 2005 and Irrlicht is installed under d:\irrlicht\working\ I have the original installed under d:\irrlicht\irrlicht-1.7.2
Don't get me wrong. Irrlicht is a great library and I really like it. I am just frustrated.
Thanks,
Brian
u32 CGUITable::getColumnWidth(u32 columnIndex)
{
if(columnIndex >= 0 && columnIndex < (u32)columns.size() )
{
return (u32)columns[columnIndex].width;
}
return 0;
}
However, here is the problem: I can't get Irrlicht to compile and my irritation is that I have so many hours an evening to work on my program and I really don't have time to sit down and hack Irrlicht too.
Any help will be greatly appreciated. I am using VC 2005 and Irrlicht is installed under d:\irrlicht\working\ I have the original installed under d:\irrlicht\irrlicht-1.7.2
Don't get me wrong. Irrlicht is a great library and I really like it. I am just frustrated.
Thanks,
Brian
-
reifsnyderb
- Posts: 45
- Joined: Wed Oct 29, 2008 6:03 pm
-
reifsnyderb
- Posts: 45
- Joined: Wed Oct 29, 2008 6:03 pm
Ok, the following works great!
u32 CGUITable::getColumnWidth(s32 columnIndex) const
{
if(columnIndex >= 0 && columnIndex < (s32)columns.size() )
{
return (u32)columns[columnIndex].width;
}
return 0;
}
Of course, the two header files need updated as well. Now, is there a chance to get this included in the next release of Irrlicht?
Regards,
Brian
u32 CGUITable::getColumnWidth(s32 columnIndex) const
{
if(columnIndex >= 0 && columnIndex < (s32)columns.size() )
{
return (u32)columns[columnIndex].width;
}
return 0;
}
Of course, the two header files need updated as well. Now, is there a chance to get this included in the next release of Irrlicht?
Regards,
Brian
question:
in this line
in this line
Code: Select all
if(columnIndex >= 0 && columnIndex < (s32)columns.size() ) Code: Select all
(s32)columns.size()
//or
(s32)Columns.size() -
reifsnyderb
- Posts: 45
- Joined: Wed Oct 29, 2008 6:03 pm
Hello,
Thanks for pointing that out. I re-typed it, on another computer, to post it. "Columns" should be capitalized. It also occurred to me that there may be a theoretical possibility of wanting to set a column to 0 so maybe a -1 should be returned if the column doesn't exist.
i.e.
[code]
s32 CGUITable::getColumnWidth(s32 columnIndex)
{
if(columnIndex >= 0 && columnIndex < (s32)Columns.size() )
{
return (u32)Columns[columnIndex].width;
}
return -1;
}
[/code]
Regards,
Brian
[quote="random"]question:
in this line
[code]if(columnIndex >= 0 && columnIndex < (s32)columns.size() ) [/code]
[code](s32)columns.size()
//or
(s32)Columns.size() [/code][/quote]
Thanks for pointing that out. I re-typed it, on another computer, to post it. "Columns" should be capitalized. It also occurred to me that there may be a theoretical possibility of wanting to set a column to 0 so maybe a -1 should be returned if the column doesn't exist.
i.e.
[code]
s32 CGUITable::getColumnWidth(s32 columnIndex)
{
if(columnIndex >= 0 && columnIndex < (s32)Columns.size() )
{
return (u32)Columns[columnIndex].width;
}
return -1;
}
[/code]
Regards,
Brian
[quote="random"]question:
in this line
[code]if(columnIndex >= 0 && columnIndex < (s32)columns.size() ) [/code]
[code](s32)columns.size()
//or
(s32)Columns.size() [/code][/quote]
-
reifsnyderb
- Posts: 45
- Joined: Wed Oct 29, 2008 6:03 pm
Hello,
It looks like it will be added to the trunk:
http://irrlicht.sourceforge.net/phpBB2/ ... 385#245385
Also, it appears that returning 0 is fine after all.
Regards,
Brian
It looks like it will be added to the trunk:
http://irrlicht.sourceforge.net/phpBB2/ ... 385#245385
Also, it appears that returning 0 is fine after all.
Regards,
Brian