X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8462a84b2caab30265823ebbdbdfc7cff91486e6..fe63109fc4429d3ca70310102f0a5daaee02f861:/src/stc/PlatWX.cpp diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 8149bfbf5c..7512383fca 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -35,6 +35,9 @@ #ifdef wxHAS_RAW_BITMAP #include "wx/rawbmp.h" #endif +#if wxUSE_GRAPHICS_CONTEXT +#include "wx/dcgraph.h" +#endif #include "Platform.h" #include "PlatWX.h" @@ -65,6 +68,14 @@ wxColour wxColourFromCA(const ColourAllocated& ca) { (unsigned char)cd.GetBlue()); } +wxColour wxColourFromCAandAlpha(const ColourAllocated& ca, int alpha) { + ColourDesired cd(ca.AsLong()); + return wxColour((unsigned char)cd.GetRed(), + (unsigned char)cd.GetGreen(), + (unsigned char)cd.GetBlue(), + (unsigned char)alpha); +} + //---------------------------------------------------------------------- Palette::Palette() { @@ -367,6 +378,16 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill, ColourAllocated outline, int alphaOutline, int /*flags*/) { +#if wxUSE_GRAPHICS_CONTEXT + wxGCDC dc(*(wxMemoryDC*)hdc); + wxColour penColour(wxColourFromCAandAlpha(outline, alphaOutline)); + wxColour brushColour(wxColourFromCAandAlpha(fill, alphaFill)); + dc.SetPen(wxPen(penColour)); + dc.SetBrush(wxBrush(brushColour)); + dc.DrawRoundedRectangle(wxRectFromPRectangle(rc), cornerSize); + return; +#else + #ifdef wxHAS_RAW_BITMAP // TODO: do something with cornerSize @@ -435,6 +456,7 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, wxUnusedVar(alphaOutline); RectangleDraw(rc, outline, fill); #endif +#endif } void SurfaceImpl::Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back) {