adds a WCheckBoxSelect with LAYOUT_COLUMN in 2 columns.
12696
private void addColumnSelectExample() {
		add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect laid out in columns"));
		add(new ExplanatoryText("Setting the layout to COLUMN will make the check boxes be rendered in 'n' columns. The number of columns is"
				+ " determined by the layoutColumnCount property."));
		final WCheckBoxSelect select = new WCheckBoxSelect("australian_state");
		select.setToolTip("Make a selection");
		select.setButtonLayout(WCheckBoxSelect.LAYOUT_COLUMNS);
		select.setButtonColumns(2);
		add(select);

		add(new WHeading(HeadingLevel.H3, "Options equal to columns"));
		String[] options = new String[]{"Dog", "Cat", "Bird"};
		final WCheckBoxSelect select2 = new WCheckBoxSelect(options);
		select2.setToolTip("Animals");
		select2.setButtonColumns(3);
		final WTextField text = new WTextField();
		text.setReadOnly(true);
		text.setText(NO_SELECTION);

		WButton update = new WButton("Select Animals");
		update.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				String output = select2.getSelected().isEmpty() ? NO_SELECTION : "The selected animals are: "
						+ select2.getSelected();
				text.setText(output);
			}
		});
		select2.setDefaultSubmitButton(update);

		add(select2);
		add(update);
		add(text);
		add(new WAjaxControl(update, text));
	}
403683
private void applySettings() {
		container.reset();
		// Now show an example of the number of different columns

		WPanel gridLayoutPanel = new WPanel();

		if (cbResponsive.isSelected()) {
			gridLayoutPanel.setHtmlClass(HtmlClassProperties.RESPOND);
		}

		GridLayout layout = new GridLayout(rowCount.getValue().intValue(), columnCount.getValue()
				.intValue(),
				hGap.getValue().intValue(),
				vGap.getValue().intValue()
		);

		gridLayoutPanel.setLayout(layout);

		addBoxes(gridLayoutPanel, boxCount.getValue().intValue()); // give approx 3 rows, with a different number
		// of boxes on the final row
		container.add(gridLayoutPanel);

		gridLayoutPanel.setVisible(cbVisible.isSelected());
	}
429705
protected function prependRowSelectorColumn()
    {
        if (!$this->option('useRowSelector')) {
            return;
        }

        $grid = $this;

        $column = new Column(Column::SELECT_COLUMN_NAME, ' ');
        $column->setGrid($this);

        $column->display(function ($value) use ($grid, $column) {
            $actions = new RowSelector($value, $grid, $column, $this);

            return $actions->display();
        });

        $this->columns->prepend($column);
    }
579494
def tabLayout(self):
        '''  '''
        self.childWindow.column += 1
        if self.childWindow.column > Layout.BUTTONS_NUMBER:
            self.childWindow.column = 0
            self.childWindow.row += 1
