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. C / C++ / MFC
  4. Two overlapping windows, one flickers, howto solve ?

Two overlapping windows, one flickers, howto solve ?

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 Posts 3 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.
  • O Offline
    O Offline
    ohadp
    wrote on last edited by
    #1

    I have two windows, let's call them Frame and List. They are both laid on a dialog, both are direct children of this dialog. List stands in the middle of the dialog, frame does too only that it's slightly larger than the list, just enough to add a frame around the list. The thing is, when resized (together ofcourse) the list flickers. Removing the list's OnEraseBkgnd eliminates the flicker, but also eliminates the list's background :-) Note that the frame only draws AROUND the list, i specifically don't draw anything where the list is positioned so that I won't cause flickering. I have an empty OnEraseBkgnd that returns TRUE. Can someone assist ?

    M M O 3 Replies Last reply
    0
    • O ohadp

      I have two windows, let's call them Frame and List. They are both laid on a dialog, both are direct children of this dialog. List stands in the middle of the dialog, frame does too only that it's slightly larger than the list, just enough to add a frame around the list. The thing is, when resized (together ofcourse) the list flickers. Removing the list's OnEraseBkgnd eliminates the flicker, but also eliminates the list's background :-) Note that the frame only draws AROUND the list, i specifically don't draw anything where the list is positioned so that I won't cause flickering. I have an empty OnEraseBkgnd that returns TRUE. Can someone assist ?

      M Offline
      M Offline
      Monty2
      wrote on last edited by
      #2

      ohadp wrote: I have an empty OnEraseBkgnd that returns TRUE. why don't you draw the background urself and return TRUE get the system color for window and draw away i can't even remember what my point is now, but anyway, i'm correct Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.

      O 1 Reply Last reply
      0
      • M Monty2

        ohadp wrote: I have an empty OnEraseBkgnd that returns TRUE. why don't you draw the background urself and return TRUE get the system color for window and draw away i can't even remember what my point is now, but anyway, i'm correct Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.

        O Offline
        O Offline
        ohadp
        wrote on last edited by
        #3

        The Frame doesn't need to erase it's background (because it omstly contains the list), so that's why it has an empty implementation of OnEraseBkgnd. The List on the other hand does need a background, and in the List's OnEraseBkgnd I do clean the background and return TRUE. My problem is that this causes the list to flicker. The List didn't flicker when there was no frame around/over it... My question is how to eliminate the flicker, or more importantly why did it start flickering now ? when I didn't have my Frame the List cleaned it's background and nothing flickered....

        1 Reply Last reply
        0
        • O ohadp

          I have two windows, let's call them Frame and List. They are both laid on a dialog, both are direct children of this dialog. List stands in the middle of the dialog, frame does too only that it's slightly larger than the list, just enough to add a frame around the list. The thing is, when resized (together ofcourse) the list flickers. Removing the list's OnEraseBkgnd eliminates the flicker, but also eliminates the list's background :-) Note that the frame only draws AROUND the list, i specifically don't draw anything where the list is positioned so that I won't cause flickering. I have an empty OnEraseBkgnd that returns TRUE. Can someone assist ?

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          Make sure all your windows (including the dialog itself) have the WS_CLIPCHILDREN style --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."   -- Buffy

          O 2 Replies Last reply
          0
          • M Michael Dunn

            Make sure all your windows (including the dialog itself) have the WS_CLIPCHILDREN style --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."   -- Buffy

            O Offline
            O Offline
            ohadp
            wrote on last edited by
            #5

            I can't say I've made sure all the windows (including the dialog) have this style, but I have tried to give the Frame itself the WS_CLIPSIBLINGS style, and give the list the container of these two windows (the dialog), the WS_CLIPCHILDREN style, but not all of them together... Can you explain why this will work ? Will it provide the list with a different clipping-region when it gets to 'OnEraseBkgnd' ? thanks

            1 Reply Last reply
            0
            • M Michael Dunn

              Make sure all your windows (including the dialog itself) have the WS_CLIPCHILDREN style --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."   -- Buffy

              O Offline
              O Offline
              ohadp
              wrote on last edited by
              #6

              I've applied the WS_CLIPCHILDREN style to all apropriate windows, but my List continuse to flicker when I don't override it's OnEraseBkgnd, any idea ? thanks

              1 Reply Last reply
              0
              • O ohadp

                I have two windows, let's call them Frame and List. They are both laid on a dialog, both are direct children of this dialog. List stands in the middle of the dialog, frame does too only that it's slightly larger than the list, just enough to add a frame around the list. The thing is, when resized (together ofcourse) the list flickers. Removing the list's OnEraseBkgnd eliminates the flicker, but also eliminates the list's background :-) Note that the frame only draws AROUND the list, i specifically don't draw anything where the list is positioned so that I won't cause flickering. I have an empty OnEraseBkgnd that returns TRUE. Can someone assist ?

                O Offline
                O Offline
                ohadp
                wrote on last edited by
                #7

                There was anoher overlapping window lacking the WS_CLIPSIBLINGS style. Thanks for WS_CLIPSIBLINGS :-)

                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