Beispiel #1
0
void ChartWidget::paintEvent(QPaintEvent*)
{
    QPainter painter(this);
    painter.setWindow(0,0,width(),height());
    painter.eraseRect(0,0,width(),height());

    QPen pen0(Qt::SolidLine);
    pen0.setColor(palette().color(QPalette::Window));
    painter.setPen(pen0);
    painter.drawRect(0,0,width(),height());

    QPen pen1(Qt::DashDotLine);
    pen1.setColor(palette().color(QPalette::Mid));
    painter.setPen(pen1);
    painter.drawLine(0,height()/2,width(),height()/2);

    for (int i=10;i<m_polygon.count();i+=10)
    {
        painter.drawLine(m_polygon[i].x(),0,m_polygon[i].x(),height());
    }

    QPen pen2(Qt::SolidLine);
    pen2.setColor(palette().color(QPalette::Dark));
    painter.setPen(pen2);

    painter.drawEllipse(m_plyIndicator,height()/2-2,3,3);

    painter.setRenderHints(QPainter::Antialiasing);
    painter.drawPolyline(m_polygon);
}
Beispiel #2
0
void YGroup::draw(CDC* dc){
	if (isSelected == TRUE){

		CPen pen0(PS_DOT, 1, RGB(0, 0, 0));
		dc->SelectObject(pen0);
		dc->SelectStockObject(NULL_BRUSH);
		dc->Rectangle(sPoint.x, sPoint.y, ePoint.x, ePoint.y);

		//draw circle
		mRect[0].SetRect(sPoint.x - 10, sPoint.y - 10, sPoint.x + 10, sPoint.y + 10);
		mRect[1].SetRect(ePoint.x - 10, ePoint.y - 10, ePoint.x + 10, ePoint.y + 10);
		mRect[2].SetRect(ePoint.x - 10, sPoint.y - 10, ePoint.x + 10, sPoint.y + 10);
		mRect[3].SetRect(sPoint.x - 10, ePoint.y - 10, sPoint.x + 10, ePoint.y + 10);

		CPen* oldPen;
		CPen pen(PS_SOLID, 2, RGB(0, 0, 0));
		oldPen = dc->SelectObject(&pen);
		dc->SelectStockObject(WHITE_BRUSH);
		dc->Ellipse(mRect[0]);
		dc->Ellipse(mRect[1]);
		dc->Ellipse(mRect[2]);
		dc->Ellipse(mRect[3]);

	}

	YObject* tmp;
	POSITION pos = groupList.GetHeadPosition();
	while (pos){
		tmp = groupList.GetNext(pos);
		tmp->draw(dc);
	}
}
void CFreqDial::drawDial()
{
	wxMemoryDC dc;
	dc.SelectObject(*m_bitmap);

#if defined(__WXMSW__)
	int major, minor;
	::wxGetOsVersion(&major, &minor);

	wxColour bgColour;
	if (major >= 6)
		bgColour = wxColour(0xF0, 0xF0, 0xF0);		// Windows Vista and newer
	else if (major == 5 && minor >= 1)
		bgColour = wxColour(0xEC, 0xE9, 0xD8);		// Windows XP
	else
		bgColour = wxColour(0xD4, 0xD0, 0xC8);		// Windows 2000 and earlier
#elif defined(__WXGTK__)
	wxColour bgColour(0xF0, 0xF1, 0xF2);
	// wxColour bgColour(0xED, 0xE9, 0xE3);
#elif defined(__WXMAC__)
	wxColour bgColour(0xF0, 0xF0, 0xF0);
#else
#error "Unknown platform"
#endif

	wxBrush brush0(bgColour);
	wxPen pen0(bgColour);

	dc.SetPen(pen0);
	dc.SetBrush(brush0);
	dc.DrawRectangle(0, 0, m_width, m_height);

	int middleX = m_width / 2;
	int middleY = m_height / 2;

	dc.SetBrush(*wxLIGHT_GREY_BRUSH);
	wxPen pen1(*wxBLACK, 2, wxSOLID);
	dc.SetPen(pen1);
	dc.DrawCircle(middleX, middleY, (m_width - 2) / 2);

	int x = m_width / 2 - int(double(m_width / 2 - 25) * ::sin(m_angle * (M_PI / 180.0)) + 0.5);
	int y = m_height / 2 + int(double(m_height / 2 - 25) * ::cos(m_angle * (M_PI / 180.0)) + 0.5);

	dc.SetBrush(*wxBLACK_BRUSH);
	wxPen pen2(*wxWHITE, 2, wxSOLID);
	dc.SetPen(pen2);
	dc.DrawCircle(x, y, 20);

	dc.SelectObject(wxNullBitmap);

	wxClientDC clientDC(this);
	show(clientDC);
}
Beispiel #4
0
void CPlotter::DrawOverlay()                                 //DrawOverlay()
{
  if(m_OverlayPixmap.isNull() or m_WaterfallPixmap.isNull() or
     m_dialFreq==0) return;
//  int w = m_WaterfallPixmap.width();
  int x,y;

  QRect rect;
  QPainter painter(&m_OverlayPixmap);
  painter.initFrom(this);
  QLinearGradient gradient(0, 0, 0 ,m_h2);  //fill background with gradient
  gradient.setColorAt(1, Qt::black);
  gradient.setColorAt(0, Qt::darkBlue);
  painter.setBrush(gradient);
  painter.drawRect(0, 0, m_w, m_h2);
  painter.setBrush(Qt::SolidPattern);

  m_fSpan = m_w*m_fftBinWidth;
  int n=m_fSpan/10;
  m_freqPerDiv=10;
  if(n>25) m_freqPerDiv=50;
  if(n>70) m_freqPerDiv=100;
  if(n>140) m_freqPerDiv=200;
  if(n>310) m_freqPerDiv=500;
  float pixPerHdiv = m_freqPerDiv/m_fftBinWidth;
  float pixPerVdiv = float(m_h2)/float(VERT_DIVS);

  m_RFHz=int(1000000.0*m_dialFreq+m_StartFreq + 0.5) % 1000;
  m_hdivs = m_w*m_fftBinWidth/m_freqPerDiv + 0.9999;

  painter.setPen(QPen(Qt::white, 1,Qt::DotLine));
  for( int i=1; i<m_hdivs; i++)                   //draw vertical grids
  {
    x=int(i*pixPerHdiv);
    painter.drawLine(x,0,x,m_h2);
  }

  for( int i=1; i<VERT_DIVS; i++)                 //draw horizontal grids
  {
    y = (int)( (float)i*pixPerVdiv );
    painter.drawLine(0,y,m_w,y);
  }

  QRect rect0;
  QPainter painter0(&m_ScalePixmap);
  painter0.initFrom(this);

  //create Font to use for scales
  QFont Font("Arial");
  Font.setPointSize(12);
  QFontMetrics metrics(Font);
  Font.setWeight(QFont::Normal);
  painter0.setFont(Font);
  painter0.setPen(Qt::black);

  m_ScalePixmap.fill(Qt::white);
  painter0.drawRect(0, 0, m_w, 30);

//draw tick marks on upper scale
  for( int i=1; i<m_hdivs; i++) {         //major ticks
    x = (int)( (float)i*pixPerHdiv );
    painter0.drawLine(x,18,x,30);
  }
  int minor=5;
  if(m_freqPerDiv==200) minor=4;
  for( int i=1; i<minor*m_hdivs; i++) {   //minor ticks
    x = i*pixPerHdiv/minor;
    painter0.drawLine(x,24,x,30);
  }

//draw frequency values
  MakeFrequencyStrs();
  for( int i=0; i<=m_hdivs; i++) {
    if(0==i) {
      //left justify the leftmost text
      x = (int)( (float)i*pixPerHdiv);
      rect0.setRect(x,0, (int)pixPerHdiv, 20);
      painter0.drawText(rect0, Qt::AlignLeft|Qt::AlignVCenter,
                       m_HDivText[i]);
    }
    else if(m_hdivs == i) {
      //right justify the rightmost text
      x = (int)( (float)i*pixPerHdiv - pixPerHdiv);
      rect0.setRect(x,0, (int)pixPerHdiv, 20);
      painter0.drawText(rect0, Qt::AlignRight|Qt::AlignVCenter,
                       m_HDivText[i]);
    } else {
      //center justify the rest of the text
      x = (int)( (float)i*pixPerHdiv - pixPerHdiv/2);
      rect0.setRect(x,0, (int)pixPerHdiv, 20);
      painter0.drawText(rect0, Qt::AlignHCenter|Qt::AlignVCenter,
                       m_HDivText[i]);
    }
  }

  QPen pen0(Qt::green, 3);              //Mark decoding range with green line
  painter0.setPen(pen0);
  int x1,x2;
  if(m_nsps==8192) {
    x=XfromFreq(1500);
    x1=x - 100/m_fftBinWidth;
    x2=x + 100/m_fftBinWidth;
  } else {
    x=XfromFreq(1612.5);
    x1=x - 12.5/m_fftBinWidth;
    x2=x + 12.5/m_fftBinWidth;
  }
  pen0.setWidth(6);
  painter0.drawLine(x1,28,x2,28);

  QPen pen1(Qt::red, 3);                         //Mark Tx Freq with red tick
  painter0.setPen(pen1);
  x = XfromFreq(m_TxFreq);
  painter0.drawLine(x,17,x,30);

}
Beispiel #5
0
void CSkinBtn::DrawButtonTitle()
{
	if(m_bRePain == FALSE)
	{
		CClientDC  dc(this);

		CRect	rect;
		GetClientRect(&rect);

		CDC memDC;
		memDC.CreateCompatibleDC(&dc);

		CBitmap Screen;
		Screen.CreateCompatibleBitmap(&dc, rect.Width(), rect.Height());
		memDC.SelectObject(&Screen);
		Screen.DeleteObject();


		//画背景 
		memDC.BitBlt(rect.left, rect.top, rect.Width(), rect.Height(), &m_memDC, 0, 0, SRCCOPY);

	//	CString str(_T(""));
	//	GetWindowText(str);	

		memDC.SetBkMode(TRANSPARENT);
		memDC.SelectObject(m_pFont);

	//	CDC MemDC;
	//	MemDC.CreateCompatibleDC(&dc);

       
        CPen pen;
		
	//	CRgb textColor(255,255,255);
        
		switch(m_state)
		{
		case NORMAL:
			memDC.SetTextColor(RGB(97,113,197));
			pen.CreatePen(PS_SOLID , 1, RGB(255,0,0));
			break;
		case HOVER:
			memDC.SetTextColor(RGB(36,93,219));
			pen.CreatePen(PS_SOLID , 1, RGB(0,255,0));
			break;
		case DOWN:
			memDC.SetTextColor(GetBGColor());
			pen.CreatePen(PS_SOLID , 1, RGB(0,0,255));
			break;
		case DISABLE:
			memDC.SetTextColor(GetFGColor());
			pen.CreatePen(PS_SOLID , 1, RGB(225,225,225));
			break;
		default:
			break;
		}
        CPen* pOldPen = (CPen*)memDC.SelectObject(&pen);
		memDC.RoundRect(rect.left, rect.top, rect.Width(), rect.Height(),2,2);
		memDC.SelectObject(pOldPen);

		CPen pen0(PS_SOLID , 1, RGB(255, 255, 255));
		CPen* pOldPen0 = (CPen*)memDC.SelectObject(&pen);
		int nXpos = 0;
		int nYpos = 0;
		int n = 0;
		int m = 0;
		int nWidth = 0;
		int nHeight = 0;
		switch(m_BtnNum)
		{
			case 1://最小化
				
				nWidth = 13;
				nXpos = rect.left + 1;
		        nYpos = rect.top +  (nWidth/2 );
                for( n = nXpos + 3;n < nXpos + nWidth;n++)
				{
					//memDC.MoveTo(nXpos + nWidth/2 - 1,nYpos - 1);
					//memDC.LineTo(nXpos + nWidth/2+ 1 ,nYpos - 1);
					memDC.MoveTo(n,nXpos + 6);
		         	memDC.LineTo(n ,nXpos + 2 + 6);
					nYpos--;

				}
				break;
				
			case 2://还原
				nWidth = 7;
				nHeight = 7;
				nXpos = rect.left + 5;
		        nYpos = rect.top + 5;
				for(m = 0;m < 2;m++)
				{
					memDC.MoveTo(nXpos,nYpos);
					memDC.LineTo(nXpos + nWidth ,nYpos);

					memDC.MoveTo(nXpos,nYpos);
					memDC.LineTo(nXpos ,nYpos + nHeight);

					memDC.MoveTo(nXpos + nWidth,nYpos + nHeight);
					memDC.LineTo(nXpos ,nYpos + nHeight);

					memDC.MoveTo(nXpos + nWidth,nYpos + nHeight);
					memDC.LineTo(nXpos + nWidth ,nYpos);
					nXpos+=2;
					nYpos+=2;
				}
				break;
			case 3://关闭
				nWidth = 10;
				nXpos = rect.left + 4;
		        nYpos = rect.top + (nWidth - 1) + 4;
				for(n = nXpos;n < nXpos + 10;n++)
				{
					memDC.MoveTo(n,n);
					memDC.LineTo(n + 3,n);

					memDC.MoveTo(n,nYpos);
					memDC.LineTo(n + 3,nYpos);
					nYpos--;

				}
				break;
			case 4://下三角按妞
				nWidth = 9;
				nXpos = rect.left;
		        nYpos = rect.top ;
				for(m = 0;m < 5;m++)
				{
					memDC.MoveTo(nXpos + m + 3,nYpos + m + 3);
			        memDC.LineTo(nXpos + nWidth - m + 3  ,nYpos + m + 3);
				}
				break;
			case 5://加号按妞
		    	nWidth = 14;
				nXpos = rect.left + 1;
		        nYpos = rect.top +  (nWidth/2 );
                for( n = nXpos + 3;n < nXpos + nWidth;n++)
				{
					//memDC.MoveTo(nXpos + nWidth/2 - 1,nYpos - 1);
					//memDC.LineTo(nXpos + nWidth/2+ 1 ,nYpos - 1);
					memDC.MoveTo(n,nXpos + 6);
		         	memDC.LineTo(n ,nXpos + 2 + 6);

					memDC.MoveTo(nXpos + nWidth/2 - 1 + 1,nYpos - 1 + 7);
		            memDC.LineTo(nXpos + nWidth/2 + 1 + 1,nYpos - 1 + 7);
					nYpos--;

				}
				break;
			case 6://画下划线按妞
				memDC.SetBkColor(TRANSPARENT);
				nXpos = rect.left ;
		        nYpos = rect.top +5;
                memDC.TextOut(23,nYpos,m_strTextOut);
		        
				break;
			default:
				break;
		}
        memDC.SelectObject(pOldPen0);
		dc.BitBlt(rect.left, rect.top, rect.Width(), rect.Height(), &memDC, 0, 0, SRCCOPY);
		memDC.DeleteDC();
		//MemDC.DeleteDC();
	}
}
Beispiel #6
0
void CVolumeDial::drawDial()
{
	wxMemoryDC dc;
	dc.SelectObject(*m_bitmap);

#if defined(__WXMSW__)
	int major, minor;
	::wxGetOsVersion(&major, &minor);

	wxColour bgColour;
	if (major >= 6)
		bgColour = wxColour(0xF0, 0xF0, 0xF0);		// Windows Vista and newer
	else if (major == 5 && minor >= 1)
		bgColour = wxColour(0xEC, 0xE9, 0xD8);		// Windows XP
	else
		bgColour = wxColour(0xD4, 0xD0, 0xC8);		// Windows 2000 and earlier
#elif defined(__WXGTK__)
	wxColour bgColour(0xF0, 0xF1, 0xF2);
	// wxColour bgColour(0xED, 0xE9, 0xE3);
#elif defined(__WXMAC__)
	wxColour bgColour(0xE8, 0xE8, 0xE8);
#else
#error "Unknown platform"
#endif

	wxBrush brush0(bgColour);
	wxPen pen0(bgColour);

	dc.SetPen(pen0);
	dc.SetBrush(brush0);
	dc.DrawRectangle(0, 0, m_width, m_height);

	if (IsEnabled()) {
		dc.SetBrush(*wxLIGHT_GREY_BRUSH);
		dc.SetPen(wxPen(*wxBLACK, 2, wxSOLID));
	} else {
		dc.SetBrush(brush0);
		dc.SetPen(wxPen(*wxLIGHT_GREY, 2, wxSOLID));
	}

	dc.DrawEllipse(1, 1, m_width - 2, m_height - 2);

	double incr = 270.0 / double(m_max - m_min); 

	double angle = (double(m_value - m_min) * incr + 45.0) * (M_PI / 180.0);

	double xFrac = ::sin(angle);
	double yFrac = ::cos(angle);

	int startX = m_width / 2 - int(double(m_width / 2 - 10) * xFrac + 0.5);
	int startY = m_height / 2 + int(double(m_height / 2 - 10) * yFrac + 0.5);

	int endX = m_width / 2 - int(double(m_width / 2 - 20) * xFrac + 0.5);
	int endY = m_height / 2 + int(double(m_height / 2 - 20) * yFrac + 0.5);

	if (IsEnabled())
		dc.SetPen(wxPen(*wxBLACK, 5, wxSOLID));
	else
		dc.SetPen(wxPen(*wxLIGHT_GREY, 2, wxSOLID));

	dc.DrawLine(startX, startY, endX, endY);	

	dc.SelectObject(wxNullBitmap);

	wxClientDC clientDC(this);
	show(clientDC);
}
Beispiel #7
0
void CPlotter::DrawOverlay()                                 //DrawOverlay()
{
  if(m_OverlayPixmap.isNull()) return;
  if(m_WaterfallPixmap.isNull()) return;
  int w = m_WaterfallPixmap.width();
  int x,y,x1,x2;
//  int nHzDiv[11]={0,50,100,200,200,200,500,500,500,500,500};
  float pixperdiv;

  QRect rect;
  QPainter painter(&m_OverlayPixmap);
  painter.initFrom(this);
  QLinearGradient gradient(0, 0, 0 ,m_h2);  //fill background with gradient
  gradient.setColorAt(1, Qt::black);
  gradient.setColorAt(0, Qt::darkBlue);
  painter.setBrush(gradient);
  painter.drawRect(0, 0, m_w, m_h2);
  painter.setBrush(Qt::SolidPattern);

  double df = m_binsPerPixel*m_fftBinWidth;
  pixperdiv = m_freqPerDiv/df;
  y = m_h2 - m_h2/VERT_DIVS;
  m_hdivs = w*df/m_freqPerDiv + 0.9999;
  for( int i=1; i<m_hdivs; i++)                   //draw vertical grids
  {
    x = (int)( (float)i*pixperdiv );
    if(x >= 0 and x<=m_w) {
      painter.setPen(QPen(Qt::white, 1,Qt::DotLine));
      painter.drawLine(x, 0, x , y);
      painter.drawLine(x, m_h2-5, x , m_h2);
    }
  }

  pixperdiv = (float)m_h2 / (float)VERT_DIVS;
  painter.setPen(QPen(Qt::white, 1,Qt::DotLine));
  for( int i=1; i<VERT_DIVS; i++)                 //draw horizontal grids
  {
          y = (int)( (float)i*pixperdiv );
          painter.drawLine(0, y, w, y);
  }

  QRect rect0;
  QPainter painter0(&m_ScalePixmap);
  painter0.initFrom(this);

  //create Font to use for scales
  QFont Font("Arial");
  Font.setPointSize(12);
  QFontMetrics metrics(Font);
  Font.setWeight(QFont::Normal);
  painter0.setFont(Font);
  painter0.setPen(Qt::black);

  if(m_binsPerPixel < 1) m_binsPerPixel=1;
  m_fSpan = w*df;
  int n=m_fSpan/10;
  m_freqPerDiv=10;
  if(n>25) m_freqPerDiv=50;
  if(n>70) m_freqPerDiv=100;
  if(n>140) m_freqPerDiv=200;
  if(n>310) m_freqPerDiv=500;
  m_hdivs = w*df/m_freqPerDiv + 0.9999;
  m_ScalePixmap.fill(Qt::white);
  painter0.drawRect(0, 0, w, 30);

//draw tick marks on upper scale
  pixperdiv = m_freqPerDiv/df;
  for( int i=1; i<m_hdivs; i++) {     //major ticks
    x = (int)( (float)i*pixperdiv );
    painter0.drawLine(x,18,x,30);
  }
  int minor=5;
  if(m_freqPerDiv==200) minor=4;
  for( int i=1; i<minor*m_hdivs; i++) {   //minor ticks
    x = i*pixperdiv/minor;
    painter0.drawLine(x,24,x,30);
  }

  //draw frequency values
  MakeFrequencyStrs();
  for( int i=0; i<=m_hdivs; i++) {
    if(0==i) {
      //left justify the leftmost text
      x = (int)( (float)i*pixperdiv);
      rect0.setRect(x,0, (int)pixperdiv, 20);
      painter0.drawText(rect0, Qt::AlignLeft|Qt::AlignVCenter,
                       m_HDivText[i]);
    }
    else if(m_hdivs == i) {
      //right justify the rightmost text
      x = (int)( (float)i*pixperdiv - pixperdiv);
      rect0.setRect(x,0, (int)pixperdiv, 20);
      painter0.drawText(rect0, Qt::AlignRight|Qt::AlignVCenter,
                       m_HDivText[i]);
    } else {
      //center justify the rest of the text
      x = (int)( (float)i*pixperdiv - pixperdiv/2);
      rect0.setRect(x,0, (int)pixperdiv, 20);
      painter0.drawText(rect0, Qt::AlignHCenter|Qt::AlignVCenter,
                       m_HDivText[i]);
    }
  }

  float bw=9.0*12000.0/m_nsps;
  if(m_modeTx=="JT65") bw=66.0*11025.0/4096.0;

  QPen pen0(Qt::green, 3);                 //Mark Rx Freq with green
  painter0.setPen(pen0);
  x1=XfromFreq(m_rxFreq);
  x2=XfromFreq(m_rxFreq+bw);
  painter0.drawLine(x1,24,x1,30);
  painter0.drawLine(x1,28,x2,28);
  painter0.drawLine(x2,24,x2,30);

  if(m_mode=="JT9+JT65") {
    QPen pen2(Qt::blue, 3);                //Mark the JT65 | JT9 divider
    painter0.setPen(pen2);
    x1=XfromFreq(m_fMin);
    if(x1<2) x1=2;
    x2=x1+30;
    painter0.drawLine(x1,8,x1,28);
  }

  QPen pen1(Qt::red, 3);                   //Mark Tx freq with red
  painter0.setPen(pen1);
  x1=XfromFreq(m_txFreq);
  x2=XfromFreq(m_txFreq+bw);
  painter0.drawLine(x1,17,x1,21);
  painter0.drawLine(x1,17,x2,17);
  painter0.drawLine(x2,17,x2,21);
}
Beispiel #8
0
DendroColorPoint DendrogramPanel::doDraw(wxDC &dc, int node_idx, int y)
{
    
    wxSize sz = this->GetClientSize();
    double hh = sz.y;
    double ww = sz.x;
    
    if (node_idx >= 0) {
        int x = ww - margin - 30;

        wxColour clr =  color_vec[clusters[node_idx] -1];
        RectNode* end = new RectNode(node_idx, x, currentY, clr);
        end->draw(dc);
        end_nodes.push_back(end);
        
        int resultX = x;
        int resultY = currentY;
        
        currentY += heightPerLeaf;
        
        wxPoint pt(resultX, resultY);
        return DendroColorPoint(pt, clr);
    }
    
    if (accessed_node.find(node_idx) != accessed_node.end()) {
        // loop!!!
        return DendroColorPoint();
    }
    accessed_node[node_idx] = 1;
    
    DendroColorPoint cp0 = doDraw(dc, root[-node_idx -1].left, y);
    DendroColorPoint cp1 = doDraw(dc, root[-node_idx -1].right, y+heightPerLeaf);
    
    wxPoint p0 = cp0.pt;
    wxColour c0 = cp0.color;
    
    wxPoint p1 = cp1.pt;
    wxColour c1 = cp1.color;
    
    //dc.DrawRectangle(wxRect(p0.x-2, p0.y-2, 4, 4));
    //dc.DrawRectangle(wxRect(p1.x-2, p1.y-2, 4, 4));
    
    double dist = level_node[node_idx];
    int vx = ww - margin - 30 - (ww - 2*margin - 30) * dist / maxDistance ;
    
    wxPen pen0(c0);
    dc.SetPen(pen0);
    dc.DrawLine(vx, p0.y, p0.x, p0.y);
    
    wxPen pen1(c1);
    dc.SetPen(pen1);
    dc.DrawLine(vx, p1.y, p1.x, p1.y);
    
    if (c0 == c1) {
        dc.DrawLine(vx, p0.y, vx, p1.y);
    } else {
        dc.SetPen(*wxBLACK_PEN);
        dc.DrawLine(vx, p0.y, vx, p1.y);
    }
    dc.SetPen(*wxBLACK_PEN);
    
    wxPoint p(vx, p0.y+(p1.y - p0.y)/2);
    
    if (c0 == c1) {
        return DendroColorPoint(p, c0);
    } else {
        return DendroColorPoint(p, *wxBLACK);
    }
}