Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. A quick question on themes...

A quick question on themes...

Scheduled Pinned Locked Moved ATL / WTL / STL
questionc++wpfgraphicsregex
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gene OK
    wrote on last edited by
    #1

    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.

    G 1 Reply Last reply
    0
    • G Gene OK

      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.

      G Offline
      G Offline
      Gene OK
      wrote on last edited by
      #2

      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:

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups