Buttons trigger actions when clicked
775683
function IconButton(props) {
  let { name, className, ...rest } = props
  let classes = cx(className, iconButtonClassName)
  return (
    <Button className={classes} {...rest}>
      <Icon name={name} />
    </Button>
  )
}
522092
function addClickHandler() {
  $('.transaction-list-item').click(function() {
    var index = $('.transaction-list-item').index(this);
    dataView.selectedTransaction = dataView.transactions[index];
    render();
  });
}
144657
def on_click(self, event):
        
        index = event["index"]
        button = event["button"]

        if index not in self._control_states.keys():
            if button == self.button_toggle:
                index = "toggle"
            elif button == self.button_stop:
                index = "stop"
            elif button == self.button_next:
                index = "next"
            elif button == self.button_previous:
                index = "previous"
            else:
                return
        elif button != 1:
            return

        try:
            control_state = self._control_states.get(index)
            if self._player and self._get_button_state(control_state):
                getattr(self._player, self._control_states[index]["action"])()
        except GError as err:
            self.py3.log(str(err).split(":", 1)[-1])
175622
def __emulate_buttons(self, changed_buttons, timeval=None):
        """"""
        events = []
        for button in changed_buttons:
            code, value, ev_type = self.__map_button(button)
            event = self.create_event_object(
                ev_type,
                code,
                value,
                timeval=timeval)
            events.append(event)
        return events
985585
def toggle(self, event):
        """"""

        if self.state < len(self.bitmap_list) - 1:
            self.state += 1
        else:
            self.state = 0

        self.SetBitmapLabel(self.bitmap_list[self.state])

        try:
            event.Skip()
        except AttributeError:
            pass

        """For compatibility with toggle buttons"""
        setattr(self, "GetToolState", lambda x: self.state)
1281608
public void onClick(MenuItemClickEvent event) {
		if (feature != null && feature.isSelected()) {
			SC.confirm(
					I18nProvider.getGlobal().confirmDeleteFeature(feature.getLabel(), feature.getLayer().getLabel()),
					new BooleanCallback() {

						public void execute(Boolean value) {
							if (value) {
								feature.getLayer().deselectFeature(feature);
								mapWidget.getMapModel().getFeatureEditor()
										.startEditing(new Feature[] { feature }, null);
								SaveEditingAction action = new SaveEditingAction(mapWidget, controller);
								action.onClick(null);
							}
						}
					});
		}
	}
465545
def toggle_actions(actions, enable):
    """"""
    if actions is not None:
        for action in actions:
            if action is not None:
                action.setEnabled(enable)
970002
public void onClick(MenuItemClickEvent event) {
		if (controller.isSnappingActive()) {
			controller.deactivateSnapping();
		} else if (layer != null) {
			controller.activateSnapping(layer.getLayerInfo().getSnappingRules(), SnapMode.ALL_GEOMETRIES_EQUAL);
		}
	}
254199
function (button, cb) {
            var lastPosition = this._lastMousePosition;
            this._sendEvent('mousedown', lastPosition.x, lastPosition.y, this.BUTTONS[button]);
            this._callCallback(cb);
        }
673406
def trigger(self, event, *args):
        """"""
        for handler in self._event_handlers[event]:
            handler(*args)
271008
function(selectValues, triggerOnChange) {
            if(!$.isArray(selectValues)) {
                selectValues = [selectValues];
            }

            for (var i = 0; i < selectValues.length; i++) {
                var value = selectValues[i];

                if (value === null || value === undefined) {
                    continue;
                }

                var $option = this.getOptionByValue(value);
                var $checkbox = this.getInputByValue(value);

                if($option === undefined || $checkbox === undefined) {
                    continue;
                }

                if (!this.options.multiple) {
                    this.deselectAll(false);
                }

                if (this.options.selectedClass) {
                    $checkbox.closest('li')
                        .addClass(this.options.selectedClass);
                }

                $checkbox.prop('checked', true);
                $option.prop('selected', true);

                if (triggerOnChange) {
                    this.options.onChange($option, true);
                }
            }

            this.updateButtonText();
            this.updateSelectAll();
        }
