Moved some methods/classes inside COMPATIBILITY_2_4.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21616 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2003-07-03 21:59:55 +00:00
parent 2ea4a2f552
commit ba8c160144
19 changed files with 132 additions and 52 deletions

View File

@@ -22,6 +22,7 @@
#include "wx/help.h"
#include "wx/hashmap.h"
#if wxUSE_BMPBUTTON
#include "wx/bmpbuttn.h"
#endif
@@ -140,6 +141,9 @@ private:
static wxHelpProvider *ms_helpProvider;
};
WX_DECLARE_HASH_MAP( long, wxString, wxIntegerHash, wxIntegerEqual,
wxLongToStringHashMap );
// wxSimpleHelpProvider is an implementation of wxHelpProvider which supports
// only plain text help strings and shows the string associated with the
// control (if any) in a tooltip
@@ -156,8 +160,8 @@ public:
protected:
// we use 2 hashes for storing the help strings associated with windows
// and the ids
wxStringHashTable m_hashWindows,
m_hashIds;
wxLongToStringHashMap m_hashWindows,
m_hashIds;
};
// wxHelpControllerHelpProvider is an implementation of wxHelpProvider which supports

View File

@@ -24,7 +24,7 @@
#include "wx/filesys.h"
class WXDLLIMPEXP_BASE wxHashTableLong;
class WXDLLIMPEXP_BASE wxLongToLongHashMap;
//--------------------------------------------------------------------------------
// wxZipFSHandler
@@ -45,7 +45,7 @@ class WXDLLIMPEXP_BASE wxZipFSHandler : public wxFileSystemHandler
void *m_Archive;
wxString m_Pattern, m_BaseDir, m_ZipFile;
bool m_AllowDirs, m_AllowFiles;
wxHashTableLong *m_DirsFound;
wxLongToLongHashMap *m_DirsFound;
wxString DoFind();

View File

@@ -18,7 +18,7 @@
#pragma interface "grid.h"
#endif
#include "wx/hash.h"
#include "wx/hashmap.h"
#include "wx/panel.h"
#include "wx/scrolwin.h"
#include "wx/string.h"
@@ -80,6 +80,9 @@ class WXDLLEXPORT wxComboBox;
class WXDLLEXPORT wxTextCtrl;
class WXDLLEXPORT wxSpinCtrl;
WX_DECLARE_EXPORTED_HASH_MAP( long, long, wxIntegerHash, wxIntegerEqual,
wxLongToLongHashMap );
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
@@ -1759,8 +1762,8 @@ protected:
// if a column has a minimal width, it will be the value for it in this
// hash table
wxHashTableLong m_colMinWidths,
m_rowMinHeights;
wxLongToLongHashMap m_colMinWidths,
m_rowMinHeights;
// get the minimal width of the given column/row
int GetColMinimalWidth(int col) const;

View File

@@ -72,6 +72,8 @@ private:
DECLARE_NO_COPY_CLASS(wxHashTableBase)
};
#if WXWIN_COMPATIBILITY_2_4
// ----------------------------------------------------------------------------
// a hash table which stores longs
// ----------------------------------------------------------------------------
@@ -143,6 +145,8 @@ private:
DECLARE_NO_COPY_CLASS(wxStringHashTable)
};
#endif
// ----------------------------------------------------------------------------
// for compatibility only
// ----------------------------------------------------------------------------
@@ -305,5 +309,23 @@ private:
#define WX_DECLARE_USER_EXPORTED_HASH(el, list, hash, usergoo) \
_WX_DECLARE_HASH(el, list, hash, class usergoo)
// delete all hash elements
//
// NB: the class declaration of the hash elements must be visible from the
// place where you use this macro, otherwise the proper destructor may not
// be called (a decent compiler should give a warning about it, but don't
// count on it)!
#define WX_CLEAR_HASH_TABLE(array) \
{ \
(array).BeginFind(); \
wxNode* it = (array).Next(); \
while( it ) \
{ \
delete it->GetData(); \
it = (array).Next(); \
} \
(array).Clear(); \
}
#endif
// _WX_HASH_H__

View File

@@ -1027,12 +1027,19 @@ public:
// from the array (operator[] or Item() method), a reference is returned.
// ----------------------------------------------------------------------------
int WXDLLIMPEXP_BASE wxStringSortAscending(wxString*, wxString*);
int WXDLLIMPEXP_BASE wxStringSortDescending(wxString*, wxString*);
class WXDLLIMPEXP_BASE wxArrayString
{
public:
// type of function used by wxArrayString::Sort()
typedef int (*CompareFunction)(const wxString& first,
const wxString& second);
// type of function used by wxArrayString::Sort(), for compatibility with
// wxArray
typedef int (*CompareFunction2)(wxString* first,
wxString* second);
// constructors and destructor
// default ctor
@@ -1095,11 +1102,13 @@ public:
return Item(Count() - 1);
}
#if WXWIN_COMPATIBILITY_2_4
// return a wxString[], useful for the controls which
// take one in their ctor. You must delete[] it yourself
// once you are done with it. Will return NULL if the
// ArrayString was empty.
wxString* GetStringArray() const;
#endif
// item management
// Search the element in the array, starting from the beginning if
@@ -1117,8 +1126,10 @@ public:
// remove first item matching this value
void Remove(const wxChar *sz);
// remove item by index
void Remove(size_t nIndex, size_t nRemove = 1);
void RemoveAt(size_t nIndex, size_t nRemove = 1) { Remove(nIndex, nRemove); }
#if WXWIN_COMPATIBILITY_2_4
void Remove(size_t nIndex, size_t nRemove = 1) { RemoveAt(nIndex, nRemove); }
#endif
void RemoveAt(size_t nIndex, size_t nRemove = 1);
// sorting
// sort array elements in alphabetical order (or reversed alphabetical
@@ -1126,6 +1137,7 @@ public:
void Sort(bool reverseOrder = FALSE);
// sort array elements using specified comparaison function
void Sort(CompareFunction compareFunction);
void Sort(CompareFunction2 compareFunction);
// comparison
// compare two arrays case sensitively