18.6 Splitter (gb.qt4)

Using the Splitter control requires more detailed preliminary considerations about the design of the form than if you just want to arrange some controls freely on a form. Once you have decided which containers you want to use and which controls are to be inserted into them, it is a good plan to record the arrangement in a suitable form. This is strongly recommended if you are developing a multiply nested form design with several containers of type Splitter:

BILD 1

Figure 18.6.1: Design with menu and two splitter controls (draft)

In the figure above, the individual containers are only coloured in the design view to make the design easier to recognise. In the following source code, essential properties of the form and the two control elements Splitter as well as the controls inserted in them are defined:

    [1] Public Sub Form_Open()
    [2]
    [3] '-- DESIGN
    [4] '-- The control `hsplitterMaster` completely fills the form in the container Form
    [5]     FMain.Arrangement = Arrange.Fill
    [6]     FMain.Margin = True
    [7]     FMain.Spacing = True
    [8]
    [9]     hsplitterMaster.Arrangement = Arrange.Horizontal
    [10]     hsplitterMaster.Layout = [20, 80]
    [11]     hsplitterMaster.Spacing = True
    [12]     hsplitterSecond.Arrangement = Arrange.Vertical
    [13]     hsplitterSecond.Layout = [70, 30]
    [14]     hsplitterSecond.Spacing = True
    [15]
    [16]     VBoxLeft.Margin = True
    [17]     VBoxLeft.Spacing = True
    [18]     DirView1.Expand = True
    [19]
    [20]     VBoxRight.Margin = True
    [21]     VBoxRight.Spacing = True
    [22]     HBoxBottom.Spacing = True
    [23]     ...
    [24]     gbttSettings = New Settings(User.Home &/ "GBTTT" &/ "gbtt.conf")
    [25]     gbttSettings.Read(Me, "Form")
    [26]     ...
    [27] End

Comment

BILD 2

Figure 18.6.2: Arrangement of controls (runtime).

Notes

Download

Projects

Download