Author Topic: (Phoenix) How to use the Layout-Manager and Splitterbar  (Read 4652 times)

0 Members and 1 Guest are viewing this topic.

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 919
  • User-Rate: +30/-4
    • it-berater
(Phoenix) How to use the Layout-Manager and Splitterbar
« on: May 19, 2007, 03:45:10 PM »
I want to add a small explanation to this, because this is really intresting for Phoenix users.
Please open the picture of the post below in a second window, to understand the explanation.

You can take that "Layout-Manager" like a small program, which is been interpreted in the Layout32.dll at runtime, if the form is resized.

Imagine the form is resized, what should happen?

Phoenix takes the commands in the Layout-Manager - Line by Line - and resizes (STRETCH) or moves (MOVE) the controls around.

To make it even more understandable as it already is, I'll interpret it now.

Line 1: STRETCH the Bottom of Splitterbar 1 (thats the vertical Splitterbar) to the TOP of Splitterbar 2 (the horizontal Splitterbar).

Line 2: MOVE the Top of Splitterbar 1 to the BOTTOM of TAB-Control 1 (Tab1 isthe TAB-Control below the Toolbar).

thats all for Splitterbar 1.
Now this control (Splitterbar 1) will always have the right size, between the TAB-Control and the second Splitterbar.
In the picture you can see that there is an additional button, which can be used to set limits for the resizing Operations.

Using this rule-based system, even complicated resizable forms can be done in short time.
« Last Edit: August 04, 2007, 07:05:52 PM by Theo Gottwald »

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 919
  • User-Rate: +30/-4
    • it-berater
Re: How to use the Layout-Manager and Splitterbar in Phoenix
« Reply #1 on: May 19, 2007, 03:46:43 PM »
Last week I asked Dominic to explain me something about this:

Quote
The splitter bar is usually used in conjunction with the Layout Manager.

It was not clear to me that time.

Here is his answer. As it is a good lesson for all Users of the Phoenix Visual Designer, I want to post it here.


Dominic wrote:
The "Layout Manager" is the editor that is used to generate fully resizeable windows in Phoenix.
You don't have to use it, but it makes creating resizeable windows a snap.

For example, when a window is split into two panes by a splitterbar, you have to write the code to move and resize the windows on either side of the splitterbar when the splitterbar is moved.

However, when the Layout Manager is used to define rules that determine how the controls on a form are moved and resized, you do not have to write any code to move and resize the controls.

Try the following to see this in action.
1) Drop two listview controls on a form.
2) Add a vertical splitterbar(SBSTYLE_VERTICAL) to the form(or use the template).
3) Position the splitterbar between the two listviews.
4) Check the WS_CLIPCHILDREN style for the form.
5) Check the WS_CLIPSIBLINGS style for the listviews and the splitterbar.
6) From the Tools menu, select the Layout Manager command.
7) Click the Defaults button on the Layout Manager window.
8) Select the Current Canvas command.
9) Click OK when the Elasticity editor appears.
10)  Click OK on the Layout Manager window.
11) Build an execute.

Resize the window or move the splitterbar.  What you see is the Layout.dll in action.

Regards,

Dominic.