Jump to content
Eternal Lands Official Forums
Sign in to follow this  
Sadez

Gui Widgets

Recommended Posts

I added support for gui widgets and made a label widget. It has been implemented like it was said in a an thread in the old forums.

 

TODO:

- More widgets: Image, button, checkbox, vertical scroll bar at least.

- XML format for easily creating windows.

- Server windows. With the XML format it will be possible to create windows sending the XML data. This could be useful for an npc to display quest information for example.

Share this post


Link to post
Share on other sites
Careful with XML defined windows . . . didn't M$ recently patent that?

Hmm, I know that they've patented file formats for Office that uses xml - but do you have a link for that information?

I've actually been working on using xml to create GTK2-windows for a while (just for generic configuration tool usage), and well - if that's true I'd have to find a server in Asia to host the source once it's more mature...

 

Software patents are evil...

Share this post


Link to post
Share on other sites

Actually, I think it was an XML based installer or something.

 

I wouldn't worry about it, I was just joking around. I'm surprised they haven't tried to patent XML.

Share this post


Link to post
Share on other sites

Ah good... Would hate to see that work go down the drain... :-)

When it comes to software patents I have a hard time figuring out the difference between what's a joke and what isn't - I mean, patenting the double-click?

Share this post


Link to post
Share on other sites

Button, progressbar and vertical scrollbar are done. Thats the basic set of widgets I had planned, they still need some polishing but I'll wait until I do the XML format for the windows.

Share this post


Link to post
Share on other sites

Added support for XML windows.

 

Here is an example:

 

win = AddXMLWindow("test.xml");

 

<window name="window1" pos_x="100" pos_y="100" size_x="100" size_y="300" flags="821">
<label pos_x="0" pos_y="20" text="se se se" r="1.0" g="0.0" b="0.0" size="0.7"/>
<image pos_x="0" pos_y="40" len_x="40" len_y="40"/>
<checkbox pos_x="50" pos_y="100" len_x="20" len_y="20" r="1.0" g="0.0" b="0.0" checked="1" />
<button pos_x="10" pos_y="120" text="si si si"/>
<progressbar pos_x="5" pos_y="140" len_x="200" len_y="20" progress="50" />
<vscrollbar pos_x="50" pos_y="70" len_x="20" len_y="200" pos="0" pos_inc="4" />
</window>

Share this post


Link to post
Share on other sites

You need to assign an id to the widget:

<button id="666" pos_x="10" pos_y="120" text="si si si"/>

Then you create the window and set the callback function

win = AddXMLWindow("test.xml");
widget_set_OnClick(win,666,clika);

the callback looks like this (it just increases the position by 10 each click):

int clika(widget_list *w){
w->pos_x+=10;
return 0;
}

Edited by Sadez

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×