Creates a PushButton with default(up), mouseover and mousedown states.
198548
public static PushButton newPushButton (Image defaultImage, Image overImage,
                                            Image downImage, ClickHandler onClick)
    {
        PushButton button = new PushButton(defaultImage, downImage);
        maybeAddClickHandler(button, onClick);
        button.getUpHoveringFace().setImage(overImage);
        return button;
    }
728407
function button(sAction) {
				var sText = rb && rb.getText("MSGBOX_" + sAction),
					oButton = new Button({
						id: sDialogId + "--btn-" + sAction,
						text: sText || sAction,
						press: function () {
							oResult = sAction;
							oDialog.close();
						}
					});
				if (sAction === oDefaultAction) {
					oDefaultButton = oButton;
				}
				return oButton;
			}
1268372
def create_toolbutton(entries, parent=None):
    
    btn = QtGui.QToolButton(parent)
    menu = QtGui.QMenu()
    actions = []

    for label, slot in entries:
        action = add_menu_action(menu, label, slot)
        actions.append(action)

    btn.setPopupMode(QtGui.QToolButton.MenuButtonPopup)
    btn.setDefaultAction(actions[0])
    btn.setMenu(menu)
    return btn, actions
1011781
private void iniButtons() {

        m_newButton = CmsToolBar.createButton(
            FontOpenCms.WAND,
            CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_ADD_ELEMENT_0));
        m_newButton.addClickListener(new ClickListener() {

            private static final long serialVersionUID = 1L;

            public void buttonClick(ClickEvent event) {

                openNewDialog();
            }
        });
        m_infoButton = new CmsInfoButton();
        Button csvButton = new Button(CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_EXPORT_ONLY_USER_0));
        csvButton.addClickListener(new ClickListener() {

            private static final long serialVersionUID = 5472430305539438757L;

            public void buttonClick(ClickEvent event) {

                boolean includeTechnicalFields = false;
                try {
                    OpenCms.getRoleManager().checkRole(m_cms, CmsRole.ADMINISTRATOR);
                    includeTechnicalFields = true;
                } catch (CmsRoleViolationException e) {
                    // ok
                }
                Window window = CmsBasicDialog.prepareWindow(DialogWidth.wide);
                CmsUserCsvExportDialog dialog = new CmsUserCsvExportDialog(
                    getFullUser(getVisibleUser()),
                    m_stateBean.getPath(),
                    m_stateBean.getType(),
                    getElementName(m_stateBean),
                    CmsVaadinUtils.isButtonPressed(getToggleButton(m_stateBean)),
                    window,
                    includeTechnicalFields);
                window.setContent(dialog);
                A_CmsUI.get().addWindow(window);

            }

        });
        m_infoButton.setAdditionalButton(csvButton);

        m_addElementButton = CmsToolBar.createButton(
            FontAwesome.PLUS,
            CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_ADD_USER_TO_GROUP_0));
        m_addElementButton.addClickListener(new ClickListener() {

            private static final long serialVersionUID = 1859694635385726953L;

            public void buttonClick(ClickEvent event) {

                openAddUserDialog();

            }
        });

        m_toggleButtonRole = CmsToolBar.createButton(
            FontOpenCms.USERS,
            CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_ROLES_TOGGLE_0));
        m_toggleButtonRole.addClickListener(new ClickListener() {

            private static final long serialVersionUID = 8265075332953321274L;

            public void buttonClick(ClickEvent event) {

                toggleTable(m_toggleButtonRole);

            }

        });

        m_toggleButtonUser = CmsToolBar.createButton(
            FontOpenCms.USERS,
            CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_USER_TOGGLE_0));
        m_toggleButtonUser.addClickListener(new ClickListener() {

            private static final long serialVersionUID = 8265075332953321274L;

            public void buttonClick(ClickEvent event) {

                toggleTable(m_toggleButtonUser);

            }

        });

        m_toggleButtonGroups = CmsToolBar.createButton(
            FontOpenCms.USERS,
            CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_GROUPS_TOGGLE_0));
        m_toggleButtonGroups.addClickListener(new ClickListener() {

            private static final long serialVersionUID = 8265075332953321274L;

            public void buttonClick(ClickEvent event) {

                toggleTable(m_toggleButtonGroups);

            }

        });

        m_uiContext.addToolbarButton(m_newButton);

        m_uiContext.addToolbarButton(m_addElementButton);
        m_uiContext.addToolbarButton(m_infoButton);
        m_uiContext.addToolbarButton(m_toggleButtonRole);
        m_uiContext.addToolbarButton(m_toggleButtonUser);
        m_uiContext.addToolbarButton(m_toggleButtonGroups);

        for (Button button : getAdditionalButtons()) {
            m_uiContext.addToolbarButton(button);
        }
        m_filter = CmsVaadinUtils.getOUComboBox(m_cms, m_baseOU, LOG);
        m_filter.setWidth("379px");
        m_infoLayout.addComponent(m_filter, 0);

        m_filterTable = new TextField();
        m_filterTable.setIcon(FontOpenCms.FILTER);
        m_filterTable.setInputPrompt(
            Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_FILTER_0));
        m_filterTable.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
        //            m_filterTable.setWidth("200px");
        m_filterTable.addTextChangeListener(new TextChangeListener() {

            private static final long serialVersionUID = 1L;

            public void textChange(TextChangeEvent event) {

                filterTable(event.getText());
            }
        });
        m_filterTable.setWidth("200px");
        m_infoLayout.addComponent(m_filterTable);
        m_infoLayout.addStyleName("o-many-elements");
        m_filter.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            public void valueChange(ValueChangeEvent event) {

                if ((m_stateBean.getType() != null) & !m_doNotChange) {
                    update((String)event.getProperty().getValue(), CmsOuTreeType.OU, null);
                } else {
                    //
                }
            }
        });
        if (!m_ouHandler.isOUManagable(m_stateBean.getPath())) {
            boolean change = m_doNotChange;
            m_doNotChange = false;
            m_filter.select(m_filter.getItemIds().iterator().next());
            m_doNotChange = change;
        }
    }
