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 » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Chamelon progress....
Chamelon progress.... [message #3916] Sun, 09 July 2006 15:40 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
DropList and related widgets now should have better appearance.

ProgressIndicator chameleonized.

HeaderCtrl chameleonized.

Mirek
Re: Chamelon progress.... [message #3942 is a reply to message #3916] Mon, 10 July 2006 15:34 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

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 Smile

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 #3946 is a reply to message #3942] Mon, 10 July 2006 17:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thats quite unfortunate....

I believe that the visually right thing is to align grid line to darkest line of header separator.

Unfortunatly, information provided by theming api is rather limited.... The only possible solution is to add more heurestics and simply detect that "darkest line"... (which will fail for "inverse" themes). OTOH, current ChWin32.cpp is already full of such visual heurestics (most of them deal with combobox button Wink, so maybe I could solve that... simply enforce that headertab ends with the darkest line.

As for "left" header, there is no support in theming API nor in chameleon YET. Possible solution (which might be provided by ch in future) is to draw to Image and rotate pixels. (ChPaintRotatedClockwise...)

Mirek
Re: Chamelon progress.... [message #3949 is a reply to message #3946] Mon, 10 July 2006 20:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, there is now

CH_INT(HeaderTabGridAdjustment, 0);

See HeaderCtrl sources for usage; maybe not quite ideal, but seems to work well for both cases - tested with standard Luna and Clearlooks. Please test with as much themes as possible...

Mirek
Re: Chamelon progress.... [message #3950 is a reply to message #3949] Mon, 10 July 2006 21:33 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Thanks Mirek! I'll try it with all themes I've got.
Re: Chamelon progress.... [message #4047 is a reply to message #3950] Tue, 18 July 2006 12:43 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

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));

index.php?t=getfile&id=187&private=0
)).

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??
  • Attachment: chameleon.png
    (Size: 1.37KB, Downloaded 2147 times)
Re: Chamelon progress.... [message #4049 is a reply to message #4047] Tue, 18 July 2006 13:12 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I am afraid not, at least not this way....

One trouble is that how XP paints that Rect is out of my control.

What I could do is to improve Image look behaviour for very small sizes. That however will not fix XP....

Just to make things clear: Should the "corrected" screenshot look like that the smaller "tab" is made of that dark-gray edge color?

Mirek
Re: Chamelon progress.... [message #4051 is a reply to message #4049] Tue, 18 July 2006 13:41 Go to previous message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

luzr wrote on Tue, 18 July 2006 07:12

Should the "corrected" screenshot look like that the smaller "tab" is made of that dark-gray edge color?
Mirek

Yes.
Previous Topic: TabCtrl news...
Next Topic: Painting refactored...
Goto Forum:
  


Current Time: Tue Apr 30 16:11:09 CEST 2024

Total time taken to generate the page: 0.03876 seconds