I have a program that displays several edit controls, and two images side by side with a splitter between them. This is working well.
For some images it would be nice to switch the display to over & under, via a user selected menu option.
Would it be reasonable to attempt this with WndResizer?
If yes, please describe how it could be accomplished.
A very good article and the demo is good (Windows 7 + VS2010) and I am looking to use it only for PropertySheets in my dialog based MFC application. However, I notice that, in the demo, none of the static text boxes are resized and the contents re-drawn/re-wrapped to fit when the dialog/propertysheet is resized. For example, the text "Note: Resize the window and observe the resize behaviour ... to resize the frames." in the "Example 5" image at the beginning of the article.
Is this because this isn't supported or just that it has not been added to the demo? If it isn't supported, can it be?
we're using your library in our project where we have placed dialogs withing dialogs which have no window ID. I noticed that it is indeed possible to use the resizer functions when manually assigning a unique window ID using the SetWindowLong function (i.e. SetWindowLong(m_hWnd, GWL_ID, windowID)).
However Cwnd::GetDlgItem still returns a zero pointer on this ID. Since this function is used several times in WndResizer, I wonder if this could cause any severe trouble. So far it seems to be working nicely when checking for this case. In particular, I added the following line to WndResizer.cpp line 50:
I am using a SDI application with a window derived from CFormView. I have the hook in the OnInitialUpdate for the CFormView derived dialog class. It is working great for the controls, but the SetMinimumSize is not working. Should the Mainform class be the root? Also, if I change the DPI, the controls are being cut off. Any suggestions for using it in this type of environment?
I think you will also have to create a member of CWndResizer in mainframe class and use it to set the minimum size of the frame after the form is created. Because CFormView does not recieve WM_SIZING message. Thus setting minimum of CFromView has no effect.
I voted 5 for three reasons: 1) The article itself was well-written and easy to follow, with lots of helpful information; 2) Your attitude and replies to comments were excellent, and show a willingness to consider each comment; 3) This article presents a practical solution to a major problem in any non-trivial application.
The only other thing I would say is that in testing on XP, there does seem to be some flicker. In my experience, flicker needs to be addressed in both OnSize and OnEraseBkgnd.
first of all, this class is great.
But i still have some problems.
I'd like to limit the Split-Container-size within
a property sheet. The function SetMinimumSize seems to have
no effect in this case.
To reproduce this behaviour just add the line
bOk = m_resizer.SetMinimumSize(IDC_LIST2, CSize(500,0));
to the Example08.cpp, this won't yield any differece at
That did the trick. Thank you very kindly. I was getting close, I knew that the gripper object was the culprit but hadn't chased down why it wasn't being deleted. This is a cool class set, it has saved me considerable time and hassle.
You are right in your findings. But that is by design. The idea was to ensure a space between the two panels with minimum width( or height) 1 pixel at least. Otherwise there would not be any room for the splitter. At least this is the ideal concept for a split container.
But I think it would be okay NOT to enforce this restriction and leave the choice of up to the developers. So for your work around, I think, only thing you have to do is change the value of SPLITTER_MIN_WIDTH from 1 to 0. In the next update, I will probably remove the SPLITTER_MIN_WIDTH all together.
NOTE: Panels must NOT overlap during the construction of the split container.
Great article! Very easy to use for my dialogs. However, I'm unsure how to let the user re-size the edge of a CPropertySheet. With a dialog resource you have a Border property that you set to "Resizing". There's no such resource property for a CPropertySheet since MFC builds the window itself based on the size of the CPropertPage resources. I changed all the CPropertyPage Border properties to "Resizing" but that didn't enable me to grab the edge of the property sheet dialog at runtime to resize it. Is there a way to turn on a "Resizing" property for CPropertySheet programmatically?