Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

void wxPdfDocument::SetLineStyle ( const wxPdfLineStyle linestyle ) [virtual]

Sets line style.

Parameters:
linestyle,:Line style.
See also:
wxPdfLineStale

Definition at line 1582 of file pdfgraphics.cpp.

References Double2String(), wxPdfLineStyle::GetColour(), wxPdfLineStyle::GetDash(), wxPdfLineStyle::GetLineCap(), wxPdfLineStyle::GetLineJoin(), wxPdfLineStyle::GetPhase(), wxPdfLineStyle::GetWidth(), m_lineStyle, m_lineWidth, OutAscii(), SetDrawColor(), and SetLineWidth().

Referenced by RegularPolygon(), and StarPolygon().

{
  m_lineStyle = linestyle;
  if (linestyle.GetWidth() >= 0)
  {
    double width_prev = m_lineWidth;
    SetLineWidth(linestyle.GetWidth());
    m_lineWidth = width_prev;
  }
  switch (linestyle.GetLineCap())
  {
    case wxPDF_LINECAP_BUTT:
    case wxPDF_LINECAP_ROUND:
    case wxPDF_LINECAP_SQUARE:
      OutAscii(wxString::Format(_T("%d  J"), linestyle.GetLineCap()));
      break;
    default:
      break;
  }
  switch (linestyle.GetLineJoin())
  {
    case wxPDF_LINEJOIN_MITER:
    case wxPDF_LINEJOIN_ROUND:
    case wxPDF_LINEJOIN_BEVEL:
      OutAscii(wxString::Format(_T("%d  j"), linestyle.GetLineJoin()));
      break;
    default:
      break;
  }

  const wxPdfArrayDouble& dash = linestyle.GetDash();
  if (&dash != NULL)
  {
    wxString dashString = _T("");
    size_t j;
    for (j = 0; j < dash.GetCount(); j++)
    {
      if (j > 0)
      {
        dashString += wxString(_T(" "));
      }
      dashString += Double2String(dash[j],2);
    }
    double phase = linestyle.GetPhase();
    if (phase < 0 || dashString.Length() == 0)
    {
      phase = 0;
    }
    OutAscii(wxString(_T("[")) + dashString + wxString(_T("] ")) +
             Double2String(phase,2) + wxString(_T(" d")));
  }
  SetDrawColor(linestyle.GetColour());
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index