693536
function Button(props) {
  let {
    label,
    href,
    type,
    size,
    children,
    className,
    primary,
    secondary,
    outline,
    flat,
    ...rest
  } = props
  /* Add className */
  const classes = cx(
    buttonClassName,
    {
      [`${buttonClassName}-primary`]: primary,
      [`${buttonClassName}-secondary`]: secondary,
      [`${buttonClassName}-outline`]: outline,
      [`${buttonClassName}-flat`]: flat,
      [`${buttonClassName}-${type}`]: type,
    },
    `${buttonClassName}-${size}`,
    className
  )

  const tagName = href ? 'a' : 'button'

  return React.createElement(
    tagName,
    {
      className: classes,
      href,
      ...rest,
    },
    children || label
  )
}
59098
private void createButtons() {
        iconButton = new NoFocusButton("InternalFrameTitlePane.iconifyButtonAccessibleName");
        iconButton.addActionListener(iconifyAction);

        if (iconButtonToolTip != null && iconButtonToolTip.length() != 0) {
            iconButton.setToolTipText(iconButtonToolTip);
        }

        maxButton = new NoFocusButton("InternalFrameTitlePane.maximizeButtonAccessibleName");
        maxButton.addActionListener(maximizeAction);

        closeButton = new NoFocusButton("InternalFrameTitlePane.closeButtonAccessibleName");
        closeButton.addActionListener(closeAction);

        if (closeButtonToolTip != null && closeButtonToolTip.length() != 0) {
            closeButton.setToolTipText(closeButtonToolTip);
        }

        setButtonTooltips();
    }
912039
function (e, keyCode, mouseButton) {

        keyCode = keyCode || e.keyCode || e.button;
        var action = keyBindings[keyCode];

        // publish a message for keydown event
        me.event.publish(me.event.KEYDOWN, [
            action,
            keyCode,
            action ? !keyLocked[action] : true
        ]);

        if (action) {
            if (!keyLocked[action]) {
                var trigger = (typeof mouseButton !== "undefined") ? mouseButton : keyCode;
                if (!keyRefs[action][trigger]) {
                    keyStatus[action]++;
                    keyRefs[action][trigger] = true;
                }
            }
            // prevent event propagation
            if (preventDefaultForKeys[keyCode] && (typeof e.preventDefault === "function")) {
                // "fake" events generated through triggerKeyEvent do not have a preventDefault fn
                return e.preventDefault();
            }
            else {
                return true;
            }
        }

        return true;
    }
435982
public void configureButton(AbstractButton button) {
        Assert.notNull(button);
        button.setText(this.text);
        button.setMnemonic(getMnemonic());
        button.setDisplayedMnemonicIndex(getMnemonicIndex());
    }
436462
function(){
      $('#priority_buttons').html('');
      var _i, pb, all_pbs = [ ];
      for (_i = 3; _i > 0; _i --){
        pb = new todo.priority_button(_i);
        $('#priority_buttons').append(pb.button);
        all_pbs.push(pb);
        if (_i == 3){
          pb.select(); // Select lower priority by default
        }
      }
      todo.all_pbs = all_pbs;
    }
