Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » design custom controls
design custom controls [message #4979] Tue, 29 August 2006 01:50 Go to next message
ronnie@ijpc.nl is currently offline  ronnie@ijpc.nl
Messages: 2
Registered: August 2006
Location: Almere
Junior Member
Hi,

I’m pretty new here, so forgive me if me questions were described earlier. Is there a common way to design custom controls? In MFC I can use png image’s to draw controls en add some handles to it (like click, mouse hover etc.)
What’s the best way to do it in Ultimate++? The main reason is I want to give my app’s a custom look instead of a platform Native look. Maybe somebody knows where I can find example code for this. Just a funny looking button created by images would be enough.
Thanks for your reply.
Re: design custom controls [message #4981 is a reply to message #4979] Tue, 29 August 2006 10:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12575
Registered: November 2005
Ultimate Member
Well, your question is addressing wo different problems:

* Creation of your own widgets (even for the purposes of different look).

Creating widgets is very simple in U++ (if you know how Wink - this was one of basic design principles. I guess for starters, look at "reference/UscCtrl" which demostrates creation of simple widget, implemented in Counter package.

The example even demonstrates how to add .usc script description so that you have the right visual response in LayoutDesigner; note that this is not necessary (you can add your custom widget anyway, you will just see it as empty rectangle in layout designer

* The look of existing U++ widgets.

This issue is in addressed in post-605 U++ by introduction of "Chameleon system" - you can adjust appearance on per-class and often even on per-instance basis. This is still under development, however the system is flexible enough to use XP theming API, which brings native look on Windows for U++....

I plan to introduce some reference examples about chameleon - if you are interested, let me know, I will do it sooner Wink

Mirek
Re: design custom controls [message #4983 is a reply to message #4981] Tue, 29 August 2006 12:15 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
luzr wrote on Tue, 29 August 2006 10:13

I plan to introduce some reference examples about chameleon - if you are interested, let me know, I will do it sooner Wink

I think this would be valuable.
My special interest is how and which theme to use for *nix systems.
What look&feels are (will be) supported (KDE, GTK2, etc.)?

Matthias
Re: design custom controls [message #4984 is a reply to message #4983] Tue, 29 August 2006 12:27 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12575
Registered: November 2005
Ultimate Member
At the moment, none of them.

In fact, I am not still 100% sure how this should work.

The very simple possibility, one that I plan to implement as the first quick fix, is to detect the theme name and then use internal U++ theme that matches it (or loosely matches it:). Ugly but simple.

Of course, I think that in some advanced phase, it should be also possible to use GTK and/or KDE theming engines. But it seems like quite complicated bussines right now.

Mirek
Re: design custom controls [message #4985 is a reply to message #4981] Tue, 29 August 2006 12:44 Go to previous messageGo to next message
ronnie@ijpc.nl is currently offline  ronnie@ijpc.nl
Messages: 2
Registered: August 2006
Location: Almere
Junior Member
Thanks for your reply. It would be very helpful if there’s an chameleon example, but first things first. So if you have spare time, please, otherwise it is no problem to wait.
Re: design custom controls [message #4987 is a reply to message #4984] Tue, 29 August 2006 14:22 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1356
Registered: November 2005
Location: Poland
Senior Contributor

luzr wrote on Tue, 29 August 2006 06:27

At the moment, none of them.

In fact, I am not still 100% sure how this should work.

The very simple possibility, one that I plan to implement as the first quick fix, is to detect the theme name and then use internal U++ theme that matches it (or loosely matches it:). Ugly but simple.

Of course, I think that in some advanced phase, it should be also possible to use GTK and/or KDE theming engines. But it seems like quite complicated bussines right now.

Mirek

From what I know KDE themes are simply C++ files with new redering code.. and if we want to be 100% compatible with kde look there is no other way than calling kde painting routines..
But I'm not 100% sure if that what I wrote is true.

I think that most KDE users use default theme (Plastik). The same situation probably takes place in GNOME.
The best IMO would be to add only these two themes to upp rendering code (using chameleon engine if possible) - that should satisfy most users.
Re: design custom controls [message #4988 is a reply to message #4987] Tue, 29 August 2006 15:05 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12575
Registered: November 2005
Ultimate Member
Quote:


From what I know KDE themes are simply C++ files with new redering code.. and if we want to be 100% compatible with kde look there is no other way than calling kde painting routines..



Yep. Same as calling XP theming API painting routines Smile

Mirek
Re: design custom controls [message #4989 is a reply to message #4987] Tue, 29 August 2006 15:12 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 604
Registered: December 2005
Location: Budapest, Hungary
Contributor
Quote:

From what I know KDE themes are simply C++ files with new redering code.. and if we want to be 100% compatible with kde look there is no other way than calling kde painting routines..

And introducing licensing problems...
Re: design custom controls [message #4990 is a reply to message #4989] Tue, 29 August 2006 18:32 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12575
Registered: November 2005
Ultimate Member
zsolt wrote on Tue, 29 August 2006 09:12

Quote:

From what I know KDE themes are simply C++ files with new redering code.. and if we want to be 100% compatible with kde look there is no other way than calling kde painting routines..

And introducing licensing problems...



Well, that is interesting question Smile

Mirek
Re: design custom controls [message #4994 is a reply to message #4989] Tue, 29 August 2006 23:09 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
zsolt wrote on Tue, 29 August 2006 15:12

And introducing licensing problems...

Why not let the developer decide, if he uses the KDE theme for his software? He can decide if he wants to release his software under the GPL, then he has no problems at all. If he wants to write a commercial app, he either has to buy a license from Trolltech or he has to set aside using KDE theme for his app.

Maybe the build linking KDE libs (and therefore using KDE theme) can be controlled by setting another build flag.

Matthias
Re: design custom controls [message #4995 is a reply to message #4994] Tue, 29 August 2006 23:15 Go to previous message
mirek is currently offline  mirek
Messages: 12575
Registered: November 2005
Ultimate Member
masu wrote on Tue, 29 August 2006 17:09

zsolt wrote on Tue, 29 August 2006 15:12

And introducing licensing problems...

Why not let the developer decide, if he uses the KDE theme for his software? He can decide if he wants to release his software under the GPL, then he has no problems at all. If he wants to write a commercial app, he either has to buy a license from Trolltech or he has to set aside using KDE theme for his app.

Maybe the build linking KDE libs (and therefore using KDE theme) can be controlled by setting another build flag.

Matthias



Actually, build do not even has to link to KDE libs. You can use dynamic loading...

Mirek
Previous Topic: DropList with "quick trigger option": best way to implement?
Next Topic: always-on-top window
Goto Forum:
  


Current Time: Mon Jul 13 01:39:15 CEST 2020

Total time taken to generate the page: 0.01116 seconds