X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/257ed895d539d3dc6a11058c337ba1a58c5b7036..8b6e6947fc8fb946391740d66b140413eccb6b6c:/contrib/src/stc/PlatWX.cpp diff --git a/contrib/src/stc/PlatWX.cpp b/contrib/src/stc/PlatWX.cpp index 2b478141af..29535072a7 100644 --- a/contrib/src/stc/PlatWX.cpp +++ b/contrib/src/stc/PlatWX.cpp @@ -112,6 +112,8 @@ Font::~Font() { } void Font::Create(const char *faceName, int characterSet, int size, bool bold, bool italic) { + // TODO: what to do about the characterSet? + Release(); id = new wxFont(size, wxDEFAULT, @@ -161,13 +163,11 @@ void Surface::Init() { Release(); hdc = new wxMemoryDC(); hdcOwned = true; - // **** ::SetTextAlign(hdc, TA_BASELINE); } void Surface::Init(SurfaceID hdc_) { Release(); hdc = hdc_; - // **** ::SetTextAlign(hdc, TA_BASELINE); } void Surface::InitPixMap(int width, int height, Surface *surface_) { @@ -176,7 +176,6 @@ void Surface::InitPixMap(int width, int height, Surface *surface_) { hdcOwned = true; bitmap = new wxBitmap(width, height); ((wxMemoryDC*)hdc)->SelectObject(*bitmap); - // **** ::SetTextAlign(hdc, TA_BASELINE); } void Surface::PenColour(Colour fore) { @@ -199,7 +198,7 @@ int Surface::LogPixelsY() { int Surface::DeviceHeightFont(int points) { - return points * LogPixelsY() / 72; + return points; } @@ -353,7 +352,7 @@ int Surface::AverageCharWidth(Font &font) { } int Surface::SetPalette(Palette *pal, bool inBackGround) { - return 0; // **** figure out what to do with palettes... + return 0; } void Surface::SetClip(PRectangle rc) { @@ -697,6 +696,36 @@ void Platform::DebugPrintf(const char *format, ...) { #endif } + +static bool assertionPopUps = true; + +bool Platform::ShowAssertionPopUps(bool assertionPopUps_) { + bool ret = assertionPopUps; + assertionPopUps = assertionPopUps_; + return ret; +} + +void Platform::Assert(const char *c, const char *file, int line) { + char buffer[2000]; + sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line); + if (assertionPopUps) { + int idButton = wxMessageBox(buffer, "Assertion failure", + wxICON_HAND | wxOK); +// if (idButton == IDRETRY) { +// ::DebugBreak(); +// } else if (idButton == IDIGNORE) { +// // all OK +// } else { +// abort(); +// } + } else { + strcat(buffer, "\r\n"); + Platform::DebugDisplay(buffer); + abort(); + } +} + + int Platform::Clamp(int val, int minVal, int maxVal) { if (val > maxVal) val = maxVal;