added wxGetMultiChoice() (which refuses to work for some reason - will fix

a.s.a.p.)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-11-03 20:52:17 +00:00
parent 53ccf1c0ba
commit d6c9c1b71e
7 changed files with 689 additions and 182 deletions

View File

@@ -35,7 +35,7 @@
// what to test (in alphabetic order)?
//#define TEST_ARRAYS
#define TEST_ARRAYS
//#define TEST_CMDLINE
//#define TEST_DATETIME
//#define TEST_DIR
@@ -3117,11 +3117,57 @@ static void PrintArray(const char* name, const wxArrayString& array)
}
}
static int StringLenCompare(const wxString& first, const wxString& second)
static void PrintArray(const char* name, const wxArrayInt& array)
{
printf("Dump of the array '%s'\n", name);
size_t nCount = array.GetCount();
for ( size_t n = 0; n < nCount; n++ )
{
printf("\t%s[%u] = %d\n", name, n, array[n]);
}
}
int wxCMPFUNC_CONV StringLenCompare(const wxString& first,
const wxString& second)
{
return first.length() - second.length();
}
int wxCMPFUNC_CONV IntCompare(int *first,
int *second)
{
return *first - *second;
}
int wxCMPFUNC_CONV IntRevCompare(int *first,
int *second)
{
return *second - *first;
}
static void TestArrayOfInts()
{
puts("*** Testing wxArrayInt ***\n");
wxArrayInt a;
a.Add(1);
a.Add(17);
a.Add(5);
a.Add(3);
puts("Initially:");
PrintArray("a", a);
puts("After sort:");
a.Sort(IntCompare);
PrintArray("a", a);
puts("After reverse sort:");
a.Sort(IntRevCompare);
PrintArray("a", a);
}
#include "wx/dynarray.h"
WX_DECLARE_OBJARRAY(Bar, ArrayBars);
@@ -3581,6 +3627,8 @@ int main(int argc, char **argv)
#endif // TEST_STRINGS
#ifdef TEST_ARRAYS
if ( 0 )
{
wxArrayString a1;
a1.Add("tiger");
a1.Add("cat");
@@ -3624,6 +3672,8 @@ int main(int argc, char **argv)
PrintArray("a1", a1);
TestArrayOfObjects();
}
TestArrayOfInts();
#endif // TEST_ARRAYS
#ifdef TEST_DIR