Page 1 of 1

CheckListboxItem in ItemListbox is not saved by LayoutEditor

Posted: Mon Aug 17, 2009 20:36
by ncoppola
Hey all,

As a sample for my project I tried adding a CheckListboxItem (from this tutorial) to an ItemListbox in CELayoutEditor. I made the CheckListboxItem a child of the ItemListbox, but the CheckListboxItem didn't save with the layout file. It happens just the same with just using a ListboxItem. Manually adding the CheckListboxItem or ListboxItem to the layout file works just fine though.

Am I wrong in my understanding that ItemListbox uses child widgets as its items, and should be doing this through some other means?


As an aside: I know that you can't (to my knowledge) add items to widgets like the Listbox or Combobox in CELayoutEditor. Are there any plans currently on adding this as a feature, or are we going to be left with just adding it through code?

Thanks.

Re: CheckListboxItem in ItemListbox is not saved by LayoutEditor

Posted: Tue Aug 18, 2009 08:04
by scriptkid
Hi and welcome :)

Coindicentely (and luckily), this week i am reworking the 'filtering' behaviour of the editor. While updating the documentation i was running some tests, and things just don't work out very convienent at this moment.

One problem (which you ran into) with the current filtering is that the editor checks on the widgetname, where it should look at the underlying mapping. For example you could add your 'CheckListboxItem', because the editor only filters on 'ListboxItem'. But they are the same, since they both map to an 'ItemEntry'. So i should check against a different value. Do you understand this?

The filtering was actually added to provide some help in avoiding weird layouts (such as adding a scrollbar to a button). But on the other hand, i might loosen things up a bit and rely on our users common sense :D

HTH.

Re: CheckListboxItem in ItemListbox is not saved by LayoutEditor

Posted: Tue Aug 18, 2009 08:34
by CrazyEddie
ncoppola wrote:As an aside: I know that you can't (to my knowledge) add items to widgets like the Listbox or Combobox in CELayoutEditor. Are there any plans currently on adding this as a feature, or are we going to be left with just adding it through code?

Currently this is not possible, since CELayoutEditor deals in Window based objects and those other list types do not support items that are Window based. This is a limitation of CEGUI itself rather than CELayoutEditor.

Eventually CEGUI will offer a single, unified, listbox-like class; one listbox to rule them all! And this will support the ItemEntry model for adding content from layouts (as is possible with the existing ItemListbox).

CE.

Re: CheckListboxItem in ItemListbox is not saved by LayoutEditor

Posted: Thu Nov 19, 2009 19:30
by hermit purple
I don't understand why this is a limitation in CEGUI and not in Layout Editor. I tried manually adding two ListboxItem into ItemListbox and it loads properly in my app. It even loads properly in Layout Editor. It's just that when saving in Layout Editor, it leaves out the two ListboxItem. It seems to be a bug in Layout Editor.

I also try nested objects like a Listbox with several ListboxItem in it and Layout Editor saves them without any problem. Why is it only ListboxItem that got left out when saving layout?

Re: CheckListboxItem in ItemListbox is not saved by LayoutEditor

Posted: Thu Apr 08, 2010 09:47
by r0br0y
Hi,

same problem here:
I can add listboxitems to a itemlistbox in the layout-xml or the editor, load and display it with the editor properly but when saving the layout in the editor all items are gone...


thanks for any advice
rob

Re: CheckListboxItem in ItemListbox is not saved by LayoutEditor

Posted: Thu Apr 08, 2010 15:05
by Jamarr
I think you misunderstood the above posts. There are two separate issues mentioned here. I will try to explain them as plainly as possible:

1 - The CELayoutEditor has a poorly implemented filtering mechanism. Because of this, custom windows like CheckListboxItem will not be saved in the layout file. It sounds like ScriptKid is already working on fixing this issue.

2 - The Listbox and Combobox windows do not support ItemEntry (or window-based) items. Since the layout files (and in turn, CELayoutEditor) only handle window-based widgets, you cannot use the editor or layout files to add non-window based items to the Listbox or Combobox.

I also try nested objects like a Listbox with several ListboxItem in it and Layout Editor saves them without any problem.


You obviously did not test this out very thoroughly. Even though you can nest ListboxItem's in a Listbox in the CELayoutEditor, those nested items are not managed by the Listbox class. You can only add managed items to the Listbox control via code. Really, the CELayoutEditor should not allow this behavior.

Re: CheckListboxItem in ItemListbox is not saved by LayoutEditor

Posted: Fri Apr 09, 2010 09:56
by r0br0y
Jamarr wrote:1 - The CELayoutEditor has a poorly implemented filtering mechanism. Because of this, custom windows like CheckListboxItem will not be saved in the layout file. It sounds like ScriptKid is already working on fixing this issue.

Sounds good! will this be available at the trunk? if yes when (roughly)?

Jamarr wrote:2 - The Listbox and Combobox windows do not support ItemEntry (or window-based) items. Since the layout files (and in turn, CELayoutEditor) only handle window-based widgets, you cannot use the editor or layout files to add non-window based items to the Listbox or Combobox...Even though you can nest ListboxItem's in a Listbox in the CELayoutEditor, those nested items are not managed by the Listbox class. You can only add managed items to the Listbox control via code. Really, the CELayoutEditor should not allow this behavior.

Makes sense ;-)

thanks

Re: CheckListboxItem in ItemListbox is not saved by LayoutEditor

Posted: Mon Apr 12, 2010 09:02
by CrazyEddie
r0br0y wrote:Sounds good! will this be available at the trunk? if yes when (roughly)?

Scriptkid is currently taking some time off. As such no progress is being made as regards to work on the layout editor, and no estimates are available for implementation of features or bug fixes.

CE.