]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/PlatWX.cpp
Another compilation fix for wxMSW without PCH.
[wxWidgets.git] / src / stc / PlatWX.cpp
index a58a60d8f5086e2d515a01d2e4de72ae10ee51c0..7512383fca331c47bf4f4beec09d3cfa13cc928a 100644 (file)
@@ -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() {
@@ -140,7 +151,7 @@ Font::~Font() {
 
 void Font::Create(const char *faceName, int characterSet,
                   int size, bool bold, bool italic,
-                  bool extraFontFlag) {
+                  bool WXUNUSED(extraFontFlag)) {
     Release();
 
     // The minus one is done because since Scintilla uses SC_SHARSET_DEFAULT
@@ -160,7 +171,6 @@ void Font::Create(const char *faceName, int characterSet,
                     false,
                     stc2wx(faceName),
                     encoding);
-    font->SetNoAntiAliasing(!extraFontFlag);
     id = font;
 }
 
@@ -368,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
@@ -436,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) {