Thanks guys --- I ended up biting the bullet and doing it "longhand". One day I may refactor it into something like what was in David's "extras"... but it would take considerably more sophistication to cope with the kind of form layout I have --- lines with 3 or 4 edit boxes across the full screen needing to be resized proportionally in the horizontal direction, while their labels stay constant size; image "window" resized to take up the remaining space among the edit boxes & buttons...
Jamaica
Posts
-
Resizing dialog-based app and its controls -
Resizing dialog-based app and its controlsI have a dialog-based app that: - displays an image in a picture control (CStatic) - has a bunch of labelled text boxes (CStatic & CEdit) - has a few other bits & pieces (CScrollbar, CComboBox, CCheckBox...) The app needs to fill as much of the available screen real-estate on the computer running it. I can resize the main dialog window easily enough... but resizing the various controls on it looks like a tedious business. It's a one-off. Am I just as well off doing the layout calculations by hand, and giving every text box label an ID other than IDC_STATIC to do it... or is there something there that will so dramatically reduce the pain of all this that it is worth learning. On the face of it, CResizableDialog is more effort than it's worth... but I stand to be corrected.
-
CScrollBar: what's the secret?What you say is all true... but has not advanced my cause :( There certainly is a hidden problem here. I've read the entire CScrollBar documentation several times, satisfied myself (e.g. by calling SetScrollPos()) that the scrollbar is just itching to be useful to me. The main problem appears to be getting any messages to or from it. There are handlers for WM_HSCROLL and WM_VSCROLL in the dialog containing the frame and scrollbars... but they simply don't respond, and nor do the scrollbars themselves. I get the sense I'm going to shoot myself when I discover how simple the answer is....
-
CScrollBar: what's the secret?What's more, in the resources, the scrollbars show in a nice Windows XP style. When the app runs, they are flat and ugly. Hmmm. If there is someone out there that can take 5 mins to do this in both VS 2005 Beta and VS 2003, and find that I'm beating my head against a bug in VS 2005 Beta, that would at least be partial relief!
-
CScrollBar: what's the secret?I've torn out what little hair I have on this. I'm using VS 2005 Beta in case it makes a difference. I create a new Dialog-based MFC App. I put a picture control on it (CStatic with frame style). I align a couple of scrollbars to the frame edge. (I gave up trying to get the inherent CWnd scrollbars to work, but they behave the same.) I try to code behind the scrollbars with calls to: - SetScrollInfo() - EnableScrollBar() - ShowScrollBar() ( slightly different functions are required for the CWnd scrollbars) The effects of SetScrollInfo() can be seen in the thumb size, and the ShowScrollBar() works as expected. But do you think I can actually get the scroll bar to do anything -- let me move the thumb, or trip my breakpoint in the OnVScroll() handler I have waiting to pounce? I can't see the magic secret in any projects I've downloaded. Help!