1305909
public void layout(float layoutX, float layoutY, float layoutWidth, float layoutHeight) {
        if (sizeInvalid)
            computeSize();

        float hpadding = w(padLeft) + w(padRight);
        float vpadding = h(padTop) + h(padBottom);

        float totalExpandWidth = 0, totalExpandHeight = 0;
        for (int i = 0; i < columns; i++)
            totalExpandWidth += expandWidth[i];
        for (int i = 0; i < rows; i++)
            totalExpandHeight += expandHeight[i];

        // Size columns and rows between min and pref size using (preferred -
        // min) size to weight distribution of extra space.
        float[] localColumnWeightedWidth;
        float totalGrowWidth = tablePrefWidth - tableMinWidth;
        if (totalGrowWidth == 0)
            localColumnWeightedWidth = columnMinWidth;
        else {
            float extraWidth = Math.min(totalGrowWidth, Math.max(0, layoutWidth - tableMinWidth));
            localColumnWeightedWidth = this.columnWeightedWidth = ensureSize(this.columnWeightedWidth, columns);
            for (int i = 0; i < columns; i++) {
                float growWidth = columnPrefWidth[i] - columnMinWidth[i];
                float growRatio = growWidth / (float) totalGrowWidth;
                localColumnWeightedWidth[i] = columnMinWidth[i] + extraWidth * growRatio;
            }
        }

        float[] localRowWeightedHeight;
        float totalGrowHeight = tablePrefHeight - tableMinHeight;
        if (totalGrowHeight == 0)
            localRowWeightedHeight = rowMinHeight;
        else {
            localRowWeightedHeight = this.rowWeightedHeight = ensureSize(this.rowWeightedHeight, rows);
            float extraHeight = Math.min(totalGrowHeight, Math.max(0, layoutHeight - tableMinHeight));
            for (int i = 0; i < rows; i++) {
                float growHeight = rowPrefHeight[i] - rowMinHeight[i];
                float growRatio = growHeight / (float) totalGrowHeight;
                localRowWeightedHeight[i] = rowMinHeight[i] + extraHeight * growRatio;
            }
        }

        // Determine widget and cell sizes (before expand or fill).
        for (int i = 0, n = cells.size(); i < n; i++) {
            Cell<C, T> c = cells.get(i);
            if (c.ignore)
                continue;

            float spannedWeightedWidth = 0;
            for (int column = c.column, nn = column + c.colspan; column < nn; column++)
                spannedWeightedWidth += localColumnWeightedWidth[column];
            float weightedHeight = localRowWeightedHeight[c.row];

            float prefWidth = w(c.prefWidth, c);
            float prefHeight = h(c.prefHeight, c);
            float minWidth = w(c.minWidth, c);
            float minHeight = h(c.minHeight, c);
            float maxWidth = w(c.maxWidth, c);
            float maxHeight = h(c.maxHeight, c);
            if (prefWidth < minWidth)
                prefWidth = minWidth;
            if (prefHeight < minHeight)
                prefHeight = minHeight;
            if (maxWidth > 0 && prefWidth > maxWidth)
                prefWidth = maxWidth;
            if (maxHeight > 0 && prefHeight > maxHeight)
                prefHeight = maxHeight;

            c.widgetWidth = Math.min(spannedWeightedWidth - c.computedPadLeft - c.computedPadRight, prefWidth);
            c.widgetHeight = Math.min(weightedHeight - c.computedPadTop - c.computedPadBottom, prefHeight);

            if (c.colspan == 1)
                columnWidth[c.column] = Math.max(columnWidth[c.column], spannedWeightedWidth);
            rowHeight[c.row] = Math.max(rowHeight[c.row], weightedHeight);
        }

        // Distribute remaining space to any expanding columns/rows.
        if (totalExpandWidth > 0) {
            float extra = layoutWidth - hpadding;
            for (int i = 0; i < columns; i++)
                extra -= columnWidth[i];
            float used = 0;
            int lastIndex = 0;
            for (int i = 0; i < columns; i++) {
                if (expandWidth[i] == 0)
                    continue;
                float amount = extra * expandWidth[i] / totalExpandWidth;
                columnWidth[i] += amount;
                used += amount;
                lastIndex = i;
            }
            columnWidth[lastIndex] += extra - used;
        }
        if (totalExpandHeight > 0) {
            float extra = layoutHeight - vpadding;
            for (int i = 0; i < rows; i++)
                extra -= rowHeight[i];
            float used = 0;
            int lastIndex = 0;
            for (int i = 0; i < rows; i++) {
                if (expandHeight[i] == 0)
                    continue;
                float amount = extra * expandHeight[i] / totalExpandHeight;
                rowHeight[i] += amount;
                used += amount;
                lastIndex = i;
            }
            rowHeight[lastIndex] += extra - used;
        }

        // Distribute any additional width added by colspanned cells to the
        // columns spanned.
        for (int i = 0, n = cells.size(); i < n; i++) {
            Cell<C, T> c = cells.get(i);
            if (c.ignore)
                continue;
            if (c.colspan == 1)
                continue;

            float extraWidth = 0;
            for (int column = c.column, nn = column + c.colspan; column < nn; column++)
                extraWidth += localColumnWeightedWidth[column] - columnWidth[column];
            extraWidth -= Math.max(0, c.computedPadLeft + c.computedPadRight);

            extraWidth /= c.colspan;
            if (extraWidth > 0) {
                for (int column = c.column, nn = column + c.colspan; column < nn; column++)
                    columnWidth[column] += extraWidth;
            }
        }

        // Determine table size.
        float tableWidth = hpadding, tableHeight = vpadding;
        for (int i = 0; i < columns; i++)
            tableWidth += columnWidth[i];
        for (int i = 0; i < rows; i++)
            tableHeight += rowHeight[i];

        // Position table within the container.
        float x = layoutX + w(padLeft);
        if ((align & RIGHT) != 0)
            x += layoutWidth - tableWidth;
        else if ((align & LEFT) == 0) // Center
            x += (layoutWidth - tableWidth) / 2;

        float y = layoutY + w(padTop);
        if ((align & BOTTOM) != 0)
            y += layoutHeight - tableHeight;
        else if ((align & TOP) == 0) // Center
            y += (layoutHeight - tableHeight) / 2;

        // Position widgets within cells.
        float currentX = x, currentY = y;
        for (int i = 0, n = cells.size(); i < n; i++) {
            Cell<C, T> c = cells.get(i);
            if (c.ignore)
                continue;

            float spannedCellWidth = 0;
            for (int column = c.column, nn = column + c.colspan; column < nn; column++)
                spannedCellWidth += columnWidth[column];
            spannedCellWidth -= c.computedPadLeft + c.computedPadRight;

            currentX += c.computedPadLeft;

            if (c.fillX > 0) {
                c.widgetWidth = spannedCellWidth * c.fillX;
                float maxWidth = w(c.maxWidth, c);
                if (maxWidth > 0)
                    c.widgetWidth = Math.min(c.widgetWidth, maxWidth);
            }
            if (c.fillY > 0) {
                c.widgetHeight = rowHeight[c.row] * c.fillY - c.computedPadTop - c.computedPadBottom;
                float maxHeight = h(c.maxHeight, c);
                if (maxHeight > 0)
                    c.widgetHeight = Math.min(c.widgetHeight, maxHeight);
            }

            if ((c.align & LEFT) != 0)
                c.widgetX = currentX;
            else if ((c.align & RIGHT) != 0)
                c.widgetX = currentX + spannedCellWidth - c.widgetWidth;
            else
                c.widgetX = currentX + (spannedCellWidth - c.widgetWidth) / 2;

            if ((c.align & TOP) != 0)
                c.widgetY = currentY + c.computedPadTop;
            else if ((c.align & BOTTOM) != 0)
                c.widgetY = currentY + rowHeight[c.row] - c.widgetHeight - c.computedPadBottom;
            else
                c.widgetY = currentY + (rowHeight[c.row] - c.widgetHeight + c.computedPadTop - c.computedPadBottom) / 2;

            if (c.endRow) {
                currentX = x;
                currentY += rowHeight[c.row];
            } else
                currentX += spannedCellWidth + c.computedPadRight;
        }

        // Draw debug widgets and bounds.
        if (debug == Debug.none)
            return;
        toolkit.clearDebugRectangles(this);
        currentX = x;
        currentY = y;
        if (debug == Debug.table || debug == Debug.all) {
            toolkit.addDebugRectangle(this, Debug.table, layoutX, layoutY, layoutWidth, layoutHeight);
            toolkit.addDebugRectangle(this, Debug.table, x, y, tableWidth - hpadding, tableHeight - vpadding);
        }
        for (int i = 0, n = cells.size(); i < n; i++) {
            Cell<C, T> c = cells.get(i);
            if (c.ignore)
                continue;

            // Widget bounds.
            if (debug == Debug.widget || debug == Debug.all)
                toolkit.addDebugRectangle(this, Debug.widget, c.widgetX, c.widgetY, c.widgetWidth, c.widgetHeight);

            // Cell bounds.
            float spannedCellWidth = 0;
            for (int column = c.column, nn = column + c.colspan; column < nn; column++)
                spannedCellWidth += columnWidth[column];
            spannedCellWidth -= c.computedPadLeft + c.computedPadRight;
            currentX += c.computedPadLeft;
            if (debug == Debug.cell || debug == Debug.all) {
                toolkit.addDebugRectangle(this, Debug.cell, currentX, currentY + c.computedPadTop, spannedCellWidth, rowHeight[c.row] - c.computedPadTop - c.computedPadBottom);
            }

            if (c.endRow) {
                currentX = x;
                currentY += rowHeight[c.row];
            } else
                currentX += spannedCellWidth + c.computedPadRight;
        }
    }
