mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 05:36:59 -04:00
Slightly fancier dotted pen on wxMSW
This commit is contained in:
@@ -39,14 +39,29 @@ Rotation ValueViewer::getRotation() const {
|
|||||||
return Rotation(deg_to_rad(getStyle()->angle), getStyle()->getExternalRect(), 1.0, getStretch());
|
return Rotation(deg_to_rad(getStyle()->angle), getStyle()->getExternalRect(), 1.0, getStretch());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__WXMSW__)
|
||||||
|
// on windows, wxDOT is not actually dotted, so use a custom style to achieve that
|
||||||
|
static wxDash dashes_dotted[] = { 0,2 };
|
||||||
|
wxPen dotted_pen(wxColour const& color) {
|
||||||
|
wxPen pen(color, 1, wxUSER_DASH);
|
||||||
|
pen.SetDashes(2, dashes_dotted);
|
||||||
|
return pen;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
wxPen dotted_pen(wxColour const& color) {
|
||||||
|
return wxPen(color, 1, wxPENSTYLE_DOT);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool ValueViewer::setFieldBorderPen(RotatedDC& dc) {
|
bool ValueViewer::setFieldBorderPen(RotatedDC& dc) {
|
||||||
if (!getField()->editable) return false;
|
if (!getField()->editable) return false;
|
||||||
DrawWhat what = viewer.drawWhat(this);
|
DrawWhat what = viewer.drawWhat(this);
|
||||||
if (!(what & DRAW_BORDERS)) return false;
|
if (!(what & DRAW_BORDERS)) return false;
|
||||||
dc.SetPen( (what & DRAW_ACTIVE)
|
if (what & DRAW_ACTIVE) {
|
||||||
? wxPen(Color(0,128,255), 1, wxPENSTYLE_SOLID)
|
dc.SetPen(wxPen(Color(0, 128, 255), 1, wxPENSTYLE_SOLID));
|
||||||
: wxPen(Color(128,128,128), 1, wxPENSTYLE_DOT)
|
} else {
|
||||||
);
|
dc.SetPen(dotted_pen(Color(128, 128, 128)));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user