parameters: (self, dc, attr, highlighted)
return_statement: return False
docstring: Sets various attributes to the input device context.
  
          :param `dc`: an instance of :class:`DC`;
          :param `attr`: an instance of :class:`UltimateListItemAttr`;
          :param `highlighted`: ``True`` if the item is highlighted, ``False`` otherwise.
docstring_summary: Sets various attributes to the input device context.
docstring_tokens: Sets various attributes to the input device context .
function: def SetAttributes(self, dc, attr, highlighted):
          """
          Sets various attributes to the input device context.
  
          :param `dc`: an instance of :class:`DC`;
          :param `attr`: an instance of :class:`UltimateListItemAttr`;
          :param `highlighted`: ``True`` if the item is highlighted, ``False`` otherwise.
          """
          
          listctrl = self._owner.GetParent()
  
          # fg colour
          # don't use foreground colour for drawing highlighted items - this might
          # make them completely invisible (and there is no way to do bit
          # arithmetics on wxColour, unfortunately)
  
          if not self._owner.HasAGWFlag(ULC_BORDER_SELECT) and not self._owner.HasAGWFlag(ULC_NO_FULL_ROW_SELECT):
              if highlighted:
                  if wx.Platform == "__WXMAC__":
                      if self._owner.HasFocus():
                          colText = wx.WHITE
                      else:
                          colText = wx.BLACK
                  else:
                      colText = wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT)
              else:
                  if attr and attr.HasTextColour():
                      colText = attr.GetTextColour()
                  else:
                      colText = listctrl.GetForegroundColour()
          elif attr and attr.HasTextColour():
              colText = attr.GetTextColour()
          else:
              colText = listctrl.GetForegroundColour()
  
          dc.SetTextForeground(colText)
  
          # font
          if attr and attr.HasFont():
              font = attr.GetFont()
          else:
              font = listctrl.GetFont()
  
          dc.SetFont(font)
  
          # bg colour
          hasBgCol = attr and attr.HasBackgroundColour()
  
          if highlighted or hasBgCol:
              if highlighted:
                  dc.SetBrush(self._owner.GetHighlightBrush())
              else:
                  dc.SetBrush(wx.Brush(attr.GetBackgroundColour(), wx.SOLID))
  
              dc.SetPen(wx.TRANSPARENT_PEN)
  
              return True
  
          return False
function_tokens: def SetAttributes ( self , dc , attr , highlighted ) : listctrl = self . _owner . GetParent ( ) # fg colour # don't use foreground colour for drawing highlighted items - this might # make them completely invisible (and there is no way to do bit # arithmetics on wxColour, unfortunately) if not self . _owner . HasAGWFlag ( ULC_BORDER_SELECT ) and not self . _owner . HasAGWFlag ( ULC_NO_FULL_ROW_SELECT ) : if highlighted : if wx . Platform == "__WXMAC__" : if self . _owner . HasFocus ( ) : colText = wx . WHITE else : colText = wx . BLACK else : colText = wx . SystemSettings . GetColour ( wx . SYS_COLOUR_HIGHLIGHTTEXT ) else : if attr and attr . HasTextColour ( ) : colText = attr . GetTextColour ( ) else : colText = listctrl . GetForegroundColour ( ) elif attr and attr . HasTextColour ( ) : colText = attr . GetTextColour ( ) else : colText = listctrl . GetForegroundColour ( ) dc . SetTextForeground ( colText ) # font if attr and attr . HasFont ( ) : font = attr . GetFont ( ) else : font = listctrl . GetFont ( ) dc . SetFont ( font ) # bg colour hasBgCol = attr and attr . HasBackgroundColour ( ) if highlighted or hasBgCol : if highlighted : dc . SetBrush ( self . _owner . GetHighlightBrush ( ) ) else : dc . SetBrush ( wx . Brush ( attr . GetBackgroundColour ( ) , wx . SOLID ) ) dc . SetPen ( wx . TRANSPARENT_PEN ) return True return False