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