Draws the text and the combobox icon
548980
def Draw(self, grid, attr, dc, rect, row, col, is_selected):
        """"""

        render = wx.RendererNative.Get()

        # clear the background
        dc.SetBackgroundMode(wx.SOLID)

        if is_selected:
            dc.SetBrush(wx.Brush(wx.BLUE, wx.SOLID))
            dc.SetPen(wx.Pen(wx.BLUE, 1, wx.SOLID))
        else:
            dc.SetBrush(wx.Brush(wx.WHITE, wx.SOLID))
            dc.SetPen(wx.Pen(wx.WHITE, 1, wx.SOLID))
        dc.DrawRectangleRect(rect)

        cb_lbl = grid.GetCellValue(row, col)
        string_x = rect.x + 2
        string_y = rect.y + 2
        dc.DrawText(cb_lbl, string_x, string_y)

        button_x = rect.x + rect.width - self.iconwidth
        button_y = rect.y
        button_width = self.iconwidth
        button_height = rect.height
        button_size = button_x, button_y, button_width, button_height
        render.DrawComboBoxDropButton(grid, dc, button_size,
                                      wx.CONTROL_CURRENT)
1051798
public void paintIcon (Component c, Graphics g, int x, int y)
    {
        Graphics2D g2 = (Graphics2D) g;
        // turn on anti-aliasing
        Object oldAlias = g2.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);

        Rectangle bounds = _shape.getBounds();
        int dx = x - bounds.x;
        int dy = y - bounds.y;
        g2.translate(dx, dy);
        if (_fillColor != null) {
            g2.setColor(_fillColor);
            g2.fill(_shape);
        }
        if (_outlineColor != null) {
            g2.setColor(_outlineColor);
            g2.draw(_shape);
        }
        g2.translate(-dx, -dy);
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, oldAlias);
    }
175166
@Override
    protected void configureList() {
        list.setFont(comboBox.getFont());
        list.setBorder(null);
        list.setCellRenderer(comboBox.getRenderer());
        list.setFocusable(false);
        list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        int selectedIndex = comboBox.getSelectedIndex();

        if (selectedIndex == -1) {
            list.clearSelection();
        } else {
            list.setSelectedIndex(selectedIndex);
            list.ensureIndexIsVisible(selectedIndex);
        }

        installListListeners();
    }
76518
function draw(renderer, text, x, y) {
         // allows to provide backward compatibility when
         // adding Bitmap Font to an object container
         if (typeof this.ancestor === "undefined") {
           // update cache
           this.setText(text); // force update bounds

           this.update(0); // save the previous global alpha value

           var _alpha = renderer.globalAlpha();

           renderer.setGlobalAlpha(_alpha * this.getOpacity());
         } else {
           // added directly to an object container
           x = this.pos.x;
           y = this.pos.y;
         }

         var strings = ("" + this._text).split("\n");

         var lX = x;
         var stringHeight = measureTextHeight(this);
         var maxWidth = 0;

         for (var i = 0; i < strings.length; i++) {
           x = lX;
           var string = me.utils.string.trimRight(strings[i]); // adjust x pos based on alignment value

           var stringWidth = measureTextWidth(this, string);

           switch (this.textAlign) {
             case "right":
               x -= stringWidth;
               break;

             case "center":
               x -= stringWidth * 0.5;
               break;

             default:
               break;
           } // adjust y pos based on alignment value


           switch (this.textBaseline) {
             case "middle":
               y -= stringHeight * 0.5;
               break;

             case "ideographic":
             case "alphabetic":
             case "bottom":
               y -= stringHeight;
               break;

             default:
               break;
           } // update initial position if required


           if (this.isDirty === true && typeof this.ancestor === "undefined") {
             if (i === 0) {
               this.pos.y = y;
             }

             if (maxWidth < stringWidth) {
               maxWidth = stringWidth;
               this.pos.x = x;
             }
           } // draw the string


           var lastGlyph = null;

           for (var c = 0, len = string.length; c < len; c++) {
             // calculate the char index
             var ch = string.charCodeAt(c);
             var glyph = this.fontData.glyphs[ch];
             var glyphWidth = glyph.width;
             var glyphHeight = glyph.height;
             var kerning = lastGlyph && lastGlyph.kerning ? lastGlyph.getKerning(ch) : 0; // draw it

             if (glyphWidth !== 0 && glyphHeight !== 0) {
               // some browser throw an exception when drawing a 0 width or height image
               renderer.drawImage(this.fontImage, glyph.x, glyph.y, glyphWidth, glyphHeight, x + glyph.xoffset, y + glyph.yoffset * this.fontScale.y, glyphWidth * this.fontScale.x, glyphHeight * this.fontScale.y);
             } // increment position


             x += (glyph.xadvance + kerning) * this.fontScale.x;
             lastGlyph = glyph;
           } // increment line


           y += stringHeight;
         }

         if (typeof this.ancestor === "undefined") {
           // restore the previous global alpha value
           renderer.setGlobalAlpha(_alpha);
         } // clear the dirty flag


         this.isDirty = false;
       }
