Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Chamelon progress....
|
Re: Chamelon progress.... [message #3942 is a reply to message #3916] |
Mon, 10 July 2006 15:34 |
|
Hi!
There is a little problem with chameleon and header ctrl. Let me try to describe it:
The problem is that vertical lines of arrayctrl (gridctrl) and header cells' separators
can't be positioned idealy. By idealy I mean impression of one straigth line.
Just look at the screenshots below. On the first screen (where clear looks theme is used)
cell separator is painted one pixel before vertical line of grid body.
On the second screen (fatluna theme (luna variation)) cell separator is painted one pixel
after the grid line.
The problem is that authors of the themes paint that separators either on the left side of header
cell bitmap or on the right side of it - it depends what visual effect they want to achieve.
But whatever place they choose there always be grid line and cell separator +/- one pixel difference.
My solution is to have functions (from ch series) to paint header cell body without the left/right edge
and function to paint only the edge of cell (is it possible to distinguish the body and the edge using
xp theme api??).
Now ChPaint(w,x,y,cx,cy, HeaderTabLook(n)) draws body and separator together (with body streched
according to cx and cy values).
If I could also paint that separators in horizontal direction I could draw properly horizontal fixed
cells (see screen 1 - the top and bottom edges of horizontal fixed cells are now duoubled).
I hope I made myself clear
PS: Screens are zipped because this forum dosn't let to attach more than one file per message..
-
Attachment: screens.zip
(Size: 134.27KB, Downloaded 1238 times)
|
|
|
|
|
|
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: Tue Apr 30 16:11:09 CEST 2024
Total time taken to generate the page: 0.03876 seconds
|