1019901
@UiHandler("m_okButton")
    protected void onOk(ClickEvent event) {

        if (!((m_croppingParam.getTargetWidth() > 0) && (m_croppingParam.getTargetHeight() > 0))) {
            if (m_croppingParam.getTargetWidth() > 0) {
                m_croppingParam.setTargetHeight(
                    (int)Math.floor(
                        (1.00 * m_croppingParam.getTargetWidth() * m_croppingParam.getCropHeight())
                            / m_croppingParam.getCropWidth()));
            } else if (m_croppingParam.getTargetHeight() > 0) {
                m_croppingParam.setTargetWidth(
                    (int)Math.floor(
                        (1.00 * m_croppingParam.getTargetHeight() * m_croppingParam.getCropWidth())
                            / m_croppingParam.getCropHeight()));
            } else {
                m_croppingParam.setTargetHeight(m_croppingParam.getCropHeight());
                m_croppingParam.setTargetWidth(m_croppingParam.getCropWidth());
            }
        }
        ValueChangeEvent.fire(this, m_croppingParam);
        hide();
    }
144859
function onTriggerClick(e, noFocus) {
    toggleSubmenu(elements.trigger, (_, done) => {
      Classlist(elements.trigger).toggle(ACTIVE_CLASS);
      const wasActive = Classlist(elements.menu).contains(ACTIVE_CLASS);
      const first = wasActive ? ACTIVE_CLASS : 'dqpl-show';
      const second = first === ACTIVE_CLASS ? 'dqpl-show' : ACTIVE_CLASS;

      Classlist(elements.menu).toggle(first);

      if (elements.scrim) {
        Classlist(elements.scrim).toggle('dqpl-scrim-show');
      }

      setTimeout(() => {
        Classlist(elements.menu).toggle(second);
        if (elements.scrim) { Classlist(elements.scrim).toggle('dqpl-scrim-fade-in'); }
        setTimeout(() => done(noFocus));
      }, 100);
    });
  }
344083
function() {
      inputEx.Form.superclass.enable.call(this);
      
      for (var i = 0 ; i < this.buttons.length ; i++) {
 	      this.buttons[i].enable();
      }
   }
1290310
function () {
    var buttonState;
    var controller = this.controller;
    var id;

    if (!controller) { return; }

    // Check every button.
    for (id = 0; id < controller.buttons.length; ++id) {
      // Initialize button state.
      if (!this.buttonStates[id]) {
        this.buttonStates[id] = {pressed: false, touched: false, value: 0};
      }
      if (!this.buttonEventDetails[id]) {
        this.buttonEventDetails[id] = {id: id, state: this.buttonStates[id]};
      }

      buttonState = controller.buttons[id];
      this.handleButton(id, buttonState);
    }
    // Check axes.
    this.handleAxes();
  }
832852
private void addActivationHandler() {

        if (m_activationHandlerRegistration == null) {
            m_activationHandlerRegistration = addMouseDownHandler(new MouseDownHandler() {

                public void onMouseDown(MouseDownEvent event) {

                    // only act on click if not inside the button bar
                    if (!m_buttonBar.getElement().isOrHasChild((Node)event.getNativeEvent().getEventTarget().cast())) {
                        activateWidget();
                    }
                }
            });
        }
    }
380212
def on_button_press(self, event):
        
        if not event.get_button()[1] == 1:  # left mouse button
            return False
        view = self.view

        item, handle = HandleFinder(view.hovered_item, view).get_handle_at_point((event.x, event.y))

        # Handle must be the end handle of a connection
        if not handle or not isinstance(item, ConnectionView) or handle not in item.end_handles():
            return False

        if handle is item.from_handle():
            self._start_port_v = item.from_port
        else:
            self._start_port_v = item.to_port

        self._parent_state_v = item.parent
        self._end_handle = handle
        if isinstance(item, TransitionView):
            self._is_transition = True
        self._connection_v = item

        return True