Skip to content

Class: cDbSplitterContainer

Properties | Events | Methods | Index of Classes

Container for multiple child panels separated by a splitter

Hierarchy

cObject > cUIObject > DfBaseObject > DfBaseWindow > DfBaseUIWindow > DfBaseContainer > DfBaseDialog > Container3d > dbContainer3d_ > dbContainer3d > cDbSplitterContainer

Show full hierarchy and direct subclasses

Library: Windows Application Class Library

Package: cDbSplitterContainer.pkg

Mixins: cSplitterContainerMixin

Description

cDbSplitterContainer objects are used to implement splitter dialogs - two containers separated by a splitter. A cDbSplitterContainer object can be dropped into any container -- (typically a view). This dropped object will consist of the cDbSplitterContainer and two, and only two, cDbSplitterContainerChild child objects. You can then place any other child containers or controls you wish inside either of the two cDbSplitterContainerChild container objects. The size of either container can be adjusted by dragging the splitter.

For example, a non-splitter view might have the following structure:

Object oView is a View

    Object oForm1 is a Form
        Set Size to 13 51
        Set Location to 5 51
    End_Object

    Object oForm2 is a Form
        Set Size to 13 51
        Set Location to 25 51
    End_Object

End_Object

This can be changed into a splitter view by inserting cDbSplitterContainer / cDbSplitterContainerChild(s) object as follows.

Object oView is a View

    Object oSplitterContainer1 is a cDbSplitterContainer
        Set pbSplitVertical to False
        Set piSplitterLocation to 100

        Object oSplitterContainerChild1 is a cDbSplitterContainerChild

            Object oForm1 is a Form
                Set Size to 13 51
                Set Location to 5 51
            End_Object

        End_Object

        Object oSplitterContainerChild2 is a cDbSplitterContainerChild

            Object oForm2 is a Form
                Set Size to 13 51
                Set Location to 5 51
            End_Object

        End_Object

    End_Object

End_Object

Customizing Splitters

A number of design-time properties are defined in the cDbSplitterContainer class which can be used to customize the appearance and behavior of splitter. Note that the cDbSplitterContainerChild contains no splitter related design-time properties.

A splitter's orientation can be horizontal or vertical and is controlled by the pbSplitVertical property

The splitter's initial location is controlled by the piSplitterLocation property.

The minimum (left / top) and maximum (right / bottom) position of a splitter are determined by the piMinSplitterLocation and piMaxSplitterLocation properties.

When a splitter's parent container (e.g. a view) is resized, only one of the two splitter child containers is resized. This is controlled by the peFixedPanel property.

Splitters and Scrolling

The cDbSplitterContainerChild objects are the regular containers and therefore they do not scroll. Often you will want to support scrolling in one or both sides of a splitter. Some controls such as an editor (cRichEdit, cDbTextEdit, etc.) or a tree view (TreeView) support scrolling themselves. In such a case, you would drop this object in the container, set its size and location to fill the container and set its peAnchors to anAll. If you have non-scrolling controls, such as forms and buttons, that need to be scrolled, you can drop a cScrollingContainer object into the cDbSplitterContainerChild and scrolling will be supported.

This shows a splitter that contains a tree view on the left, which supports its own scrolling and a scrolling container on the right.

Object oView is a View

    Object oSplitterContainer1 is a cDbSplitterContainer
        Set pbSplitVertical to True
        Set piSplitterLocation to 100

        Object oSplitterContainerChild1 is a cDbSplitterContainerChild

            Object oT1 is a TreeView
                Set Size to y x // size to fill the entire container
                Set peAnchors to anAll
            End_Object   

        End_Object

        Object oSplitterContainerChild2 is a cDbSplitterContainerChild

            Object oScrollingContainer1 is a cScrollingContainer
                Object oScrollingClientArea1 is a cScrollingClientArea

                    Object oForm1 is a Form
                        Set Size to 13 51
                        Set Location to 5 51
                    End_Object

                    Object oForm2 is a Form
                        Set Size to 13 51
                        Set Location to 25 51
                    End_Object

            End_Object
        End_Object

    End_Object

End_Object

The Visual Designer

When a cDbSplitterContainer is dropped from the Studio's Class Palette onto a component, such as a view, an object of class cDbSplitterContainer is created and inside it, two objects of class cDbSplitterContainerChild. You can change the initial location of the splitter by dragging the splitter.

Notes

A cDbSplitterContainer should be the only visual object inside its parent object. A cDbSplitterContainerChild object must contain two and only two cDbSplitterContainerChild objects. You are discouraged from adding any other code inside of this object. An object of class cDbSplitterContainerChild can only be used inside of cDbSplitterContainer object. A non-data-aware version of this class pair is cSplitterContainer / cSplitterContainerChild. Size, Location and peAnchors should not be set for either of these classes, as they will be inherited from their parent containers. The cDbSplitterContainer uses the full size of its container's client-area. The cDbSplitterContainerChild objects determine their size based on the size of their parent and the location of the splitter. A cDbSplitterContainer can be dropped into any container. A cDbSplitterContainerChild object may itself contain another cDbSplitterContainer object. It does not make sense to drop splitters in some containers such as groups, scrolling containers, etc.