## class fltk::MultiBrowser

### Class Hierarchy

    fltk::Browser
       |
       +----fltk::MultiBrowser

### Include Files

    #include <fltk/MultiBrowser.h>

### Description

The `fltk::MultiBrowser` class is a subclass of `fltk::Browser` which lets the user select any set of the lines. Clicking on an item selects only that one. Ctrl+click toggles items on/off. Shift+drag (or shift+arrows) will extend selections. Normally the callback is done when any item changes it's state, but you can change this with `when()`.

See `fltk::Browser` for methods to control the display and "current item", and `fltk::Menu` for methods to add and remove lines from the browser.

The methods on `fltk::Browser` for controlling the "value" control item with the keyboard focus in a multi-browser. You must use the "select" methods described here to change what items are turned on.

### Methods

- fltk::MultiBrowser
- set_item_selected
- select_only_this
- deselect
- select
- selected

#### fltk::MultiBrowser::MultiBrowser(int x, int y, int w, int h, const char *label = 0)

Creates a new, empty `fltk::MultiBrowser`.

#### bool set_item_selected(bool value = true, int do_callback = 0);

Turn the `fltk::VALUE` flag on or off in the current item (use `goto_index()` to set the current item before calling this).

If do_callback has some bits that are also in `when()` then the callback is done for each item that changes selected state.

#### bool select_only_this(int do_callback = 0);

Make the current item be the only selected one. If do_callback has some bits that are also in `when()` then the callback is done for each item that changes selected state.

If you did `goto_index(-1)` before this it does `deselect()`.

#### bool deselect(int do_callback = 0);

Make no items be selected. If do_callback has some bits that are also in `when()` then the callback is done for each item that changes selected state.

#### bool select(int line, bool value = true);

Same as `goto_index(line),set_item_selected(value);`, to change the selected state of an item in a non-hierarchial fltk::MultiBrowser. If line is negative nothing is selected.

#### bool selected(int line);

Returns the value of the `goto_index(line)` item.