857789
public void addButtonRow()
    {
        buttons=new Composite();
        
        if (!extendRow)
        {
            column.newRow();
            column.addCell(buttons).left().middle();
            column.cell().attribute("colspan","2");
        }
        extendRow=false;
    }
998439
private void addAddInfoLayout(String key, Object value, boolean editable) {

        HorizontalLayout res = addInfoLayout(key, value, editable);
        if (editable) {
            m_userinfoGroup.addRow(res);
        } else {
            m_userinfoNoEditGroup.addRow(res);
        }
    }
1245999
void switchTwoColumns(int columnIndex, int columnToIndex) {
        checkForInit();
        int cellData = mColumnWidths[columnToIndex];
        mColumnWidths[columnToIndex] = mColumnWidths[columnIndex];
        mColumnWidths[columnIndex] = cellData;
    }
1250281
def add_widget(self, w):
        """"""
        if self.layout():
            self.layout().addWidget(w)
        else:
            layout = QVBoxLayout(self)
            layout.addWidget(w)
330650
def select_cell(self, row, col, add_to_selected=False):
        """"""

        self.grid.SelectBlock(row, col, row, col,
                              addToSelected=add_to_selected)
473184
public void setButtonLayout(final Layout layout) {
		CheckBoxSelectModel model = getOrCreateComponentModel();
		model.layout = layout;
		model.numColumns = 0;
	}
