X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a8ffaddebef7e2057391217a047bcbee33abe2d..1978421a6d8b81c1f8a961da4b8ddf544fec7b1b:/src/stc/PlatWX.cpp?ds=sidebyside diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index ec41de2733..7bda5100eb 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -405,7 +405,7 @@ void SurfaceImpl::DrawTextNoClip(PRectangle rc, Font &font, int ybase, SetFont(font); hdc->SetTextForeground(wxColourFromCA(fore)); hdc->SetTextBackground(wxColourFromCA(back)); - //FillRectangle(rc, back); + FillRectangle(rc, back); // 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... @@ -418,11 +418,12 @@ void SurfaceImpl::DrawTextClipped(PRectangle rc, Font &font, int ybase, SetFont(font); hdc->SetTextForeground(wxColourFromCA(fore)); hdc->SetTextBackground(wxColourFromCA(back)); - //FillRectangle(rc, back); + FillRectangle(rc, back); hdc->SetClippingRegion(wxRectFromPRectangle(rc)); // see comments above hdc->DrawText(stc2wx(s, len), rc.left, ybase - font.ascent); + hdc->DestroyClippingRegion(); } @@ -450,7 +451,7 @@ void SurfaceImpl::MeasureWidths(Font &font, const char *s, int len, int *positio #ifndef __WXMAC__ // Calculate the position of each character based on the widths of // the previous characters - int* tpos = new int[len]; + int* tpos = new int[len+1]; int totalWidth = 0; size_t i; for (i=0; i= 0x80) { @@ -575,13 +576,6 @@ void SurfaceImpl::FlushCachedState() { void SurfaceImpl::SetUnicodeMode(bool unicodeMode_) { unicodeMode=unicodeMode_; -#if wxUSE_UNICODE - wxASSERT_MSG(unicodeMode == wxUSE_UNICODE, - wxT("Only unicode may be used when wxUSE_UNICODE is on.")); -#else - wxASSERT_MSG(unicodeMode == wxUSE_UNICODE, - wxT("Only non-unicode may be used when wxUSE_UNICODE is off.")); -#endif } void SurfaceImpl::SetDBCSMode(int codePage) { @@ -1069,6 +1063,13 @@ void Menu::Show(Point pt, Window &w) { //---------------------------------------------------------------------- +DynamicLibrary *DynamicLibrary::Load(const char *modulePath) { + wxFAIL_MSG(wxT("Dynamic lexer loading not implemented yet")); + return NULL; +} + +//---------------------------------------------------------------------- + ColourDesired Platform::Chrome() { wxColour c; c = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); @@ -1200,11 +1201,11 @@ bool Platform::IsDBCSLeadByte(int codePage, char ch) { } int Platform::DBCSCharLength(int codePage, const char *s) { - return 0; + return 1; } int Platform::DBCSCharMaxLength() { - return 0; + return 1; } @@ -1223,6 +1224,22 @@ double ElapsedTime::Duration(bool reset) { //---------------------------------------------------------------------- +#if wxUSE_UNICODE +wxString stc2wx(const char* str, size_t len) +{ + char *buffer=new char[len+1]; + strncpy(buffer, str, len); + buffer[len]=0; + + wxString cstr(buffer, wxConvUTF8); + + delete[] buffer; + return cstr; +} +#endif + + +