[Solved] How does one add tabcontrol to the IrrlichtDevice?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
carlwryker
Posts: 22
Joined: Sun Jun 12, 2016 8:03 am

[Solved] How does one add tabcontrol to the IrrlichtDevice?

Post by carlwryker »

Hello, I tried the Interface and Mesh Viewer tutorials and they run successfully. I'm trying to add tabs to my IrrlichtDevice (Primary Window) instead of the IGUIWindow element (TestWindow) as shown by the red arrow in Figure 1.

Image
Figure 1.

I initially thought it would be as simple as changing my code segment from Code 1 to Code 2 (i.e. changing parent of tab control to the IrrlichtDevice). However, when I try to compile with the changes made in Code 2, CodeBlocks gives me error message of "no matching function for call to" as shown in Figure 2. As declared in Code 3 (which is actually located before Code 1), gWindowPrimary, is the IrrlichtDevice, gTabsBar is the IGUITabControl, gIrrEnvir is the IGUIEnvironment. I would like to share more of the code, but my colleague is reluctant to do so.

Code 1:

Code: Select all

 
irr::gui::IGUIWindow * window = gIrrEnvir->addWindow( irr::core::rect<irr::s32>( 0, 40, 800, 480 ), false, L"TestWindow", 0, GUI_ID_ );
gTabsBar = gIrrEnvir->addTabControl( irr::core::rect<irr::s32>( 2, 20, 1024-602, 480-7 ), window, true, true );
 
Code 2:

Code: Select all

 
gTabsBar = gIrrEnvir->addTabControl( irr::core::rect<irr::s32>( 2, 20, 1024-602, 480-7 ), gWindowPrimary, true, true );
 
Image
Figure 2.

Code3:

Code: Select all

 
irr::IrrlichtDevice * gWindowPrimary;
gWindowPrimary = irr::createDevice( driverType, irr::core::dimension2d<irr::u32>( 1024, 768 ), 16, false, false, false );
irr::gui::IGUIEnvironment * gIrrEnvir;
gIrrEnvir = gWindowPrimary->getGUIEnvironment();
irr::gui::IGUITabControl * gTabsBar;
 
Last edited by carlwryker on Mon Jun 13, 2016 4:42 am, edited 1 time in total.
Code::Blocks
mingw
Windows 10 64-bit
carlwryker
Posts: 22
Joined: Sun Jun 12, 2016 8:03 am

Re: How does one add tabcontrol to the IrrlichtDevice?

Post by carlwryker »

Solved by setting the parent to 0.

Code: Select all

 
gTabsBar = gIrrEnvir->addTabControl( irr::core::rect<irr::s32>( 2, 20, 1024-602, 480-7 ), 0, true, true );
 
Code::Blocks
mingw
Windows 10 64-bit
Post Reply