Function manipulates with entries and buttons.
501965
def _check_box_toggled(self, widget, data=None):
        
        active = widget.get_active()
        arg_name = data

        if 'entry' in self.args[arg_name]:
            self.args[arg_name]['entry'].set_sensitive(active)
        if 'browse_btn' in self.args[arg_name]:
            self.args[arg_name]['browse_btn'].set_sensitive(active)

        self.path_window.show_all()
1178495
function ( oSettings, fnCallbackDraw )
			{
				if ( !oSettings.aanFeatures.p )
				{
					return;
				}
				
				var iPageCount = DataTable.ext.oPagination.iFullNumbersShowPages;
				var iPageCountHalf = Math.floor(iPageCount / 2);
				var iPages = Math.ceil((oSettings.fnRecordsDisplay()) / oSettings._iDisplayLength);
				var iCurrentPage = Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength) + 1;
				var sList = "";
				var iStartButton, iEndButton, i, iLen;
				var oClasses = oSettings.oClasses;
				var anButtons, anStatic, nPaginateList;
				var an = oSettings.aanFeatures.p;
				var fnBind = function (j) {
					oSettings.oApi._fnBindAction( this, {"page": j+iStartButton-1}, function(e) {
						/* Use the information in the element to jump to the required page */
						oSettings.oApi._fnPageChange( oSettings, e.data.page );
						fnCallbackDraw( oSettings );
						e.preventDefault();
					} );
				};
				
				/* Pages calculation */
				if ( oSettings._iDisplayLength === -1 )
				{
					iStartButton = 1;
					iEndButton = 1;
					iCurrentPage = 1;
				}
				else if (iPages < iPageCount)
				{
					iStartButton = 1;
					iEndButton = iPages;
				}
				else if (iCurrentPage <= iPageCountHalf)
				{
					iStartButton = 1;
					iEndButton = iPageCount;
				}
				else if (iCurrentPage >= (iPages - iPageCountHalf))
				{
					iStartButton = iPages - iPageCount + 1;
					iEndButton = iPages;
				}
				else
				{
					iStartButton = iCurrentPage - Math.ceil(iPageCount / 2) + 1;
					iEndButton = iStartButton + iPageCount - 1;
				}
	
				
				/* Build the dynamic list */
				for ( i=iStartButton ; i<=iEndButton ; i++ )
				{
					sList += (iCurrentPage !== i) ?
						'<a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+'">'+oSettings.fnFormatNumber(i)+'</a>' :
						'<a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButtonActive+'">'+oSettings.fnFormatNumber(i)+'</a>';
				}
				
				/* Loop over each instance of the pager */
				for ( i=0, iLen=an.length ; i<iLen ; i++ )
				{
					if ( an[i].childNodes.length === 0 )
					{
						continue;
					}
					
					/* Build up the dynamic list forst - html and listeners */
					$('span:eq(0)', an[i])
						.html( sList )
						.children('a').each( fnBind );
					
					/* Update the premanent botton's classes */
					anButtons = an[i].getElementsByTagName('a');
					anStatic = [
						anButtons[0], anButtons[1], 
						anButtons[anButtons.length-2], anButtons[anButtons.length-1]
					];
	
					$(anStatic).removeClass( oClasses.sPageButton+" "+oClasses.sPageButtonActive+" "+oClasses.sPageButtonStaticDisabled );
					$([anStatic[0], anStatic[1]]).addClass( 
						(iCurrentPage==1) ?
							oClasses.sPageButtonStaticDisabled :
							oClasses.sPageButton
					);
					$([anStatic[2], anStatic[3]]).addClass(
						(iPages===0 || iCurrentPage===iPages || oSettings._iDisplayLength===-1) ?
							oClasses.sPageButtonStaticDisabled :
							oClasses.sPageButton
					);
				}
			}
125918
function(event, context, callback, selector) {
        var options = this.options;

        // Replace tokens
        if (event === '{mode}') {
            event = options.mode;
        }

        if (selector === '{selector}') {
            selector = this.nodes ? this.nodes.selector : '';
        }

        // Find and bind the function
        if ($.type(callback) === 'string') {
            callback = this[callback].bind(this);
        }

        this.__events.push([event, context, callback, selector]);
    }
657227
function (event, fn) {
		this._events = this._events || {};
		var e = this._events[event];
		if (e) {
			for (var i = 0, l = e.length; i < l; i++) {
				if (e[i][0] === fn) {
					e.splice(i, 1);
					i--;
					l--;
				}
			}
		}
	}
