Draw the help dialog.
346373
def draw_help(self, surf):
    """"""
    if not self._help:
      return

    def write(loc, text):
      surf.write_screen(self._font_large, colors.black, loc, text)

    surf.surf.fill(colors.white * 0.8)
    write((1, 1), "Shortcuts:")

    max_len = max(len(s) for s, _ in self.shortcuts)
    for i, (hotkey, description) in enumerate(self.shortcuts, start=2):
      write((2, i), hotkey)
      write((3 + max_len * 0.7, i), description)
1045722
def draw(self, context):
        """"""

        context.set_line_width(self.width)
        context.set_source_rgb(*self.color)

        context.move_to(*self.start_point)
        context.line_to(*self.end_point)
        context.stroke()
886313
def draw(self):
        """"""
        if not self.visible:
            return

        # Blit the current checkbox's image.

        if self.isEnabled:
            if self.mouseIsDown and self.lastMouseDownOverButton and self.mouseOverButton:
                if self.value:
                    self.window.blit(self.surfaceOnDown, self.loc)
                else:
                    self.window.blit(self.surfaceOffDown, self.loc)
            else:
                if self.value:
                    self.window.blit(self.surfaceOn, self.loc)
                else:
                    self.window.blit(self.surfaceOff, self.loc)


        else:
            if self.value:
                self.window.blit(self.surfaceOnDisabled, self.loc)
            else:
                self.window.blit(self.surfaceOffDisabled, self.loc)
589396
def draw_on(self, folium_map):
        """"""
        f = getattr(folium_map, self._map_method_name)
        f(**self._folium_kwargs)
124697
def _draw_messages(self, painter):
        
        checker_modes = []
        for m in self.editor.modes:
            if isinstance(m, modes.CheckerMode):
                checker_modes.append(m)
        for checker_mode in checker_modes:
            for msg in checker_mode.messages:
                block = msg.block
                color = QtGui.QColor(msg.color)
                brush = QtGui.QBrush(color)
                rect = QtCore.QRect()
                rect.setX(self.sizeHint().width() / 4)
                rect.setY(block.blockNumber() * self.get_marker_height())
                rect.setSize(self.get_marker_size())
                painter.fillRect(rect, brush)
990745
def on_helpButton(self, event, page=None):
        """"""
        # for use on the command line:
        path = find_pmag_dir.get_pmag_dir()
        # for use with pyinstaller
        #path = self.main_frame.resource_dir
        help_page = os.path.join(path, 'dialogs', 'help_files', page)
        # if using with py2app, the directory structure is flat,
        # so check to see where the resource actually is
        if not os.path.exists(help_page):
            help_page = os.path.join(path, 'help_files', page)
        html_frame = pw.HtmlFrame(self, page=help_page)
        html_frame.Show()
1119012
def help(self, message, plugin=None):
        """"""
        # help_data = self.load("help_files")
        selected_modules = help_modules = self.load("help_modules")

        self.say("Sure thing, %s." % message.sender.handle)

        help_text = "Here's what I know how to do:"
        if plugin and plugin in help_modules:
            help_text = "Here's what I know how to do about %s:" % plugin
            selected_modules = dict()
            selected_modules[plugin] = help_modules[plugin]

        for k in sorted(selected_modules, key=lambda x: x[0]):
            help_data = selected_modules[k]
            if help_data:
                help_text += "<br/><br/><b>%s</b>:" % k
                for line in help_data:
                    if line:
                        if ":" in line:
                            line = "&nbsp; <b>%s</b>%s" % (line[:line.find(":")], line[line.find(":"):])
                        help_text += "<br/> %s" % line

        self.say(help_text, html=True)
1059222
def draw(self, milliseconds, surface):
        """"""
        surface.blit(self.image, self.coords, self.source, special_flags=0)
357488
def _draw_text(self, pos, text, font, **kw):
        
        self.drawables.append((pos, text, font, kw))
988116
function draw_shield(resp){

			    // ll("shield what: " + bbop.core.what_is(resp));
			    // ll("shield resp: " + bbop.core.dump(resp));

			     // First, extract the fields from the
			     // minimal response.
			     var fina = call_time_field_name;
			     var flist = resp.facet_field(call_time_field_name);

			     // Draw the proper contents of the shield.
			     filter_shield.draw(fina, flist, manager);
			 }
