memdc.DrawRectangle(0,0,20,70);
memdc.DrawLine( 10,0,10,70 );
+ // to the right
+ memdc.SetPen(*wxRED_PEN);
memdc.DrawLine( 10, 5,10, 5 );
memdc.DrawLine( 10,10,11,10 );
memdc.DrawLine( 10,15,12,15 );
memdc.DrawLine( 10,20,13,20 );
+/*
+ memdc.SetPen(*wxRED_PEN);
memdc.DrawLine( 12, 5,12, 5 );
memdc.DrawLine( 12,10,13,10 );
memdc.DrawLine( 12,15,14,15 );
memdc.DrawLine( 12,20,15,20 );
+*/
// same to the left
memdc.DrawLine( 10,25,10,25 );
memdc.DrawLine( 10,40, 7,40 );
// XOR draw lines
+ dc.SetPen(*wxWHITE_PEN);
memdc.SetLogicalFunction( wxINVERT );
memdc.SetPen( *wxWHITE_PEN );
memdc.DrawLine( 10,50,10,50 );
GdkCapStyle capStyle = GDK_CAP_ROUND;
switch (m_pen.GetCap())
{
- case wxCAP_ROUND: { capStyle = (width <= 1) ? GDK_CAP_NOT_LAST : GDK_CAP_ROUND; break; }
case wxCAP_PROJECTING: { capStyle = GDK_CAP_PROJECTING; break; }
case wxCAP_BUTT: { capStyle = GDK_CAP_BUTT; break; }
+ case wxCAP_ROUND:
+ default:
+ {
+ if (width <= 1)
+ {
+ width = 0;
+ capStyle = GDK_CAP_NOT_LAST;
+ }
+ else
+ {
+ capStyle = GDK_CAP_ROUND;
+ }
+ break;
+ }
}
GdkJoinStyle joinStyle = GDK_JOIN_ROUND;
switch (m_pen.GetJoin())
{
case wxJOIN_BEVEL: { joinStyle = GDK_JOIN_BEVEL; break; }
- case wxJOIN_ROUND: { joinStyle = GDK_JOIN_ROUND; break; }
case wxJOIN_MITER: { joinStyle = GDK_JOIN_MITER; break; }
+ case wxJOIN_ROUND:
+ default: { joinStyle = GDK_JOIN_ROUND; break; }
}
gdk_gc_set_line_attributes( m_penGC, width, lineStyle, capStyle, joinStyle );
GdkCapStyle capStyle = GDK_CAP_ROUND;
switch (m_pen.GetCap())
{
- case wxCAP_ROUND: { capStyle = (width <= 1) ? GDK_CAP_NOT_LAST : GDK_CAP_ROUND; break; }
case wxCAP_PROJECTING: { capStyle = GDK_CAP_PROJECTING; break; }
case wxCAP_BUTT: { capStyle = GDK_CAP_BUTT; break; }
+ case wxCAP_ROUND:
+ default:
+ {
+ if (width <= 1)
+ {
+ width = 0;
+ capStyle = GDK_CAP_NOT_LAST;
+ }
+ else
+ {
+ capStyle = GDK_CAP_ROUND;
+ }
+ break;
+ }
}
GdkJoinStyle joinStyle = GDK_JOIN_ROUND;
switch (m_pen.GetJoin())
{
case wxJOIN_BEVEL: { joinStyle = GDK_JOIN_BEVEL; break; }
- case wxJOIN_ROUND: { joinStyle = GDK_JOIN_ROUND; break; }
case wxJOIN_MITER: { joinStyle = GDK_JOIN_MITER; break; }
+ case wxJOIN_ROUND:
+ default: { joinStyle = GDK_JOIN_ROUND; break; }
}
gdk_gc_set_line_attributes( m_penGC, width, lineStyle, capStyle, joinStyle );