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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. CSplitterWindow flicker when resizing

CSplitterWindow flicker when resizing

Scheduled Pinned Locked Moved ATL / WTL / STL
comquestionannouncement
4 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.
  • N Offline
    N Offline
    Nathan Going
    wrote on last edited by
    #1

    I've created a CSplitterWindow that works perfectly except when resized. My Code[^] I use SetWindowPos to move the splitter as my "view" is resized, while sizing there is alot of flicker. How does the CSplitterWindow update it's panes when the splitter is moved so smoothly? Any suggestions would be greatly appreciated. Thanks, Nathan

    L A 2 Replies Last reply
    0
    • N Nathan Going

      I've created a CSplitterWindow that works perfectly except when resized. My Code[^] I use SetWindowPos to move the splitter as my "view" is resized, while sizing there is alot of flicker. How does the CSplitterWindow update it's panes when the splitter is moved so smoothly? Any suggestions would be greatly appreciated. Thanks, Nathan

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Nathan Going wrote:

      How does the CSplitterWindow update it's panes

      Not sure what you mean. Everything in windows get's painted more or less the same way, in response to a WM_PAINT message. Perhaps you can rephrase your question for clarity?

      led mike

      N 1 Reply Last reply
      0
      • L led mike

        Nathan Going wrote:

        How does the CSplitterWindow update it's panes

        Not sure what you mean. Everything in windows get's painted more or less the same way, in response to a WM_PAINT message. Perhaps you can rephrase your question for clarity?

        led mike

        N Offline
        N Offline
        Nathan Going
        wrote on last edited by
        #3

        Ok, start with the CSplitterWindow, if you move the splitter bar left or right, both panes are resized smoothly using a set of calls to SetWindowPos internally. Now I have the CSplitterWindow created as a child of another CWindow derived "View". I catch the WM_SIZE event and call SetWindowPos to set the new size of the CSplitterWindow, when this happens it appears that the entire window gets redrawn, producing a "flicker" effect. In my "view" window, I catch the WM_ERASEBKGND message so it doesn’t happen; also I handle WM_PAINT so I can draw a margin around the CSplitterWindow. I'm trying to find a way to resize the entire window and at the same time reduce the flickering of the contents as much as possible. Thank you.

        1 Reply Last reply
        0
        • N Nathan Going

          I've created a CSplitterWindow that works perfectly except when resized. My Code[^] I use SetWindowPos to move the splitter as my "view" is resized, while sizing there is alot of flicker. How does the CSplitterWindow update it's panes when the splitter is moved so smoothly? Any suggestions would be greatly appreciated. Thanks, Nathan

          A Offline
          A Offline
          Alain Rist
          wrote on last edited by
          #4

          Hi Nathan, Replace DECLARE_WND_CLASS(xx) in your frame and intermediate windows by DECLARE_WND_CLASS_EX(xx, 0, -1); BTW your layout is much too complicated. Just paint what you want in your frame window and override the default CFrameWindowImplBase::UpdateLayout() to compute the position of your client window. cheers, AR

          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