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. CSplitterWnd

CSplitterWnd

Scheduled Pinned Locked Moved C / C++ / MFC
questioncss
7 Posts 2 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
    ov
    wrote on last edited by
    #1

    I've created a splitted window. And I want my left part of the window to be not less than 150 pixels by X axis. How can I do this? With the best regards, Vitaly.

    T 1 Reply Last reply
    0
    • O ov

      I've created a splitted window. And I want my left part of the window to be not less than 150 pixels by X axis. How can I do this? With the best regards, Vitaly.

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      Use CSplitterWnd::SetColumnInfo/SetRowInfo. They have a parameter that controls the minimum pane size. Tomasz Sowinski -- http://www.shooltz.com

      O 1 Reply Last reply
      0
      • T Tomasz Sowinski

        Use CSplitterWnd::SetColumnInfo/SetRowInfo. They have a parameter that controls the minimum pane size. Tomasz Sowinski -- http://www.shooltz.com

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

        No, it isn't work the way I need. If I reduce the column width less than cxMin value - it's width will be set to 0. But I need it to be set to the cxMin. At this moment I'm trying to make a child class for CSplitterWnd and correct the width in RecalcLayout(). With the best regards, Vitaly.

        O T 2 Replies Last reply
        0
        • O ov

          No, it isn't work the way I need. If I reduce the column width less than cxMin value - it's width will be set to 0. But I need it to be set to the cxMin. At this moment I'm trying to make a child class for CSplitterWnd and correct the width in RecalcLayout(). With the best regards, Vitaly.

          O Offline
          O Offline
          ov
          wrote on last edited by
          #4

          yeah! it works :) With the best regards, Vitaly.

          1 Reply Last reply
          0
          • O ov

            No, it isn't work the way I need. If I reduce the column width less than cxMin value - it's width will be set to 0. But I need it to be set to the cxMin. At this moment I'm trying to make a child class for CSplitterWnd and correct the width in RecalcLayout(). With the best regards, Vitaly.

            T Offline
            T Offline
            Tomasz Sowinski
            wrote on last edited by
            #5

            I see - user can drag the splitter to hide a column. RecalcLayout looks very ugly - maybe it's better to hack into OnMouseMove? Tomasz Sowinski -- http://www.shooltz.com

            O 1 Reply Last reply
            0
            • T Tomasz Sowinski

              I see - user can drag the splitter to hide a column. RecalcLayout looks very ugly - maybe it's better to hack into OnMouseMove? Tomasz Sowinski -- http://www.shooltz.com

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

              Do you find this ugly?

              void CVertSplitter::RecalcLayout() {
              CSplitterWnd::RecalcLayout();
              int cur, min;
              GetColumnInfo(0, cur, min);
              if (cur < min) {
              SetColumnInfo(0, min, min);
              CSplitterWnd::RecalcLayout();
              }
              }

              With the best regards, Vitaly.

              T 1 Reply Last reply
              0
              • O ov

                Do you find this ugly?

                void CVertSplitter::RecalcLayout() {
                CSplitterWnd::RecalcLayout();
                int cur, min;
                GetColumnInfo(0, cur, min);
                if (cur < min) {
                SetColumnInfo(0, min, min);
                CSplitterWnd::RecalcLayout();
                }
                }

                With the best regards, Vitaly.

                T Offline
                T Offline
                Tomasz Sowinski
                wrote on last edited by
                #7

                Mea culpa. I didn't realize that RecalcLayout is virtual and you'll have to take the source of CSplitterWnd and make substantial changes. Cheers, Tomasz Sowinski -- http://www.shooltz.com

                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