### .attachCheckBoxColumn()

Adds a checkbox column to the grid. It is called when
541453
protected function attachCheckBoxColumn() {
    	
        $dataProvider = $this->grid->dataProvider;
        $columnName = null;

        if (!isset($this->checkBoxColumnConfig['name'])) {
            // supports two types of DataProviders
            if ($dataProvider instanceof CActiveDataProvider) {
                // we need to get the name of the key field 'by default'
                if (is_string($dataProvider->modelClass)) {
                    $modelClass = $dataProvider->modelClass;
                    $model = CActiveRecord::model($modelClass);
                } else {
                    $model = $dataProvider->modelClass;
                }

                $table = $model->tableSchema;
                if (is_string($table->primaryKey)) {
                    $columnName = $this->{$table->primaryKey};
                } else if (is_array($table->primaryKey)) {
                    $columnName = $table->primaryKey[0];
                } // just get the first one
            }
            if ($dataProvider instanceof CArrayDataProvider || $dataProvider instanceof CSqlDataProvider) {
                $columnName = $dataProvider->keyField;
            } // key Field
        }
        // create CCheckBoxColumn and attach to columns at its beginning
        $column = CMap::mergeArray(
            array(
                'class' => 'CCheckBoxColumn',
                'name' => $columnName,
            ),
            $this->checkBoxColumnConfig
        );


        array_unshift($this->grid->columns, $column);
        $this->columnName = $this->grid->id . '_c0\[\]'; //
    }
1086022
public function initColumn() {
    	
        if (!is_array($this->checkBoxColumnConfig)) {
            $this->checkBoxColumnConfig = array();
        }

        if (empty($this->grid->columns)) {
            return false;
        }

        $columns = $this->grid->columns;

        foreach ($columns as $idx => $column) {
            if (!is_array($column) || !isset($column['class'])) {
                continue;
            }
            if (preg_match('/ccheckboxcolumn/i', $column['class'])) {
                if (isset($column['checkBoxHtmlOptions']) && isset($column['checkBoxHtmlOptions']['name'])) {
                    $this->columnName = strtr(
                        $column['checkBoxHtmlOptions']['name'],
                        array('[' => "\\[", ']' => "\\]")
                    );
                } else {
                    $this->columnName = $this->grid->id . '_c' . $idx . '\[\]';
                }
                return true; // it has already a CCheckBoxColumn
            }
        }
        // not CCheckBoxColumn, attach one
        $this->attachCheckBoxColumn();
        return true;
    }
1006294
private void addCustomGridded(AbstractButton button) {
        builder.getLayout().appendRow(this.rowSpec);
        builder.getLayout().addGroupedRow(builder.getRow());
        button.putClientProperty("jgoodies.isNarrow", Boolean.TRUE);
        builder.add(button);
        builder.nextRow();
    }
351756
private void setupCheckboxBindings() {
    for (CheckBox checkbox : checkboxes) {
      checkbox.disableProperty().bind(field.editableProperty().not());
    }
  }
143690
function addCol($col_data, $col_id = 0, $row_id = 0) {
        foreach ($col_data as $col_cell) {
            $this->_data[$row_id++][$col_id] = $col_cell;
        }

        $this->_updateRowsCols();
        $this->_max_cols = max($this->_max_cols, $col_id + 1);
    }
1224297
protected function checkBox()
    {
        if (is_array($this->box) && count($this->box)) {
            foreach ($this->box as $name => $value) {
                switch ($name) {
                    case 'classOuter':
                        $this->addClassOption('classOuter', $value);
                        break;
                    case 'classButton':
                        $this->addClassOption('classButton', $value);
                        break;
                    case 'classInner':
                        $this->addClassOption('classInner', $value);
                        break;
                    case 'replaceOuterStyle':
                        $this->replaceStyle(0, $value);
                        break;
                    case 'replaceInnerStyle':
                        $this->replaceStyle(1, $value);
                        break;
                    case 'replaceButtonStyle':
                        $this->replaceStyle(2, $value);
                        break;
                    case 'addOuterStyle':
                        $this->addStyle(0, $value);
                        break;
                    case 'addInnerStyle':
                        $this->addStyle(1, $value);
                        break;
                    case 'addButtonStyle':
                        $this->addStyle(2, $value);
                        break;
                    case 'setOuterStyle':
                        $this->setStyle(0, $value);
                        break;
                    case 'setInnerStyle':
                        $this->setStyle(1, $value);
                        break;
                    case 'setButtonStyle':
                        $this->setStyle(2, $value);
                        break;
                    case 'view':
                        $this->setCookieView($value);
                        break;
                    case 'outerHtmlOptions':
                        $this->setHtmlOptions(0, $value);
                        break;
                    case 'innerHtmlOptions':
                        $this->setHtmlOptions(1, $value);
                        break;
                    case 'buttonHtmlOptions':
                        $this->setHtmlOptions(2, $value);
                        break;
                }
            }
        }
    }
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()
451965
function Cell(cell) {
        // Adds property: className and content.
        Entity.call(this, cell);

        /**
         * ### Cell.x
         *
         * The row number
         */
        this.x = 'undefined' !== typeof cell.x ? cell.x : null;

        /**
         * ### Cell.y
         *
         * The column number
         */
        this.y = 'undefined' !== typeof cell.y ? cell.y : null;

        /**
         * ### Cell.tdElement
         *
         * Reference to the TD/TH element, if built already
         */
        this.HTMLElement = cell.HTMLElement || null;
    }
