From 80cc5fc7ad102221a1ce9e160eac3c29a0586664 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 26 Nov 2008 19:11:22 +0000 Subject: [PATCH] document column reordering in wxListCtrl; fix confusion between GetColumnOrder() and GetColumnIndexFromOrder() doing this discovered; show the use of these methods in the sample and added a unit test for them git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/listctrl.h | 4 + interface/wx/listctrl.h | 89 ++++++++++++++++---- samples/listctrl/listtest.cpp | 71 ++++++++++++++++ samples/listctrl/listtest.h | 8 ++ src/msw/listctrl.cpp | 19 ++--- tests/Makefile.in | 4 + tests/controls/listctrltest.cpp | 143 ++++++++++++++++++++++++++++++++ tests/makefile.bcc | 8 ++ tests/makefile.gcc | 8 ++ tests/makefile.vc | 8 ++ tests/makefile.wat | 8 ++ tests/test.bkl | 1 + tests/test_test_gui.dsp | 4 + tests/test_vc7_test_gui.vcproj | 3 + tests/test_vc8_test_gui.vcproj | 4 + tests/test_vc9_test_gui.vcproj | 4 + 16 files changed, 358 insertions(+), 28 deletions(-) create mode 100644 tests/controls/listctrltest.cpp diff --git a/include/wx/msw/listctrl.h b/include/wx/msw/listctrl.h index 8be82a416f..ea13f0b6a6 100644 --- a/include/wx/msw/listctrl.h +++ b/include/wx/msw/listctrl.h @@ -17,6 +17,10 @@ class WXDLLIMPEXP_FWD_CORE wxImageList; +// define this symbol to indicate the availability of SetColumnsOrder() and +// related functions +#define wxHAS_LISTCTRL_COLUMN_ORDER + /* The wxListCtrl can show lists of items in four different modes: wxLC_LIST: multicolumn list view, with optional small icons (icons could be diff --git a/interface/wx/listctrl.h b/interface/wx/listctrl.h index 9a9b24fb69..fe4eda7324 100644 --- a/interface/wx/listctrl.h +++ b/interface/wx/listctrl.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: listctrl.h +// Name: wx/listctrl.h // Purpose: interface of wxListCtrl // Author: wxWidgets team // RCS-ID: $Id$ @@ -41,16 +41,6 @@ modes. You can use the generic implementation for report mode as well by setting the @c mac.listctrl.always_use_generic system option (see wxSystemOption) to 1. - wxMSW Note: In report view, the control has several columns - which are identified by their internal indices. By default, these indices - correspond to their order on screen, i.e. the column 0 appears first (in the - left-to-right or maybe right-to-left if the current language uses this writing - direction), the column 1 next and so on. However it is possible to reorder the - columns visual order using SetColumnsOrder() method and the user can also - rearrange the columns interactively by dragging them. In this case, the index - of the column is not the same as its order and the functions GetColumnOrder() - and GetColumnIndexFromOrder() should be used to translate between them. - @beginStyleTable @style{wxLC_LIST} @@ -293,12 +283,30 @@ public: int GetColumnCount() const; /** - Gets the column number by visual order index (report view only). + Gets the column index from its position in visual order. + + After calling SetColumnsOrder(), the index returned by this function + corresponds to the value of the element number @a pos in the array + returned by GetColumnsOrder(). + + Please see SetColumnsOrder() documentation for an example and + additional remarks about the columns ordering. + + @see GetColumnOrder() */ - int GetColumnIndexFromOrder(int order) const; + int GetColumnIndexFromOrder(int pos) const; /** - Gets the column visual order index (valid in report view only). + Gets the column visual order position. + + This function returns the index of the column which appears at the + given visual position, e.g. calling it with @a col equal to 0 returns + the index of the first shown column. + + Please see SetColumnsOrder() documentation for an example and + additional remarks about the columns ordering. + + @see GetColumnsOrder(), GetColumnIndexFromOrder() */ int GetColumnOrder(int col) const; @@ -309,7 +317,13 @@ public: /** Returns the array containing the orders of all columns. + On error, an empty array is returned. + + Please see SetColumnsOrder() documentation for an example and + additional remarks about the columns ordering. + + @see GetColumnOrder(), GetColumnIndexFromOrder() */ wxArrayInt GetColumnsOrder() const; @@ -641,14 +655,53 @@ public: bool SetColumnWidth(int col, int width); /** - Sets the order of all columns at once. + Changes the order in which the columns are shown. + + By default, the columns of a list control appear on the screen in order + of their indices, i.e. the column 0 appears first, the column 1 next + and so on. However by using this function it is possible to arbitrarily + reorder the columns visual order and the user can also rearrange the + columns interactively by dragging them. In this case, the index of the + column is not the same as its order and the functions GetColumnOrder() + and GetColumnIndexFromOrder() should be used to translate between them. + Notice that all the other functions still work with the column indices, + i.e. the visual positioning of the columns on screen doesn't affect the + code setting or getting their values for example. The @a orders array must have the same number elements as the number of - columns and contain each position exactly once. + columns and contain each position exactly once. Its n-th element + contains the index of the column to be shown in n-th position, so for a + control with three columns passing an array with elements 2, 0 and 1 + results in the third column being displayed first, the first one next + and the second one last. + + Example of using it: + @code + wxListCtrl *list = new wxListCtrl(...); + for ( int i = 0; i < 3; i++ ) + list->InsertColumn(i, wxString::Format("Column %d", i)); + + wxArrayInt order(3); + order[0] = 2; + order[1] = 0; + order[2] = 1; + list->SetColumnsOrder(order); + + // now list->GetColumnsOrder() will return order and + // list->GetColumnIndexFromOrder(n) will return order[n] and + // list->GetColumnOrder() will return 1, 2 and 0 for the column 0, + // 1 and 2 respectively + @endcode + + Please notice that this function makes sense for report view only and + currently is only implemented in wxMSW port. To avoid explicit tests + for @c __WXMSW__ in your code, please use @c wxHAS_LISTCTRL_COLUMN_ORDER + as this will allow it to start working under the other platforms when + support for the column reordering is added there. - This function is valid in report view only. + @see GetColumnsOrder() */ - bool SetColumnOrder(const wxArrayInt& orders) const; + bool SetColumnsOrder(const wxArrayInt& orders) const; /** Sets the image list associated with the control. diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index 508ccfde34..f18999f66d 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -91,6 +91,10 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(LIST_SHOW_COL_INFO, MyFrame::OnShowColInfo) EVT_MENU(LIST_SHOW_SEL_INFO, MyFrame::OnShowSelInfo) EVT_MENU(LIST_SHOW_VIEW_RECT, MyFrame::OnShowViewRect) +#ifdef wxHAS_LISTCTRL_COLUMN_ORDER + EVT_MENU(LIST_SET_COL_ORDER, MyFrame::OnSetColOrder) + EVT_MENU(LIST_GET_COL_ORDER, MyFrame::OnGetColOrder) +#endif // wxHAS_LISTCTRL_COLUMN_ORDER EVT_MENU(LIST_FREEZE, MyFrame::OnFreeze) EVT_MENU(LIST_THAW, MyFrame::OnThaw) EVT_MENU(LIST_TOGGLE_LINES, MyFrame::OnToggleLines) @@ -236,6 +240,10 @@ MyFrame::MyFrame(const wxChar *title) menuList->Append(LIST_SHOW_COL_INFO, _T("Show &column info\tCtrl-C")); menuList->Append(LIST_SHOW_SEL_INFO, _T("Show &selected items\tCtrl-S")); menuList->Append(LIST_SHOW_VIEW_RECT, _T("Show &view rect")); +#ifdef wxHAS_LISTCTRL_COLUMN_ORDER + menuList->Append(LIST_SET_COL_ORDER, _T("Se&t columns order\tShift-Ctrl-O")); + menuList->Append(LIST_GET_COL_ORDER, _T("Show&w columns order\tCtrl-O")); +#endif // wxHAS_LISTCTRL_COLUMN_ORDER menuList->AppendSeparator(); menuList->Append(LIST_SORT, _T("Sor&t\tCtrl-T")); menuList->AppendSeparator(); @@ -652,6 +660,69 @@ void MyFrame::OnShowViewRect(wxCommandEvent& WXUNUSED(event)) r.GetLeft(), r.GetTop(), r.GetRight(), r.GetBottom()); } +// ---------------------------------------------------------------------------- +// column order tests +// ---------------------------------------------------------------------------- + +#ifdef wxHAS_LISTCTRL_COLUMN_ORDER + +static wxString DumpIntArray(const wxArrayInt& a) +{ + wxString s("{ "); + const size_t count = a.size(); + for ( size_t n = 0; n < count; n++ ) + { + if ( n ) + s += ", "; + s += wxString::Format("%lu", (unsigned long)a[n]); + } + + s += " }"; + + return s; +} + +void MyFrame::OnSetColOrder(wxCommandEvent& WXUNUSED(event)) +{ + wxArrayInt order(3); + order[0] = 2; + order[1] = 0; + order[2] = 1; + if ( m_listCtrl->SetColumnsOrder(order) ) + wxLogMessage("Column order set to %s", DumpIntArray(order)); +} + +void MyFrame::OnGetColOrder(wxCommandEvent& WXUNUSED(event)) +{ + // show what GetColumnsOrder() returns + const wxArrayInt order = m_listCtrl->GetColumnsOrder(); + wxString msg = "Columns order: " + + DumpIntArray(m_listCtrl->GetColumnsOrder()) + "\n"; + + int n; + const int count = m_listCtrl->GetColumnCount(); + + // show the results of GetColumnOrder() for each column + msg += "GetColumnOrder() results:\n"; + for ( n = 0; n < count; n++ ) + { + msg += wxString::Format(" %2d -> %2d\n", + n, m_listCtrl->GetColumnOrder(n)); + } + + // and the results of GetColumnIndexFromOrder() too + msg += "GetColumnIndexFromOrder() results:\n"; + for ( n = 0; n < count; n++ ) + { + msg += wxString::Format(" %2d -> %2d\n", + n, m_listCtrl->GetColumnIndexFromOrder(n)); + } + + wxLogMessage("%s", msg); +} + +#endif // wxHAS_LISTCTRL_COLUMN_ORDER + void MyFrame::OnShowColInfo(wxCommandEvent& WXUNUSED(event)) { int count = m_listCtrl->GetColumnCount(); diff --git a/samples/listctrl/listtest.h b/samples/listctrl/listtest.h index 2b5fefb324..e203f8f5f8 100644 --- a/samples/listctrl/listtest.h +++ b/samples/listctrl/listtest.h @@ -136,6 +136,10 @@ protected: void OnShowColInfo(wxCommandEvent& event); void OnShowSelInfo(wxCommandEvent& event); void OnShowViewRect(wxCommandEvent& event); +#ifdef wxHAS_LISTCTRL_COLUMN_ORDER + void OnSetColOrder(wxCommandEvent& event); + void OnGetColOrder(wxCommandEvent& event); +#endif // wxHAS_LISTCTRL_COLUMN_ORDER void OnFreeze(wxCommandEvent& event); void OnThaw(wxCommandEvent& event); void OnToggleLines(wxCommandEvent& event); @@ -204,6 +208,10 @@ enum LIST_SHOW_COL_INFO, LIST_SHOW_SEL_INFO, LIST_SHOW_VIEW_RECT, +#ifdef wxHAS_LISTCTRL_COLUMN_ORDER + LIST_SET_COL_ORDER, + LIST_GET_COL_ORDER, +#endif // wxHAS_LISTCTRL_COLUMN_ORDER LIST_GOTO, LIST_FOCUS_LAST, LIST_FREEZE, diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index c337ef14e9..4d7e28177a 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -721,33 +721,32 @@ bool wxListCtrl::SetColumnWidth(int col, int width) // columns order // ---------------------------------------------------------------------------- -int wxListCtrl::GetColumnOrder(int col) const +int wxListCtrl::GetColumnIndexFromOrder(int order) const { const int numCols = GetColumnCount(); - wxCHECK_MSG( col >= 0 && col < numCols, -1, _T("Col index out of bounds") ); + wxCHECK_MSG( order >= 0 && order < numCols, -1, + _T("Column position out of bounds") ); wxArrayInt indexArray(numCols); - if ( !ListView_GetColumnOrderArray(GetHwnd(), numCols, &indexArray[0]) ) return -1; - return indexArray[col]; + return indexArray[order]; } -int wxListCtrl::GetColumnIndexFromOrder(int order) const +int wxListCtrl::GetColumnOrder(int col) const { const int numCols = GetColumnCount(); - wxASSERT_MSG( order >= 0 && order < numCols, _T("Col order out of bounds") ); + wxASSERT_MSG( col >= 0 && col < numCols, _T("Column index out of bounds") ); wxArrayInt indexArray(numCols); - if ( !ListView_GetColumnOrderArray(GetHwnd(), numCols, &indexArray[0]) ) return -1; - for ( int col = 0; col < numCols; col++ ) + for ( int pos = 0; pos < numCols; pos++ ) { - if ( indexArray[col] == order ) - return col; + if ( indexArray[pos] == col ) + return pos; } wxFAIL_MSG( _T("no column with with given order?") ); diff --git a/tests/Makefile.in b/tests/Makefile.in index 59e1d55f5a..cad57a6425 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -126,6 +126,7 @@ TEST_GUI_OBJECTS = \ test_gui_comboboxtest.o \ test_gui_textctrltest.o \ test_gui_textentrytest.o \ + test_gui_listctrltest.o \ test_gui_rawbmp.o \ test_gui_htmlwindow.o \ test_gui_guifuncs.o \ @@ -543,6 +544,9 @@ test_gui_textctrltest.o: $(srcdir)/controls/textctrltest.cpp $(TEST_GUI_ODEP) test_gui_textentrytest.o: $(srcdir)/controls/textentrytest.cpp $(TEST_GUI_ODEP) $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/textentrytest.cpp +test_gui_listctrltest.o: $(srcdir)/controls/listctrltest.cpp $(TEST_GUI_ODEP) + $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/listctrltest.cpp + test_gui_rawbmp.o: $(srcdir)/image/rawbmp.cpp $(TEST_GUI_ODEP) $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/image/rawbmp.cpp diff --git a/tests/controls/listctrltest.cpp b/tests/controls/listctrltest.cpp new file mode 100644 index 0000000000..21325d6957 --- /dev/null +++ b/tests/controls/listctrltest.cpp @@ -0,0 +1,143 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: tests/controls/listctrltest.cpp +// Purpose: wxListCtrl unit test +// Author: Vadim Zeitlin +// Created: 2008-11-26 +// RCS-ID: $Id$ +// Copyright: (c) 2008 Vadim Zeitlin +/////////////////////////////////////////////////////////////////////////////// + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +#include "testprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/listctrl.h" +#endif // WX_PRECOMP + +// ---------------------------------------------------------------------------- +// test class +// ---------------------------------------------------------------------------- + +class ListCtrlTestCase : public CppUnit::TestCase +{ +public: + ListCtrlTestCase() { } + + virtual void setUp(); + virtual void tearDown(); + +private: + CPPUNIT_TEST_SUITE( ListCtrlTestCase ); +#ifdef wxHAS_LISTCTRL_COLUMN_ORDER + CPPUNIT_TEST( ColumnsOrder ); +#endif // wxHAS_LISTCTRL_COLUMN_ORDER + CPPUNIT_TEST_SUITE_END(); + +#ifdef wxHAS_LISTCTRL_COLUMN_ORDER + void ColumnsOrder(); +#endif // wxHAS_LISTCTRL_COLUMN_ORDER + + wxListCtrl *m_list; + + DECLARE_NO_COPY_CLASS(ListCtrlTestCase) +}; + +// register in the unnamed registry so that these tests are run by default +CPPUNIT_TEST_SUITE_REGISTRATION( ListCtrlTestCase ); + +// also include in it's own registry so that these tests can be run alone +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ListCtrlTestCase, "ListCtrlTestCase" ); + +// ---------------------------------------------------------------------------- +// test initialization +// ---------------------------------------------------------------------------- + +void ListCtrlTestCase::setUp() +{ + m_list = new wxListCtrl(wxTheApp->GetTopWindow()); +} + +void ListCtrlTestCase::tearDown() +{ + delete m_list; + m_list = NULL; +} + +// ---------------------------------------------------------------------------- +// the tests themselves +// ---------------------------------------------------------------------------- + +#ifdef wxHAS_LISTCTRL_COLUMN_ORDER + +void ListCtrlTestCase::ColumnsOrder() +{ + static const int NUM_COLS; + int n; + wxListItem li; + li.SetMask(wxLIST_MASK_TEXT); + + // first set up some columns + m_list->InsertColumn(0, "Column 0"); + m_list->InsertColumn(1, "Column 1"); + m_list->InsertColumn(2, "Column 2"); + + // and a couple of test items too + m_list->InsertItem(0, "Item 0"); + m_list->SetItem(0, 1, "first in first"); + + m_list->InsertItem(1, "Item 1"); + m_list->SetItem(1, 2, "second in second"); + + + // check that the order is natural in the beginning + const wxArrayInt orderOrig = m_list->GetColumnsOrder(); + for ( n = 0; n < NUM_COLS; n++ ) + CPPUNIT_ASSERT_EQUAL( n, orderOrig[n] ); + + // then rearrange them: using { 2, 0, 1 } order means that column 2 is + // shown first, then column 0 and finally column 1 + wxArrayInt order(3); + order[0] = 2; + order[1] = 0; + order[2] = 1; + m_list->SetColumnsOrder(order); + + // check that we get back the same order as we set + const wxArrayInt orderNew = m_list->GetColumnsOrder(); + for ( n = 0; n < NUM_COLS; n++ ) + CPPUNIT_ASSERT_EQUAL( order[n], orderNew[n] ); + + // and the order -> index mappings for individual columns + for ( n = 0; n < NUM_COLS; n++ ) + CPPUNIT_ASSERT_EQUAL( order[n], m_list->GetColumnIndexFromOrder(n) ); + + // and also the reverse mapping + CPPUNIT_ASSERT_EQUAL( 1, m_list->GetColumnOrder(0) ); + CPPUNIT_ASSERT_EQUAL( 2, m_list->GetColumnOrder(1) ); + CPPUNIT_ASSERT_EQUAL( 0, m_list->GetColumnOrder(2) ); + + + // finally check that accessors still use indices, not order + CPPUNIT_ASSERT( m_list->GetColumn(0, li) ); + CPPUNIT_ASSERT_EQUAL( "Column 0", li.GetText() ); + + li.SetId(0); + li.SetColumn(1); + CPPUNIT_ASSERT( m_list->GetItem(li) ); + CPPUNIT_ASSERT_EQUAL( "first in first", li.GetText() ); + + li.SetId(1); + li.SetColumn(2); + CPPUNIT_ASSERT( m_list->GetItem(li) ); + CPPUNIT_ASSERT_EQUAL( "second in second", li.GetText() ); +} + +#endif // wxHAS_LISTCTRL_COLUMN_ORDER diff --git a/tests/makefile.bcc b/tests/makefile.bcc index 03173f9608..4a0c138602 100644 --- a/tests/makefile.bcc +++ b/tests/makefile.bcc @@ -46,6 +46,7 @@ TEST_OBJECTS = \ $(OBJS)\test_cmdlinetest.obj \ $(OBJS)\test_fileconf.obj \ $(OBJS)\test_datetimetest.obj \ + $(OBJS)\test_timertest.obj \ $(OBJS)\test_filekind.obj \ $(OBJS)\test_filenametest.obj \ $(OBJS)\test_filesystest.obj \ @@ -112,6 +113,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_comboboxtest.obj \ $(OBJS)\test_gui_textctrltest.obj \ $(OBJS)\test_gui_textentrytest.obj \ + $(OBJS)\test_gui_listctrltest.obj \ $(OBJS)\test_gui_rawbmp.obj \ $(OBJS)\test_gui_htmlwindow.obj \ $(OBJS)\test_gui_guifuncs.obj \ @@ -402,6 +404,9 @@ $(OBJS)\test_fileconf.obj: .\config\fileconf.cpp $(OBJS)\test_datetimetest.obj: .\datetime\datetimetest.cpp $(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) .\datetime\datetimetest.cpp +$(OBJS)\test_timertest.obj: .\events\timertest.cpp + $(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) .\events\timertest.cpp + $(OBJS)\test_filekind.obj: .\filekind\filekind.cpp $(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) .\filekind\filekind.cpp @@ -579,6 +584,9 @@ $(OBJS)\test_gui_textctrltest.obj: .\controls\textctrltest.cpp $(OBJS)\test_gui_textentrytest.obj: .\controls\textentrytest.cpp $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\textentrytest.cpp +$(OBJS)\test_gui_listctrltest.obj: .\controls\listctrltest.cpp + $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\listctrltest.cpp + $(OBJS)\test_gui_rawbmp.obj: .\image\rawbmp.cpp $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\image\rawbmp.cpp diff --git a/tests/makefile.gcc b/tests/makefile.gcc index 65a2f34066..f3f74e43bd 100644 --- a/tests/makefile.gcc +++ b/tests/makefile.gcc @@ -38,6 +38,7 @@ TEST_OBJECTS = \ $(OBJS)\test_cmdlinetest.o \ $(OBJS)\test_fileconf.o \ $(OBJS)\test_datetimetest.o \ + $(OBJS)\test_timertest.o \ $(OBJS)\test_filekind.o \ $(OBJS)\test_filenametest.o \ $(OBJS)\test_filesystest.o \ @@ -105,6 +106,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_comboboxtest.o \ $(OBJS)\test_gui_textctrltest.o \ $(OBJS)\test_gui_textentrytest.o \ + $(OBJS)\test_gui_listctrltest.o \ $(OBJS)\test_gui_rawbmp.o \ $(OBJS)\test_gui_htmlwindow.o \ $(OBJS)\test_gui_guifuncs.o \ @@ -380,6 +382,9 @@ $(OBJS)\test_fileconf.o: ./config/fileconf.cpp $(OBJS)\test_datetimetest.o: ./datetime/datetimetest.cpp $(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\test_timertest.o: ./events/timertest.cpp + $(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\test_filekind.o: ./filekind/filekind.cpp $(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $< @@ -557,6 +562,9 @@ $(OBJS)\test_gui_textctrltest.o: ./controls/textctrltest.cpp $(OBJS)\test_gui_textentrytest.o: ./controls/textentrytest.cpp $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\test_gui_listctrltest.o: ./controls/listctrltest.cpp + $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\test_gui_rawbmp.o: ./image/rawbmp.cpp $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< diff --git a/tests/makefile.vc b/tests/makefile.vc index 61c38538ed..8d1138b915 100644 --- a/tests/makefile.vc +++ b/tests/makefile.vc @@ -39,6 +39,7 @@ TEST_OBJECTS = \ $(OBJS)\test_cmdlinetest.obj \ $(OBJS)\test_fileconf.obj \ $(OBJS)\test_datetimetest.obj \ + $(OBJS)\test_timertest.obj \ $(OBJS)\test_filekind.obj \ $(OBJS)\test_filenametest.obj \ $(OBJS)\test_filesystest.obj \ @@ -108,6 +109,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_comboboxtest.obj \ $(OBJS)\test_gui_textctrltest.obj \ $(OBJS)\test_gui_textentrytest.obj \ + $(OBJS)\test_gui_listctrltest.obj \ $(OBJS)\test_gui_rawbmp.obj \ $(OBJS)\test_gui_htmlwindow.obj \ $(OBJS)\test_gui_guifuncs.obj \ @@ -487,6 +489,9 @@ $(OBJS)\test_fileconf.obj: .\config\fileconf.cpp $(OBJS)\test_datetimetest.obj: .\datetime\datetimetest.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) .\datetime\datetimetest.cpp +$(OBJS)\test_timertest.obj: .\events\timertest.cpp + $(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) .\events\timertest.cpp + $(OBJS)\test_filekind.obj: .\filekind\filekind.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) .\filekind\filekind.cpp @@ -664,6 +669,9 @@ $(OBJS)\test_gui_textctrltest.obj: .\controls\textctrltest.cpp $(OBJS)\test_gui_textentrytest.obj: .\controls\textentrytest.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\textentrytest.cpp +$(OBJS)\test_gui_listctrltest.obj: .\controls\listctrltest.cpp + $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\listctrltest.cpp + $(OBJS)\test_gui_rawbmp.obj: .\image\rawbmp.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\image\rawbmp.cpp diff --git a/tests/makefile.wat b/tests/makefile.wat index 18a0693303..f0d4f57e2c 100644 --- a/tests/makefile.wat +++ b/tests/makefile.wat @@ -256,6 +256,7 @@ TEST_OBJECTS = & $(OBJS)\test_cmdlinetest.obj & $(OBJS)\test_fileconf.obj & $(OBJS)\test_datetimetest.obj & + $(OBJS)\test_timertest.obj & $(OBJS)\test_filekind.obj & $(OBJS)\test_filenametest.obj & $(OBJS)\test_filesystest.obj & @@ -322,6 +323,7 @@ TEST_GUI_OBJECTS = & $(OBJS)\test_gui_comboboxtest.obj & $(OBJS)\test_gui_textctrltest.obj & $(OBJS)\test_gui_textentrytest.obj & + $(OBJS)\test_gui_listctrltest.obj & $(OBJS)\test_gui_rawbmp.obj & $(OBJS)\test_gui_htmlwindow.obj & $(OBJS)\test_gui_guifuncs.obj & @@ -434,6 +436,9 @@ $(OBJS)\test_fileconf.obj : .AUTODEPEND .\config\fileconf.cpp $(OBJS)\test_datetimetest.obj : .AUTODEPEND .\datetime\datetimetest.cpp $(CXX) -bt=nt -zq -fo=$^@ $(TEST_CXXFLAGS) $< +$(OBJS)\test_timertest.obj : .AUTODEPEND .\events\timertest.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(TEST_CXXFLAGS) $< + $(OBJS)\test_filekind.obj : .AUTODEPEND .\filekind\filekind.cpp $(CXX) -bt=nt -zq -fo=$^@ $(TEST_CXXFLAGS) $< @@ -611,6 +616,9 @@ $(OBJS)\test_gui_textctrltest.obj : .AUTODEPEND .\controls\textctrltest.cpp $(OBJS)\test_gui_textentrytest.obj : .AUTODEPEND .\controls\textentrytest.cpp $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $< +$(OBJS)\test_gui_listctrltest.obj : .AUTODEPEND .\controls\listctrltest.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $< + $(OBJS)\test_gui_rawbmp.obj : .AUTODEPEND .\image\rawbmp.cpp $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $< diff --git a/tests/test.bkl b/tests/test.bkl index ecde829c6a..7a78b18971 100644 --- a/tests/test.bkl +++ b/tests/test.bkl @@ -110,6 +110,7 @@ controls/comboboxtest.cpp controls/textctrltest.cpp controls/textentrytest.cpp + controls/listctrltest.cpp image/rawbmp.cpp html/htmlwindow.cpp misc/guifuncs.cpp diff --git a/tests/test_test_gui.dsp b/tests/test_test_gui.dsp index 54f603443f..6ad4be8ae1 100644 --- a/tests/test_test_gui.dsp +++ b/tests/test_test_gui.dsp @@ -261,6 +261,10 @@ SOURCE=.\html\htmlwindow.cpp # End Source File # Begin Source File +SOURCE=.\controls\listctrltest.cpp +# End Source File +# Begin Source File + SOURCE=.\geometry\point.cpp # End Source File # Begin Source File diff --git a/tests/test_vc7_test_gui.vcproj b/tests/test_vc7_test_gui.vcproj index 48877b044e..dde55705a1 100644 --- a/tests/test_vc7_test_gui.vcproj +++ b/tests/test_vc7_test_gui.vcproj @@ -615,6 +615,9 @@ + + diff --git a/tests/test_vc8_test_gui.vcproj b/tests/test_vc8_test_gui.vcproj index 2df95ac98e..02a3bf72e5 100644 --- a/tests/test_vc8_test_gui.vcproj +++ b/tests/test_vc8_test_gui.vcproj @@ -899,6 +899,10 @@ RelativePath=".\html\htmlwindow.cpp" > + + diff --git a/tests/test_vc9_test_gui.vcproj b/tests/test_vc9_test_gui.vcproj index 45e74ae9dc..ccf1610481 100644 --- a/tests/test_vc9_test_gui.vcproj +++ b/tests/test_vc9_test_gui.vcproj @@ -871,6 +871,10 @@ RelativePath=".\html\htmlwindow.cpp" > + + -- 2.45.2