Adding ClanGUI support

Use this forum for:
- Discussion regarding unofficial CEGUI related tools, scripts and utilities.
- User to user help for the obsoleted CELayoutEditor and CEImagesetEditor tools.

Moderators: CEGUI MVP, CEGUI Team

User avatar
insert_nick
Just popping in
Just popping in
Posts: 5
Joined: Thu Mar 24, 2005 12:42

Adding ClanGUI support

Postby insert_nick » Sat May 07, 2005 15:25

Hi, I've just a request (you can ignore it smoothly) for scriptkid or someone (I've not much C++ experience to find my way in the CELayoutEditor code...)

You've already done all the big stuff, as you can output that clean XML code for CE GUI, so I dare with this request: "could you add support for ClanGUI?"
That is, could you optionally generate from CELayoutEditor an XML file which is compliant with ClanLib specs?

No other libraries must be included in your project, it's just a matter of generating the right XML file. I don't know how hard it is in C++, anyway I've written a small php utility that parses your generated CE xml file and produces a ClanGUI compliant one. It works fine for my purposes, but it's just a quick hack: not all the ClanGUI components and components' properties are supported, so usually it's needed a manual (boring) editing of the generated files.

For those (very little I suppose) who are unaware of what I'm speaking about, ClanLib is a good opensource C++ library designed for game creation (but not only!), it has a built-in GUI module and a default nice style (GUIStyleSilver), which can be changed and redesigned from scratch. GUIs can be hardcoded, or better it is to read them from XML files (from that the chance to use CELayoutEditor as a gui builder).

So what I'm asking to everyone with golden heart here is basically to include in CELayoutEditor the possibility to compose a ClanGUI XML "gui definition file" (composing stuff with the WindowsLook style is just ok, I use it as the ghost of ClanLib's GUIStyleSilver...), that is adding ClanLib's components and their supported properties, and saving a right XML file, which can be tested with a simple application - it's included in the conversion package I've made, here it is the link:

http://digilander.libero.it/odnalro/coding/gui_edit.zip

(just put a ClanGUI xml file named "clan_gui.xml" in the same directory with "3_test.exe" and run "3_test.exe", hop-la'!)


Let me know, of course don't fear to just answer "no way!", I'll not hate you ;) Here follows a small example of a ClanLib xml file attached, but a quick look here is recommended (it's the page in ClanLib docs).

Code: Select all

<components>
   <window name="my_window" x="10" y="10" width="600" height="400" title="My Window" >
      <components>
         <button name="my_button" x="25" y="25" width="100" height="20" text="My Button" />
         <label name="my_label" x="25" y="50" text="My label" />
      </components>
   </window>
</components>



Goodbye thanks for the attention, and compliments for the editor!

User avatar
insert_nick
Just popping in
Just popping in
Posts: 5
Joined: Thu Mar 24, 2005 12:42

Re: Adding ClanGUI support

Postby insert_nick » Sun May 08, 2005 15:48

Whoops, there was a small error in the php script of the package I linked in my previous post, I generated a <button> tag instead of a <label> one, sorry: fixed now.

And I forgot to mention that the stuff in the zipped file (gui_edit.zip) should be copied into the CELayoutEditor root folder.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Re: Adding ClanGUI support

Postby scriptkid » Mon May 09, 2005 11:09

Hi,

thanks for the suggestion. I believe i read a sort-of suggestion once before but couldn't find it in this forum..

But to this one i will reply ;-)

I think your apprauch (a converter) is a good one. Another one would be to write export-plugins for the editor. But that would (as you imply yourself) require (a bit) more knowledge of C++ and CEGUI then a php-based converted would be.

About your quick hack: isn't is a matter of enhancing your converter script?

At this moment i cannot decide about the best way to go yet. So maybe other people can give input on this matter?

Thanks for the complements on the editor btw :-)

User avatar
insert_nick
Just popping in
Just popping in
Posts: 5
Joined: Thu Mar 24, 2005 12:42

Re: Adding ClanGUI support

Postby insert_nick » Mon May 09, 2005 23:22

thanks for the suggestion. I believe i read a sort-of suggestion once before but couldn't find it in this forum..


Yes it was me, I sent it as a PM but wanted to post it here too with some modifications, then I've been busy and lost the way, so finally here I am back late (and still busy...)

