GUIEditorControl

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

GUIEditorControl

Post by Nox »

Hi,

I searched a easy way to create and edit the GUI. The GUIEditor seems to be broken (i.e. textures could not be set, setting a big image to the background disable the window etc.) and i could not find another working editors.
So now there is a simple GUI-control which could be integrated into a game to edit the GUI directly. It bases on a treeview ( http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=17422 ) and the CGUIPanel from the GUIEditor.

link: http://7bitfaster.de/downloads/Irrlicht ... ontrol.zip

Patches, tips, improvments are wellcome.

Updates:

14.01.09
-fixed ScaleGUI
-removed tooltips because else they get added to the treeview => crash if TreeView->GetSelected()->Text is called

15.01.09
-add workingdir (save old workingdir before adding filedialog, set workingdir and restore old workingdir if a workingdir was set)
-added UseBuiltInSkin (works only for the mainwindow, because else OnEvent got problems)
-Imagerect is loaded automatically after changing a imagepath.
Last edited by Nox on Thu Jan 15, 2009 9:36 pm, edited 4 times in total.
geckoman
Posts: 143
Joined: Thu Nov 27, 2008 11:05 am
Location: Germany
Contact:

Post by geckoman »

I'm having a bit of a problem here:


Image

It crashes my graphicsdriver, again and again. But I could see something at first

EDIT:

I changed to Burningsvideo that works.
But I found a bug. If I click the scalgui-button the app crashes.
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

errr yeah....the ScalGUI function is brocken (sry, forgot to mention that).

The crashed device is a interesting issue. Could you find out at which point the device got killed? Could you try the pure treeview from the link? Just to be sure it is not the treeview. And you could remove the CGUIPanel to test if its the panel. Please just play a bit around, because i have no chance to find the bug without your help. (may be questions concerning the use of a debugger? just ask :) )

Update: fixed the ScaleGUI methode.
geckoman
Posts: 143
Joined: Thu Nov 27, 2008 11:05 am
Location: Germany
Contact:

Post by geckoman »

This line is causing the crash:

// draw body fast
rect = skin->draw3DWindowBackground(this, true, skin->getColor(EGDC_ACTIVE_BORDER),
AbsoluteRect, &AbsoluteClippingRect);

I found more bugs and things but I go to bed now. I will post it tomorrow
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

Waiting for input :)
trnrez
Posts: 28
Joined: Wed Dec 27, 2006 5:56 pm
Location: Murfreesboro, TN
Contact:

Post by trnrez »

When a dialog opens from the main section that dialog can only move within the main dialog. For instance, I tell it I want to load an image the image dialog box pops up. I try and move it away from the main dialog and it will only go as far as the edge of the main dialog. If I move the main dialog then the image dialog moves right along with it. Not a major issue but a small quirk.

As far as I could move the load image dialog left:
Image

If I move the main dialog the load image is attached to it:
Image

Edit: Also it isn't allowing me to load an image onto a selected button. Keep getting "Could not open file of texture:"

I will keep playing with it and hope to give you some more feedback. Looks good though.
Jon Jones
Portfolio - needs updating
geckoman
Posts: 143
Joined: Thu Nov 27, 2008 11:05 am
Location: Germany
Contact:

Post by geckoman »

If I load a xml-file with white-button-color the font-color in the main dialog also changes and I can see no text...
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

The "feature" you described is due to the fact that the filedialog is a child of the mainwindow (else the mainwindow never receive a fileinputmessage afaik).

I will create a version there the imagerect is adapted automatically.

EDIT: yeah....the window get drawed with the actual set skin. I could do a workaround but then the OnEvent is uneffected -> the tabbuttons get shifted (the click rect ist different to the draw rect).
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

@geckoman
// draw body fast
rect = skin->draw3DWindowBackground(this, true, skin->getColor(EGDC_ACTIVE_BORDER),
AbsoluteRect, &AbsoluteClippingRect);
that code causes the crash? Strange because i just copied it from CGUIWindow and i only find it in CGUIEditorControl.cpp ll. 532 :?

May be the tree malfunction the skin or something like this? Did u removed that lines and everything went correct?
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

the editor isn't broken it's just unfinished.

I think bitplane intended to include his spritebank which never got finished and the function to add it on the fly was never finished either.

however it still outputs gui.xml files and you can alter irrlicht to change the attributes. this would be a better solution/inclusion then making an entirely new editor.

but this might be useful in other ways
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

hmm, define "unfinished" and "broken" and we can discuss your point of view.
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

Nox wrote:hmm, define "unfinished" and "broken" and we can discuss your point of view.
unfinished = incomplete, work in progress, be patient.
broken = damaged, abandoned, no hope.

pretty standard definitions having had to outline that for you I'm not sure I want to discuss it further however.
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

Well...what is standard? That was everybody think it has to be?
By the way...the last change of the editor is about 2 months ago, and these were just adoption changes.
But...do you have a better solution for editing a irrlicht-gui at the moment which i.e. allows to set textures? You are wellcome to share it with us.
OR
Do you have a version of the guieditor with a working "open file" functionality for setting a texture?
My Solution is far away from being mature. Its just a hack and is buggy. It does not support all the functionality of the irrlicht gui either. But it allow to add, change and remove all the existing standard elements ;)

But yeah, i guess you are right and i will wait now until someone spend its rare time to complete the guieditor. Maybe it will be done the next day or may be in 2 years. But i have time. I can wait...........
Post Reply