Some questions: GUI

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
Nils:D
Posts: 24
Joined: Sat Sep 09, 2006 12:35 pm

Some questions: GUI

Post by Nils:D »

Hi,

i have a GUIWindow.

Code: Select all

IGUIEnvironment* env = device->getGUIEnvironment();
IGUIElement* root = env->getRootGUIElement();
IGUIElement* e = root->getElementFromId(5000, true);
if (e) e->remove();

IGUIWindow* wnd = env->addWindow(core::rect<s32>(0,0,640,480),
   false, L"Modelloader", 0, 5000);
Is it possible to set the Buttons, ComboBox etc. set in the window ? Cause: How can i make a GUIWindow to the MainWindow ? In Delphi it was BorderStyle := bsNone, but i don't know the way for this in Cpp with Irrlicht. That means: how can i make the Windowsborderstyle Invisible and there is only the GUIWindow within the other GUI... .
kornerr
Posts: 245
Joined: Thu Jul 06, 2006 9:57 am
Location: Russia, Siberia, Kemerovo
Contact:

Post by kornerr »

If you want to make MainMenu there's no need in IGUIWindow, create elements with no parent. Other than MainMenu area I can't see any need for "captionless" windows.
Open Source all the way, baby ;)
OSRPG
Nils:D
Posts: 24
Joined: Sat Sep 09, 2006 12:35 pm

Post by Nils:D »

I think you missunderstand me. With the Irrlicht-GUI it is at the moment like Picture1, the Controls are only in front, if i click on the created Window the Controls will be push behind the Window (Picture2):
Picture1
Picture2
How can i make a window (the mainwindow of the application) looks like this ?

In short words: How can i make a GUIWindow to the Applicationwindow.
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

I see currently no easy way to do that (but maybe i'm also missing something). I think you would have to change the devicestub's for linux&windows to do that (which actually might be not so hard). But you will get this behaviour automatically in fullscreen-mode.
kornerr
Posts: 245
Joined: Thu Jul 06, 2006 9:57 am
Location: Russia, Siberia, Kemerovo
Contact:

Post by kornerr »

It's impossible to make IGUIWindow be Irrlicht's display window.
Open Source all the way, baby ;)
OSRPG
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I think you are asking a simple gui question. If all you want is for the buttons and stuff to move with the gui window you've created that is no problem. Each of the add methods of the gui environment take a parent pointer. All you need to do is specify a parent when creating the controls and those controls will be bound to the parent. They will move with it, and they will stay on top of it.

Code: Select all

IGUIWindow* wnd = env->addWindow(core::rect<s32>(0,0,640,480), 
   false, L"Modelloader", 0, 5000);

env->addButton(rect<s32>(10,210,110,210 + 32), wnd, 101, L"Quit");
env->addButton(rect<s32>(10,250,110,250 + 32), wnd, 102, L"New Window");
env->addButton(rect<s32>(10,290,110,290 + 32), wnd, 103, L"File Open");
If you want to make eliminate the border of the actual application window, then you need to write code to create your own window, make it borderless, and then use createDeviceEx() to create a device in your custom window.

Travis
Post Reply