How to create two flexible button columns?

Started by roy_043, September 19, 2011, 03:36:08 AM

Previous topic - Next topic

roy_043

I am trying to create a flexible dialog with two flexible button columns. I have managed to 'flex' the right column, but can't find a way to do the same for the left column. Can this be done in OpenDCL?

Fred Tomke

Hi, roy_043, I haven't just the time to test your project but it seems you want to let resize your buttons when the form will be resized. The I recommend you to activate the OnSize event of the form. Then deactivate all the control's dependencies to the form-border (like UseRightFromRight and UseTopFromBottom) and place alle the controls by yourself using SetPos.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

A useful trick is to embed an invisible splitter in your form, then position your controls relative to the splitter, and the splitter relative to the form (or however you want with custom code in OnSize).
Owen Wengerd (Outside The Box) / ManuSoft

roy_043

Owen and Fred, many thanks to you both for your answers. For now I am going with the splitter approach. I am trying to find a solution that does not require any lisp code...

Two flexible button columns Step 2:

Problem A:
I have managed to add a splitter that stays in the middle of the dialog and sticks to the bottom as I stretch the dialog. This is exactly what is needed... But if I restart the dialog the splitter has either become invisible or shows up in the wrong position. It seems its position is not stored correctly in the registry.

Problem B:
To position the buttons in the left column I need the ID of the splitter. How to you determine a splitter's ID?

owenwengerd

Try using the control properties dialog (an easy way to open this dialog is to double-click on the control in the Tab/ZOrder pane). By using the properties dialog, your splitter(s) will be listed by name in the dropdown for easy identification. I didn't test your files, but I think if you fix the alignment properties it will work correctly.
Owen Wengerd (Outside The Box) / ManuSoft

roy_043

#5
Thanks Owen. I tried using every index from 11 to 30 for the UseRightFromRight property of the buttons in the left column (the documentation mentions '>10'). But using the control properties dialog, which is of course much easier, it turns out that the index is 10 in this case.

I still have a problem with the position of the splitter (problem A in my previous post). See attached image. This is not a big issue: in the final dialog the splitter will be invisible.

owenwengerd

Thanks for the excellent feedback! I believe the position problem is now corrected for the next build, and I also fixed the documentation (changed >10 to 10+).
Owen Wengerd (Outside The Box) / ManuSoft