For special widget
760348
public function getListItems()
    {
        $item_arr = [];
        foreach ($this->items as $item)
        {
            $item_arr[$item->id] = $item->title;
        }
        return $item_arr;
    }
780481
def _set(self, name, value):
        ""
        return self.widget(self.widget_element._set(name, value))
374721
def selected(self, sel):
        """"""
        ParameterItem.selected(self, sel)

        if self.widget is None:
            return
        if sel and self.param.writable():
            self.showEditor()
        elif self.hideWidget:
            self.hideEditor()
1117142
def create_widget(self):
        
        d = self.declaration
        self.widget = CoordinatorLayout(self.get_context(), None, d.style)
565253
def create_widget(self):
        
        d = self.declaration
        self.widget = TextClock(self.get_context(), None, d.style)
887420
def onselection(self, widget):
        """"""
        self._selected_key = None
        for k in self.children:
            if self.children[k] == widget:  # widget is the selected ListItem
                self._selected_key = k
                if (self._selected_item is not None) and self._selectable:
                    self._selected_item.attributes['selected'] = False
                self._selected_item = self.children[self._selected_key]
                if self._selectable:
                    self._selected_item.attributes['selected'] = True
                break
        return (self._selected_key,)
1274111
public void onClick(Widget widget) {

        if (widget == m_rbHue) {
            if (m_colorMode != CmsSliderBar.HUE) {
                m_colorMode = CmsSliderBar.HUE;
                m_slidermap.setColorSelectMode(CmsSliderBar.HUE);
                m_sliderbar.setColorSelectMode(CmsSliderBar.HUE);
                m_slidermap.setOverlayOpacity(100);
                m_sliderbar.setLayerOpacity(100, CmsSliderBar.COLORBAR_D);
            }

            try {
                CmsColor color = new CmsColor();
                color.setHSV(m_hue, 100, 100);
                m_slidermap.setOverlayColor("#" + color.getHex());
            } catch (Exception e) {
                // do something.
            }

            m_sliderbar.setSliderPosition(256 - (int)((new Integer(m_hue).floatValue() / 360) * 256));
            m_slidermap.setSliderPosition(
                (int)((new Integer(m_saturation).floatValue() / 100) * 256),
                256 - (int)((new Integer(m_brightness).floatValue() / 100) * 256));
        } else if (widget == m_rbSaturation) {
            if (m_colorMode != CmsSliderBar.SATURATIN) {
                m_colorMode = CmsSliderBar.SATURATIN;
                m_slidermap.setColorSelectMode(CmsSliderBar.SATURATIN);
                m_sliderbar.setColorSelectMode(CmsSliderBar.SATURATIN);
                m_slidermap.setOverlayColor("transparent");
                m_sliderbar.setLayerOpacity(100, CmsSliderBar.COLORBAR_D);
            }

            try {
                CmsColor color = new CmsColor();
                color.setHSV(m_hue, 100, m_brightness);
                m_sliderbar.setLayerColor("#" + color.getHex(), CmsSliderBar.COLORBAR_D);
            } catch (Exception e) {
                // do something.
            }

            m_slidermap.setOverlayOpacity(100 - m_saturation);

            m_sliderbar.setSliderPosition(256 - (int)((new Integer(m_saturation).floatValue() / 100) * 256));
            m_slidermap.setSliderPosition(
                (int)((new Integer(m_hue).floatValue() / 360) * 256),
                256 - (int)((new Integer(m_brightness).floatValue() / 100) * 256));
        } else if (widget == m_rbBrightness) {
            if (m_colorMode != CmsSliderBar.BRIGHTNESS) {
                m_colorMode = CmsSliderBar.BRIGHTNESS;
                m_slidermap.setColorSelectMode(CmsSliderBar.BRIGHTNESS);
                m_sliderbar.setColorSelectMode(CmsSliderBar.BRIGHTNESS);
                m_slidermap.setUnderlayColor("#000000");
                m_slidermap.setOverlayColor("transparent");
                m_sliderbar.setLayerOpacity(100, CmsSliderBar.COLORBAR_D);
            }

            try {
                CmsColor color = new CmsColor();
                color.setHSV(m_hue, m_saturation, 100);
                m_sliderbar.setLayerColor("#" + color.getHex(), CmsSliderBar.COLORBAR_D);
            } catch (Exception e) {
                // do something.
            }

            m_slidermap.setOverlayOpacity(m_brightness);

            m_sliderbar.setSliderPosition(256 - (int)((new Integer(m_brightness).floatValue() / 100) * 256));
            m_slidermap.setSliderPosition(
                (int)((new Integer(m_hue).floatValue() / 360) * 256),
                256 - (int)((new Integer(m_saturation).floatValue() / 100) * 256));
        } else if (widget == m_rbRed) {
            if (m_colorMode != CmsSliderBar.RED) {
                m_colorMode = CmsSliderBar.RED;
                m_slidermap.setColorSelectMode(CmsSliderBar.RED);
                m_sliderbar.setColorSelectMode(CmsSliderBar.RED);
            }
            m_slidermap.setOverlayOpacity(percentOf(m_red, 100));

            m_sliderbar.setSliderPosition(256 - m_red);
            m_slidermap.setSliderPosition(m_blue, 256 - m_green);
        } else if (widget == m_rbGreen) {
            if (m_colorMode != CmsSliderBar.GREEN) {
                m_colorMode = CmsSliderBar.GREEN;
                m_slidermap.setColorSelectMode(CmsSliderBar.GREEN);
                m_sliderbar.setColorSelectMode(CmsSliderBar.GREEN);
            }

            m_slidermap.setOverlayOpacity(percentOf(m_green, 100));

            m_sliderbar.setSliderPosition(256 - m_green);
            m_slidermap.setSliderPosition(m_blue, 256 - m_red);
        } else if (widget == m_rbBlue) {
            if (m_colorMode != CmsSliderBar.BLUE) {
                m_colorMode = CmsSliderBar.BLUE;
                m_slidermap.setColorSelectMode(CmsSliderBar.BLUE);
                m_sliderbar.setColorSelectMode(CmsSliderBar.BLUE);
            }

            m_slidermap.setOverlayOpacity(percentOf(m_blue, 100));

            m_sliderbar.setSliderPosition(256 - m_blue);
            m_slidermap.setSliderPosition(m_red, 256 - m_green);
        }

        if ((m_colorMode == CmsSliderBar.RED)
            || (m_colorMode == CmsSliderBar.GREEN)
            || (m_colorMode == CmsSliderBar.BLUE)) {
            int x = 0;
            int y = 0;

            if (m_colorMode == CmsSliderBar.RED) {
                x = m_blue;
                y = m_green;
            }

            if (m_colorMode == CmsSliderBar.GREEN) {
                x = m_blue;
                y = m_red;
            }

            if (m_colorMode == CmsSliderBar.BLUE) {
                x = m_red;
                y = m_green;
            }

            int horzPer = (int)((new Float(x).floatValue() / 256) * 100);
            int vertPer = (int)((new Float(y).floatValue() / 256) * 100);
            int horzPerRev = (int)(((256 - new Float(x).floatValue()) / 256) * 100);
            int vertPerRev = (int)(((256 - new Float(y).floatValue()) / 256) * 100);

            if (vertPerRev > horzPerRev) {
                m_sliderbar.setLayerOpacity(horzPerRev, CmsSliderBar.COLORBAR_D);
            } else {
                m_sliderbar.setLayerOpacity(vertPerRev, CmsSliderBar.COLORBAR_D);
            }
            if (vertPerRev > horzPer) {
                m_sliderbar.setLayerOpacity(horzPer, CmsSliderBar.COLORBAR_C);
            } else {
                m_sliderbar.setLayerOpacity(vertPerRev, CmsSliderBar.COLORBAR_C);
            }
            if (vertPer > horzPer) {
                m_sliderbar.setLayerOpacity(horzPer, CmsSliderBar.COLORBAR_B);
            } else {
                m_sliderbar.setLayerOpacity(vertPer, CmsSliderBar.COLORBAR_B);
            }
            if (vertPer > horzPerRev) {
                m_sliderbar.setLayerOpacity(horzPerRev, CmsSliderBar.COLORBAR_A);
            } else {
                m_sliderbar.setLayerOpacity(vertPer, CmsSliderBar.COLORBAR_A);
            }
        }
    }
