If multi-column menuitems then try going to a left item (prev column same row)
 NOTE It should only come here if items are open, otherwise row and col will be blank.
 NOTE active_index nil means no items open
771418
def select_left_item
      return :UNHANDLED if @items.nil? or @items.empty? or @active_index.nil?
      index = nil
      crow = @items[@active_index].row 
      ccol = @items[@active_index].col 
      @items.each_with_index { |e, i| index = i if e.row == crow && e.col < ccol }
      if index
        select_item index
      else
        return :UNHANDLED
      end
    end
46433
def selected_items
      ((m = marked_items).any? ? m : Array(current_item)).reject {|i| %w(. ..).include? i.name}
    end
188955
def OnItemSelected(self, event):
        """"""

        value = event.m_itemIndex
        self.startIndex = value

        self.switching = True
        post_command_event(self, self.GridActionTableSwitchMsg, newtable=value)
        self.switching = False

        event.Skip()
1241805
function(index, event) {
        this.index = index;

        var rows = this.element.find('li');

        rows
            .removeClass('is-active')
            .find('a')
                .aria('selected', false);

        // Select
        if (index >= 0) {
            if (this.items[index]) {
                var item = this.items[index];

                rows.eq(index)
                    .addClass('is-active')
                    .find('a')
                        .aria('selected', true);

                this.input.val(item.title);

                this.fireEvent(event || 'select', [item, index]);
            }

        // Reset
        } else {
            this.input.val(this.term);

            this.fireEvent('reset');
        }
    }
121992
def _on_item_clicked(self, item):
        
        if item:
            name = item.data(0, QtCore.Qt.UserRole)
            if name:
                go = name.block.blockNumber()
                helper = TextHelper(self._editor)
                if helper.current_line_nbr() != go:
                    helper.goto_line(go, column=name.column)
                self._editor.setFocus()
1234541
def get_value(self, column=0, row=0):
        
        x = self._widget.item(row, column)

        if x==None: return x
        else:       return str(self._widget.item(row,column).text())
1228900
function () {
            var carousel = this,
                isVertical = carousel.get("isVertical"),
                cols       = carousel._cols,
                item     = carousel._firstItem - carousel.get("numVisible");

            if (item < 0) { // only account for multi-row when scrolling backwards from item 0
                if (cols) {
                    item = carousel._firstItem - cols;
                }
            }

            if (carousel.get("selectOnScroll")) {
                carousel._selectedItem = carousel._getSelectedItem(item);
            }

            carousel.scrollTo(item);
        }
288935
void onItemClick(MouseEvents.ClickEvent event, Object itemId, Object propertyId) {

        if (!event.isCtrlKey() && !event.isShiftKey()) {

            changeValueIfNotMultiSelect(itemId);

            // don't interfere with multi-selection using control key
            if (event.getButton().equals(MouseButton.RIGHT) || (propertyId == null)) {
                m_menu.setEntries(getMenuEntries(), getSearchIndexNames());
                m_menu.openForTable(event, itemId, propertyId, this);
            } else if (event.getButton().equals(MouseButton.LEFT) && TableProperty.Name.equals(propertyId)) {
                showSourcesWindow(((I_CmsSearchIndex)((Set<?>)getValue()).iterator().next()).getName());
            }
        }
    }
587834
def on_tblFunctions1_itemSelectionChanged(self):
        
        # Clear the selection on the 2nd matrix
        self.parent.step_fc_functions2.tblFunctions2.clearContents()
        self.parent.step_fc_functions2.lblAvailableFunctions2.clear()
        self.parent.pbnNext.setEnabled(True)

        # Put a dot to the selected cell - note there is no way
        # to center an icon without using a custom ItemDelegate
        selection = self.tblFunctions1.selectedItems()
        selItem = (len(selection) == 1) and selection[0] or None
        for row in range(self.tblFunctions1.rowCount()):
            for column in range(self.tblFunctions1.columnCount()):
                item = self.tblFunctions1.item(row, column)
                item.setText((item == selItem) and '•' or '')
772062
public boolean isActiveInMenuTree(MenuEntry activeMenu, MenuEntry actualEntry) {
		return actualEntry.flattened().anyMatch(
				entry -> checkForNull(entry, activeMenu) ? entry.getName().equals(activeMenu.getName()): false);
	}