I think your apprauch (a converter) is a good one. [...] About your quick hack: isn't is a matter of enhancing your converter script?


Yes I think so, and enhancing it to support all of the ClanLib components is trivial, requiring just some copy/paste in the switch statement and very little mods (I think I'll rewrite the code to avoid the copy/paste job though).

But what the conversion can't support really are components' attributes: ClanLib ones are different from those you provide in the editor, so what would allow a complete conversion is the addition in the editor of support for ClanLib components' attributes, I can't do nothing about that.

Simplifying, where in your editor there's a dropdown menu labeled "Available properties" (in the "Available properties in the current selection" section) there should be, together with those sections framed by two "===" (Numerical Properties, Alphanumerical Properties, Boolean Properties, Font Properties), another one ("=== ClanLib Properties ===" ) where one can find those attributes that are available for ClanGUI components (it doesn't matter if Numerical, Alphanumerical and Choice input will be all enabled, ClanLib users will have to pay more attention filling with right values the right fields...); I think a checkbox "Show ClanLib attributes" would be nice to let non-ClanLib users get rid of these additional list of properties in the dropdown menu.

At this moment i cannot decide about the best way to go yet. So maybe other people can give input on this matter?


What I've just suggested should be a satisfactory compromise, if that feature will be added I'll complete the php converter with support for all the components, as it is easily adjustable by people in case of changes in your editor's output. And happily trash it when someone will write an export plugin for the editor.

You can find other ways than what I'm suggested, but it seems to me the more convenient for you (well, of course the more convenient is to just don't add ClanLib support ;)
Feel free to ignore my posts, anyway just in case here it is a reference list of all ClanGUI's components and their attributes: there is the ClanGUI tag followed by its counterpart in CELayoutEditor ("like CE's ..." ), then component's attributes are listed, with type and default value in brackets, followed by a short description of the attribute's scope.

Thanks for your reply, I'll try to avoid you waste time for some other reply to this one, so here it is a pre-made format for you ;) (put an "x" on the right checkbox):

A: Will you add that stuff or something?
[ ] Ok, but it will cost a postcard from your town.
[ ] Ok, but if we meet I want a beer payed by you.
[ ] Ok.
[ ] No way, I'll pretend this message has never been written.
[ ] No way, besides this message hurts me and I'll find your nice cat and close it in your fridge.


ClanLib's components and their attributes (this list may be enhanced, it's from ClanLib's manual wich may be outdated compared to the svn version, but not sure about it):

Code: Select all

<component>  like CE's "DefaultWindow"

visible (Boolean, true): Visibility of component
enabled (Boolean, true): If the component is enabled or disabled.
tab_id  (integer, 0): Tab id.

-----------------------------------------------------------------

<button>  like CE's "Button"

toggled (Boolean, false): If the button is toggled by default or not.
togglemode (Boolean, false): The togglemode, if false the button is sticky.

-----------------------------------------------------------------

<frame>  like CE's "TabPane"

filled (Boolean, false): If the frame should be filled or transparent.

-----------------------------------------------------------------

<image> like CE's "StaticImage"

-----------------------------------------------------------------

<inputbox>  like CE's "EditBox"

text (Sring, ""): Default input of the inputbox.
passwordmode (Boolean, false): Password mode sets if the inputbox should display only * when entering text.
read_only (Boolean, false): If read only, it is not possible to enter text into the inputbox.
max_length (Integer, unlimited): Max number of characters allowed.

-----------------------------------------------------------------

<label>  like CE's "StaticText"

-----------------------------------------------------------------

<listbox>  like CE's "Listbox"

<item>: Defines a item in the listbox.
value (Sring, ""): Text of the listitem.

-----------------------------------------------------------------

<progressbar>  like CE's "ProgressBar"

steps (Integer, 0): Number of steps in the progressbar.

-----------------------------------------------------------------

<radiobutton>  like CE's "RadioButton"

-----------------------------------------------------------------

<scrollbar>  like CE's "HorizontalScrollbar" or "VerticalScrollbar"

min (Integer, 0): Minimum value of the scrollbar range.
max (Integer, value of minimum): Maximum value of the scrollbar range.
value (Integer, value of minimum): Current value of the scrollbar range.
tracking (Boolean, false): Enables or disables tracking.