34072
public function addCheckbox() : Checkbox
    {
        $checkbox = new Checkbox($this->form, $this->name . '[]');
        $this->checkboxes[] = $checkbox;

        return $checkbox;
    }
1187899
def _add_table_row(self, arg, number, row):
        
        self.args[arg.name] = dict()
        self.args[arg.name]['arg'] = arg
        check_box_title = arg.flags[number][2:].title()
        self.args[arg.name]['label'] = check_box_title
        align = self.gui_helper.create_alignment()
        if arg.kwargs.get('required'):
            # If argument is required then red star instead of checkbox
            star_label = self.gui_helper.create_label('<span color="#FF0000">*</span>')
            star_label.set_padding(0, 3)
            label = self.gui_helper.create_label(check_box_title)
            box = self.gui_helper.create_box()
            box.pack_start(star_label, False, False, 6)
            box.pack_start(label, False, False, 6)
            align.add(box)
        else:
            chbox = self.gui_helper.create_checkbox(check_box_title)
            chbox.set_alignment(0, 0)
            if arg.name == "deps_only":
                chbox.connect("clicked", self._deps_only_toggled)
            else:
                chbox.connect("clicked", self._check_box_toggled, arg.name)
            align.add(chbox)
            self.args[arg.name]['checkbox'] = chbox
        if row == 0:
            self.grid.add(align)
        else:
            self.grid.attach(align, 0, row, 1, 1)
        label = self.gui_helper.create_label(arg.kwargs['help'], justify=Gtk.Justification.LEFT)
        label.set_alignment(0, 0)
        label.set_padding(0, 3)
        self.grid.attach(label, 1, row, 1, 1)
        label_check_box = self.gui_helper.create_label(name="")
        self.grid.attach(label_check_box, 0, row, 1, 1)
        if arg.get_gui_hint('type') not in ['bool', 'const']:
            new_box = self.gui_helper.create_box(spacing=6)
            entry = self.gui_helper.create_entry(text="")
            align = self.gui_helper.create_alignment()
            align.add(entry)
            new_box.pack_start(align, False, False, 6)
            align_btn = self.gui_helper.create_alignment()
            ''' If a button is needed please add there and in function
                _check_box_toggled
                Also do not forget to create a function for that button
                This can not be done by any automatic tool from those reasons
                Some fields needs a input user like user name for GitHub
                and some fields needs to have interaction from user like selecting directory
            '''
            entry.set_text(arg.get_gui_hint('default'))
            entry.set_sensitive(arg.kwargs.get('required') == True)

            if arg.get_gui_hint('type') == 'path':
                browse_btn = self.gui_helper.button_with_label("Browse")
                browse_btn.connect("clicked", self.browse_clicked, entry)
                browse_btn.set_sensitive(arg.kwargs.get('required') == True)
                align_btn.add(browse_btn)
                self.args[arg.name]['browse_btn'] = browse_btn
            elif arg.get_gui_hint('type') == 'str':
                if arg.name == 'github' or arg.name == 'github-login':
                    link_button = self.gui_helper.create_link_button(text="For registration visit GitHub Homepage",
                                                                     uri="https://www.github.com")
                    align_btn.add(link_button)
            new_box.pack_start(align_btn, False, False, 6)
            row += 1
            self.args[arg.name]['entry'] = entry
            self.grid.attach(new_box, 1, row, 1, 1)
        else:
            if 'preserved' in arg.kwargs and config_manager.get_config_value(arg.kwargs['preserved']):
                if 'checkbox' in self.args[arg.name]:
                    self.args[arg.name]['checkbox'].set_active(True)
        return row
661217
private void createCheckboxes() {
    node.getChildren().clear();
    checkboxes.clear();

    for (int i = 0; i < field.getItems().size(); i++) {
      CheckBox cb = new CheckBox();

      cb.setText(field.getItems().get(i).toString());
      cb.setSelected(field.getSelection().contains(field.getItems().get(i)));

      checkboxes.add(cb);
    }

    node.getChildren().addAll(checkboxes);
  }
