ComponentOne List 8.0 for ActiveX
Sizing and Scaling Splits

True DBList gives you full control over the size and scaling of individual splits. You can configure a split to occupy an exact width, hold a fixed number of columns, or adjust its size proportionally in relation to other splits. If you are just starting out with True DBList, you can use splits in a variety of ways without having to master all of the details.

At run time, the actual size of a Split object depends upon its Size and SizeMode properties. The SizeMode property specifies the unit of measurement; the Size property specifies the number of units. True DBList supports three different sizing modes for splits, as determined by the setting of the SizeMode property:

0 - Scalable

Size denotes relative width in relation to other splits

1 - Exact

Size specifies a fixed width in container coordinates

2 - Number of Columns

Size specifies a fixed number of columns

In code, you can use the constants dblScalable, dblExact, and dblNumberOfColumns to refer to these settings.

A scalable split uses the value of its Size property to determine the percentage of space the split will occupy. For any scalable split, the percentage is determined by dividing its Size value by the sum of the Size values of all other scalable splits. Thus, you can consider the Size property of a scalable split to be the numerator of a fraction, the denominator of which is the sum of the scalable split sizes. Scalable splits compete for the space remaining after nonscalable splits have been allocated. By default, all splits are scalable, so they compete for the entire list display region. SizeMode is always 0 - Scalable when a list contains only one split.

An exact split uses the value of its Size property as its fixed width in container coordinates. Exact splits will be truncated if they will not fit within the horizontal list boundaries. This mode is not applicable when a list contains only one split.

A fixed-column split uses the Size property to indicate the exact number of columns that should always be displayed within the split. These splits automatically reconfigure the entire list if the size of the displayed columns changes (either by code or user interaction), or if columns in the split are scrolled horizontally so that the widths of the displayed columns are different. This mode is primarily used to create fixed columns that do not scroll horizontally. However, it can be used for a variety of other purposes as well. This mode is not applicable when a list contains only one split.

Note that when there is only one split (the list's default behavior), the split spans the entire width of the list, the SizeMode property is always 0 - Scalable, and the Size property is always 1. Setting either of these properties has no effect when there is only one split. If there are multiple splits, and you then remove all but one, the SizeMode and Size properties of the remaining split automatically revert to 0 and 1, respectively.

By default, the SizeMode property for a newly created split is 0 - Scalable, and the Size property is set to 1. For example, if you create two additional splits with the following code:

Example Title
Copy Code
Dim S As TrueDBList80.Split

Set S = TDBList1.Splits.Add(0) ' Create a Split at the left

Set S = TDBList1.Splits.Add(0) ' Create another

The resulting list display will look like this:

Notice that each split occupies 1/3 of the total list space. This is because there are three scalable splits, and each split has a Size of 1. If you change the sizes of the splits to 1, 2, and 3, respectively:

Example Title
Copy Code
TDBList1.Splits(0).Size = 1 ' Change relative size to 1

TDBList1.Splits(1).Size = 2 ' Change relative size to 2

TDBList1.Splits(2).Size = 3 ' Change relative size to 3

The resulting list display will look like this:

Notice the sum of the split sizes (1+2+3) is 6, so the size of each split is a fraction with the numerator being the value of its Size property and a denominator of 6.

When a split's SizeMode is set to 1 - Exact, that split receives space before the other splits. This behavior is somewhat more complex, but understanding how scalable splits work is helpful. For example, assume that splits are set in the following way:

Example Title
Copy Code
Split0.SizeMode = dblScalable

Split0.Size = 1

 

Split1.SizeMode = dblExact

Split1.Size = 2500

 

Split2.SizeMode = dblScalable

Split2.Size = 2

After configuring the splits in this way, the resulting list display will look like this:

The fixed-size split in the middle (Split1) is configured to exactly 2500 twips, and the remaining splits compete for the space remaining in the list. Since the remaining splits are both scalable splits, they divide the remaining space among themselves according to the percentages calculated using their Size property values. So, the leftmost split occupies 1/3 of the remaining space, and the rightmost split occupies 2/3.

Splits with SizeMode set to 2 - Number of Columns behave almost identically to exact splits, except their size is determined by the width of an integral number of columns. The width, however, is dynamic, so resizing the columns or scrolling so that different columns are in view will cause the entire list to reconfigure itself.

Avoid creating a list with no scalable splits. Although True DBList handles this situation, it is difficult to work with a list configured in this way. For example, if no splits are scalable, all splits will have an exact size, which may not fill the entire horizontal width of the list. If the total width of the splits is too short, True DBList displays a "null-zone" where there are no splits. If the total width of the splits is wider than the list, then True DBList will show only the separator lines for the splits that cannot be shown.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback