Helper function that creates a new progress button, adds it to the given layout.
Returns a reference to the progress button for customization.
186994
private ProgressButton addProgressButton(LinearLayout container) {
    final LinearLayout.LayoutParams layoutParams =
        new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f);
    final ProgressButton progressButton = new ProgressButton(this);
    progressButton.setLayoutParams(layoutParams);
    container.addView(progressButton);
    return progressButton;
  }
1325994
def insert(self, button):
        
        if self.inline_keyboard and len(self.inline_keyboard[-1]) < self.row_width:
            self.inline_keyboard[-1].append(button)
        else:
            self.add(button)
        return self
568202
def add_widget(self, widget):
        
        if self._buttons.get(widget):
            return
        btn = self.create_button(widget)
        cb = partial(self.focus_widget, w=widget)
        btn.clicked.connect(cb)
        self.layout().addWidget(btn)
        self._buttons[widget] = btn
273460
public final void addButton(String label, String className, SimpleCallback callback) {
        addButton(BUTTON_PREFIX + BUTTON_INDEX++, label, className,
            callback != null ? callback : SimpleCallback.DEFAULT_SIMPLE_CALLBACK);
    }
538592
def updateUi(self):
        
        index = self._slideshow.currentIndex()
        count = self._slideshow.count()
        
        self._previousButton.setVisible(index != 0)
        self._nextButton.setText('Finish' if index == count - 1 else 'Next')
        self.autoLayout()
1042794
def add_button(self, name, button_class=wtf_fields.SubmitField, **options):
        """"""
        self._buttons[name] = button_class(**options)
76657
public void addProgressListener(ProgressListener pListener) {
        if (pListener == null) {
            return;
        }

        if (listeners == null) {
            listeners = new CopyOnWriteArrayList<ProgressListener>();
        }

        listeners.add(pListener);
    }
808389
public static LoadingLayout wrap(final View targetView, final int progressBarStyle){
        if(targetView==null){
            throw new IllegalArgumentException();
        }

        final LoadingLayout loadingLayout = new LoadingLayout(targetView.getContext()){
            @Override
            protected View createProgressBar() {
                return new ProgressBar(getContext(),null,progressBarStyle);
            }
        };
        loadingLayout.attachTo(targetView);
        return loadingLayout;
    }
1161025
def add_button(self, name, checkable=False, checked=False):
        

        # first clean up the name
        name = self._clean_up_name(name)

        # split into (presumably existing) branches and parameter
        s = name.split('/')

        # make sure it doesn't already exist
        if not self._find_parameter(s, quiet=True) == None:
            self.print_message("Error: '"+name+"' already exists.")
            return None

        # get the leaf name off the list.
        p = s.pop(-1)

        # create / get the branch on which to add the leaf
        b = self._find_parameter(s, create_missing=True)

        # quit out if it pooped
        if b == None: return None

        # create the leaf object
        ap = _g.parametertree.Parameter.create(name=p, type='action')

        # add it to the tree (different methods for root)
        if b == self._widget: b.addParameters(ap)
        else:                 b.addChild(ap)

        # modify the existing class to fit our conventions
        ap.signal_clicked = ap.sigActivated

        # Now set the default value if any
        if name in self._lazy_load:
            v = self._lazy_load.pop(name)
            self._set_value_safe(name, v, True, True)
        
        # Connect it to autosave (will only create unique connections)
        self.connect_any_signal_changed(self.autosave)
        
        return Button(name, checkable, checked, list(ap.items.keys())[0].button)
531588
def create_layout_params(self, child, layout):
        
        from .android_fragment import AndroidFragment
        if isinstance(child, AndroidFragment):
            return super(AndroidViewPager, self).create_layout_params(child,
                                                                      layout)
        # Only apply to decor views
        dp = self.dp
        w, h = (coerce_size(layout.get('width', 'match_parent')),
                coerce_size(layout.get('height', 'wrap_content')))
        w = w if w < 0 else int(w * dp)
        h = h if h < 0 else int(h * dp)
        # No (w,h) constructor
        params = ViewPagerLayoutParams()
        params.width = w
        params.height = h
        params.isDecor = True
        return params
1171263
protected PushButton createAddButton() {

        PushButton button = createIconButton(I_CmsButton.ADD_SMALL);
        button.setTitle(aliasMessages.addAlias());
        return button;
    }
583767
function (progress) {
			var _this = this;
			this.progressBar.animate({
				value: progress
			}, 1, function() {
				_this.onProgress(progress);
			});
			this.progress = progress;
		}
1211637
def add_slide(self, slide_layout):
        
        partname = self._next_slide_partname
        slide_layout_part = slide_layout.part
        slide_part = SlidePart.new(partname, self.package, slide_layout_part)
        rId = self.relate_to(slide_part, RT.SLIDE)
        return rId, slide_part.slide
402921
public UI wrapLayout(Layout layout) {
        // TODO: add a header to switch the style, etc
        // TODO: add bookmark to set the style
        if (server.getConfig().isDevelopmentHeader()) {
            final VerticalSplitPanel mainLayout = new VerticalSplitPanel();
            mainLayout.setSizeFull();
            mainLayout.setSplitPosition(SPLIT_POSITION, Sizeable.Unit.PIXELS);
            mainLayout.setLocked(true);

            final DevApplicationHeader header = new DevApplicationHeader(server);
            header.setSpacing(true);
            mainLayout.setFirstComponent(header);

            mainLayout.setSecondComponent(layout);

            return new DevUI(mainLayout);
        } else {
            return new DevUI(layout);
        }
    }
788756
def add(self, *args):
        
        row = []
        for index, button in enumerate(args, start=1):
            row.append(button)
            if index % self.row_width == 0:
                self.inline_keyboard.append(row)
                row = []
        if len(row) > 0:
            self.inline_keyboard.append(row)
        return self
959286
def add_layout(self, l):
        """"""
        if self.layout():
            self.layout().addLayout(l)
        else:
            layout = QVBoxLayout(self)
            layout.addLayout(l)
261582
function (progressListener) {
            var self = this, listeners = self[PROMISE_PROGRESS_LISTENERS];
            if (listeners === false) {
                return self;
            }
            if (!listeners) {
                listeners = self[PROMISE_PROGRESS_LISTENERS] = [];
            }
            listeners.push(progressListener);
            return self;
        }