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 » Look and Chameleon Technology » A little theming
Re: A little theming [message #21520 is a reply to message #21519] Sun, 24 May 2009 11:33 Go to previous messageGo to previous message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
The compile problem is not only on MINGW, there is the same problem on linux ==> the "problem" comes from the compiler GCC.

Here is a valid correction but it needs to be optimised (on point 2):

In Theme.cpp
------------
1 - I removed the second template parameter: V is supposed to be a Value type since you use ' v.Is<Upp::String> ' just let C++ inheritance do it's work.

//template <typename T, typename V>
template <typename T>
inline void SetIfNotNull(T& t, Value v)
{
	if ( v.Is<Upp::String>() && ((String)v == "null") )
		t = Null;
	else
		if (!IsNull(v))
	    	t = v;
}


2 - You have to add a temporary object:
Image imag
because problems when using temporary references: It is not excluded that
ImageBuffer img( imag );
will use the address of the passed object which would be completely false for a temporary reference. Even though the problem is still here after correction (img is a temporary to the scope) at least it is visible while reading the code and not left to compiler will.

Value Theme::StringToObject(const String& s, const String& def) {
	Vector<String> v = Split(s, ' ');
	if (v.GetCount() == 0)
		return Null;
	if (v[0] == "png") {
		Image imag = PNGRaster().LoadFileAny(AppendFileName(dir, def));
		ImageBuffer img( imag );
		if (img.IsEmpty())



In Theme.h
----------
3 - remove the
 Theme:: 
from the following line
	void Theme::LoadEditField(EditField::Style& d, const VectorMap<String, String>& set, const String& dir, const String& file);




Question:
---------
1 - Is there some documentation for the 'theme.ini' file syntax ?
2 - Can I use several themes in one application (like have two tabs not using same theme) or add in 'theme.ini' several different versions of skin for a ctrl ?


Skulpture looks good on linux Cool

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
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: Fri Apr 26 22:51:39 CEST 2024

Total time taken to generate the page: 0.06597 seconds