Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Chamelon progress....
Re: Chamelon progress.... [message #4047 is a reply to message #3950] |
Tue, 18 July 2006 12:43   |
|
unodgs wrote on Mon, 10 July 2006 15:33 | Thanks Mirek! I'll try it with all themes I've got.
|
The "new system" seem to work fine with all themes I've tried so far.
But I have one feature request to the chameleon. More advanced version of ChPaint:
ChPaint(Draw, x, y, cx, cy, Value, offsetx = 0, offsety = 0, mode = STRETCH_BOTH)
where mode can be one of following:
NO_STRETCH = 0
STRETCH_X = 0x2
STRETCH_Y = 0x4
STRETCH_BOTH = STRETCH_X | STRETCH_Y (default)
offsetX/Y means that if ones are given the ChPaint should stretch or just paint (if no stretch mode is passed) the internal bitmap with first pixels omitted in x by offsetx and in y by offsety. In stretch mode that skipped pixels should not be stretched.
I need it because I have to paint header in my gridctrl a little bit different. In arrayctrl header is always refreshed as a whole even during scrolling. In my grid I repaint only the invalidate area and I also check if cell of header should be painted using IsPainting routine. So I now use a code like this to paint header cell
(case if HeaderTabGridAdjustment() is positive)
ht = HeaderTabGridAdjustment()
ChPaint(w, x - ht, y, cx - ht, cy, HeaderTabLook(q))
ChPaint(w, x + cx - ht, y, ht, cy, HeaderTabLook(q))
The problem lies in second call of ChPaint. It dosn't paint left border of header because ht is too small and result of stretching for this size is a bitmap without left border (it was eaten during resizeing,
see screenshot - result of code:
w.DrawRect(GetSize(), White);
w.DrawRect(5, 5, 100, 100, LtGreen);
int ht = HeaderTabGridAdjustment();
int q = CTRL_NORMAL;
ChPaint(w, 6, 6, 50, 18, HeaderTabLook(q));
ChPaint(w, 6, 30, 1, 18, HeaderTabLook(q));

)).
With new ChPaint I could write it like this:
ChPaint(w, x, y, cx - ht, cy, HeaderTabLook(q), ht, 0, STRETCH_BOTH)
ChPaint(w, x + cx - ht, y, ht, cy, HeaderTabLook(q), 0, 0, STRETCH_Y)
Is that extension to ChPaint possible to add??
|
|
|
Goto Forum:
Current Time: Wed Aug 27 22:16:31 CEST 2025
Total time taken to generate the page: 0.00571 seconds
|