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 » Strange Chameleon Problem
Strange Chameleon Problem [message #13663] Sat, 19 January 2008 15:54 Go to next message
Oblivion is currently online  Oblivion
Messages: 534
Registered: August 2007
Location: Turkey
Contributor
I'm working on a TabInterface class (which is derived from Quicktabs) for my dockctrl project. Bu I have a strange problem with chameleon system.

the chameleon definitions are;

in .h file:
#define IMAGECLASS TabInterfaceImages
#define IMAGEFILE <DockTab/DockTab.iml>
#include <Draw/iml_header.h>
...
...
	struct Style : ChStyle<Style> 
	{
		int tabheight, margin, extendleft;
		Rect sel, edge;

		Value normal[4], first[4], last[4], both[4];		
		Font font;
	};
	
	const Style*  style;

        static const Style& StyleDefault();
        TabInterface& SetStyle(const Style& s);			
        const Style*  GetStyle() { return style ? style : &StyleDefault(); }


in .cpp file:
#define IMAGECLASS TabInterfaceImages
#define IMAGEFILE <DockTab/DockTab.iml>
#include <Draw/iml_source.h>
...
...
CH_STYLE(TabInterface, Style, StyleDefault)
{
CtrlsImageLook(normal, TabInterfaceImages::I_TAB, 4);
CtrlsImageLook(first, TabInterfaceImages::I_FTAB, 4);
CtrlsImageLook(last, TabInterfaceImages::I_LTAB, 4);
CtrlsImageLook(both, TabInterfaceImages::I_BTAB, 4);
}


The strange part is, whenever I use my own DockTab.iml file and use value with ChPaint(), I get some other ctrl images from the CtrlLib's CtrlsImg class...

My every effort to avoid this strange behaviour is failed... Sad
Any Idea?



index.php?t=getfile&id=948&private=0
  • Attachment: chproblem.jpg
    (Size: 34.76KB, Downloaded 545 times)

[Updated on: Sat, 19 January 2008 16:14]

Report message to a moderator

Re: Strange Chameleon Problem [message #13676 is a reply to message #13663] Mon, 21 January 2008 12:03 Go to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Aha! I had this problem, and probably for exactly the same reasons as you did, namely thinking that you could use CtrlsImageLook with other image collections.

In fact, the definition of CtrlsImageLook is:
Quote:

void CtrlsImageLook(Value *look, int i, int n)
{
while(n--)
*look++ = CtrlsImg::Get(i++);
}

which means that whats happening is that you are passing in the index of the image in your image file, and the index is then used to look up an image in CtrlsImg.

The solution: Set all images individually or create your own TabsImageLook variant.
Previous Topic: How can I change the background color of my Upp app?
Next Topic: Resizeing on Vista
Goto Forum:
  


Current Time: Sun Feb 17 11:00:59 CET 2019

Total time taken to generate the page: 0.00713 seconds