A quick question on themes...
-
I am working on a button that has a custom shape, and I wanted to give the user the option to match the button color scheme used by XP. I was planning to fill the button region with a gradient matching the current XP theme. I asked this question on the Yahoo WTL forum. The answer makes writing a custom shaped button a little more difficult. I am trying to use theme colors in XP to draw a gradient background that is not rectangular. I am utilizing atltheme.h to call GetThemeColor(BP_PUSHBUTTON, PBS_HOT, TMT_GRADIENTCOLOR1, &c). I am trying to retrieve just one gradient color at the moment. I've tried using DrawThemeBackground for a button. The colors are correct, but the shape cannot be changed to fit the region I am filling. I've discovered that most theme parts do not return gradient colors. (I am able to get some colors, just not the gradient colors.) Does anyone know how to retrieve the gradient colors used to draw themed buttons? Most of the examples I have found hard code the gradient colors to look like the theme colors. The answer I received: Themed buttons are actually drawn using a template bitmap, so there are no gradient colours to retrieve. Is this documented some place? I searched using google and I've had no luck locating any references to bitmap templates used for buttons.
-
I am working on a button that has a custom shape, and I wanted to give the user the option to match the button color scheme used by XP. I was planning to fill the button region with a gradient matching the current XP theme. I asked this question on the Yahoo WTL forum. The answer makes writing a custom shaped button a little more difficult. I am trying to use theme colors in XP to draw a gradient background that is not rectangular. I am utilizing atltheme.h to call GetThemeColor(BP_PUSHBUTTON, PBS_HOT, TMT_GRADIENTCOLOR1, &c). I am trying to retrieve just one gradient color at the moment. I've tried using DrawThemeBackground for a button. The colors are correct, but the shape cannot be changed to fit the region I am filling. I've discovered that most theme parts do not return gradient colors. (I am able to get some colors, just not the gradient colors.) Does anyone know how to retrieve the gradient colors used to draw themed buttons? Most of the examples I have found hard code the gradient colors to look like the theme colors. The answer I received: Themed buttons are actually drawn using a template bitmap, so there are no gradient colours to retrieve. Is this documented some place? I searched using google and I've had no luck locating any references to bitmap templates used for buttons.
Jim Barry answered all of my questions on Yahoo WTL[^]. Many thanks to him. Short answer: Oh yes, totally undocumented. Jim's answer also made it clear to me why custom shapes are difficult to theme if you want to use the "Button" theme. :sigh: I am most grateful for Jim's quick and accurate answers.:cool: