X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9b01abb82d79983cdc0e94f46e8f2ea99705aab2..404b319a85dadd7decf7a5a5331020520031a41c:/src/stc/PlatWX.cpp?ds=sidebyside diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 661b5207fe..af67c0cdaa 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -277,7 +277,14 @@ void SurfaceImpl::LineTo(int x_, int y_) { void SurfaceImpl::Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back) { PenColour(fore); BrushColour(back); - hdc->DrawPolygon(npts, (wxPoint*)pts); + wxPoint *p = new wxPoint[npts]; + + for (int i=0; iDrawPolygon(npts, p); + delete [] p; } void SurfaceImpl::RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) { @@ -337,55 +344,60 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, int x, y; wxRect r = wxRectFromPRectangle(rc); wxBitmap bmp(r.width, r.height, 32); - wxAlphaPixelData pixData(bmp); - // Set the fill pixels - ColourDesired cdf(fill.AsLong()); - int red = cdf.GetRed(); - int green = cdf.GetGreen(); - int blue = cdf.GetBlue(); + // This block is needed to ensure that the changes done to the bitmap via + // pixel data object are committed before the bitmap is drawn. + { + wxAlphaPixelData pixData(bmp); + + // Set the fill pixels + ColourDesired cdf(fill.AsLong()); + int red = cdf.GetRed(); + int green = cdf.GetGreen(); + int blue = cdf.GetBlue(); + + wxAlphaPixelData::Iterator p(pixData); + for (y=0; yShow(); #endif -#ifdef __WXOSX_COCOA__ +#if defined(__WXOSX_COCOA__) || defined(__WXGTK__) + // This color will end up being our border SetBackgroundColour(wxColour(0xC0, 0xC0, 0xC0)); #endif } @@ -893,7 +906,7 @@ public: x = y = 0; w = sz.x; h = sz.y; -#ifdef __WXOSX_COCOA__ +#if defined(__WXOSX_COCOA__) || defined(__WXGTK__) // make room for the parent's bg color to show, to act as a border x = y = 1; w -= 2; @@ -1322,8 +1335,10 @@ void ListBoxImpl::RegisterImage(int type, const char *xpm_data) { void ListBoxImpl::RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) { +#ifdef wxHAS_RAW_BITMAP wxBitmap bmp = BitmapFromRGBAImage(width, height, pixelsImage); RegisterImageHelper(type, bmp); +#endif }