2.87 .direction

This attribute determines the orientation of the object.

Definition

  • Data type

    integer

  • Access

    get, set

  • changed event

    yes

Value range

1
Vertical or column-wise orientation.
2
Horizontal or row-wise orientation

layoutbox

The .direction attribute controls how the child objects are arranged in the layoutbox.

Value range

1

The children of the layoutbox are arranged column by column in the order they appear in the child vector. If there is no more space in a column, i.e. the object would not be visible if it were placed in the same column, the next child is placed in the next column. In each column the maximum width is determined. The children of the layoutbox are then aligned according to this maximum width.
2 (default)
The children of the layoutbox are arranged row by row in the order they appear in the child vector. If there is no more space in a row, i.e. the object would not be visible if it were placed in the same row, the next child is positioned in the next row. In each row the maximum height is determined. The children of the layoutbox are then aligned according to this maximum height.

notebook (Motif only)

This attribute defines the orientation of the notebook, i.e. the direction of the binding.

Value range

1 (default)
The binding is vertical. Depending on the .backpage attribute, the notebook is bound on the left or right.
2
The binding is horizontal. Depending on the .backpage attribute, the notebook is bound at the top or bottom.

In the following table the effects of the attributes .backpage and .direction on the positioning of major tabs and minor tabs as well as on the binding are shown:

.backpage

.direction

Major Tab

Minor Tab

Binding

bp_bottomright

1

right

bottom

left

bp_bottomright

2

bottom

right

top

bp_bottomleft

1

left

bottom

right

bp_bottomleft

2

bottom

left

top

bp_topright

1

right

top

left

bp_topright

2

top

right

bottom

bp_topleft

1

left

top

right

bp_topleft

2

top

left

bottom

progressbar

The .direction attribute defines the orientation of the progress indicator.

Value range

1
The progress indicator runs vertically from bottom to top.
2 (default)
The progress indicator runs horizontally from left to right.

scrollbar

The .direction attribute determines the orientation of the scrollbar.

Value range

1 (default)
Vertical scrollbar with .minvalue at the top and .maxvalue at the bottom.
2
Horizontal scrollbar with .minvalue on the left and .maxvalue on the right

spinbox

With the spinbox, the .direction attribute determines whether the arrows of the buttons point up and down or left and right.

Value range

1 (default)
Vertical arrangement of the buttons with arrows pointing up and down.
2
Horizontal arrangement of the buttons with arrows pointing left and right.

Note on the IDM for Qt

The .direction attribute and the horizontal alignment of the arrows are not supported.

splitbox

The .direction attribute determines whether the splitbox is divided horizontally or vertically into split areas.

Value range

1 (default)
The splitbars are vertical, i.e. the splitbox is divided horizontally into split areas and by moving the splitbars the width of the split areas can be changed.
2
The splitbars are horizontal, i.e. the splitbox is divided vertically into split areas and by moving the splitbars the height of the split areas can be changed.

tablefield

The .direction attribute defines the orientation of the tablefield and controls whether rows or columns take precedence. The attribute influences the adopting of row and column default values, the selection and navigation as well as certain methods.

Value range

1 (default)
Vertical orientation with column priority.
2
Horizontal orientation with row priority.

Effects

Default values

With . direction = 1, the column defaults, i.e. the attribute values with the indices [0,<C>], will be used for cell values (.content[index], .bgc[index], .fgc[index]…) that are not set. With .direction = 2, the row default values, i.e. the attribute values with the indices [<R>,0], will be used.

Selection

If both .selection[sel_column] and .selection[sel_row] are set to true and the cell [<R>,<C>] is selected, then with . direction = 1 the column <C> and with .direction = 2 the row <R> will be selected.

In a tablefield with multiple selection .nextactive[index] searches for the next selected cell row by row if .direction = 1 and column by column if .direction = 2. For example, if cells [4,2] and [3,5] are selected, .nextactive[1,1] will return [3,5] if .direction = 1 and [4,2] if .direction = 2.

Navigation

If .direction = 1, pressing Return will move the input focus to the next selectable cell to the right of the current cell. Home and End will jump to the beginning or end of the row with the currently focused cell.

If .direction = 2, pressing Return will move the input focus to the next selectable cell below the current cell. Home and End will jump to the beginning or end of the column with the currently focused cell.

:find() method

The .direction attribute affects the search direction of the :find() method. If .direction = 1, the tablefield is searched row by lrow, if .direction = 2, it is searched column by column. For example, if the searched value is located in cells [4,2] and [3,5], :find() without specifying a search range will return the location [3,5] if .direction = 1 and the location [4,2] if .direction = 2.

Methods :clear(), :delete(), :exchange(), :insert() and :move()

The attribute .direction, together with the optional Direction parameter of the methods, controls whether the methods are applied to rows or columns. If the Direction parameter is not specified, the methods are applied to rows if .direction = 1 and to columns if .direction = 2.