U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » Look and Chameleon Technology » A little theming
A little theming [message #18450] Wed, 01 October 2008 19:23 Go to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
Here is a little theme that I would like to incorporate in my applications: Skulpture. I've already asked permission from the author.

One side effect of this will probably be a theming engine for U++. Ans thanks to Chamaelon, that theming engine is 95% done Very Happy.

I hope I'll have something to show by weekend (screenshots and maybe some comments on flexibility of Chameleon)
Re: A little theming [message #18452 is a reply to message #18450] Wed, 01 October 2008 21:58 Go to previous messageGo to next message
captainc is currently offline  captainc
Messages: 278
Registered: December 2006
Location: New Jersey, USA
Experienced Member
Very cool. I'll definitely be using it. I know it is good UI design to maintain the system theme, but after using Gnome+Compiz, Windows XP is just ugly!
Re: A little theming [message #18459 is a reply to message #18450] Thu, 02 October 2008 06:34 Go to previous messageGo to next message
yoco is currently offline  yoco
Messages: 25
Registered: June 2006
Location: Taiwan
Promising Member
Expecting ^^
Re: A little theming [message #18489 is a reply to message #18459] Fri, 03 October 2008 17:06 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
I managed to skin Button together with it's default style, and I must say that it looks as good on Windows as it did under Linux! Heck, I’ll use this as a default theme for NOGTK apps. No offense to Windows 95, but their widgets look butt ugly when next to a Gtk+ or KDE4 app. And option to change theme under Windows will forever populate my Options dialog.

But the initial quick start was halted when I discovered that Option, Switch and LabelBox have no direct retrievable style. Obtaining the style from an Option would give a Button style. I checked out the Paint methods, and the skinning is dome by determining which image to show from and image list.

So basically I have to override the content of the image list to make it work. I could do this, but I would rather have all controls to own their style.

If Mirek is OK with it, I can add Style structures similar to the one in Button to all the controls that need skinning, and also refactor the Paint methods. I’ll be waiting for the reply on that before I skin additional widgets.
Re: A little theming [message #18490 is a reply to message #18489] Fri, 03 October 2008 17:30 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
You can alter the appearance of Option/Switch by directly manipulating CtrlImg.

See static chCtrlsImg sImgs[] in ChWin32.cpp.

This solution is perhaps a little bit non-uniform, but IMO sufficient...

I am looking forward to the second addition to "art" folder Smile

Mirek
Re: A little theming [message #18491 is a reply to message #18490] Fri, 03 October 2008 18:11 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
luzr wrote on Fri, 03 October 2008 18:30

You can alter the appearance of Option/Switch by directly manipulating CtrlImg.

See static chCtrlsImg sImgs[] in ChWin32.cpp.

This solution is perhaps a little bit non-uniform, but IMO sufficient...

I am looking forward to the second addition to "art" folder Smile

Mirek


Ok, I'll go along because getting the theme done is more important (and easy) than convincing you that current solution is rather ugly.

I used CtrlsImg directly because there is no way to access that static chCtrlsImg array from the outside and I don't want Windows specific solution.

I attached a preview screenshot with the dark gray color style of the Skulpture theme:
index.php?t=getfile&id=1409&private=0


As you can see, the LabelBox is not skinned yet, because it uses manual line drawing for it's look. What solution would you prefer to enable skinning for this widget?

  • Attachment: test.PNG
    (Size: 9.04KB, Downloaded 2337 times)
Re: A little theming [message #18492 is a reply to message #18491] Fri, 03 October 2008 19:35 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1367
Registered: November 2005
Location: Poland
Ultimate Contributor

Looks very nice! I'm trying something similar for kde's oxygen theme. I've found equivalent for gnome http://kims-area.com/?q=node/63
Re: A little theming [message #18493 is a reply to message #18491] Fri, 03 October 2008 19:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
cbpporter wrote on Fri, 03 October 2008 12:11


I used CtrlsImg directly because there is no way to access that static chCtrlsImg array from the outside and I don't want Windows specific solution.



Ops, of course. I have posted it just as example of altering Option/Switch!

You ARE supposed to use CtrlsImg directly.

Quote:


As you can see, the LabelBox is not skinned yet, because it uses manual line drawing for it's look. What solution would you prefer to enable skinning for this widget?



If I would have known, I would have done it already Smile

So far, it looks quite acceptable to provide just those predefined styles there and color...

Mirek
Re: A little theming [message #18515 is a reply to message #18493] Mon, 06 October 2008 08:44 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
I did a little color theme change because the previous one was a little too dark and too gray. This one is more lively I think. I attached a small sample, only with two widgets (the rest are yet to be ported to the new color scheme).

I have a small question: when I use tab to cycle through the widgets in the window, the style for buttons gets overridden with the default Windows style for focused buttons, with a little dotted frame and Windows skin. How can I change that?

edit: deleted old exe

[Updated on: Sat, 11 October 2008 19:24]

Report message to a moderator

Re: A little theming [message #18516 is a reply to message #18515] Mon, 06 October 2008 09:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Well, now this is really interesting. I have no clue. I wish I could see the code.

Mirek

[Updated on: Mon, 06 October 2008 09:03]

Report message to a moderator

Re: A little theming [message #18519 is a reply to message #18516] Mon, 06 October 2008 09:54 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
Here is a small testcase.

Edit: removed exe, see newer posts.

[Updated on: Mon, 06 October 2008 18:31]

Report message to a moderator

Re: A little theming [message #18520 is a reply to message #18519] Mon, 06 October 2008 11:04 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
Hint: it seems that the style from StyleOK is used to draw the focused buttons.

Another issue: if I call Set(0, true) on a single item Switch, the item is not selected. If I call Set(0, true, “text”), then the item is selected.
Re: A little theming [message #18521 is a reply to message #18520] Mon, 06 October 2008 18:31 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
So here is the next preview. It is starting to really shape up.

Disabled scrollbars are a little bit ugly because I can't get the desired effect with hotspots yet. Also, it would be nice if the Style could specify if a disabled scrollbar shows it's thumb or not.

DropList skin is not complete.

EditFields have some problem with their border, because I can't figure out yet how to resize it. I need to define border sizes through chameleon.

And DocEdit uses yet another style of code to draw it's border, so I'm no where near as to touching it's style. But the scrollbar inside works with new skin.

Also, modifying Button::StyleScroll does not affect any scrollbars. Am I correct in assuming that I need to initialize it with the ScrollBar style?

Another question: what are ScrollBar::Style.left2, up2, etc. used for? I only modified the fields that don't end in 2.

Edit: removed old exe.

[Updated on: Thu, 16 October 2008 22:46]

Report message to a moderator

Re: A little theming [message #18600 is a reply to message #18521] Sat, 11 October 2008 08:22 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Note: we have only about 1GB for the forum now. Please at least delete previous versions Smile

Mirek
Re: A little theming [message #18601 is a reply to message #18519] Sat, 11 October 2008 08:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
cbpporter wrote on Mon, 06 October 2008 03:54

Here is a small testcase.



Well, I would need testcase (and after all, the whole thing too Smile in source form...

Mirek
Re: A little theming [message #18602 is a reply to message #18521] Sat, 11 October 2008 08:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
cbpporter wrote on Mon, 06 October 2008 12:31

So here is the next preview. It is starting to really shape up.

Disabled scrollbars are a little bit ugly because I can't get the desired effect with hotspots yet. Also, it would be nice if the Style could specify if a disabled scrollbar shows it's thumb or not.

DropList skin is not complete.

EditFields have some problem with their border, because I can't figure out yet how to resize it. I need to define border sizes through chameleon.



I cannot help without seeing the code Smile

Quote:


Also, modifying Button::StyleScroll does not affect any scrollbars. Am I correct in assuming that I need to initialize it with the ScrollBar style?



StyleScroll is now deprecated. It was used to paint scrollbar buttons, which was enough for XP, but not for Linux themes.

Quote:


Another question: what are ScrollBar::Style.left2, up2, etc. used for? I only modified the fields that don't end in 2.



Some GTK themes have secondary buttons (usually two up buttons, second one close to down button).

You can activate them using 'isup2' etc...

Mirek

P.S.: I hope you could write some T++ about theming when you are finished Smile

Re: A little theming [message #18607 is a reply to message #18602] Sat, 11 October 2008 19:46 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
luzr wrote on Sat, 11 October 2008 09:29

cbpporter wrote on Mon, 06 October 2008 12:31

So here is the next preview. It is starting to really shape up.

Disabled scrollbars are a little bit ugly because I can't get the desired effect with hotspots yet. Also, it would be nice if the Style could specify if a disabled scrollbar shows it's thumb or not.

DropList skin is not complete.

EditFields have some problem with their border, because I can't figure out yet how to resize it. I need to define border sizes through chameleon.



I cannot help without seeing the code Smile


Hmmm, I thought that I posted a test case with source. Guess I forgot. Sorry. Anyway, wait a little (I still need some days) and I'll post something working so that everybody can start using it. Just need to iron out some details first. My approach is to have a ChameleonTheme class which can load the theming info from disk. It does the streaming itself for each Style class for now, but in the future I hope we can move streaming to each style. Also, the theme can be embedded in the exe with binary inclusion mechanism if external file is not desired. Another advantage is that we can keep multiple themes in memory, and mix and match.

Those comments about what is wrong with the theme right now where more given as information for people downloading the exe and see something wrong or ugly, not to ask help.

Except for the EditField question. I think that can be answered without seeing any of my code, because I haven’t done anything to it: how can I change the border size of EditFields through Chameleon (not sure if possible right now). And except setting thumb visibility for disabled ScrollBars.

Quote:


StyleScroll is now deprecated. It was used to paint scrollbar buttons, which was enough for XP, but not for Linux themes.


OK, I'll initialize it with ScrollBar style to keep some compatibility.

Quote:


You can activate them using 'isup2' etc...


Great, I always wanted that second down button under Windows!

Quote:


P.S.: I hope you could write some T++ about theming when you are finished Smile


Sure, that shouldn’t be a problem. By the time I finish this theme, I'm sure to have the knowledge for that Razz. But there are some areas which should be improved before documenting, but we'll get to that later.
Re: A little theming [message #18608 is a reply to message #18600] Sat, 11 October 2008 19:48 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
luzr wrote on Sat, 11 October 2008 09:22

Note: we have only about 1GB for the forum now. Please at least delete previous versions Smile

Mirek

If anything is left from the money, maybe you should consider buying another 512 MiB:). I will try to delete large attachments if they are no longer needed.
Re: A little theming [message #18609 is a reply to message #18607] Sat, 11 October 2008 20:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
cbpporter wrote on Sat, 11 October 2008 13:46


Except for the EditField question. I think that can be answered without seeing any of my code, because I haven’t done anything to it: how can I change the border size of EditFields through Chameleon (not sure if possible right now).



Via EditField::Style::edge the margin is defined in

void ActiveEdgeFrame::FrameAddSize(Size& sz);
void ActiveEdgeFrame::FrameLayout(Rect& r)

based on ChFrame. I am not sure what are you using to define edge Value, but if Image, it is simply defined by hotspots.

Mirek
Re: A little theming [message #18613 is a reply to message #18609] Sat, 11 October 2008 23:48 Go to previous messageGo to next message
TeCNoYoTTa is currently offline  TeCNoYoTTa
Messages: 138
Registered: July 2008
Location: Egypt
Experienced Member
can u please put the code ??
Re: A little theming [message #18618 is a reply to message #18607] Sun, 12 October 2008 11:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
cbpporter wrote on Sat, 11 October 2008 13:46

luzr wrote on Sat, 11 October 2008 09:29

cbpporter wrote on Mon, 06 October 2008 12:31

So here is the next preview. It is starting to really shape up.

Disabled scrollbars are a little bit ugly because I can't get the desired effect with hotspots yet. Also, it would be nice if the Style could specify if a disabled scrollbar shows it's thumb or not.

DropList skin is not complete.

EditFields have some problem with their border, because I can't figure out yet how to resize it. I need to define border sizes through chameleon.



I cannot help without seeing the code Smile


Hmmm, I thought that I posted a test case with source.



BTW, maybe we should add some "more relaxed" nest to svn so that others can easily participate in projects like this?

Or maybe you should have just uploaded into bazaar?

Mirek
Re: A little theming [message #18638 is a reply to message #18618] Mon, 13 October 2008 20:34 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
Ok. I've started the refactoring of my bloated Theme class to get ready for sharing, but I have encountered a strange issue.

I can no longer change the default Style. Even when doing something like:
s.look[0] = Blue();

in Them.cpp the style remains unchanged.

See testcase.
Re: A little theming [message #18645 is a reply to message #18638] Tue, 14 October 2008 13:14 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I think the problem is with your serialization. If you apply the Theme straight away after creating it (before saving and loading it) it works. My guess is that Upp somehow detects that the style is corrupt/invalid and falls back to the default theme. Which would be incredibly clever if true Smile

I don't think you can just serialize Values the way you are attempting to, not for Images and the other Chameloen LookWith* types anyway.

[Updated on: Tue, 14 October 2008 13:15]

Report message to a moderator

Re: A little theming [message #18647 is a reply to message #18645] Tue, 14 October 2008 13:32 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
mrjt wrote on Tue, 14 October 2008 14:14

I think the problem is with your serialization. If you apply the Theme straight away after creating it (before saving and loading it) it works. My guess is that Upp somehow detects that the style is corrupt/invalid and falls back to the default theme. Which would be incredibly clever if true Smile

I don't think you can just serialize Values the way you are attempting to, not for Images and the other Chameloen LookWith* types anyway.


Yes, I noticed that. I am just not able to figure out why this is happening, but I don't think it is something as clever as that. Maybe it has something to do with the fact that ImageLists can be reset to their initial content. Maybe that is what is serialized.

Anyway, I need to figure this out because I want to serialize themes. I already have a big Theme class which overwrites all the Style*().Write() instances, similar to how current theming is done or with BlueBar. But I don't like this hard-coded approach and want to load my themes from disk and not have them embedded in the exe.
Re: A little theming [message #18649 is a reply to message #18647] Tue, 14 October 2008 14:39 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Well, I've bodged it. The problems:
1- As above, you have to add code to serialize the look based on it's type.
2- The reason the style was being ignored was that you can't just create a ChStyle and expect it to work, it needs to registered properly with Upp. This is normally done by the CH_STYLE macro, but you can also do it by copying an existing ChStyle before altering it. It may also be possible to use ChRegisterStyle__ directly.

Below is the code I used. There is a bit more bodging with StringStreams because for some reason PNGRaster and PNGEncoder are slightly incompatible.

Personally I would avoid supporting saving themes, and just create a sensible file format than can be edited externally.

enum {
	ImageLookType = 0,
	ColorLookType	
};

void SerializeLook(Stream &s, Value &v) {
	int type;
	if (s.IsStoring()) {
		if(IsType<Color>(v)) {
			Color c = v;
			type = ColorLookType;
			s % type % c;
		}
		else if(IsType<Image>(v)) {
			type = ImageLookType;
			s % type;
			StringStream png;
			Image img = v;
			PNGEncoder().Save(png, img);
			s % (String)png;
			Point p1 = img.GetHotSpot();
			Point p2 = img.Get2ndSpot();
			s % p1 % p2;
		}
	}
	else {
		s % type; 
		if (type == ImageLookType) {
			String png;
			s % png;
			StringStream str(png);
			Image img = PNGRaster().Load(str);
			ASSERT(!IsNull(img));
			Point p1;
			Point p2;
			s % p1 % p2;
			ImageBuffer ib(img);
			ib.SetHotSpot(p1);
			ib.Set2ndSpot(p2);
			v = (Image)ib;
		}
		else if (type == ColorLookType) {
			Color c;
			s % c;
			ASSERT(!IsNull(c));
			v = c;
		}			
	}
};

void Theme::ButtonStyle::Serialize(Stream& s)
{
	if (s.IsLoading())
		d = Button::StyleNormal(); // Make sure style is initialised
	s % d.cancel % d.exit % d.focusmargin;
	for (int i = 0; i < 4; i++)	{	
		SerializeLook(s, d.look[i]);
	}
}

[Updated on: Tue, 14 October 2008 14:43]

Report message to a moderator

Re: A little theming [message #18667 is a reply to message #18649] Wed, 15 October 2008 17:07 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
mrjt wrote on Tue, 14 October 2008 15:39

Well, I've bodged it. The problems:
2- The reason the style was being ignored was that you can't just create a ChStyle and expect it to work, it needs to registered properly with Upp. This is normally done by the CH_STYLE macro, but you can also do it by copying an existing ChStyle before altering it. It may also be possible to use ChRegisterStyle__ directly.

	if (s.IsLoading())
		d = Button::StyleNormal(); // Make sure style is initialised
}


Thanks, that solved it! Not I can edit the styles again. I had no idea about the need to register styles. Just when I thought that Chameleon is done with it's surprises.

Quote:


Personally I would avoid supporting saving themes, and just create a sensible file format than can be edited externally.


A more sensible format would be better than raw serializing, but I don't really know what to use. A ZIP with PNGs and a XML comes to mind, but that is a little too much work for my current needs. Maybe if some day we'll want official explicit theme support, I'll rewrite the thing to be a much nicer solution. Right now I'll focus on theming Toolbar and then get a preview out with code, which I'll show to the author of the original theme also, so he can warn me if I've completely butchered the look Razz.

Quote:


There is a bit more bodging with StringStreams because for some reason PNGRaster and PNGEncoder are slightly incompatible.


What do you mean by that?
Re: A little theming [message #18669 is a reply to message #18667] Wed, 15 October 2008 17:41 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
cbpporter wrote on Wed, 15 October 2008 16:07

Quote:


There is a bit more bodging with StringStreams because for some reason PNGRaster and PNGEncoder are slightly incompatible.

What do you mean by that?

PNGRaster doesn't seem to read quite all of the data that's written by PNGEncoder:
	int beefin = 0xDEADBEEF;
	int beefout;
	StringStream s;

	PNGEncoder().Save(s, CtrlImg::HelpCursor1());
	s % beefin;

	s.SetLoading();
	s.Seek(0);
	Image img = PNGRaster().Load(s);
	s % beefout;

	ASSERT(!IsNull(img));	
	ASSERT(beefin == beefout);	

In this example the Image is read correctly but 'beefin == beefout' asserts because beefout is read from the incorrect point in the stream.

I avoided this in the code above by encoding the png into a String first so that you can guarantee the correct number of bytes are read, but really it should be fixed.

Edit: Tested on 2008.1

[Updated on: Wed, 15 October 2008 17:47]

Report message to a moderator

Re: A little theming [message #18670 is a reply to message #18669] Wed, 15 October 2008 20:14 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
If I remember correctly, I saw in a Delphi PNG implementation that PNGs can not be easily streamed because they use the size of the file to compute some information that is not directly saved in the header. But that was a long time ago, so maybe I'm wrong.
Re: A little theming [message #18685 is a reply to message #18670] Thu, 16 October 2008 22:45 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
Is there a way to control the height difference between an active tab of a TabCtrl and an inactive tab? Under Windows it seems to be hardcoded. I need this to fully reproduce the skin. Also, I need to be able to draw the background area that is behind the tab headers with a single look Value.

I leave you with this final screenshot before release. I removed the old ones and the exe.

I promise, this is going to be the final teaser before the release Smile.

index.php?t=getfile&id=1443&private=0
  • Attachment: untitled.PNG
    (Size: 21.85KB, Downloaded 1771 times)
Re: A little theming [message #18687 is a reply to message #18685] Fri, 17 October 2008 00:04 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
That's looking really good! I might have to use it myself.

For setting the inactive height you can change sel.top. Setting it to 0 for instance makes all tabs the same height. With the current code I don't think it's possible to set the background, since it's drawn as part of the tabs.
Re: A little theming [message #18707 is a reply to message #18687] Fri, 17 October 2008 18:56 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
So here is a first version of the theme. It is currently alpha quality only, so don't except too much from it. The format under which themes are stored will definitely change to something more robust and hopefully more editable. The interface will also surely change. Ignore all those nested classes. They are simple wrappers around the normal Styles, because normal Styles don't support any form of streaming and I can't change change their implementation to allow streaming.

The attachment contains two packages. The first one, Skulpture, creates the theme and exports it. You will need to run it once to create the theme. Just change the output path to something better than "C:\".

The second package is the Theme itself. This is the one you need. Add it to your project, and do something like:
Theme m;
LoadFromFile(m, "c:\\test.utheme");
m.Apply(); 


The theme covers buttons, default buttons, options, switches, tabs, edit fields, drop lists, menus and toolbars. Rest to come in future revisions.

TabCtrl is not perfect yet. A small change to it's paint is needed to allow background look for tab area.

And I still couldn't figure out how to change EditField border sizes.
  • Attachment: Skulpture.rar
    (Size: 20.98KB, Downloaded 571 times)
Re: A little theming [message #18712 is a reply to message #18707] Sat, 18 October 2008 09:10 Go to previous messageGo to next message
chickenk is currently offline  chickenk
Messages: 171
Registered: May 2007
Location: Grenoble, France
Experienced Member
Hello,

thanks for this theme. I tried to compile and test it on Linux. 2 remarks :

1. The tabs seems to go down a few pixels more than they should, see the picture below:
index.php?t=getfile&id=1445&private=0

2. The Stream operator% overloading seems to make gcc unhappy. The prototype is:
Stream& Stream::operator%(String& s);

Since it is passed a reference, the parameter must be a real allocated variable (at least it seems to be what gcc wants). In file Theme.cpp, line 27, the code
s % (String)png;
raises an error from gcc.
I could correct it by first creating a string variable from the 'png' StringStream, then passing its reference to the operator, like this :
String s_png = (String)png;
s % s_png;

Is there a better way to achieve this? Or a GCC option allowing the original contruction ? Can you confirm you compiled this code with MSVC and not mingw ?

Thanks,
Lionel
Re: A little theming [message #18713 is a reply to message #18712] Sat, 18 October 2008 09:51 Go to previous messageGo to next message
chickenk is currently offline  chickenk
Messages: 171
Registered: May 2007
Location: Grenoble, France
Experienced Member
please ignore this one-liner post. I wrote stupid things in it but could not delete it so I replaced the content.

[Updated on: Sat, 18 October 2008 09:59]

Report message to a moderator

Re: A little theming [message #18742 is a reply to message #18712] Sun, 19 October 2008 13:08 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
chickenk wrote on Sat, 18 October 2008 10:10


1. The tabs seems to go down a few pixels more than they should, see the picture below:


Yes, the theme was developed under Windows and some minor look discrepancies are bound to appear. These will be fixed soon as the them matures. Please be patient.

Quote:


2. The Stream operator% overloading seems to make gcc unhappy. The prototype is:
Stream& Stream::operator%(String& s);



I don't normally use GCC, especially because of the way it handles such issues. I once tried to show somebody how to write a very simple boost::format and it worked fine on my compiler, but MINGW failed miserably to compile that. I don't know which of the too compilers is right here. Maybe I can dig up that sample.

But back to the problem: I'll investigate these and try to deliver a version which works on all platforms. But this will have to wait a little, because I'm having problems even building CtrlCOre and CtrlLib with latest SVN under MINGW.
Re: A little theming [message #18762 is a reply to message #18712] Mon, 20 October 2008 10:51 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
chickenk wrote on Sat, 18 October 2008 08:10

2. The Stream operator% overloading seems to make gcc unhappy. The prototype is:
Stream& Stream::operator%(String& s);

Since it is passed a reference, the parameter must be a real allocated variable (at least it seems to be what gcc wants). In file Theme.cpp, line 27, the code
s % (String)png;
raises an error from gcc.
I could correct it by first creating a string variable from the 'png' StringStream, then passing its reference to the operator, like this :
String s_png = (String)png;
s % s_png;

Is there a better way to achieve this? Or a GCC option allowing the original contruction ? Can you confirm you compiled this code with MSVC and not mingw ?

Sorry, this one is my error. It was tested of MSVC and I always forget the stricter GCC requirements.

I don't know of any better way that adding a variable. It's a real pain IMO.
Re: A little theming [message #18812 is a reply to message #18762] Thu, 23 October 2008 19:57 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
The them is really approaching production status. There are still a bunch of controls that need skinning, but most common ones are done.

Under Linux the style still varies depending on Gnome theme. I'll try to fix that soon a repost the theme with a few nice additions.
I had to do some compromises, and I hope to be able to eliminate some of them to preserve the original look.

PS: I will point Christoph Feck, the author of this theme directly to this forum, so that he can see the progress.

Here is UWord:
index.php?t=getfile&id=1458&private=0
  • Attachment: sample.png
    (Size: 68.45KB, Downloaded 1678 times)
Re: A little theming [message #18814 is a reply to message #18812] Thu, 23 October 2008 21:06 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1367
Registered: November 2005
Location: Poland
Ultimate Contributor

Beautiful. I use it in my own applications. I see you styled arrayctrl and multibutton. That's great. The only strange place is for example dropdown button of font height combo on the toolbar. It's too big. But maybe it's not a fault of the theme. Must check this out.
IMO the default button soft border could be blue. I think it would add some "light" to the theme. I hope you will experiment with it Smile

[Updated on: Thu, 23 October 2008 21:07]

Report message to a moderator

Re: A little theming [message #18816 is a reply to message #18812] Fri, 24 October 2008 07:59 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

What about to create a visual theme editor mechanism?
I thing that will be greater!
Re: A little theming [message #18818 is a reply to message #18816] Fri, 24 October 2008 11:01 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
unodgs wrote on Thu, 23 October 2008 22:06

Beautiful. I use it in my own applications. I see you styled arrayctrl and multibutton. That's great. The only strange place is for example dropdown button of font height combo on the toolbar. It's too big. But maybe it's not a fault of the theme. Must check this out.
IMO the default button soft border could be blue. I think it would add some "light" to the theme. I hope you will experiment with it Smile

I'm glad you like it!

Yes, I skinned MultiButton. I had to make a huge compromise with it, because MultiButton style and rules are quite complex, and my patience with endless trial & error is limited. But surprisingly, it turned out quite close to the original.

Array control is far from done, it is lacking the smooth shadows that are typical for this theme. But I will get there.

I know about DropChoice being too big. It stands out really bad, but I couldn't figure out a way to make it behave the way I want. Again, a lot of trial & error.

And there is still the huge problem with EditField border. Depending on Linux theme, it adds an extra border. Also under Windows. I've spent about six hours in the last two days trying to figure out the code, and each time I found something that looked like it would be responsible for the extra border, I hit a dead end. For this screen shot I choose a theme that has no such issues. Should I have chosen a different theme, you could have seen the extra border.

I'll work hard to get it to a beta level this weekend.

PS: How's your Oxygen style progressing? With two high quality custom themes, and one reproducing the “modern” Windows look (like in ToolKit Pro), we will have great eye-candy possibilities.

tojocky wrote on Fri, 24 October 2008 08:59

What about to create a visual theme editor mechanism?
I thing that will be greater!

That would be great, but I don't know how it could be possible. When I started doing this theme, I thought that all that working with the images and fiddling to get shadows perfect would be horrible. But instead, that was the easies part. Figuring out how to set thing inn Chameleon so that it looks the same under all platforms was/is the hard part. It would be even harder to incorporate that into a visual editor. But it is something to think about. If you have any ideas, please share.

OTOH, I've been thinking a lot about the previous idea with an achieve with and XML and a bunch of pictures. It would make the theme more editable by the non technical people. Sure, TheIDE's image editor is quite excellent after you get used tot it (but I did manage to crash it once), but you have to write code to apply those images and extra information to a theme and export it as a shareable binary. With and XML, people could edit it easily and use their favorite image editing program. Yet, U++ theming engine is not really targeted by anybody else than us, and I think we can handle a little code Smile.

Re: A little theming [message #18820 is a reply to message #18818] Fri, 24 October 2008 14:53 Go to previous messageGo to previous message
unodgs is currently offline  unodgs
Messages: 1367
Registered: November 2005
Location: Poland
Ultimate Contributor

cbpporter wrote on Fri, 24 October 2008 05:01


Array control is far from done, it is lacking the smooth shadows that are typical for this theme. But I will get there.


I used skulpture button image to draw grid ctrl. I think it looks very good:
index.php?t=getfile&id=1459&private=0
Quote:


And there is still the huge problem with EditField border. Depending on Linux theme, it adds an extra border. Also under Windows. I've spent about six hours in the last two days trying to figure out the code, and each time I found something that looked like it would be responsible for the extra border, I hit a dead end. For this screen shot I choose a theme that has no such issues. Should I have chosen a different theme, you could have seen the extra border.


yes, edit field frame it's a complicated piece of code. Mirek worked on it quite long.
Quote:


I'll work hard to get it to a beta level this weekend.


Great! But maybe could you start using our svn?
Quote:


PS: How's your Oxygen style progressing? With two high quality custom themes, and one reproducing the “modern” Windows look (like in ToolKit Pro), we will have great eye-candy possibilities.


The problem is I have no time right now, as always (one commercial project is almost finished the next is coming..), but I'll try to get back to it ASAP.
  • Attachment: grid.png
    (Size: 1.72KB, Downloaded 1582 times)
Previous Topic: The problem with the operation of the buffer.
Next Topic: Set fields side to other fields and fields width to text width
Goto Forum:
  


Current Time: Sun May 03 07:21:27 GMT+2 2026

Total time taken to generate the page: 0.01154 seconds