37053
function _setupGoLiveButton() {
        if (!_$btnGoLive) {
            _$btnGoLive = $("#toolbar-go-live");
            _$btnGoLive.click(function onGoLive() {
                _handleGoLiveCommand();
            });
        }
        LiveDevImpl.on("statusChange", function statusChange(event, status, reason) {
            // status starts at -1 (error), so add one when looking up name and style
            // See the comments at the top of LiveDevelopment.js for details on the
            // various status codes.
            _setLabel(_$btnGoLive, null, _status[status + 1].style, _status[status + 1].tooltip);
            _showStatusChangeReason(reason);
            if (config.autoconnect) {
                window.sessionStorage.setItem("live.enabled", status === 3);
            }
        });

        // Initialize tooltip for 'not connected' state
        _setLabel(_$btnGoLive, null, _status[1].style, _status[1].tooltip);
    }
933699
def on_click(self, button, button_state, cursor_x, cursor_y):
        
        self.isdragging = False
        if button == glut.GLUT_LEFT_BUTTON and button_state == glut.GLUT_UP:
            # Left button released
            self.lastrot = copy.copy(self.thisrot)  # Set Last Static Rotation To Last Dynamic One
        elif button == glut.GLUT_LEFT_BUTTON and button_state == glut.GLUT_DOWN:
            # Left button clicked down
            self.lastrot = copy.copy(self.thisrot)  # Set Last Static Rotation To Last Dynamic One
            self.isdragging = True  # Prepare For Dragging
            mouse_pt = arcball.Point2fT(cursor_x, cursor_y)
            self.arcball.click(mouse_pt)  # Update Start Vector And Prepare For Dragging
        elif button == glut.GLUT_RIGHT_BUTTON and button_state == glut.GLUT_DOWN:
            # If a mouse click location was requested, return it to caller
            if hasattr(self, 'event_port'):
                self.mouseclick_port = self.event_port
                del self.event_port
            if hasattr(self, 'mouseclick_port'):
                self.send_mouseclick_to_caller(cursor_x, cursor_y)
        elif button == glut.GLUT_MIDDLE_BUTTON and button_state == glut.GLUT_DOWN:
            # If a mouse click location was requested, return it to caller
            if hasattr(self, 'event_port'):
                self.mouseclick_port = self.event_port
                del self.event_port
            if hasattr(self, 'mouseclick_port'):
                self.send_mouseclick_to_caller(cursor_x, cursor_y, button='middle')
        glut.glutPostRedisplay()
1112548
function createActionButton (title, callback, appendTo) {
    appendTo = appendTo || 'buttons';
    var buttons = document.getElementById(appendTo);
    var div = document.createElement('div');
    var button = document.createElement('a');
    button.textContent = title;
    button.onclick = function (e) {
        e.preventDefault();
        callback();
    };
    button.classList.add('topcoat-button');
    div.appendChild(button);
    buttons.appendChild(div);
}
302979
function( start, end, duration, element, callback ) {
			createEventAtPoint("mousedown", start, element);
			startMove(start, end, duration, element, function() {
				createEventAtPoint("mouseup", end, element);
				callback();
			})
		}
330784
public static PushButton newImageButton (String style, ClickHandler onClick)
    {
        PushButton button = new PushButton();
        maybeAddClickHandler(button, onClick);
        return setStyleNames(button, style, "actionLabel");
    }
294870
def create_toolbutton(parent, text=None, shortcut=None, icon=None, tip=None,
                      toggled=None, triggered=None,
                      autoraise=True, text_beside_icon=False):
    """"""
    button = QToolButton(parent)
    if text is not None:
        button.setText(text)
    if icon is not None:
        if is_text_string(icon):
            icon = get_icon(icon)
        button.setIcon(icon)
    if text is not None or tip is not None:
        button.setToolTip(text if tip is None else tip)
    if text_beside_icon:
        button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
    button.setAutoRaise(autoraise)
    if triggered is not None:
        button.clicked.connect(triggered)
    if toggled is not None:
        button.toggled.connect(toggled)
        button.setCheckable(True)
    if shortcut is not None:
        button.setShortcut(shortcut)
    return button
