X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6636ac1ea9f6f716dc51ca17c72516ebb08eb972..ed4eede6c2c16cdb422a39c1b3655956b8f51a1c:/src/stc/PlatWX.cpp diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index ec10a85950..af915be587 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -6,6 +6,9 @@ #include +#define Point macPoint // These names are also defined by some mac headers so +#define Style macStyle // change their names, and then undef before we need them + #include #include #include @@ -13,15 +16,14 @@ #include #include +#undef Point +#undef Style + #include "Platform.h" #include "PlatWX.h" #include "wx/stc/stc.h" -#ifdef __WXGTK__ -#include -#endif - Point Point::FromLong(long lpoint) { return Point(lpoint & 0xFFFF, lpoint >> 16); @@ -40,7 +42,9 @@ PRectangle PRectangleFromwxRect(wxRect rc) { wxColour wxColourFromCA(const ColourAllocated& ca) { ColourDesired cd(ca.AsLong()); - return wxColour(cd.GetRed(), cd.GetGreen(), cd.GetBlue()); + return wxColour((unsigned char)cd.GetRed(), + (unsigned char)cd.GetGreen(), + (unsigned char)cd.GetBlue()); } //---------------------------------------------------------------------- @@ -804,6 +808,14 @@ public: event.Skip(); } +#ifdef __WXMAC__ + virtual bool Show(bool show = true) { + bool rv = wxWindow::Show(show); + GetParent()->Refresh(false); + return rv; + } +#endif + void OnActivate(wxListEvent& WXUNUSED(event)) { doubleClickAction(doubleClickActionData); } @@ -1015,7 +1027,8 @@ void ListBoxImpl::GetValue(int n, char *value, int len) { void ListBoxImpl::RegisterImage(int type, const char *xpm_data) { wxMemoryInputStream stream(xpm_data, strlen(xpm_data)+1); - wxBitmap bmp(wxImage(stream, wxBITMAP_TYPE_XPM)); + wxImage img(stream, wxBITMAP_TYPE_XPM); + wxBitmap bmp(img); if (! imgList) { // assumes all images are the same size @@ -1254,7 +1267,7 @@ double ElapsedTime::Duration(bool reset) { // Convert using Scintilla's functions instead of wx's, Scintilla's are more // forgiving and won't assert... - + wxString stc2wx(const char* str, size_t len) { if (!len) @@ -1286,7 +1299,6 @@ const wxWX2MBbuf wx2stc(const wxString& str) // TODO check NULL termination!! - return buffer; }