Manipulating a ListBox from getelementID
Manipulating a ListBox from getelementID
Ok...I want to add an item to a listbox from an IGUIEnvironment element->getelementfromID(ID,false). How could I go about this?
A listbox can only hold strings, not 3d nor gui elements !!!
But what you're trying to do ???
Maybe an array could help you ???
But what you're trying to do ???
Maybe an array could help you ???
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:

http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Check that the element returned is indeed a list box, cast it to an IGUIListBox and then call the correct list box function...
If you compiled the Irrlicht library with RTTI enabled, you could use a dynamic_cast, something like this.
Travis
Code: Select all
IGUIElement* found= element->getElementFromID(ID, false);
if (found->getType() == EGUIET_LIST_BOX)
{
IGUIListBox* listBox = (IGUIListBox*)found;
listBox->addItem("hello world!");
}
Code: Select all
IGUIListBox* listBox = dynamic_cast<IGUIListBox*>(element->getElementFromID(ID, false));
if (listBox)
{
listBox->addItem("hello world!");
}
Oh, I thought he want's to get an element and add this element to a listbox...
I was wondering why someone would do this...
Yes, a type cast should solve the problem...
Also with element->getType() you can check for EGUIET_LIST_BOX if the element really is a listbox (as Travis mentioned)
I was wondering why someone would do this...
Yes, a type cast should solve the problem...
Also with element->getType() you can check for EGUIET_LIST_BOX if the element really is a listbox (as Travis mentioned)
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:

http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Well, I have not uploaded a precompiled dll, because IrrExtensions was designed for easily recompiling the dll !!! 
Another reason is that you can choose what extensions, lib type and drivers you want to use !!!
So you can create 100s of different dlls with it...
Also there is a difference between using GCC and MSVC (what will double the ammount of possible dll types) !!!
Another reason is that you can choose what extensions, lib type and drivers you want to use !!!
So you can create 100s of different dlls with it...
Also there is a difference between using GCC and MSVC (what will double the ammount of possible dll types) !!!
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:

http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
I ask for it because when I try to run your extensions program it either tells me it can't find the includes (though they are with the source as per the instructions for v1.1) OR it tells me they are the wrong version (when trying with v1.2). Which is why I would like a copy of it all with all the new extension additions if possible. If not I guess I will need to figure out why this is not cooperating.
Well, if you really don't get it to work I can upload a dll temporarly for you... 
But I think you made an common mistake with it...
You'll have to copy the include folder into the source folder (source\Irrlicht) !!!
Some people had this problem, too...
But everybody got it to work after they knew this...
In older Irrlicht versions the include folder was already there, but now you'll have to copy it there...
All this is also described in the IrrExtensions help file...
Now, give it a last try, and if you don't get it tell me if you want the dll with sound (Audiere) or not !!!
But remember if sound was included to the dll, then all your projects need to link against Audiere, too (even you don't need sound in the project)...
And if no sound was included to the dll, then the AVI-Player extension has no sound support...
But I think you made an common mistake with it...
You'll have to copy the include folder into the source folder (source\Irrlicht) !!!
Some people had this problem, too...
But everybody got it to work after they knew this...
In older Irrlicht versions the include folder was already there, but now you'll have to copy it there...
All this is also described in the IrrExtensions help file...
Now, give it a last try, and if you don't get it tell me if you want the dll with sound (Audiere) or not !!!
But remember if sound was included to the dll, then all your projects need to link against Audiere, too (even you don't need sound in the project)...
And if no sound was included to the dll, then the AVI-Player extension has no sound support...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:

http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
I second the error report and maybe the instructions, however the folder copy did work so I should be set and thanks again for making these extensions. Now i jsut need to figure out how to extract the slightly illegal .devpak and does this work on v1.2
Last edited by utimagus on Sun Jan 28, 2007 11:05 pm, edited 1 time in total.
A DevPack is nothing more than a TAR archive...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:

http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
No, you need 3 things from the archive:
1st the includes - copy them to your compilers include directory, and/or add the path to your compiler settings
2nd the libs - copy them to your compilers libs directory, and/or add the path to your compiler settings
3rd the dlls - copy them to your windows system folder (c:\windows\system32) or directly into the folder of every Irlicht project you make
This is the procedure for every sdk you want to install (like Audiere, Newton, and so on)
1st the includes - copy them to your compilers include directory, and/or add the path to your compiler settings
2nd the libs - copy them to your compilers libs directory, and/or add the path to your compiler settings
3rd the dlls - copy them to your windows system folder (c:\windows\system32) or directly into the folder of every Irlicht project you make
This is the procedure for every sdk you want to install (like Audiere, Newton, and so on)
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:

http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
now i just gotta figure out why vanilla irrlicht compiles with a mess load of errors there are about 20 sets of this set of errors:
c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(222) : error C2146: syntax error : missing ';' before identifier 'PVOID64'
c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(222) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(5940) : error C2146: syntax error : missing ';' before identifier 'Buffer'
c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(5940) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(5940) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
not sure why
c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(222) : error C2146: syntax error : missing ';' before identifier 'PVOID64'
c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(222) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(5940) : error C2146: syntax error : missing ';' before identifier 'Buffer'
c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(5940) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(5940) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
not sure why