Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
WiskeyDonkey
In need of some credit
In need of some credit
Posts: 4
Joined: Fri Dec 16, 2016 2:17 pm

Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Postby WiskeyDonkey » Fri Dec 16, 2016 2:39 pm

Hi There!

I am a part of a team of programmers who are working a open source reimplementation of C&C: Tiberian Sun in C++, and one of the issues we have at the moment, is replicating the in-game dialog system.

The original game is Windows only, and we aim to make our project cross platform, so we are looking at a fully skinable UI subsystem to implement and then skin with the assets from the original game, and so far wxWidgets gives us the best interface we require.

From what I can tell, it uses OwnerDraw (drawn with GDI) and index PCX files, but the dialogs also animate like a horizontal scroll on creation/open. The dialogs are designed and stored as RC scripts in a external DLL.

Is this something wxWidgets can do, any amount of work involved is not a issue, as I guess we might have to write another layer on top of wxWidgets to draw the edges, background and inner glow of the dialog? (these need to be separate assets due to the way the animation works).

Hopefully someone can answer my questions,

Thanks!

PS. For those of you that might have not played Tiberian Sun, here is a few screenshots of the in-game dialogs.

Image

Image

Image

User avatar
doublemax
Moderator
Moderator
Posts: 10745
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Postby doublemax » Fri Dec 16, 2016 3:16 pm

wxWidgets' key feature is that it uses native controls where ever possible. As you can't override the look of most native controls, i'd say wxWidgets might not the best tool for you. Basically you'd have to rewrite almost every control you need. If it would be just simple controls like buttons, static texts, etc. the effort would be still pretty low. When you need listboxes and choice controls like in your screenshot, the effort gets higher.

Everything is possible though, it's just a matter of how much effort you're willing to put into this. Especially if you're new to wxWidgets.
Use the source, Luke!

WiskeyDonkey
In need of some credit
In need of some credit
Posts: 4
Joined: Fri Dec 16, 2016 2:17 pm

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Postby WiskeyDonkey » Fri Dec 16, 2016 3:42 pm

doublemax wrote:wxWidgets' key feature is that it uses native controls where ever possible. As you can't override the look of most native controls, i'd say wxWidgets might not the best tool for you. Basically you'd have to rewrite almost every control you need. If it would be just simple controls like buttons, static texts, etc. the effort would be still pretty low. When you need listboxes and choice controls like in your screenshot, the effort gets higher.

Everything is possible though, it's just a matter of how much effort you're willing to put into this. Especially if you're new to wxWidgets.


Thanks for the reply, do you happen to have any links/examples of projects that have achieved similar UI's? Also, is there any other cross platform GUI kits that you recommend for our requirements?

User avatar
doublemax
Moderator
Moderator
Posts: 10745
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Postby doublemax » Fri Dec 16, 2016 3:46 pm

do you happen to have any links/examples of projects that have achieved similar UI's?
Sorry, no.

Also, is there any other cross platform GUI kits that you recommend for our requirements?
Qt is really the only reasonable alternative. All others reach their limits very quickly.

BTW: After reading your post again, i'm not 100% sure that i understood you correctly. Do you want to keep the dialog logic of the old code and just replace the drawing functions? That would be easier. I was talking about rebuilding the whole gui and event system with wxWidgets methods (panels, sizers, custom controls. etc) and then changing the look of it.
Use the source, Luke!

WiskeyDonkey
In need of some credit
In need of some credit
Posts: 4
Joined: Fri Dec 16, 2016 2:17 pm

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Postby WiskeyDonkey » Fri Dec 16, 2016 4:06 pm

doublemax wrote:
do you happen to have any links/examples of projects that have achieved similar UI's?
Sorry, no.

Also, is there any other cross platform GUI kits that you recommend for our requirements?
Qt is really the only reasonable alternative. All others reach their limits very quickly.

BTW: After reading your post again, i'm not 100% sure that i understood you correctly. Do you want to keep the dialog logic of the old code and just replace the drawing functions? That would be easier. I was talking about rebuilding the whole gui and event system with wxWidgets methods (panels, sizers, custom controls. etc) and then changing the look of it.


We did look at Qt, but using the library bloats the output binary immensely, and we fell this is a huge negative, unless there is a way to link to a DLL (I think it requires a commercial licence?).

For this project, we are actually reverse engineering the original game, and wish to make the code fully cross platform. So as long as the visual aspect of the dialog is the same, so the core mechanics are not a issue (from what I understand, we can create high level interfaces on top of wxWidgets for the rest of the game to interact?).

EDIT: We are totally open to coding a complete UI system on top of wxWidgets.

User avatar
doublemax
Moderator
Moderator
Posts: 10745
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Postby doublemax » Fri Dec 16, 2016 4:15 pm

So, you're actually rewriting the whole game and not re-using any code?
Use the source, Luke!

catalin
Moderator
Moderator
Posts: 1365
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Postby catalin » Fri Dec 16, 2016 4:34 pm

WiskeyDonkey wrote:We did look at Qt, but using the library bloats the output binary immensely, and we fell this is a huge negative, unless there is a way to link to a DLL (I think it requires a commercial licence?).

There is, and actually without a commercial license you are allowed to keep closed sources only if you link dynamically against Qt.

WiskeyDonkey
In need of some credit
In need of some credit
Posts: 4
Joined: Fri Dec 16, 2016 2:17 pm

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Postby WiskeyDonkey » Fri Dec 16, 2016 4:39 pm

doublemax wrote:So, you're actually rewriting the whole game and not re-using any code?

Correct, so we are not bound to old Windows code, so we have a complete fresh platter to start from, no restrictions.

catalin wrote:
WiskeyDonkey wrote:We did look at Qt, but using the library bloats the output binary immensely, and we fell this is a huge negative, unless there is a way to link to a DLL (I think it requires a commercial licence?).

There is, and actually without a commercial license you are allowed to keep closed sources only if you link dynamically against Qt.

So we can still be open source (GPLV2) and link to a precompiled DLL?

catalin
Moderator
Moderator
Posts: 1365
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Postby catalin » Fri Dec 16, 2016 4:45 pm

WiskeyDonkey wrote:So we can still be open source (GPLV2) and link to a precompiled DLL?

When using Qt in open source code you don't have any restrictions. So the answer is yes.

Manolo
Super wx Problem Solver
Super wx Problem Solver
Posts: 497
Joined: Mon Apr 30, 2012 11:07 pm

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Postby Manolo » Fri Dec 16, 2016 9:23 pm

I have never done it but, if I recall well, you can draw your UI using wxHTML http://docs.wxwidgets.org/trunk/overview_html.html and http://docs.wxwidgets.org/trunk/classwx_web_view.html

A screenshot of an app showing custom sliders http://wxwidgets.org/about/screenshots/ ... on-msw.png

coderrc
Experienced Solver
Experienced Solver
Posts: 54
Joined: Tue Nov 01, 2016 2:46 pm

Re: Fully Skinned UI in wxWidgets (Trying to Emulate OwnerDraw)

Postby coderrc » Thu Dec 29, 2016 1:49 pm

wouldnt you be better served doing this with the UI skinning utility of your game engine? eg UE4, box2d, irrlicht, cocos, etc. Especially given that they will likely already have better graphics hardware support and animation routines. not to mention HID interfaces.

GUI toolkits like wxWiddgets and Qt seem like the wrong approach for this sort of thing.


Return to “General Development”

Who is online

Users browsing this forum: No registered users and 1 guest