Functions to automatically resize dialog controls when user resizes dialog or drags splitter.
Shows how to make dialog resizable.
Function DT_AutoSizeControls: Moves or resizes dialog controls when you resize the dialog.
Control class QM_Splitter. Resizes adjacent controls when user drags splitter. And class DlgSplitter.
Note: if you already have function DT_AutoSizeControls, delete it.
Nov 8 2010:
Added class DlgSplitter.
Now you can get/set splitter position from code.
Fixed 1 bug.
2013-10-28:
Some small changes.
Upgrading: delete old folder (probably named "Resizable dialog, resizable controls, splitters") and import this file. Restart QM.
Hi Gintaras,
I have been having so much fun setting up my dialogs with splitters. I was wondering if there was a way to snap the splitters back to their original position (with appropriate resetting of the size of the associated dialog elements). Similar is there a way to set them at certain different positions by a command (e.g. max expand, min, 10%, 90%, etc). I have been doing it by moving the mouse to a Splitter Acc position then doing a lef+, mou+, lef- which is not the ideal way of doing it.
Hi Gintaras,
Since I started using the new splitters, one of the objects started to "misbehave". It is a SysTabControl32 multi-tab control with each tab bringing up a different webpage. When you move the splitter around, you get multiple versions of the tab once you go to a different tab than the original. This is a simplified version. Does this have a simple solution? What's weird is that this was working properly with the previous splitter version (not on this exact dialog code, so there may be a variation that is causing the problem not related to the update).
but since I wasn't filling it from an array made from a folder full of htm's, I decided to just directly code the url links. BUT I left out the part about first hiding all current tabs and THEN unhiding the selected tab if the control is already created. I was just making a new control each time. Not good!
I am still a bit confused about how to accomplish this. The splitters have funny behavior with this mtultibrowser tabs. Sometimes, they always grab onto the tab control but only sometimes grab onto the actual browser window within it. And after switching tabs, sometimes will fill in the new size of the control (after using the splitter to enlarge/shrink), even if it didn't drag to that new size when first dragging the splitter. I think this may be all solved by managing the tabs like in your original dialog (hide all, unhide selected rather than new control each time without hiding previous) but I am not sure I can figure it out by myself.
Thanks,
Stuart
there is no control 103. I think you may be referring to SECOND "SHDocVw.WebBrowser". id(3 hDlg) is actually an ActiveX control I use in the real dialog not for additional web-browsing but to display PDF's and folder contents (which I use setwintext to display into that ActiveX element). It has been behaving fine with the splitters as it is not multi-tab. The multi-tab element in this case is control 4, a SysTabControl32 which I have created an ActiveX "SHDocVw.WebBrowser for separately in the tab controls in message3.
Hi Gintaras,
I have been trying to add a toolbar with several buttons to a splitter (like child id 2207 in the Quick Macros program (Find, Output, Tips, Bookmarks and Saved Searches) but I can't seem to get a toolbar in a dialog to be in a specific location other than as the top row.
I have tried to modify "Explorer style dialog with treeview, listview, toolbar, statusbar" ....ie DEX_Main and Dialog_rebar_toolbars from the Resources/QM Extensions but for some reason the toolbar seems to want to stay on top...I want to be able to set the attributes of the toolbar (location and orientation (horizontal/vertical), specifically) and have the whole group of buttons slide back and forth with the adjacent splitter.
Do you think you could give a simpler example than DEX_Main of adding a toolbar and setting some of its attribtes (size, location, etc).
This doesn't seem to be documented, but this worked for me to resize something horizontal and vertically. "3svh" didn't work, so I just started playing around.
On Windows Vista/7 can check: dialog editor -> grid properties -> more style -> auto size columns.
On older windows need to resize explicitly on WM_SIZE.