Status & Roadmap
Authors & License
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 offline  Oblivion
Messages: 614
Registered: August 2007
Location: Turkey
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?

  • Attachment: chproblem.jpg
    (Size: 34.76KB, Downloaded 564 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
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:

void CtrlsImageLook(Value *look, int i, int 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: Sat Jan 25 19:44:04 CET 2020

Total time taken to generate the page: 0.01085 seconds