X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b829bf55a0cc891cff1cee117801ba48dc8bcbd0..8adb5d455797d5b656ef677c74359e5a578b539f:/src/common/utilscmn.cpp diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 32e2332a52..93aa19f675 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -6,7 +6,7 @@ // Created: 29/01/98 // RCS-ID: $Id$ // Copyright: (c) 1998 Julian Smart -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -133,6 +133,15 @@ wxRegisterId (long id) wxCurrentId = id + 1; } +// ---------------------------------------------------------------------------- +// String <-> Number conversions (deprecated) +// ---------------------------------------------------------------------------- + +#if WXWIN_COMPATIBILITY_2_4 + +WXDLLEXPORT_DATA(const wxChar *) wxFloatToStringStr = wxT("%.2f"); +WXDLLEXPORT_DATA(const wxChar *) wxDoubleToStringStr = wxT("%.2f"); + void StringToFloat (const wxChar *s, float *number) { @@ -197,6 +206,8 @@ LongToString (long number) return buf; } +#endif // WXWIN_COMPATIBILITY_2_4 + // Array used in DecToHex conversion routine. static wxChar hexArray[] = wxT("0123456789ABCDEF"); @@ -431,10 +442,10 @@ wxWindow* wxFindWindowAtPoint(wxWindow* win, const wxPoint& pt) if (frame->GetToolBar()) extraChildren.Append(frame->GetToolBar()); - wxNode* node = extraChildren.First(); + wxNode* node = extraChildren.GetFirst(); while (node) { - wxWindow* child = (wxWindow*) node->Data(); + wxWindow* child = (wxWindow*) node->GetData(); wxWindow* foundWin = wxFindWindowAtPoint(child, pt); if (foundWin) return foundWin; @@ -443,14 +454,14 @@ wxWindow* wxFindWindowAtPoint(wxWindow* win, const wxPoint& pt) } */ - wxNode* node = win->GetChildren().Last(); + wxWindowList::Node *node = win->GetChildren().GetLast(); while (node) { - wxWindow* child = (wxWindow*) node->Data(); + wxWindow* child = node->GetData(); wxWindow* foundWin = wxFindWindowAtPoint(child, pt); if (foundWin) return foundWin; - node = node->Previous(); + node = node->GetPrevious(); } wxPoint pos = win->GetPosition(); @@ -472,14 +483,14 @@ wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt) // Go backwards through the list since windows // on top are likely to have been appended most // recently. - wxNode* node = wxTopLevelWindows.Last(); + wxWindowList::Node *node = wxTopLevelWindows.GetLast(); while (node) { - wxWindow* win = (wxWindow*) node->Data(); + wxWindow* win = node->GetData(); wxWindow* found = wxFindWindowAtPoint(win, pt); if (found) return found; - node = node->Previous(); + node = node->GetPrevious(); } return NULL; } @@ -801,13 +812,11 @@ wxFont wxGetFontFromUser(wxWindow *parent, const wxFont& fontInit) // missing C RTL functions (FIXME shouldn't be here at all) // ---------------------------------------------------------------------------- -#ifdef __MWERKS__ -#if __MSL__ < 0x7000 +#if defined( __MWERKS__ ) && !defined(__MACH__) char *strdup(const char *s) { return strcpy( (char*) malloc( strlen( s ) + 1 ) , s ) ; } -#endif int isascii( int c ) { return ( c >= 0 && c < 128 ) ; @@ -872,14 +881,15 @@ wxWindowDisabler::~wxWindowDisabler() // Yield to other apps/messages and disable user input to all windows except // the given one -bool wxSafeYield(wxWindow *win, bool onlyIfNeeded = FALSE) +bool wxSafeYield(wxWindow *win, bool onlyIfNeeded) { wxWindowDisabler wd(win); + bool rc; if (onlyIfNeeded) - bool rc = wxYieldIfNeeded(); + rc = wxYieldIfNeeded(); else - bool rc = wxYield(); + rc = wxYield(); return rc; } @@ -1068,6 +1078,7 @@ wxString wxGetCurrentDir() // wxDoExecuteWithCapture() helper: reads an entire stream into one array // // returns TRUE if ok, FALSE if error +#if wxUSE_STREAMS static bool ReadAll(wxInputStream *is, wxArrayString& output) { wxCHECK_MSG( is, FALSE, _T("NULL stream in wxExecute()?") ); @@ -1096,6 +1107,7 @@ static bool ReadAll(wxInputStream *is, wxArrayString& output) return cont; } +#endif // wxUSE_STREAMS // this is a private function because it hasn't a clean interface: the first // array is passed by reference, the second by pointer - instead we have 2