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 » U++ Library support » Look and Chameleon Technology » Office Ribbon skin
Re: Any function to draw gradient color? [message #11749 is a reply to message #11746] Mon, 24 September 2007 21:19 Go to previous messageGo to next message
piratalp is currently offline  piratalp
Messages: 26
Registered: September 2007
Location: Argentina
Promising Member
[quote title=luzr wrote on Mon, 24 September 2007 14:29]
Maybe you could also try some 3rd party theme / visuals...
[quote]

I don't understand, what themes do you want me to try?

Quote:


I do not get this. How are you using Values for chameleonization?

My (original) idea is that those Values just represent how things are about to be painted.

In this case you either put Images there, or you perhaps define your new Value and put those colors in it; it will then be interpreted by creating required gradient (if that is what you desire).

I definitely do not see a reason to add 8 Values per widget....

But maybe I just do not understand something....


Yes, you're not getting the whole picture, I know I can put anything into chameleon values to ChPaint widgets, and I'm really doing that, but using static images is not my way, I could just capture some screens, cut buttons, progress & scroll bars & so on and create a ctrl.iml but I don't like that, why? because they are STATIC, and they consume memory & executable space, what I prefer is to code how the skin work and provide a Palette to it, so it is indiferent to the skin system if you want to render things in black, blue, white, red or whatever flavor you want, that's impossible with any of current skins but not with ribbon..

So, why I was needing 8 values per widget? 4 values for the 4 states (Normal, Highlight, Pressed and Disabled) and 4 values for text colors of those 4 states, hope this is clear now, but.. the problem I found is that using this way the palette was storing actual "Values" passed to ChPaint, and that's WRONG, why? because if I store Values for ribbon skin use in it those values can't be used in other skins, also, using values was forcing me to define that 8 values combination for every widget chameleonized, that's why I dropped that idea & refactored ChPalette to store Colors, a set of basic face/highlight/pressed/disabled colors used for every widget except buttons, progress, scrollbars & other widgets that have very custom look in most skins..

Quote:


Quote:


struct ChPalette {
Color FaceLight;
Color FaceMedium;
Color FaceNormal;
Color FaceDark;
Color FaceBorder;
Color FaceText;
}



Hope it is more clear now...

Well, convert this to Value (e.g. RawToValue) and provide ChPaint ... Smile

Mirek


Yes, that's what I do Wink

Bests,
Mauricio
Re: Office Ribbon skin [message #11750 is a reply to message #11748] Mon, 24 September 2007 21:41 Go to previous messageGo to next message
sergei is currently offline  sergei
Messages: 94
Registered: September 2007
Member
piratalp wrote on Mon, 24 September 2007 21:05

sergei wrote on Mon, 24 September 2007 14:28

AFAIK that's the difference between copyright and patent - if you reinvent copyrighted stuff you're fine, if you reinvent a patent you still can get sued Confused
But if that's US-only it's of less concern.


Read your original post again, it states that ribbon-like software made BEFORE the patent with no m$ specs help will not fall into patent infringement

Quote:


You're giving me too much credit Razz I wanted to get these colors too, went to MSDN for some info: http://msdn2.microsoft.com/en-us/library/system.drawing.syst emcolors.aspx (scroll down). But a dumper might not be such a bad idea when the skin is complete, so many nice XP themes could be converted to U++ skins Very Happy

Looking forward for office-style U++.


I don't think it will be necessary, just screenshot + gimp, it's what I'm doing to rip Office 2007 Blue palette..

Your office-style sentence is ambiguous, both .NET 2.0 (Office 2003) and Ribbon (Office 2007) falls there, however I'm planning to make also an Office 2003 skin when Ribbon is completed (both are gradient skins, one doing linear light-to-dark gradient, the other with a two-step gradient bringing a glass-like efect)

Regards


That's fine for now, but patents might work retractively. Especially M$ patents in the US Razz


I see that you took a different approach from what I've assumed. With gimp you're just hardcoding the palettes for the themes, right? I thought you found a transformation from system colors to professionalcolortable-like palette. With such a transformation themes could be converted to palettes.

Re: Any function to draw gradient color? [message #11752 is a reply to message #11749] Mon, 24 September 2007 23:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14164
Registered: November 2005
Ultimate Member
[quote title=piratalp wrote on Mon, 24 September 2007 15:19][quote title=luzr wrote on Mon, 24 September 2007 14:29]
Maybe you could also try some 3rd party theme / visuals...
Quote:



I don't understand, what themes do you want me to try?



uxtheme.dll patch and e.g. try MacOSX theme for XP and investigate what happens to Office toolbars.. Smile

Quote:


Yes, you're not getting the whole picture, I know I can put anything into chameleon values to ChPaint widgets, and I'm really doing that, but using static images is not my way, I could just capture some screens, cut buttons, progress & scroll bars & so on and create a ctrl.iml but I don't like that, why? because they are STATIC, and they consume memory & executable space



Actually, I was rather thinking about generating the images by chameleon code. Resizing images is quite fast, maybe faster than e.g. generating gradients. BTW, in both WinXP and GTK chameleon code, this is quite used option, because very often the theming engine does not contain things we need - e.g. scrollbar buttons without arrows (so that you can put something else into them).

In those cases, we are using various heurestics applied on images to get reasonable results...

Quote:


So, why I was needing 8 values per widget? 4 values for the 4 states (Normal, Highlight, Pressed and Disabled) and 4 values for text colors of those 4 states, hope this is clear now, but..



Well, not really. It is still 4 Values for me... Smile

But perhaps we are speaking about the same thing...

Quote:


the problem I found is that using this way the palette was storing actual "Values" passed to ChPaint, and that's WRONG, why? because if I store Values for ribbon skin use in it those values



Please, in order to make my stupid aging mind understand, what type you wanted to store into Value in this "WRONG" 4x4 attempt?

Mirek
Re: Office Ribbon skin [message #11754 is a reply to message #11384] Mon, 24 September 2007 23:59 Go to previous messageGo to next message
sergei is currently offline  sergei
Messages: 94
Registered: September 2007
Member
I've found some interesting input:

http://blogs.msdn.com/jensenh/archive/2006/08/10/694577.aspx
http://blogs.msdn.com/jensenh/archive/2006/08/14/699304.aspx
http://blogs.msdn.com/jensenh/archive/2006/11/21/licensing-t he-2007-microsoft-office-user-interface.aspx

I hope your implementation won't need 1500 colors Razz
Re: Office Ribbon skin [message #11777 is a reply to message #11750] Tue, 25 September 2007 17:11 Go to previous messageGo to next message
piratalp is currently offline  piratalp
Messages: 26
Registered: September 2007
Location: Argentina
Promising Member
sergei wrote on Mon, 24 September 2007 16:41


I see that you took a different approach from what I've assumed. With gimp you're just hardcoding the palettes for the themes, right? I thought you found a transformation from system colors to professionalcolortable-like palette. With such a transformation themes could be converted to palettes.



Yes, no.. both Razz
Ribbon skin works with any combination of colors, the skin itself is only the code needed to render widgets, on the other side there is palette, ribbon skin can work with ANY palette, and of course, it can use actual system colors, the problem is how to get those colors? well, currently I just make some blend hackery on current SColor*() palette, as it may change from system to system and from skin to skin.. so ribbon will render fine with any combination of colors currently assigned, it does not rely on ProfessionalColorTable nor windoze internals, in fact, ribbon knows NOTHING about what palette is using, that's managed by lowlevel upp subsystems that assign SColor*() values (win32 part could fill them from ProfessionalColorTable but that's out of my field..) and application developers (you can manually set any palette you want, already bundled or created by your own)

Hope this answers your question, yes, I'm now hardcoding Office 2007 Blue palette into ONE FUNCTION that will assign these values to a palette:

void ChOffice2007Blue(ChPalette &p)
{
    p.FaceLight  = Color(...
    p.FaceMedium = Color(...
    p.FaceNormal = Color(...
    p.FaceDark   = Color(...

    // and so on..
}


But this does NOT mean that ribbon will use just these values, there will be as many palettes as.. we want Wink

Bests
Re: Office Ribbon skin [message #11780 is a reply to message #11384] Tue, 25 September 2007 18:12 Go to previous messageGo to next message
sergei is currently offline  sergei
Messages: 94
Registered: September 2007
Member
Yes, it mostly answers my questions, thanks. So, you're using: SColor*(System Colors) -> ChPalette -> Gradients/Blendings/...

The interesting part (for me at least) is SColor*(System Colors) -> ChPalette. For Office 2007 I see that you hardcode ChPalette. But (at least for Office 2003) it can be achieved from system colors. I've inspected ProfessionalColorTable as a reference, it used only 3 system colors for most of its 56 colors - window (SColorPaper), highlight (SColorHighlight), 3D face (SColorFace). Do you use these three too?

And is this your ProfessionalColorTable alternative?
struct ChPalette {
Color FaceLight;
Color FaceMedium;
Color FaceNormal;
Color FaceDark;
Color FaceBorder;
Color FaceText;
}
If so, isn't that too few colors? E.g. what color is used for highlight? What for start/end of gradient in menu/button/pressed state? Or does ChPalette provide colors for future blending?
Re: Any function to draw gradient color? [message #11783 is a reply to message #11752] Tue, 25 September 2007 19:56 Go to previous messageGo to next message
piratalp is currently offline  piratalp
Messages: 26
Registered: September 2007
Location: Argentina
Promising Member
luzr wrote on Mon, 24 September 2007 18:56


uxtheme.dll patch and e.g. try MacOSX theme for XP and investigate what happens to Office toolbars.. Smile


Ahh, now I understand, yes, I tried and it works ok, upp also reflects this change Smile

Quote:



Actually, I was rather thinking about generating the images by chameleon code. Resizing images is quite fast, maybe faster than e.g. generating gradients. BTW, in both WinXP and GTK chameleon code, this is quite used option, because very often the theming engine does not contain things we need - e.g. scrollbar buttons without arrows (so that you can put something else into them).

In those cases, we are using various heurestics applied on images to get reasonable results...


Yes I thought about that more than once but it will still force to static color images initialized when skin is changed, what if user wants to change palette? what about custom style for just one widget? While I think this now I also think that in any case the user (end programmer) will need to call a function to set the style and its a matter of returning an image instead a gradient.. not bad idea, I need to code it and see what happens...

Quote:


Well, not really. It is still 4 Values for me... Smile

But perhaps we are speaking about the same thing...



4 values are for chpaint background, but you also have textcolor[4] for buttons, and it should be in menuitems too or you will end with light text over light bg or dark text over dark bg..

Quote:


Please, in order to make my stupid aging mind understand, what type you wanted to store into Value in this "WRONG" 4x4 attempt?

Mirek


Mirek, it's not what I was storing inside chameleon styles, it's what I was storing inside Palette, that was what complicated it all, I just changed Palette to store colors, not final Value for ChPaint, end style->Value holds exactly the same thing as before

Regards
Re: Any function to draw gradient color? [message #11786 is a reply to message #11783] Tue, 25 September 2007 23:00 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14164
Registered: November 2005
Ultimate Member
piratalp wrote on Tue, 25 September 2007 13:56



Yes I thought about that more than once but it will still force to static color images initialized when skin is changed, what if user wants to change palette?



You just regenerate images.

Quote:


Mirek, it's not what I was storing inside chameleon styles, it's what I was storing inside Palette, that was what complicated it all, I just changed Palette to store colors, not final Value for ChPaint, end style->Value holds exactly the same thing as before



Thanks, I guess it makes more sense to me (a bit Smile.
Re: Office Ribbon skin [message #11791 is a reply to message #11780] Wed, 26 September 2007 00:07 Go to previous messageGo to next message
piratalp is currently offline  piratalp
Messages: 26
Registered: September 2007
Location: Argentina
Promising Member
sergei wrote on Tue, 25 September 2007 13:12

Yes, it mostly answers my questions, thanks. So, you're using: SColor*(System Colors) -> ChPalette -> Gradients/Blendings/...

The interesting part (for me at least) is SColor*(System Colors) -> ChPalette. For Office 2007 I see that you hardcode ChPalette. But (at least for Office 2003) it can be achieved from system colors. I've inspected ProfessionalColorTable as a reference, it used only 3 system colors for most of its 56 colors - window (SColorPaper), highlight (SColorHighlight), 3D face (SColorFace). Do you use these three too?



The answer to your question is yes.
But you're misunderstanding how the skin work, I'm not hardcoding an Office 2007 skin, what I'm hardcoding now is the Office 2007 Blue palette, returned by ChOffice2007Blue() as I said before, there is also ChSystemPalette(), and will be ChOffice2007Black(), ChOffice2007Silver(), ChXPBlue(), ChXPOlive(), ChXPSilver() and as many as we want, the skin will simply use the color from the palette YOU choose to render widgets in a ribbon style. For Office2003 look & feel, I'll make another skin (a piece of cake after ribbon is finished, just minor modifications) that ALSO will render widgets in ANY combination of colors..

Quote:


And is this your ProfessionalColorTable alternative?
struct ChPalette {
Color FaceLight;
Color FaceMedium;
Color FaceNormal;
Color FaceDark;
Color FaceBorder;
Color FaceText;
}
If so, isn't that too few colors? E.g. what color is used for highlight? What for start/end of gradient in menu/button/pressed state? Or does ChPalette provide colors for future blending?



No, those 6 items represent just ONE final item (you can see it like SColorFace() divided in the 4-color needed to make the gradient + one for border + one for text), it is used in general items as I said in previous posts, there are also highlight, pressed & disabled combinations for general items, then start customized ones like menus & buttons..

Bests
Re: Office Ribbon Skin [message #11794 is a reply to message #11786] Wed, 26 September 2007 00:34 Go to previous messageGo to next message
piratalp is currently offline  piratalp
Messages: 26
Registered: September 2007
Location: Argentina
Promising Member
luzr wrote on Tue, 25 September 2007 18:00

piratalp wrote on Tue, 25 September 2007 13:56



Yes I thought about that more than once but it will still force to static color images initialized when skin is changed, what if user wants to change palette?



You just regenerate images.



Yes, that's what I thought then, I think it will be a bit more complicated but I'll make some tests and see what's best..

Regards
Re: Office Ribbon Skin [message #11824 is a reply to message #11794] Wed, 26 September 2007 20:13 Go to previous message
mirek is currently offline  mirek
Messages: 14164
Registered: November 2005
Ultimate Member
piratalp wrote on Tue, 25 September 2007 18:34

luzr wrote on Tue, 25 September 2007 18:00

piratalp wrote on Tue, 25 September 2007 13:56



Yes I thought about that more than once but it will still force to static color images initialized when skin is changed, what if user wants to change palette?



You just regenerate images.



Yes, that's what I thought then, I think it will be a bit more complicated but I'll make some tests and see what's best..

Regards


BTW, not quite related and not very helpful in this case, but one of my recent ideas is that palette (generally, not in this case only) can be quite effectively implemented using Image too. With the advantage that you can use color selector in .iml editor.. Smile

(Not used for anything so far, just an idea).

Mirek
Previous Topic: progress bar not chameleonized
Next Topic: How can I change the background color of my Upp app?
Goto Forum:
  


Current Time: Sat Dec 14 15:29:59 CET 2024

Total time taken to generate the page: 0.04649 seconds