SFML community forums

Bindings - other languages => DotNet => Topic started by: omeg on August 06, 2011, 01:07:45 pm

Title: C# port of GWEN - a GUI library
Post by: omeg on August 06, 2011, 01:07:45 pm
Hello, first time poster here.
I'm using SFML.NET for my project and I was really annoyed by lack of any decent GUI library for this environment. By chance I've discovered GWEN (http://code.google.com/p/gwen/). It's a lightweight library with rich collection of controls, supports skinning and all the good stuff. There is one problem though (for me): it's written in C++. Interfacing C++ with C# is tricky at best, so I've decided to just rewrite the thing. It's going pretty well, I've got most of the framework and a few simple controls working:

(http://i.imgur.com/uEaWG.png)

I'll post updates on the GWEN forums (http://www.facepunch.com/forums/376-GWEN-Lightweight-GUI-Widget-library) and probably here (and of course on my blog (http://omeg.pl/blog/) ;))

PS. I've modified two input classes in SFML.NET (KeyEventArgs and MouseButtonEventArgs) to include bool field indicating if the key/button is depressed. That field seems present in original SFML but was removed in .NET, would be nice to have it back. :)
Title: C# port of GWEN - a GUI library
Post by: omeg on August 08, 2011, 10:39:10 pm
I've created a Google Code project: http://code.google.com/p/gwen-dotnet/
I'll be adding more controls in the coming days. The API will most likely be refactored once more stuff is implemented.
Title: C# port of GWEN - a GUI library
Post by: omeg on August 13, 2011, 04:11:50 pm
Latest test snapshot:

(http://i.imgur.com/hmzE9.png)
Title: C# port of GWEN - a GUI library
Post by: omeg on September 08, 2011, 07:53:38 pm
Project is nearing completion. Only a few controls are missing: trees, properties and RichLabel. There are a few bugs but nothing too serious.

(http://omeg.pl/blog/wp-content/uploads/gwennet_button.png)

(http://omeg.pl/blog/wp-content/uploads/gwennet_splitter.png)

http://omeg.pl/blog/2011/09/gwen-net-almost-there/
Title: C# port of GWEN - a GUI library
Post by: zombiekiller222 on September 09, 2011, 11:41:16 am
Pretty nice. :D.

Are the controls os specific?
Title: C# port of GWEN - a GUI library
Post by: omeg on September 09, 2011, 11:50:16 am
Quote from: "zombiekiller222"
Pretty nice. :D.

Are the controls os specific?

No. It's platform agnostic. If you can run Mono there it should work. ;)
Title: C# port of GWEN - a GUI library
Post by: scorch on September 17, 2011, 06:10:56 pm
I saw the samples and they look awsome. They still have a few bugs, but you have made a great work. Congrats.  :D
Title: C# port of GWEN - a GUI library
Post by: omeg on September 19, 2011, 07:51:45 pm
All GWEN controls are now implemented. I've also added XML comments to most public symbols (when I knew what are they for anyway). I'll focus on fixing bugs and enhancing usability next. That also most likely involves changing event system to use control-specific event args instead of one generic callback.
Title: C# port of GWEN - a GUI library
Post by: zombiekiller222 on September 20, 2011, 02:46:55 am
Quote from: "omeg"
Quote from: "zombiekiller222"
Pretty nice. :D.

Are the controls os specific?

No. It's platform agnostic. If you can run Mono there it should work. ;)


But will it look APPLEISH on an mac?
Title: C# port of GWEN - a GUI library
Post by: omeg on September 20, 2011, 09:20:24 am
Quote from: "zombiekiller222"
Quote from: "omeg"
Quote from: "zombiekiller222"
Pretty nice. :D.

Are the controls os specific?

No. It's platform agnostic. If you can run Mono there it should work. ;)


But will it look APPLEISH on an mac?

No - all the controls are custom drawn, look depends on what skin do you use.
Title: error compiling GWEN workspace
Post by: carsaxy on December 03, 2011, 02:58:36 pm
Hi All!
This library looks great, but I have some problems trying to compile it with Code::Blocks on Windows.

First of all, it tells me "error: 'Gwen::Utility' was not declared" when you try to compile the file "Gwen\Controls\Base.h" but adding "#include "Gwen/Utility.h" " seems to be fixed.

However, it finds another error in the file "src\Utility.cpp":

Quote
error: invalid conversion from 'unsigned int' to 'const wchar_t*'
error: cannot convert 'const wchar_t*' to 'char*' for argument '3' to 'int vswprintf(wchar_t*, const wchar_t*, char*)'

in the declaration of the function

Code: [Select]
UnicodeString Gwen::Utility::Format( const wchar_t* fmt, ... )
{
wchar_t strOut[ 4096 ];

va_list s;
va_start( s, fmt );
vswprintf( strOut, sizeof(strOut), fmt, s );
va_end(s);

UnicodeString str = strOut;
return str;
}


but to me the code seems right...

Am I compiling the wrong way? Is the problem only mine? How can I fix it?

Thanks!