X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9e730a78765d0e70ca5b77512569c94585070fe2..1978421a6d8b81c1f8a961da4b8ddf544fec7b1b:/src/stc/PlatWX.cpp?ds=sidebyside diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 80f8f795ce..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) { @@ -1009,7 +1003,7 @@ void ListBoxImpl::RegisterImage(int type, const char *xpm_data) { // do we need to extend the mapping array? wxArrayInt& itm = *imgTypeMap; - if ( itm.GetCount() < type+1) + if ( itm.GetCount() < (size_t)type+1) itm.Add(-1, type - itm.GetCount() + 1); // Add an item that maps type to the image index @@ -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 + + +