975916
def on_add_cols(self, event):
        
        col_labels = self.grid.col_labels
        dia = pw.ChooseOne(self, yes="Add single columns", no="Add groups")
        result1 = dia.ShowModal()
        if result1 == wx.ID_CANCEL:
            return
        elif result1 == wx.ID_YES:
            items = sorted([col_name for col_name in self.dm.index if col_name not in col_labels])
            dia = pw.HeaderDialog(self, 'columns to add',
                                  items1=list(items), groups=[])
            dia.Centre()
            result2 = dia.ShowModal()
        else:
            groups = self.dm['group'].unique()
            dia = pw.HeaderDialog(self, 'groups to add',
                                  items1=list(groups), groups=True)
            dia.Centre()
            result2 = dia.ShowModal()
        new_headers = []
        if result2 == 5100:
            new_headers = dia.text_list
        # if there is nothing to add, quit
        if not new_headers:
            return
        if result1 == wx.ID_YES:
            # add individual headers
            errors = self.add_new_grid_headers(new_headers)
        else:
            # add header groups
            errors = self.add_new_header_groups(new_headers)
        if errors:
            errors_str = ', '.join(errors)
            pw.simple_warning('You are already using the following headers: {}\nSo they will not be added'.format(errors_str))

        # problem: if widgets above the grid are too wide,
        # the grid does not re-size when adding columns
        # awkward solution (causes flashing):
        if self.grid.GetWindowStyle() != wx.DOUBLE_BORDER:
            self.grid.SetWindowStyle(wx.DOUBLE_BORDER)
        self.main_sizer.Fit(self)
        self.grid.SetWindowStyle(wx.NO_BORDER)
        self.Centre()
        self.main_sizer.Fit(self)
        #
        self.grid.changes = set(range(self.grid.GetNumberRows()))
        dia.Destroy()
492369
def _do_layout(self):
        """"""

        sizer_csvoptions = wx.FlexGridSizer(5, 4, 5, 5)

        # Adding parameter widgets to sizer_csvoptions
        leftpos = wx.LEFT | wx.ADJUST_MINSIZE
        rightpos = wx.RIGHT | wx.EXPAND

        current_label_margin = 0  # smaller for left column
        other_label_margin = 15

        for label, widget in zip(self.param_labels, self.param_widgets):
            sizer_csvoptions.Add(label, 0, leftpos, current_label_margin)
            sizer_csvoptions.Add(widget, 0, rightpos, current_label_margin)

            current_label_margin, other_label_margin = \
                other_label_margin, current_label_margin

        sizer_csvoptions.AddGrowableCol(1)
        sizer_csvoptions.AddGrowableCol(3)

        self.sizer_csvoptions = sizer_csvoptions