1078658
def draw(self):
        """"""
        from onshapepy import Part
        CAD = Part(
            'https://cad.onshape.com/documents/b4cfd328713460beeb3125ac/w/3928b5c91bb0a0be7858d99e/e/6f2eeada21e494cebb49515f'
        )
        CAD.params = {
            'channel_L': self.channel_L,
            'channel_W': self.channel_W,
            'channel_H': self.downstream_H,
            'channel_pairs': self.channel_n/2,
            'baffle_S': self.baffle_S,
        }
246308
def on_draw(self, e):
        """"""
        gloo.clear()
        for visual in self.visuals:
            logger.log(5, "Draw visual `%s`.", visual)
            visual.on_draw()
419882
function(){
		var iscmp = (!!this.clist.checkCmp ? this.clist.checkCmp() : false);
		if(this.cmp !== iscmp){
			this.cmp = iscmp;
			if(this.puzzle.execConfig('autocmp')){
				this.clist.draw();
			}
		}
	}
1058488
function() {
        for ( var i = 0; i < this._items.length; i++ ) {
            this._items[i].draw();
        }

        this._needsDraw = false;
    }
61774
def _draw(self):
        """"""
        self._compute()
        self._compute_x_labels()
        self._compute_x_labels_major()
        self._compute_y_labels()
        self._compute_y_labels_major()
        self._compute_secondary()
        self._post_compute()
        self._compute_margin()
        self._decorate()
        if self.series and self._has_data() and self._values:
            self._plot()
        else:
            self.svg.draw_no_data()
720005
def draw(self):
        """"""
        if not self.visible:
            return

        # If this input text has focus, draw an outline around the text image
        if self.focus:
            pygame.draw.rect(self.window, self.focusColor, self.focusedImageRect, 1)

        # Blit in the image of text (set earlier in _updateImage)
        self.window.blit(self.textImage, self.loc)

        # If this field has focus, see if it is time to blink the cursor
        if self.focus:
            self.cursorMsCounter = self.cursorMsCounter + self.clock.get_time()
            if self.cursorMsCounter >= self.cursorSwitchMs:
                self.cursorMsCounter = self.cursorMsCounter % self.cursorSwitchMs
                self.cursorVisible = not self.cursorVisible

            if self.cursorVisible:
                cursorOffset = self.font.size(self.text[:self.cursorPosition])[0]
                if self.cursorPosition > 0: # Try to get between characters
                    cursorOffset = cursorOffset - 1
                if cursorOffset < self.width:  # if the loc is within the text area, draw it
                    self.cursorLoc[0] = self.loc[0] + cursorOffset
                    self.window.blit(self.cursorSurface, self.cursorLoc)

            self.clock.tick()
920295
def draw_choices(bootstrap, type, method, collection, value_method, text_method, _options, html_options)
      draw_form_group_fieldset(bootstrap, method) do
        if bootstrap.custom_control
          label_css_class = "custom-control-label"

          form_check_css_class = "custom-control"
          form_check_css_class +=
            case type
            when :radio_button then " custom-radio"
            when :check_box    then " custom-checkbox"
            end

          form_check_css_class += " custom-control-inline" if bootstrap.check_inline

          add_css_class!(html_options, "custom-control-input")

        else
          label_css_class = "form-check-label"

          form_check_css_class = "form-check"
          form_check_css_class += " form-check-inline" if bootstrap.check_inline

          add_css_class!(html_options, "form-check-input")
        end

        errors    = draw_errors(method)
        help_text = draw_help(bootstrap.help)

        add_css_class!(html_options, "is-invalid") if errors.present?

        content = "".html_safe
        collection.each_with_index do |item, index|
          item_value  = item.send(value_method)
          item_text   = item.send(text_method)

          content << content_tag(:div, class: form_check_css_class) do
            concat yield method, item_value, html_options
            concat label(method, item_text, value: item_value, class: label_css_class)
            if ((collection.count - 1) == index) && !bootstrap.check_inline
              concat errors     if errors.present?
              concat help_text  if help_text.present?
            end
          end
        end

        if bootstrap.check_inline
          content << errors     if errors.present?
          content << help_text  if help_text.present?
        end

        content
      end
    end