The rounded corners look really dumb at this size.
[wxWidgets.git] / tests / controls / simplebooktest.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/controls/simplebooktest.cpp
3 // Purpose: wxSimplebook unit test
4 // Author: Vadim Zeitlin
5 // Created: 2013-06-23
6 // Copyright: (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
7 ///////////////////////////////////////////////////////////////////////////////
8
9 #include "testprec.h"
10
11 #if wxUSE_BOOKCTRL
12
13 #ifdef __BORLANDC__
14 #pragma hdrstop
15 #endif
16
17 #ifndef WX_PRECOMP
18 #include "wx/app.h"
19 #include "wx/panel.h"
20 #endif // WX_PRECOMP
21
22 #include "wx/simplebook.h"
23 #include "bookctrlbasetest.h"
24
25 class SimplebookTestCase : public BookCtrlBaseTestCase, public CppUnit::TestCase
26 {
27 public:
28 SimplebookTestCase() { }
29
30 virtual void setUp();
31 virtual void tearDown();
32
33 private:
34 virtual wxBookCtrlBase *GetBase() const { return m_simplebook; }
35
36 virtual wxEventType GetChangedEvent() const
37 { return wxEVT_BOOKCTRL_PAGE_CHANGED; }
38
39 virtual wxEventType GetChangingEvent() const
40 { return wxEVT_BOOKCTRL_PAGE_CHANGING; }
41
42 CPPUNIT_TEST_SUITE( SimplebookTestCase );
43 wxBOOK_CTRL_BASE_TESTS();
44 CPPUNIT_TEST_SUITE_END();
45
46 wxSimplebook *m_simplebook;
47
48 DECLARE_NO_COPY_CLASS(SimplebookTestCase)
49 };
50
51 // register in the unnamed registry so that these tests are run by default
52 CPPUNIT_TEST_SUITE_REGISTRATION( SimplebookTestCase );
53
54 // also include in its own registry so that these tests can be run alone
55 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SimplebookTestCase, "SimplebookTestCase" );
56
57 void SimplebookTestCase::setUp()
58 {
59 m_simplebook = new wxSimplebook(wxTheApp->GetTopWindow(), wxID_ANY);
60 AddPanels();
61 }
62
63 void SimplebookTestCase::tearDown()
64 {
65 wxDELETE(m_simplebook);
66 }
67
68 #endif // wxUSE_BOOKCTRL
69