Loading ...
Sorry, an error occurred while loading the content.

Property Sheet in a view on WinXP has tiled background?!

Expand Messages
  • Catalin Rotaru
    Hi, I am trying to use a Property Sheet as a splitter windows in my application. I made it modeless and I reduced the template to get rid of the buttons. I got
    Message 1 of 8 , Aug 5 6:05 AM
    • 0 Attachment
      Hi,

      I am trying to use a Property Sheet as a splitter windows in my
      application. I made it modeless and I reduced the template to get rid
      of the buttons. I got the ONSIZE event to resize the page then the
      windows was resized.

      The problem is that when I maximize the window (on my 1600x1200
      monitor), the Property Sheet background, which is originally a nice
      gradient, gets tiled! As if it was painted for a fixed dimension which
      was too small.

      Anybody ideas why? How can I fix it? It probably has to do with
      Windows Themes. Any pointer where I can learn more?

      Thanks,
      Cata

      --
      Catalin Rotaru
      http://www.rotaru.com
    • Jim Barry
      ... Yes - in fact, that is exactly the situation. It is one of the many known issues with Visual Styles. I am not aware of any fix. -- Jim Barry, MVP for
      Message 2 of 8 , Aug 5 11:06 AM
      • 0 Attachment
        Catalin Rotaru wrote:
        > The problem is that when I maximize the window (on my 1600x1200
        > monitor), the Property Sheet background, which is originally a nice
        > gradient, gets tiled! As if it was painted for a fixed dimension which
        > was too small.

        Yes - in fact, that is exactly the situation. It is one of the many known "issues" with Visual Styles. I am not aware of any fix.

        --
        Jim Barry, MVP for Windows SDK
      • Roger Headrick
        ... rid ... which ... Hi Catalin, I believe the background is drawn with a bitmap brush. All the visual style bitmaps for the luna theme can be found in
        Message 3 of 8 , Aug 5 11:28 AM
        • 0 Attachment
          --- In wtl@yahoogroups.com, Catalin Rotaru <catalin.rotaru@g...>
          wrote:
          > Hi,
          >
          > I am trying to use a Property Sheet as a splitter windows in my
          > application. I made it modeless and I reduced the template to get
          rid
          > of the buttons. I got the ONSIZE event to resize the page then the
          > windows was resized.
          >
          > The problem is that when I maximize the window (on my 1600x1200
          > monitor), the Property Sheet background, which is originally a nice
          > gradient, gets tiled! As if it was painted for a fixed dimension
          which
          > was too small.
          >
          > Anybody ideas why? How can I fix it? It probably has to do with
          > Windows Themes. Any pointer where I can learn more?
          >
          > Thanks,
          > Cata
          >
          > --
          > Catalin Rotaru
          > http://www.rotaru.com


          Hi Catalin,

          I believe the background is drawn with a bitmap brush. All the
          visual style bitmaps for the luna theme can be found in
          C:\WINNT\Resources\Themes\Luna\luna.msstyles if you want to
          experiment with creating your own brush.

          -Roger
        • Catalin Rotaru
          Damn. Is there any way I can overwrite that and draw the background of the Property Sheet myself? Maybe using a better bitmap brush or a plain color. Thanks,
          Message 4 of 8 , Aug 6 12:07 AM
          • 0 Attachment
            Damn. Is there any way I can overwrite that and draw the background of
            the Property Sheet myself? Maybe using a better bitmap brush or a
            plain color.

            Thanks,
            Cata


            ----- Original Message -----
            From: Roger Headrick <lilsroro@...>
            Date: Thu, 05 Aug 2004 18:28:43 -0000
            Subject: [wtl] Re: Property Sheet in a view on WinXP has tiled background?!
            To: wtl@yahoogroups.com

            --- In wtl@yahoogroups.com, Catalin Rotaru <catalin.rotaru@g...>


            wrote:
            > Hi,
            >
            > I am trying to use a Property Sheet as a splitter windows in my
            > application. I made it modeless and I reduced the template to get
            rid
            > of the buttons. I got the ONSIZE event to resize the page then the
            > windows was resized.
            >
            > The problem is that when I maximize the window (on my 1600x1200
            > monitor), the Property Sheet background, which is originally a nice
            > gradient, gets tiled! As if it was painted for a fixed dimension
            which
            > was too small.
            >
            > Anybody ideas why? How can I fix it? It probably has to do with
            > Windows Themes. Any pointer where I can learn more?
            >
            > Thanks,
            > Cata
            >
            > --
            > Catalin Rotaru
            > http://www.rotaru.com


            Hi Catalin,

            I believe the background is drawn with a bitmap brush. All the
            visual style bitmaps for the luna theme can be found in
            C:\WINNT\Resources\Themes\Luna\luna.msstyles if you want to
            experiment with creating your own brush.

            -Roger






            Yahoo! Groups Sponsor

            ADVERTISEMENT


            ________________________________
            Yahoo! Groups Links

            To visit your group on the web, go to:
            http://groups.yahoo.com/group/wtl/

            To unsubscribe from this group, send an email to:
            wtl-unsubscribe@yahoogroups.com

            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



            --
            Catalin Rotaru
            http://www.rotaru.com
          • Roger Headrick
            ... background of ... Ha Cata, If I were really determined to fix the problem, I might try the following approach: 1. Extract a copy of the bitmap out of
            Message 5 of 8 , Aug 6 2:01 AM
            • 0 Attachment
              --- In wtl@yahoogroups.com, Catalin Rotaru <catalin.rotaru@g...>
              wrote:
              > Damn. Is there any way I can overwrite that and draw the
              background of
              > the Property Sheet myself? Maybe using a better bitmap brush or a
              > plain color.
              >
              > Thanks,
              > Cata
              >
              >

              Ha Cata,

              If I were really determined to fix the problem, I might try the
              following approach:

              1. Extract a copy of the bitmap out of luna.msstyles, using Resource
              Hacker or similar program, and put it in your app's resources.
              Alternatively, you could extract the bitmap programmatically at
              runtime, but I don't remember how to do that :)

              2. Subclass the property sheet's tab control by making the tab
              control a CContainedWindowT member of the property sheet class. I'm
              guessing there are examples somewhere of how to do this, but I dont
              think its difficult.

              3. Handle the tab control's WM_PAINT message by using a memory dc
              and having the tab control paint on the memory dc. Then draw the
              bitmap over the background. In psuedo-code, it would look something
              like this:

              CTheme theme;
              if(theme.IsThemingSupported() && ::IsThemeActive())
              {
              CPaintDC dc(m_tabctrl);
              // the following class would be
              // a memory dc class like in Bjarke Viksoe's
              // atlgdix.h file.
              CMemDC dcMem(dc);
              // have tab control paint on memdc
              m_tabctrl.DefWindowProc(WM_PAINT, (WPARAM)(HDC)dcMem, 0);
              // select the theme bitmap into another memory dc and StretchBlt it
              // onto the dcMem where the tab body background rect is located.
              DoStretchBlt(...);
              return 0;
              }

              bHandled = FALSE;
              return 0;

              HTH,
              -Roger
            • Jim Barry
              ... You can turn off the background texture with EnableThemeDialogTexture. However, if you want to paint your own background, you will have some fun with
              Message 6 of 8 , Aug 6 2:06 AM
              • 0 Attachment
                > Damn. Is there any way I can overwrite that and draw the background of
                > the Property Sheet myself? Maybe using a better bitmap brush or a
                > plain color.

                You can turn off the background texture with EnableThemeDialogTexture. However, if you want to paint your own background, you will have some fun with semitransparent controls, e.g. static text.

                --
                Jim Barry, MVP for Windows SDK
              • Roger Headrick
                ... background of ... EnableThemeDialogTexture. However, if you want to paint your own background, you will have some fun with semitransparent controls, e.g.
                Message 7 of 8 , Aug 6 2:30 AM
                • 0 Attachment
                  --- In wtl@yahoogroups.com, "Jim Barry" <jim@m...> wrote:
                  > > Damn. Is there any way I can overwrite that and draw the
                  background of
                  > > the Property Sheet myself? Maybe using a better bitmap brush or a
                  > > plain color.
                  >
                  > You can turn off the background texture with
                  EnableThemeDialogTexture. However, if you want to paint your own
                  background, you will have some fun with semitransparent controls,
                  e.g. static text.
                  >
                  > --
                  > Jim Barry, MVP for Windows SDK

                  After reading Jim's post above it occurred to me that, if you used
                  my approach, you would really need to stretchblt the bitmap onto
                  each property page's background by handling each property page's
                  WM_ERASEBKGND.

                  Jim's suggested approach of disabling the theme dialog texture is
                  probably the one I would use, and not mess with trying to fix the
                  problem.

                  -Roger
                • Catalin Rotaru
                  Yes, sounds more and more that this is the sanest option. Drawing the background myself would be interesting, but what do I do if the theme changes?! What
                  Message 8 of 8 , Aug 6 3:36 AM
                  • 0 Attachment
                    Yes, sounds more and more that this is the sanest option. Drawing the
                    background myself would be interesting, but what do I do if the theme
                    changes?!

                    What sucks though, is that the tab control is white-ish in XP, and a
                    non-themed Property Sheet should have a gray background, like a dialog
                    => big, ugly difference.


                    ----- Original Message -----
                    From: Jim Barry <jim@...>
                    Date: Fri, 6 Aug 2004 10:06:50 +0100
                    Subject: Re: [wtl] Re: Property Sheet in a view on WinXP has tiled background?!
                    To: wtl@yahoogroups.com

                    > Damn. Is there any way I can overwrite that and draw the background of
                    > the Property Sheet myself? Maybe using a better bitmap brush or a
                    > plain color.

                    You can turn off the background texture with EnableThemeDialogTexture.
                    However, if you want to paint your own background, you will have some
                    fun with semitransparent controls, e.g. static text.

                    --
                    Jim Barry, MVP for Windows SDK





                    Yahoo! Groups Sponsor

                    ADVERTISEMENT


                    ________________________________
                    Yahoo! Groups Links

                    To visit your group on the web, go to:
                    http://groups.yahoo.com/group/wtl/

                    To unsubscribe from this group, send an email to:
                    wtl-unsubscribe@yahoogroups.com

                    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



                    --
                    Catalin Rotaru
                    http://www.rotaru.com
                  Your message has been successfully submitted and would be delivered to recipients shortly.