Cross-platform C SDK logo

Cross-platform C SDK

SplitView

❮ Back
Next ❯
This page has been automatically translated using the Google Translate API services. We are working on improving texts. Thank you for your understanding and patience.

Header

#include <gui/splitview.h>


Functions

SplitView*splitview_horizontal (void)
SplitView*splitview_vertical (void)
voidsplitview_view (...)
voidsplitview_textview (...)
voidsplitview_webview (...)
voidsplitview_tableview (...)
voidsplitview_splitview (...)
voidsplitview_panel (...)
voidsplitview_pos (...)
real32_tsplitview_get_pos (...)
voidsplitview_visible0 (...)
voidsplitview_visible1 (...)
voidsplitview_minsize0 (...)
voidsplitview_minsize1 (...)

The SplitView are views divided into two parts, where in each of them we place another child view or panel. The divider line is draggable, which allows to resize parts, distributing the total control size between both descendants. In Hello SplitView! you have an example of use (Listing 1), (Figure 1).


1. Add controls

We have several functions to add content to the SplitView. The first call will place the view or panel on the left or upper side. The second call will make it on the right or bottom side. Successive calls will generate an error, since each view supports a maximum of two descendants.


2. Positioning the divider

The initial position of the divider, as well as the size of the SplitView will be calculated according to the Natural sizing of children controls (Figure 3).

Image that represents the default position of a SplitView.
Figure 3: Divider default position in (Listing 1).

The divider will have different behaviors when the size of SplitView changes, depending on the parameter split_mode_t of splitview_pos:

  • ekSPLIT_NORMAL: The position of the divider will always remain constant with respect to the size of the SplitView. That is, a 0.3 value means that the left view will always occupy 1/3 of the total size and right 2/3. To do this, indicate a value between 0 and 1 in the pos parameter.
  • ekSPLIT_FIXED0: The size changes of the SplitView will always leave the left/upper child with a constant size.
  • ekSPLIT_FIXED1: The right/lower child will maintain its size.
The divider proportional or fixed value will change if the user drags it with the mouse, but the mode will not change.

3. Divider minimum size

It is possible that the children controls impose minimal size restrictions that prevent the divisor from moving beyond these limits. However, it is possible to establish minimums from the SplitView itself. It is also possible to completely hide one of the descendants. In this case, the divider bar will disappear, using the entire SplitView space for the visible descendant.

❮ Back
Next ❯

splitview_horizontal ()

Create a SplitView with horizontal division.

SplitView*
splitview_horizontal(void);

Return

The new view.


splitview_vertical ()

Create a SplitView with vertical division.

SplitView*
splitview_vertical(void);

Return

The new view.


splitview_view ()

Add a view to SplitView.

void
splitview_view(SplitView *split,
               View *view,
               const bool_t tabstop);
split

The SplitView.

view

The child view.

tabstop

TRUE if we want the view to be part of the tablist. See Tabstops.

Remarks

See Add controls.


splitview_textview ()

Add a text view to SplitView.

void
splitview_textview(SplitView *split,
                   TextView *view,
                   const bool_t tabstop);
split

The SplitView.

view

The text view.

tabstop

TRUE if we want the view to be part of the tablist. See Tabstops.

Remarks

See Add controls.


splitview_webview ()

Add a web view to SplitView.

void
splitview_webview(SplitView *split,
                  WebView *view,
                  const bool_t tabstop);
split

The SplitView.

view

The web view.

tabstop

TRUE if we want the view to be part of the tablist. See Tabstops.

Remarks

See Add controls.


splitview_tableview ()

Add a table view to SplitView.

void
splitview_tableview(SplitView *split,
                    TableView *view,
                    const bool_t tabstop);
split

The SplitView.

view

The table view.

tabstop

TRUE if we want the view to be part of the tablist. See Tabstops.

Remarks

See Add controls.


splitview_splitview ()

Add a child SplitView to SplitView.

void
splitview_splitview(SplitView *split,
                    SplitView *view);
split

The SplitView.

view

The child SplitView.

Remarks

See Add controls.


splitview_panel ()

Add a panel to SplitView.

void
splitview_panel(SplitView *split,
                Panel *panel);
split

The SplitView.

panel

The panel.

Remarks

See Add controls.


splitview_pos ()

Set the divider position and mode.

void
splitview_pos(SplitView *split,
              const split_mode_t mode,
              const real32_t pos);
split

The SplitView.

mode

The behavior mode.

pos

The new divider position.

Remarks

Ver Positioning the divider.


splitview_get_pos ()

Get the current divider position.

real32_t
splitview_get_pos(const SplitView *split,
                  const split_mode_t mode);
split

The SplitView.

mode

The unit in which we want the result.

Return

The divider position.

Remarks

Ver Positioning the divider.


splitview_visible0 ()

Show/hide the left/upper child.

void
splitview_visible0(SplitView *split,
                   const bool_t visible);
split

The SplitView.

visible

Show or hide.

Remarks

Ver Divider minimum size.


splitview_visible1 ()

Show/hide the right/bottom child.

void
splitview_visible1(SplitView *split,
                   const bool_t visible);
split

The SplitView.

visible

Show or hide.

Remarks

Ver Divider minimum size.


splitview_minsize0 ()

Set the minimum size of the left/upper child.

void
splitview_minsize0(SplitView *split,
                   const real32_t size);
split

The SplitView.

size

Minimum size.

Remarks

Ver Divider minimum size.


splitview_minsize1 ()

Set the minimum size of the right/bottom child.

void
splitview_minsize1(SplitView *split,
                   const real32_t size);
split

The SplitView.

size

Minimum size.

Remarks

Ver Divider minimum size.

❮ Back
Next ❯