-----------------------------------------------------------------

<window>  like CE's "FrameWindow"


Bye!

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Re: Adding ClanGUI support

Postby scriptkid » Thu May 19, 2005 20:17

insert_nick wrote:
Yes it was me, I sent it as a PM but wanted to post it here too with some modifications, then I've been busy and lost the way, so finally here I am back late (and still busy...)


Sorry i read that indeed but never answered :oops:

insert_nick wrote:
Simplifying, where in your editor there's a dropdown menu labeled "Available properties" (in the "Available properties in the current selection" section) there should be, together with those sections framed by two "===" (Numerical Properties, Alphanumerical Properties, Boolean Properties, Font Properties), another one ("=== ClanLib Properties ===" ) where one can find those attributes that are available for ClanGUI components (it doesn't matter if Numerical, Alphanumerical and Choice input will be all enabled, ClanLib users will have to pay more attention filling with right values the right fields...);


What you're saying looks like you want more than an exporter. Although this sounds very do-able (just maintain some variable which denotes whether a CE- or a Clanlib compatible layout is being created. However this won't be WYSIWYG then, since the editor will render in CE style, right? So it will become a bit of a gamble?

Note that i don't want to burn your suggestion down, but i think that a conversion script would do the trick the best, since it seems that each property is somehow supported by CE as well...

It really took me some time to come up with this answer, since i'd definately go for the beer if we should meet one day ;-)

Please don't hesitate to post other questions or suggestions here ok?

Bye :-)

User avatar
insert_nick
Just popping in
Just popping in
Posts: 5
Joined: Thu Mar 24, 2005 12:42

Re: Adding ClanGUI support

Postby insert_nick » Wed May 25, 2005 23:36

scriptkid wrote:
Sorry i read that indeed but never answered :oops:


no problem, it was my fault sending a pm, as the topic could be interesting for some others too (but seems it isn't, so perhaps I was right before ;)

scriptkid wrote:
However this won't be WYSIWYG then, since the editor will render in CE style, right? So it will become a bit of a gamble?


well, yes! But I thought that even CE- users had this kind of use of the editor, at least those that want to use a custom theme different from Taharez-look or Windows-look. I don't know which is the way to add a new theme support but seems it's hardcoded, so if I want to use CE-gui with a non-included theme, I have at least a feel of how it would be using the more similar one. The same applies, for using a custom ClanGUI theme, or its default GUIStyleSilver, which eventually could be hardcoded to obtain a wysiwyg feature, but it's not necessary. It's a white gambling, as it doesn't hurts anyone (I hope)

scriptkid wrote:
Note that i don't want to burn your suggestion down, but i think that a conversion script would do the trick the best, since it seems that each property is somehow supported by CE as well...


Yes, I'm for the conversion script side (if it was not clear from my previous post) and I will complete it myself, but I'll check better 'cause I remember that not all the ClanGUI components' properties had a counterpart in your editor, and in case I'll write them down here for future reference. Thanks for the reply, bye!

User avatar
insert_nick
Just popping in
Just popping in
Posts: 5
Joined: Thu Mar 24, 2005 12:42

Conversion script update

Postby insert_nick » Mon May 30, 2005 17:36

My conversion script from the xml output of CELayoutEditor to a ClanGUI XML definition file once supported only few
components. Now I've added support for all the components described on the online docs, I've
some doubts only for the "image" and "radiobutton" tags, for whose there
are no attributes and examples on the docs.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Re: Adding ClanGUI support

Postby scriptkid » Tue May 31, 2005 07:10

Hi,

insert_nick wrote:
I don't know which is the way to add a new theme support but seems it's hardcoded, so if I want to use CE-gui with a non-included theme, I have at least a feel of how it would be using the more similar one.


If you only want a different look, but no different functionality or widgets, you only have to create your own TGA and eventually update the imageset file to apply each coordinate.

It's good to hear that you have managed to get your conversion script updated! :-)

Just to be sure: you know that the editor's output is no different from CEGUI files, right? You could run your script against each CEGUI layout, not only the ones which are created from the editor.

Bye!


Return to “Unofficial CEGUI-Related Tools”

Who is online

Users browsing this forum: No registered users and 4 guests