686202
function Button(options) {

	this.__proto__ = new Control();

	this.init = function(options) {
		this.type = options.type = 'Button';
		this.parent = options.parent;
		this.defaults = {
			x:48, y:48,
			w:120,
			h: (options.subtype == 'circle') ? 120 : 48,
			value: 0,
			text: '',
			script: undefined,
			onload: undefined,
			fill:this.parent.fill,
			stroke: this.parent.stroke,
			'stroke-width': this.parent.control_stroke,
			fontsize: this.parent.fontsize,
			repeat: 0,
			running: 0,
			corner: this.parent.button_corner,
			subtype: undefined,
			group: undefined,
			row: undefined,
			col: undefined,
			autorun: undefined,
			highlighttrue: undefined,
			source: undefined,
			refresh: 0,

//			r: 60,
			noreadout: undefined,
			path: undefined,
			scale: 1
		};
		this.setoptions(options);
		this.fill_highlight = this.parent.lighter(this.stroke);

		this.render();
		return this;
	};

/*
	this.indragzone = function(e) {
		if (this.subtype == 'circle') {
			if (e.clientX > (this.x + this.w/2 - this.parent.grid)) return true;
			if (e.clientY > (this.y + this.h/2 - this.parent.grid)) return true;
			return false
		}
		return this.__proto__.indragzone.call(this, e);
	};
*/

	this.layout = function() {
		if (this.subtype == 'circle') {
			this.cx = this.x + this.w/2;
			this.cy = this.y + this.h/2;
		}
	};

	this.render = function() {
		this.layout();

		if (this.subtype == 'circle') {
			this.elt = this.parent.paper.ellipse(this.cx, this.cy, this.w/2, this.h/2);
			this.label = this.parent.paper.text(this.cx, this.cy, this.text);
			if (!this.noreadout) this.readout = this.parent.paper.text(this.cx, this.y + this.h + this.fontsize, '');
		}
		else if (this.subtype == 'path') {	// path button
			var translation = ['t', this.x, ',', this.y, 's', this.scale].join('');
			this.elt = this.parent.paper.path(this.path)
				.transform(translation);

			var bbox = this.elt.getBBox();
			this.elt.toFront();

			this.w = bbox.width;
			this.h = bbox.height;
			var labelx = this.x;
			var labely = bbox.y + this.h + this.fontsize;

			this.label = this.parent.paper.text(labelx, labely, this.text);
			if (!this.noreadout) this.readout = this.parent.paper.text(this.x, this.y, '');
		}
		else {		// default rectangular button
			this.elt = this.parent.paper.rect(this.x, this.y, this.w, this.h, this.corner);
			this.label = this.parent.paper.text(this.x + (this.w/2), this.y + this.h/2, this.text);
			if (!this.noreadout) this.readout = this.parent.paper.text(this.x + (this.w/2), this.y + this.h + this.fontsize, '');
		}

		this.elt.attr({fill:this.fill, stroke:this.stroke, 'stroke-width': this['stroke-width']});
		this.elts.push(this.elt);

		if (this.label) this.label.attr({fill:this.stroke, stroke:this.stroke, 'font-size': this.fontsize});
		this.textelts.push(this.label);

		if (this.readout) {
			this.readout.attr({fill:this.stroke, stroke:this.stroke, 'font-size': this.fontsize-2});
			this.textelts.push(this.readout);
		}
		this.sethandlers();
	};

	this.move = function(x, y) {
		//console.log('move:', x, y, this);
		this.x = x;
		this.y = y;
		this.layout();

		if (this.subtype == 'circle') {
			this.elt.attr({cx:this.cx, cy:this.cy, rx: this.w/2, ry:this.h/2});
			this.label.attr({x:this.cx, y:this.cy});
			if (this.readout) this.readout.attr({x:this.cx, y:this.y + this.h + this.fontsize});
		}
		else if (this.subtype == 'path') {
			this.bbox = this.elt.getBBox();
			this.elt.transform(['t', x, ',', y, 's', this.scale].join(''));
			var labely = this.bbox.y + this.h + this.fontsize;
			this.label.attr({x:x, y:labely});
			if (this.readout) this.readout.attr({x:x, y:y});
		}
		else {
			this.elt.attr({x:x, y:y, width:this.w, height:this.h});
			this.label.attr({x:x + this.w/2, y:y + this.h/2});
			if (this.readout) this.readout.attr({x:x + this.w/2, y:y + this.h + this.fontsize});
		}
	};

	this.handleClick = function(e) {
		// handle group side effects like radio buttons and bitwise highlighting
		if (this.group) {
			var group = this.parent.controls[this.group];
			if (group.radio) {
				group.selected = this.text;
				group.handleClick(e);
				return;
			}
		}
		this.__proto__.handleClick.call(this, e);
	};

	this.setValue = function(value) {
/*
		// handle group side effects like radio buttons and bitwise highlighting
		if (this.group) {
			this.parent.controls[this.group].setValue(value);
			return;
		}
*/
		this.value = value;
		if (this.readout) this.readout.attr({text: '' + this.value});
		if (this.highlighttrue) {
			if (typeof this.value == 'string') this.value = parseInt(this.value, 10);
			if (this.value) this.highlight();
			else this.dehighlight();
		}
		var update = {id: this.id, value: this.value};
		this.fire('update', update);
	};

/*
	this.exec = function() {
		//console.log('Button exec!');
		// handle radio button side effects
		if (this.group && this.parent.controls[this.group].radio) {
			this.parent.controls[this.group].setValue(this.text);
		}
		this.__proto__.exec.call(this);
	};
*/

	return this.init(options || {});
}
297922
def create_button(self, widget):
        
        btn = QtGui.QToolButton(self)
        btn.setIconSize(QtCore.QSize(self._iconw, self._iconh))
        self.update_button(btn, widget)
        return btn