748469
function makeButton(classes, content, selected, size, color, inlineType, icon, inner, toggle,
  func, useCapture, listners) {
  let workClasses = ["btn"];

  switch (size) {
    case "extra-small":
      workClasses.push("btn-xs");
      break;
    case "small":
      workClasses.push("btn-sm");
      break;
    case "large":
      workClasses.push("btn-lg");
      break;
    default:
  }

  switch (color) {
    case "primary":
      workClasses.push("btn-primary");
      break;
    case "info":
      workClasses.push("btn-info");
      break;
    case "success":
      workClasses.push("btn-success");
      break;
    case "warning":
      workClasses.push("btn-warning");
      break;
    case "error":
      workClasses.push("btn-error");
      break;
    default:
  }

  switch (inlineType) {
    case "inline":
      workClasses.push("inline-block");
      break;
    case "inline-tight":
      workClasses.push("inline-block");
      break;
    default:
  }

  if (selected === true) {
    workClasses.push("selected");
  }
  if (icon !== null && icon !== "no-icon") {
    workClasses = workClasses.concat(["icon", icon]);
  }

  let ele = createElementWithClass("button", workClasses.concat(classes));
  if (content !== null) {
    ele.textContent = content;
  }
  if (inner !== null) {
    ele.innerHTML = inner;
  }
  if (toggle !== null) {
    setToggleState(ele, toggle);
    listners.push(setEventListener(ele, "click", changeToggleState(ele), useCapture));
  }
  if (!isEmptyObject(func)) {
    listners.push(setEventListener(ele, "click", func, useCapture)); //spaceを押すとclickイベントが起こる
  }
  return ele;
}
584085
def on_click(self, handler):
        ''' 

        '''
        self.on_event(ButtonClick, handler)
        self.on_event(MenuItemClick, handler)
109352
function pushEdit (edits, item, added, removed) {
  var last = edits[edits.length - 1]

  if (last && last.added === added && last.removed === removed) {
    last.items.unshift(item) // Not push: edits get reversed later
  } else {
    edits.push({
      items: [item],
      added: added,
      removed: removed
    })
  }
}
840186
function(obj, func, items, func2){
					each(items, function(i, item){
						when(obj, func, item, func2)
					})
				}
665137
function() {
            if( !$module.hasClass(className.expand) ) {
              $expandButton
                .addClass(className.active)
              ;
              module.expand();
            }
            else {
              $expandButton
                .removeClass(className.active)
              ;
              module.contract();
            }
          }
758918
def bind(cls):
        
        super(cls, cls).bind()

        cls.search_btn_el.bind("click", cls.start)
        cls.input_el.bind("keypress", func_on_enter(cls.start))
1348937
function onDrag(evt) {
    const
        rect = this._rect,
        x = valueToX.call(this, this._value),
        min = -x,
        max = rect.width - x,
        tx = clamp(evt.x - evt.x0, min, max),
        value = xToValue.call(this, x + tx);
    Dom.css(this.$elements.button, { transform: `translateX(${tx}px)` });
    this.displayedValue = valueToDisplayedValue.call(this, value);
    if (this.smooth) {
        this._dragging = true;
        this.value = value;
    }
}
730580
function initTipsy() {
        var $importButton = $('#import-button');
        $importButton.tipsy({
            opacity: 1,
            trigger: 'manual'
        });
        $importButton.bind('mouseenter', function (e) {
            var allMenus = $('.opener'); // Check if there is a menu opened
            if (allMenus.filter('.open').length != 0) {
                // Hide all opened menus but add a class to enable linked menus
                allMenus.each(function () {
                    dropdownMenus.hideWindow($(this));
                    $(this).addClass('menu-link');
                });
            }
            $(this).tipsy("show");
        });
        $importButton.bind('mouseleave', function (e) {
            $(this).tipsy("hide");
        });
    }
752225
function enterFunction(node) {
			scopeInfo = {
				isBound: isCalleeOfBindMethod(node),
				thisFound: false,
				upper: scopeInfo
			};
		}