1166415
function() {
    if(lang.isArray(this.checkboxOptions)) {
        var checkboxOption, checkboxValue, checkboxId, elLabel, j, len;
        
        // Create the checkbox buttons in an IE-friendly way...
        for(j=0,len=this.checkboxOptions.length; j<len; j++) {
            checkboxOption = this.checkboxOptions[j];
            checkboxValue = lang.isValue(checkboxOption.value) ?
                    checkboxOption.value : checkboxOption;

            checkboxId = this.getId() + "-chk" + j;
            this.getContainerEl().innerHTML += "<input type=\"checkbox\"" +
                    " id=\"" + checkboxId + "\"" + // Needed for label
                    " value=\"" + checkboxValue + "\" />";
            
            // Create the labels in an IE-friendly way
            elLabel = this.getContainerEl().appendChild(document.createElement("label"));
            elLabel.htmlFor = checkboxId;
            elLabel.innerHTML = lang.isValue(checkboxOption.label) ?
                    checkboxOption.label : checkboxOption;
        }
        
        // Store the reference to the checkbox elements
        var allCheckboxes = [];
        for(j=0; j<len; j++) {
            allCheckboxes[allCheckboxes.length] = this.getContainerEl().childNodes[j*2];
        }
        this.checkboxes = allCheckboxes;

        if(this.disableBtns) {
            this.handleDisabledBtns();
        }
    }
    else {
    }
}
58986
private void addCheckBox(final String internalValue, String labelMessageKey) {

        CmsCheckBox box = new CmsCheckBox(Messages.get().key(labelMessageKey));
        box.setInternalValue(internalValue);
        box.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

            public void onValueChange(ValueChangeEvent<Boolean> event) {

                if (handleChange()) {
                    m_controller.weeksChange(internalValue, event.getValue());
                }
            }
        });
        m_weekPanel.add(box);
        m_checkboxes.add(box);

    }
1145511
public void addGridHeading()
    {
        JPanel panel = new JPanel();
        panel.setOpaque(false);
        panel.setAlignmentX(LEFT_ALIGNMENT);
        panel.setAlignmentY(TOP_ALIGNMENT);
        this.add(panel);
        panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
        
        m_rgcompHeadings = new JLabel[this.getModel().getColumnCount()];
        for (int iColumnIndex = 0; iColumnIndex < m_rgcompHeadings.length; iColumnIndex++)
        {
            panel.add(m_rgcompHeadings[iColumnIndex] = new JLabel(this.getModel().getColumnName(iColumnIndex) + " "));
        }
    }
1191323
function (columns) {
        var i, j, k,
            totalCol = 0,
            flag = [];

        for (i = 0; i < columns[0].length; i++) {
            totalCol += columns[0][i].colspan || 1;
        }

        for (i = 0; i < columns.length; i++) {
            flag[i] = [];
            for (j = 0; j < totalCol; j++) {
                flag[i][j] = false;
            }
        }

        for (i = 0; i < columns.length; i++) {
            for (j = 0; j < columns[i].length; j++) {
                var r = columns[i][j],
                    rowspan = r.rowspan || 1,
                    colspan = r.colspan || 1,
                    index = $.inArray(false, flag[i]);

                if (colspan === 1) {
                    r.fieldIndex = index;
                    // when field is undefined, use index instead
                    if (typeof r.field === 'undefined') {
                        r.field = index;
                    }
                }

                for (k = 0; k < rowspan; k++) {
                    flag[i + k][index] = true;
                }
                for (k = 0; k < colspan; k++) {
                    flag[i][index + k] = true;
                }
            }
        }
    }
1186301
function checkbox(bind, el, param, value) {
  var attr = {type: 'checkbox', name: param.signal};
  if (value) attr.checked = true;
  var node = element('input', attr);

  el.appendChild(node);

  node.addEventListener('change', function() {
    bind.update(node.checked);
  });

  bind.elements = [node];
  bind.set = function(value) { node.checked = !!value || null; }
}
1117391
function() {
            var alreadyHasSelectAll = this.hasSelectAll();

            if (!alreadyHasSelectAll && this.options.includeSelectAllOption && this.options.multiple
                    && $('option', this.$select).length > this.options.includeSelectAllIfMoreThan) {

                // Check whether to add a divider after the select all.
                if (this.options.includeSelectAllDivider) {
                    this.$ul.prepend($(this.options.templates.divider));
                }

                var $li = $(this.options.templates.li);
                $('label', $li).addClass("checkbox");
                $('label', $li).append('<input type="checkbox" name="' + this.options.checkboxName + '" />');

                var $checkbox = $('input', $li);
                $checkbox.val(this.options.selectAllValue);

                $li.addClass("multiselect-item multiselect-all");
                $checkbox.parent().parent()
                    .addClass('multiselect-all');

                $('label', $li).append(" " + this.options.selectAllText);

                this.$ul.prepend($li);

                $checkbox.prop('checked', false);
            }
        }