687886
def drawColHeader(self, scr, y, vcolidx):
        ''
        col = self.visibleCols[vcolidx]

        # hdrattr highlights whole column header
        # sepattr is for header separators and indicators
        sepattr = colors.color_column_sep

        hdrattr = self.colorize(col, None)
        if vcolidx == self.cursorVisibleColIndex:
            hdrattr = hdrattr.update_attr(colors.color_current_hdr, 2)

        C = options.disp_column_sep
        if (self.keyCols and col is self.keyCols[-1]) or vcolidx == self.rightVisibleColIndex:
            C = options.disp_keycol_sep

        x, colwidth = self.visibleColLayout[vcolidx]

        # ANameTC
        T = getType(col.type).icon
        if T is None:  # still allow icon to be explicitly non-displayed ''
            T = '?'
        N = ' ' + col.name  # save room at front for LeftMore
        if len(N) > colwidth-1:
            N = N[:colwidth-len(options.disp_truncator)] + options.disp_truncator
        clipdraw(scr, y, x, N, hdrattr.attr, colwidth)
        clipdraw(scr, y, x+colwidth-len(T), T, hdrattr.attr, len(T))
        vd.onMouse(scr, y, x, 1, colwidth, BUTTON3_RELEASED='rename-col')

        if vcolidx == self.leftVisibleColIndex and col not in self.keyCols and self.nonKeyVisibleCols.index(col) > 0:
            A = options.disp_more_left
            scr.addstr(y, x, A, sepattr)

        if C and x+colwidth+len(C) < self.vd.windowWidth:
            scr.addstr(y, x+colwidth, C, sepattr)
867848
private void appendClazzColumnForSelect(StringBuffer buf)
    {
        ClassDescriptor cld = getSearchClassDescriptor();
        ClassDescriptor[] clds = getMultiJoinedClassDescriptors(cld);

        if (clds.length == 0)
        {
            return;
        }
        
        buf.append(",CASE");

        for (int i = clds.length; i > 0; i--)
        {
            buf.append(" WHEN ");

            ClassDescriptor subCld = clds[i - 1];
            FieldDescriptor[] fieldDescriptors = subCld.getPkFields();

            TableAlias alias = getTableAliasForClassDescriptor(subCld);
            for (int j = 0; j < fieldDescriptors.length; j++)
            {
                FieldDescriptor field = fieldDescriptors[j];
                if (j > 0)
                {
                    buf.append(" AND ");
                }
                appendColumn(alias, field, buf);
                buf.append(" IS NOT NULL");
            }
            buf.append(" THEN '").append(subCld.getClassNameOfObject()).append("'");
        }
        buf.append(" ELSE '").append(cld.getClassNameOfObject()).append("'");
        buf.append(" END AS " + SqlHelper.OJB_CLASS_COLUMN);
    }
921178
def addWidget(self, widget, name):
        """"""
        self.exploreStimTypeCmbbx.addItem(name)
        self.componentStack.addWidget(widget)
        widget.valueChanged.connect(self.valueChanged.emit)
1020958
private void addPreviewColumn() {

        CmsButtonCell<CmsHistoryResourceBean> previewCell = new CmsButtonCell<CmsHistoryResourceBean>(
            CmsHistoryMessages.titlePreview(),
            I_CmsButton.ICON_FONT + " " + I_CmsButton.PREVIEW_SMALL,
            new ActionCell.Delegate<CmsHistoryResourceBean>() {

                @SuppressWarnings("synthetic-access")
                public void execute(CmsHistoryResourceBean historyRes) {

                    m_handler.showPreview(historyRes);
                }
            },
            new Predicate<CmsHistoryResourceBean>() {

                public boolean apply(CmsHistoryResourceBean bean) {

                    return true;

                }
            });

        addColumn(CmsHistoryMessages.columnPreview(), 30, new IdentityColumn<CmsHistoryResourceBean>(previewCell));
    }