538046
function onDragEnd(evt) {
    this._dragging = false;

    const
        rect = this._rect,
        x = valueToX.call(this, this._value),
        min = -x,
        max = rect.width - x,
        tx = clamp(evt.x - evt.x0, min, max);
    Dom.css(this.$elements.button, { transform: `translateX(0px)` });
    this.value = xToValue.call(this, x + tx);
}
207096
function Knob(options) {

	this.__proto__ = new Control();

	this.init = function(options) {
		this.type = options.type = 'Knob';
		this.parent = options.parent;
		this.defaults = {
			x:48, y:48,
			w:120,
			h:120,
			value: 0,
			text: '',
			script: undefined,
			onload: undefined,
			fill:'315-gray:1-white:50-gray:99',		//this.parent.fill,
			stroke: this.parent.stroke,
			'stroke-width': this.parent.control_stroke,
			fontsize: this.parent.fontsize,
			repeat: 0,
			running: 0,
			corner: this.parent.Knob_corner,
			subtype: undefined,
			group: undefined,
			row: undefined,
			col: undefined,
			autorun: undefined,
			highlighttrue: undefined,
			source: undefined,
			refresh: 0,

			noreadout: undefined,

			increment:1,
			min:0,
			max:1024,
			rscale:2		// scales increments to degrees of rotation
		};
		this.setoptions(options);
		this.fill_highlight = this.parent.lighter(this.stroke);

		this.render();
		return this;
	};

	this.layout = function() {
		this.cx = this.x + this.w/2;
		this.cy = this.y + this.h/2;
		this.rx = this.cx;
		this.ry = this.y + this.h + this.fontsize;
	};

	// block normal highlighting
	this.highlight = function() {
	};

	this.dehighlight = function() {
	};

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

		this.knob = this.parent.paper.ellipse(this.cx, this.cy, this.w/2, this.h/2)
			.attr({fill:this.fill, stroke:this.stroke, 'stroke-width': this['stroke-width']})
			.drag(this.knobMove, this.knobStart, this.knobEnd, this, this, this);
		this.elts.push(this.knob);

		this.label = this.parent.paper.text(this.cx, this.cy, this.text)
			.attr({fill:this.stroke, stroke:this.stroke, 'font-size': this.fontsize});
		this.textelts.push(this.label);

		if (!this.noreadout) {
			this.readout = this.parent.paper.text(this.rx, this.ry, '')
				.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();

		this.knob.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.rx, y:this.ry});
	};

	this.markStart = function(x, y) {
		this.spinx = x;
		this.spiny = y;
	};

	this.sign = function(x) {
		if (x < 0) return -1;
		if (x > 0) return 1;
		return 0;
	};

	this.knob_angle = 0;

	this.rotateKnob = function(degrees) {
		this.knob_angle += (degrees / this.rscale);
		this.knob.transform("r" + this.knob_angle + " " + this.cx + " " + this.cy);
	};

	this.knobStart = function(x, y, e) {
		this.markStart(x, y);
	};

	this.knobMove = function(dx, dy, x, y, e) {
		//console.log('Knob dragMove:',dx,dy,x,y,e);
		var dragx = x - this.spinx;
		var dragy = y - this.spiny;
		var dx = x - this.cx;
		var dy = y - this.cy;
		var increment;
		if (dx > dy) increment = this.sign(dx) * dragy * this.increment;
		else increment = -this.sign(dy) * dragx * this.increment;

		var value = this.value + increment;
		if (value < this.min) value = this.min;
		else if (value > this.max) value = this.max;
		else this.rotateKnob(increment);

		this.setValue(value);
		this.exec();

		this.markStart(x, y);
	};

	this.knobEnd = function(e) {
	};

	this.setValue = function(value) {
		this.value = value;
		if (this.readout) this.readout.attr({text: '' + this.value});
		var update = {id: this.id, value: this.value};
		this.fire('update', update);
	};

	return this.init(options || {});
}
1240098
function add(id, text, title, fn) {
			if (!buttons[id]) {
				var button = renderer.text(
					text,
					0,
					0
				)
				.css(options.toolbar.itemStyle)
				.align({
					align: 'right',
					x: -marginRight - 20,
					y: plotTop + 30
				})
				.on('click', fn)
				/*.on('touchstart', function(e) {
					e.stopPropagation(); // don't fire the container event
					fn();
				})*/
				.attr({
					align: 'right',
					zIndex: 20
				})
				.add();
				buttons[id] = button;
			}
		}
796647
def _pressed(self, evt):
        """"""
        x, y, widget = evt.x, evt.y, evt.widget
        item = widget.identify_row(y)
        column = widget.identify_column(x)

        if not column or not item in self._items:
            # clicked in the weekdays row or just outside the columns
            return

        item_values = widget.item(item)['values']
        if not len(item_values):  # row is empty for this month
            return

        text = item_values[int(column[1]) - 1]
        if not text:  # date is empty
            return

        bbox = widget.bbox(item, column)
        if not bbox:  # calendar not visible yet
            return

        # update and then show selection
        text = '%02d' % text
        self._selection = (text, item, column)
        self._show_selection(text, bbox)
        year, month = self._date.year, self._date.month
        try:
            self._TargetElement.Update(self.datetime(year, month, int(self._selection[0])))
            if self._TargetElement.ChangeSubmits:
                self._TargetElement.ParentForm.LastButtonClicked = self._TargetElement.Key
                self._TargetElement.ParentForm.FormRemainedOpen = True
                self._TargetElement.ParentForm.TKroot.quit()  # kick the users out of the mainloop
        except:
            pass
        if self.close_when_chosen:
            self._master.destroy()