X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9e96e16fe0bc7af32d329c965ad110a3e5be5ad8..902b679a455b146555607d6123cf8b9159c39888:/src/stc/PlatWX.cpp diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index fbc9ce00a3..f2c6302917 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -86,8 +86,7 @@ Palette::Palette() { Palette::~Palette() { Release(); - delete [] entries; - entries = 0; + wxDELETEA(entries); } void Palette::Release() { @@ -386,7 +385,7 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, dc.DrawRoundedRectangle(wxRectFromPRectangle(rc), cornerSize); return; #else - + #ifdef wxHAS_RAW_BITMAP // TODO: do something with cornerSize @@ -546,7 +545,7 @@ void SurfaceImpl::MeasureWidths(Font &font, const char *s, int len, int *positio #else // If not unicode then just use the widths we have -#if wxUSE_STL +#if wxUSE_STD_CONTAINERS std::copy(tpos.begin(), tpos.end(), positions); #else memcpy(positions, tpos.begin(), len * sizeof(int)); @@ -850,6 +849,9 @@ public: lv->Reparent(this); #ifdef __WXMSW__ lv->Show(); +#endif +#ifdef __WXOSX_COCOA__ + SetBackgroundColour(wxColour(0xC0, 0xC0, 0xC0)); #endif } @@ -909,10 +911,20 @@ public: void OnSize(wxSizeEvent& event) { // resize the child to fill the popup wxSize sz = GetClientSize(); - lv->SetSize(0, 0, sz.x, sz.y); + int x, y, w, h; + x = y = 0; + w = sz.x; + h = sz.y; +#ifdef __WXOSX_COCOA__ + // make room for the parent's bg color to show, to act as a border + x = y = 1; + w -= 2; + h -= 2; +#endif + lv->SetSize(x, y, w, h); // reset the column widths lv->SetColumnWidth(0, IconWidth()+4); - lv->SetColumnWidth(1, sz.x - 2 - lv->GetColumnWidth(0) - + lv->SetColumnWidth(1, w - 2 - lv->GetColumnWidth(0) - wxSystemSettings::GetMetric(wxSYS_VSCROLL_X)); event.Skip(); } @@ -1144,14 +1156,8 @@ ListBoxImpl::ListBoxImpl() } ListBoxImpl::~ListBoxImpl() { - if (imgList) { - delete imgList; - imgList = NULL; - } - if (imgTypeMap) { - delete imgTypeMap; - imgTypeMap = NULL; - } + wxDELETE(imgList); + wxDELETE(imgTypeMap); } @@ -1329,14 +1335,8 @@ void ListBoxImpl::RegisterImage(int type, const char *xpm_data) { } void ListBoxImpl::ClearRegisteredImages() { - if (imgList) { - delete imgList; - imgList = NULL; - } - if (imgTypeMap) { - delete imgTypeMap; - imgTypeMap = NULL; - } + wxDELETE(imgList); + wxDELETE(imgTypeMap); if (wid) GETLB(wid)->SetImageList(NULL, wxIMAGE_LIST_SMALL); }