bookctrlbasetest.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: tests/controls/bookctrlbasetest.cpp
  3. // Purpose: wxBookCtrlBase unit test
  4. // Author: Steven Lamerton
  5. // Created: 2010-07-02
  6. // Copyright: (c) 2010 Steven Lamerton
  7. ///////////////////////////////////////////////////////////////////////////////
  8. #ifndef _WX_TESTS_CONTROLS_BOOKCTRLBASETEST_H_
  9. #define _WX_TESTS_CONTROLS_BOOKCTRLBASETEST_H_
  10. class BookCtrlBaseTestCase
  11. {
  12. public:
  13. BookCtrlBaseTestCase() { }
  14. virtual ~BookCtrlBaseTestCase() { }
  15. protected:
  16. // this function must be overridden by the derived classes to return the
  17. // text entry object we're testing, typically this is done by creating a
  18. // control implementing wxBookCtrlBase interface in setUp() virtual method and
  19. // just returning it from here
  20. virtual wxBookCtrlBase *GetBase() const = 0;
  21. virtual wxEventType GetChangedEvent() const = 0;
  22. virtual wxEventType GetChangingEvent() const = 0;
  23. // this should be inserted in the derived class CPPUNIT_TEST_SUITE
  24. // definition to run all wxBookCtrlBase tests as part of it
  25. #define wxBOOK_CTRL_BASE_TESTS() \
  26. CPPUNIT_TEST( Selection ); \
  27. CPPUNIT_TEST( Text ); \
  28. CPPUNIT_TEST( PageManagement ); \
  29. CPPUNIT_TEST( ChangeEvents )
  30. void Selection();
  31. void Text();
  32. void PageManagement();
  33. void ChangeEvents();
  34. //You need to add CPPUNIT_TEST( Image ) specifically if you want it to be
  35. //tested as only wxNotebook and wxTreebook support images correctly
  36. void Image();
  37. //Call this from the setUp function of a specific test to add panels to
  38. //the ctrl.
  39. void AddPanels();
  40. // Override this to call Realize() on the toolbar in the wxToolbook test.
  41. virtual void Realize() { }
  42. wxPanel* m_panel1;
  43. wxPanel* m_panel2;
  44. wxPanel* m_panel3;
  45. wxImageList* m_list;
  46. private:
  47. wxDECLARE_NO_COPY_CLASS(BookCtrlBaseTestCase);
  48. };
  49. #endif // _WX_TESTS_CONTROLS_BOOKCTRLBASETEST_H_