Home » U++ Library support » Look and Chameleon Technology » Strange Chameleon Problem
Strange Chameleon Problem [message #13663] |
Sat, 19 January 2008 15:54 |
Oblivion
Messages: 1112 Registered: August 2007
|
Senior 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...
Any Idea?
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[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 |
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.
|
|
|
Goto Forum:
Current Time: Sat Sep 21 03:02:26 CEST 2024
Total time taken to generate the page: 0.05441 seconds
|