1249181
def on_left_click(self, event, grid, choices):
        
        color = self.grid.GetCellBackgroundColour(event.GetRow(), event.GetCol())
        # allow user to cherry-pick cells for editing.  gets selection of meta key for mac, ctrl key for pc
        if event.ControlDown() or event.MetaDown():
            row, col = event.GetRow(), event.GetCol()
            if (row, col) not in self.dispersed_selection:
                self.dispersed_selection.append((row, col))
                self.grid.SetCellBackgroundColour(row, col, 'light blue')
            else:
                self.dispersed_selection.remove((row, col))
                self.grid.SetCellBackgroundColour(row, col, color)# 'white'
            self.grid.ForceRefresh()
            return
        if event.ShiftDown(): # allow user to highlight multiple consecutive cells in a column
            previous_col = self.grid.GetGridCursorCol()
            previous_row = self.grid.GetGridCursorRow()
            col = event.GetCol()
            row = event.GetRow()
            if col != previous_col:
                return
            else:
                if row > previous_row:
                    row_range = list(range(previous_row, row+1))
                else:
                    row_range = list(range(row, previous_row+1))
            for r in row_range:
                self.grid.SetCellBackgroundColour(r, col, 'light blue')
                self.selection.append((r, col))
            self.grid.ForceRefresh()
            return

        selection = False

        if self.dispersed_selection:
            is_dispersed = True
            selection = self.dispersed_selection

        if self.selection:
            is_dispersed = False
            selection = self.selection

        try:
            col = event.GetCol()
            row = event.GetRow()
        except AttributeError:
            row, col = selection[0][0], selection[0][1]

        self.grid.SetGridCursor(row, col)

        if col in list(choices.keys()): # column should have a pop-up menu
            menu = wx.Menu()
            two_tiered = choices[col][1]
            choices = choices[col][0]
            if not two_tiered: # menu is one tiered
                if 'CLEAR cell of all values' not in choices:
                    choices.insert(0, 'CLEAR cell of all values')
                for choice in choices:
                    if not choice:
                        choice = " " # prevents error if choice is an empty string
                    menuitem = menu.Append(wx.ID_ANY, str(choice))
                    self.window.Bind(wx.EVT_MENU, lambda event: self.on_select_menuitem(event, grid, row, col, selection), menuitem)
                self.show_menu(event, menu)
            else: # menu is two_tiered
                clear = menu.Append(-1, 'CLEAR cell of all values')
                self.window.Bind(wx.EVT_MENU, lambda event: self.on_select_menuitem(event, grid, row, col, selection), clear)
                for choice in sorted(choices.items()):
                    submenu = wx.Menu()
                    for item in choice[1]:
                        menuitem = submenu.Append(-1, str(item))
                        self.window.Bind(wx.EVT_MENU, lambda event: self.on_select_menuitem(event, grid, row, col, selection), menuitem)
                    menu.Append(-1, choice[0], submenu)
                self.show_menu(event, menu)

        if selection:
            # re-whiten the cells that were previously highlighted
            for row, col in selection:
                self.grid.SetCellBackgroundColour(row, col, self.col_color)
            self.dispersed_selection = []
            self.selection = []
            self.grid.ForceRefresh()
1002076
function (index) {
            var carousel = this;

            if (index < 0 || index >= carousel.get("numItems")) {
                YAHOO.log("Index out of bounds", "error", WidgetName);
                return null;
            }

            if (carousel._itemsTable.numItems > index) {
                if (!JS.isUndefined(carousel._itemsTable.items[index])) {
                    return carousel._itemsTable.items[index];
                }
            }

            return null;
        }
1319532
def ColumnItem(name='', key=None, **kwargs):
    ''
    return Column(name,
            expr=key if key is not None else name,
            getter=lambda col,row: getitemdef(row, col.expr),
            setter=lambda col,row,val: setitem(row, col.expr, val),
            **kwargs)
706721
def flags(self, index):
        
        activeFlags = (Qt.ItemIsEnabled | Qt.ItemIsSelectable |
                       Qt.ItemIsUserCheckable)

        item = self.item(index)
        column = index.column()

        if column > 0 and not item.childCount():
            activeFlags = activeFlags | Qt.ItemIsEditable

        return activeFlags
646672
function findItem( path, items ) {
  var result = null;
  items.forEach( function ( item ) {
    if (!result && item instanceof MenuItem && item.paths.filter( function( value ) {
        return value === path;
      } ).length > 0)
      result = item;
    if (!result && item instanceof MenuNode) {
      var child = findItem( path, item.children );
      if (child)
        result = child;
    }
  } );
  return result;
}
667395
def set_menu index
      #$log.debug "set meu: #{@active_index} #{index}" 
      # first leave the existing window
      menu = @items[@active_index]
      menu.on_leave # hide its window, if open
      # now move to given menu
      @active_index = index
      menu = @items[@active_index]
      menu.on_enter #display window, if previous was displayed
      # move cursor to selected menu option on top, not inside list
      @window.wmove menu.row, menu.col
#     menu.show
#     menu.window.wrefresh # XXX we need this
    end
341866
def ls
      fetch_items_from_filesystem_or_zip
      sort_items_according_to_current_direction

      @current_page ||= 0
      draw_items
      move_cursor (current_row ? [current_row, items.size - 1].min : nil)

      draw_marked_items
      draw_total_items
      true
    end