1237956
protected function displayWidgetCell()
    {
        $td_tag = new SwatHtmlTag('td');
        $colspan = $this->view->getXhtmlColspan();
        $td_tag->colspan = $colspan - $this->offset;
        $td_tag->class = 'widget-cell';
        $td_tag->open();
        $this->widget->display();
        $td_tag->close();
    }
1024922
def add(self, widget, *args, **kwargs):
        
        ins_widget = widget(*args, **kwargs)
        self.__iadd__(ins_widget)
        return ins_widget
1019533
def OnWidget(self, event):
        """'"""

        self.choice_dialects.SetValue(len(self.choices['dialects']) - 1)
        event.Skip()
408359
def create_widget(self):
        
        d = self.declaration
        self.widget = SeekBar(self.get_context(), None,
                              d.style or '@attr/seekBarStyle')
74198
def create_widget(self):
        
        d = self.declaration
        self.widget = Switch(self.get_context(), None,
                             d.style or '@attr/switchStyle')
651032
def add_widget(self, wclass):
        """"""

        tree = self.treeview
        #  get the selected item:
        selected_item = ''
        tsel = tree.selection()
        if tsel:
            selected_item = tsel[0]

        #  Need to remove filter if set
        self.filter_remove()

        root = selected_item
        #  check if the widget can be added at selected point
        if not self._validate_add(root, wclass, False):
            #  if not try to add at item parent level
            parent = tree.parent(root)
            if parent != root:
                if self._validate_add(parent, wclass):
                    root = parent
                else:
                    return
            else:
                return

        #  root item should be set at this point
        #  setup properties
        widget_id = self.get_unique_id(wclass)

        data = WidgetDescr(wclass, widget_id)

        # setup default values for properties
        for pname in builder.CLASS_MAP[wclass].builder.properties:
            pdescription = {}
            if pname in properties.WIDGET_PROPERTIES:
                pdescription = properties.WIDGET_PROPERTIES[pname]
            if wclass in pdescription:
                pdescription = dict(pdescription, **pdescription[wclass])
            default_value = str(pdescription.get('default', ''))
            data.set_property(pname, default_value)
            # default text for widgets with text prop:
            if pname in ('text', 'label'):
                data.set_property(pname, widget_id)

        #
        #  default grid properties
        #
        # is_container = builder.CLASS_MAP[wclass].builder.container
        for prop_name in properties.GRID_PROPERTIES:
            pdescription = properties.LAYOUT_OPTIONS[prop_name]
            if wclass in pdescription:
                pdescription = dict(pdescription, **pdescription[wclass])
            default_value = str(pdescription.get('default', ''))
            data.set_layout_property(prop_name, default_value)

        rownum = '0'
        if root:
            rownum = str(self.get_max_row(root)+1)
        data.set_layout_property('row', rownum)
        data.set_layout_property('column', '0')

        item = self._insert_item(root, data)

        # Do redraw
        self.draw_widget(item)

        # Select and show the item created
        tree.after_idle(lambda: tree.selection_set(item))
        tree.after_idle(lambda: tree.focus(item))
        tree.after_idle(lambda: tree.see(item))
477086
def setContentFor(self, widget):
        """"""
        for i in range(self.count()):
            item = self.widget(i)
            if widget.isStatic:
                item.setStaticContent(widget)
            else:
                item.setContent(widget)
425674
def set_widgets(self):
        """"""
        self.tvBrowserExposure_selection_changed()

        # Set icon
        exposure = self.parent.step_fc_functions1.selected_value(
            layer_purpose_exposure['key'])
        icon_path = get_image_path(exposure)
        self.lblIconIFCWExposureFromBrowser.setPixmap(QPixmap(icon_path))
358255
def setCentralWidget( self, widget ):
        
        self._scrollArea.takeWidget()
        self._scrollArea.setWidget(widget)
        
        self.adjustSize()
1153459
def is_widget_with_placeholder(widget):
    
    return isinstance(
        widget, (TextInput, Textarea, NumberInput, EmailInput, URLInput, PasswordInput)
    )