1262111
def DrawIconAndLabel(self, dc, node, x, y, w, h, depth):
        '''  '''
        if w-2 < self._em_size_//2 or h-2 < self._em_size_ //2:
            return
        dc.SetClippingRegion(x+1, y+1, w-2, h-2) # Don't draw outside the box
        try:
            icon = self.adapter.icon(node, node==self.selectedNode)
            if icon and h >= icon.GetHeight() and w >= icon.GetWidth():
                iconWidth = icon.GetWidth() + 2
                dc.DrawIcon(icon, x+2, y+2)
            else:
                iconWidth = 0
            if self.labels and h >= dc.GetTextExtent('ABC')[1]:
                dc.SetTextForeground(self.TextForegroundForNode(node, depth))
                dc.DrawText(self.adapter.label(node), x + iconWidth + 2, y+2)
        finally:
            dc.DestroyClippingRegion()
1359320
def draw_pin(text, background_color='green', font_color='white'):
    ''''''
    image = Image.new('RGB', (120, 20))
    draw = ImageDraw.Draw(image)
    draw.rectangle([(1, 1), (118, 18)], fill=color(background_color))
    draw.text((10, 4), text, fill=color(font_color))
    return image
371454
function drawText( &$font, $textColor, $text, $x, $y, $angle,
                       $imageObject = null )
    {
        if ( !$font )
        {
            eZDebug::writeWarning( 'Cannot render text, no font is set', __METHOD__ );
            return false;
        }
        if ( !$textColor )
        {
            eZDebug::writeWarning( 'Cannot render text, no text color is set', __METHOD__ );
            return false;
        }
        if ( is_string( $textColor ) )
            $textColor = $this->color( $textColor );
        if ( $textColor === null )
        {
            eZDebug::writeWarning( 'Cannot render text, invalid text color', __METHOD__ );
            return false;
        }

        $x += $font->xAdjustment();
        $y += $font->yAdjustment();

        if ( $imageObject === null )
            $imageObject = $this->ImageObject;

        ImageTTFText( $imageObject, $font->pointSize(), $angle, $x, $y,
                      $textColor, $font->realFile(), $text );
    }
434129
def paintEvent(self, event):
        
        super(DebuggerPanel, self).paintEvent(event)
        painter = QPainter(self)
        painter.fillRect(event.rect(), self.editor.sideareas_color)

        for top, line_number, block in self.editor.visible_blocks:
            if self.line_number_hint == line_number:
                self._draw_breakpoint_icon(top, painter, 'transparent')
            if self._current_line_arrow == line_number and not self.stop:
                self._draw_breakpoint_icon(top, painter, 'arrow')

            data = block.userData()
            if data is None or not data.breakpoint:
                continue

            if data.breakpoint_condition is None:
                self._draw_breakpoint_icon(top, painter, 'breakpoint')
            else:
                self._draw_breakpoint_icon(top, painter, 'condition')
730739
def paint(self, iconic, painter, rect, mode, state, options):
        """"""
        for opt in options:
            self._paint_icon(iconic, painter, rect, mode, state, opt)
955269
@Override
    public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) {
        ListCellRenderer renderer = comboBox.getRenderer();
        Component c;

        c = renderer.getListCellRendererComponent(listBox, comboBox.getSelectedItem(), -1, false, false);

        // Fix for 4238829: should lay out the JPanel.
        boolean shouldValidate = false;
        if (c instanceof JPanel) {
            shouldValidate = true;
        }

        if (c instanceof UIResource) {
            c.setName("ComboBox.renderer");
        }

        boolean force = forceOpaque && c instanceof JComponent;
        if (force) {
            ((JComponent) c).setOpaque(false);
        }

        int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
        if (padding != null) {
            x = bounds.x + padding.left;
            y = bounds.y + padding.top;
            w = bounds.width - (padding.left + padding.right);
            h = bounds.height - (padding.top + padding.bottom);
        }

        currentValuePane.paintComponent(g, c, comboBox, x, y, w, h, shouldValidate);

        if (force) {
            ((JComponent) c).setOpaque(true);
        }

    }
