X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d35ad26eee38a8d71efde5a6e7f7f28f4b7df1bd..cc1487e53905bd534dba2099d33ac2142cec7818:/src/stc/PlatWX.cpp diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 7b40662901..2e80894a47 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -47,14 +47,21 @@ wxColour wxColourFromCA(const ColourAllocated& ca) { Palette::Palette() { used = 0; allowRealization = false; + size = 100; + entries = new ColourPair[size]; } Palette::~Palette() { Release(); + delete [] entries; + entries = 0; } void Palette::Release() { used = 0; + delete [] entries; + size = 100; + entries = new ColourPair[size]; } // This method either adds a colour to the list of wanted colours (want==true) @@ -67,11 +74,20 @@ void Palette::WantFind(ColourPair &cp, bool want) { return; } - if (used < numEntries) { - entries[used].desired = cp.desired; - entries[used].allocated.Set(cp.desired.AsLong()); - used++; + if (used >= size) { + int sizeNew = size * 2; + ColourPair *entriesNew = new ColourPair[sizeNew]; + for (int j=0; jDrawRoundedRectangle(wxRectFromPRectangle(rc), 4); } +void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, + ColourAllocated fill, int alphaFill, + ColourAllocated outline, int alphaOutline, int flags) { +// ** TODO + + RectangleDraw(rc, outline, fill); +} + void SurfaceImpl::Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back) { PenColour(fore); BrushColour(back); @@ -543,13 +569,11 @@ void Window::Show(bool show) { void Window::InvalidateAll() { GETWIN(id)->Refresh(false); - wxWakeUpIdle(); } void Window::InvalidateRectangle(PRectangle rc) { wxRect r = wxRectFromPRectangle(rc); GETWIN(id)->Refresh(false, &r); - wxWakeUpIdle(); } void Window::SetFont(Font &font) { @@ -919,7 +943,7 @@ private: bool unicodeMode; int desiredVisibleRows; int aveCharWidth; - int maxStrWidth; + size_t maxStrWidth; Point location; // Caret location at which the list is opened wxImageList* imgList; wxArrayInt* imgTypeMap; @@ -1342,11 +1366,20 @@ int Platform::DBCSCharMaxLength() { //---------------------------------------------------------------------- ElapsedTime::ElapsedTime() { - wxStartTimer(); + wxLongLong localTime = wxGetLocalTimeMillis(); + littleBit = localTime.GetLo(); + bigBit = localTime.GetHi(); } double ElapsedTime::Duration(bool reset) { - double result = wxGetElapsedTime(reset); + wxLongLong prevTime(bigBit, littleBit); + wxLongLong localTime = wxGetLocalTimeMillis(); + if(reset) { + littleBit = localTime.GetLo(); + bigBit = localTime.GetHi(); + } + wxLongLong duration = localTime - prevTime; + double result = duration.ToDouble(); result /= 1000.0; return result; }