X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d67c33888f65e236adedd65ffbd978607eadc9d5..34f0083726b6fd8d642df975e8999ca0dc8af903:/src/stc/PlatWX.cpp diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 1fc084cb15..79bb27b801 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -32,9 +32,7 @@ #include "wx/imaglist.h" #include "wx/tokenzr.h" -#ifdef wxHAVE_RAW_BITMAP #include "wx/rawbmp.h" -#endif #include "Platform.h" #include "PlatWX.h" @@ -291,11 +289,11 @@ bool SurfaceImpl::Initialised() { void SurfaceImpl::PenColour(ColourAllocated fore) { - hdc->SetPen(wxPen(wxColourFromCA(fore), 1, wxSOLID)); + hdc->SetPen(wxPen(wxColourFromCA(fore))); } void SurfaceImpl::BrushColour(ColourAllocated back) { - hdc->SetBrush(wxBrush(wxColourFromCA(back), wxSOLID)); + hdc->SetBrush(wxBrush(wxColourFromCA(back))); } void SurfaceImpl::SetFont(Font &font_) { @@ -346,7 +344,7 @@ void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) { if (((SurfaceImpl&)surfacePattern).bitmap) br = wxBrush(*((SurfaceImpl&)surfacePattern).bitmap); else // Something is wrong so display in red - br = wxBrush(*wxRED, wxSOLID); + br = wxBrush(*wxRED); hdc->SetPen(*wxTRANSPARENT_PEN); hdc->SetBrush(br); hdc->DrawRectangle(wxRectFromPRectangle(rc)); @@ -368,11 +366,10 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill, ColourAllocated outline, int alphaOutline, int /*flags*/) { -#ifdef wxHAVE_RAW_BITMAP // TODO: do something with cornerSize wxUnusedVar(cornerSize); - + int x, y; wxRect r = wxRectFromPRectangle(rc); wxBitmap bmp(r.width, r.height, 32); @@ -392,7 +389,7 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, p.Green() = wxPy_premultiply(green, alphaFill); p.Blue() = wxPy_premultiply(blue, alphaFill); p.Alpha() = alphaFill; - ++p; + ++p; } } @@ -406,12 +403,12 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, p.Red() = wxPy_premultiply(red, alphaOutline); p.Green() = wxPy_premultiply(green, alphaOutline); p.Blue() = wxPy_premultiply(blue, alphaOutline); - p.Alpha() = alphaOutline; + p.Alpha() = alphaOutline; p.MoveTo(pixData, x, r.height-1); p.Red() = wxPy_premultiply(red, alphaOutline); p.Green() = wxPy_premultiply(green, alphaOutline); p.Blue() = wxPy_premultiply(blue, alphaOutline); - p.Alpha() = alphaOutline; + p.Alpha() = alphaOutline; } for (y=0; yDrawBitmap(bmp, r.x, r.y, true); - -#else - wxUnusedVar(cornerSize); - wxUnusedVar(alphaFill); - wxUnusedVar(alphaOutline); - RectangleDraw(rc, outline, fill); -#endif } void SurfaceImpl::Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back) { @@ -485,13 +475,13 @@ void SurfaceImpl::DrawTextTransparent(PRectangle rc, Font &font, int ybase, SetFont(font); hdc->SetTextForeground(wxColourFromCA(fore)); - hdc->SetBackgroundMode(wxTRANSPARENT); + hdc->SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); // ybase is where the baseline should be, but wxWin uses the upper left // corner, so I need to calculate the real position for the text... hdc->DrawText(stc2wx(s, len), rc.left, ybase - font.ascent); - hdc->SetBackgroundMode(wxSOLID); + hdc->SetBackgroundMode(wxBRUSHSTYLE_SOLID); } @@ -823,7 +813,7 @@ public: wxSTCListBoxWin(wxWindow* parent, wxWindowID id, Point WXUNUSED(location)) : wxPopupWindow(parent, wxBORDER_NONE) { - + SetBackgroundColour(*wxBLACK); // for our simple border lv = new wxSTCListBox(parent, id, wxPoint(-50,-50), wxDefaultSize, @@ -946,7 +936,7 @@ public: wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT #ifdef __WXMAC__ - | wxPOPUP_WINDOW + | wxPOPUP_WINDOW | wxNO_BORDER #else | wxSIMPLE_BORDER @@ -965,7 +955,7 @@ public: lv->SetFocus(); Hide(); - } + } // On OSX and (possibly others) there can still be pending @@ -1035,7 +1025,7 @@ public: if (frame) frame->Raise(); } - + virtual void DoSetSize(int x, int y, int width, int height, @@ -1234,7 +1224,7 @@ void ListBoxImpl::Append(char *s, int type) { void ListBoxImpl::Append(const wxString& text, int type) { long count = GETLB(id)->GetItemCount(); long itemID = GETLB(id)->InsertItem(count, wxEmptyString); - ling idx = -1; + long idx = -1; GETLB(id)->SetItem(itemID, 1, text); maxStrWidth = wxMax(maxStrWidth, text.length()); if (type != -1) {