830359
def paintEvent(self, event):
        
        super(XLineEdit, self).paintEvent(event)
        
        # paint the hint text if not text is set
        if self.text() and not (self.icon() and not self.icon().isNull()):
            return
        
        # paint the hint text
        with XPainter(self) as painter:
            painter.setPen(self.hintColor())
            
            icon = self.icon()
            left, top, right, bottom = self.getTextMargins()
            
            w = self.width()
            h = self.height() - 2
            
            w -= (right + left)
            h -= (bottom + top)
            
            if icon and not icon.isNull():
                size = icon.actualSize(self.iconSize())
                x    = self.cornerRadius() + 2
                y    = (self.height() - size.height()) / 2.0
                
                painter.drawPixmap(x, y, icon.pixmap(size.width(), size.height()))
                
                w -= size.width() - 2
            else:
                x = 6 + left
            
            w -= self._buttonWidth
            y = 2 + top
            
            # create the elided hint
            if not self.text() and self.hint():
                rect    = self.cursorRect()
                metrics = QFontMetrics(self.font())
                hint    = metrics.elidedText(self.hint(), Qt.ElideRight, w)
                align   = self.alignment()
                
                if align & Qt.AlignHCenter:
                    x = 0
                else:
                    x = rect.center().x()
                
                painter.drawText(x, y, w, h, align, hint)
454294
function (out) {
            var oSelf = this;
            ariaUtilsArray.forEach(this._iconsLeft, function (value) {
                oSelf._writeIcon(value, out);
            });
            this._frame.writeMarkupBegin(out);
        }
379631
def paintEvent(self, event):
        
        painter = QPainter(self)
        painter.fillRect(event.rect(), self.editor.sideareas_color)
        # This is needed to make that the font size of line numbers
        # be the same as the text one when zooming
        # See Issue 2296 and 4811
        font = self.editor.font()
        font_height = self.editor.fontMetrics().height()

        active_block = self.editor.textCursor().block()
        active_line_number = active_block.blockNumber() + 1

        def draw_pixmap(ytop, pixmap):
            if not QT55_VERSION:
                pixmap_height = pixmap.height()
            else:
                # scale pixmap height to device independent pixels
                pixmap_height = pixmap.height() / pixmap.devicePixelRatio()
            painter.drawPixmap(0, ytop + (font_height-pixmap_height) / 2,
                               pixmap)

        for top, line_number, block in self.editor.visible_blocks:
            if self._margin:
                if line_number == active_line_number:
                    font.setWeight(font.Bold)
                    painter.setFont(font)
                    painter.setPen(self.editor.normal_color)
                else:
                    font.setWeight(font.Normal)
                    painter.setFont(font)
                    painter.setPen(self.linenumbers_color)

                painter.drawText(0, top, self.width(),
                                 font_height,
                                 Qt.AlignRight | Qt.AlignBottom,
                                 to_text_string(line_number))

            data = block.userData()
            if self._markers_margin and data:
                if data.code_analysis:
                    for source, code, severity, message in data.code_analysis:
                        error = severity == DiagnosticSeverity.ERROR
                        if error:
                            break
                    if error:
                        draw_pixmap(top, self.error_pixmap)
                    else:
                        draw_pixmap(top, self.warning_pixmap)
                if data.todo:
                    draw_pixmap(top, self.todo_pixmap)
523989
def draw_icon(point, icon)
      x, y = point.pixel(@bounding_box)
      icon.draw(@canvas, x, y)
    end
1321927
private void paintButton(Graphics2D g, JComponent c, int width, int height) {
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

        Shape s = createButtonPath(CornerSize.BORDER, 0, 2, width - 2, height - 4);

        g.setPaint(getComboBoxButtonBorderPaint(s, type));
        g.fill(s);

        s = createButtonPath(CornerSize.INTERIOR, 1, 3, width - 4, height - 6);
        g.setPaint(getComboBoxButtonInteriorPaint(s, type));
        g.fill(s);
    }
713622
def show(self):
        

        selected_text = self.__container.get_current_editor().get_selected_text()
        selected_text and SearchAndReplace.insert_pattern(selected_text, self.__search_patterns_model)
        self.Search_comboBox.line_edit().selectAll()
        self.Search_comboBox.setFocus()

        super(SearchInFiles, self).show()
        self.raise_()
168198
def paintEvent(self, event):
        """"""
        painter = QPainter(self)
        size = self.size()

        color = QColor(self.color)
        color.setAlphaF(.5)
        painter.setPen(color)

        for column in self.columns:
            x = self.editor.fontMetrics().width(column * '9')
            painter.drawLine(x, 0, x, size.height())