Changeset 30
- Timestamp:
- 04/11/06 14:16:02 (2 years ago)
- Files:
-
- trunk/src/MainPter.cxx (modified) (5 diffs)
- trunk/src/MainPter.h (modified) (1 diff)
- trunk/tests/DumbDocument.cxx (modified) (2 diffs)
- trunk/tests/MainPterTest.cxx (modified) (1 diff)
- trunk/tests/MainPterTest.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/MainPter.cxx
r29 r30 139 139 } 140 140 141 /// 142 /// @brief The "Go To Last Page" action was activated. 143 /// 141 144 void 142 145 MainPter::goToLastPageActivated (void) … … 149 152 } 150 153 154 /// 155 /// @brief The "Go To Next Page" action was activated. 156 /// 151 157 void 152 158 MainPter::goToNextPageActivated (void) … … 159 165 } 160 166 167 /// 168 /// @brief The "Go To Page" action was activated. 169 /// 170 /// This action is activated when the user presses the Enter key on 171 /// the displayed current apge number. The user can change the value, 172 /// and the page will change to that value. 173 /// 161 174 void 162 175 MainPter::goToPageActivated (void) … … 178 191 } 179 192 193 194 /// 195 /// @brief The "Go To Previous Page" action was activated. 196 /// 180 197 void 181 198 MainPter::goToPreviousPageActivated (void) … … 265 282 266 283 /// 284 /// @brief The "Rotate Left" was activated. 285 /// 286 void 287 MainPter::rotateLeftActivated () 288 { 289 g_assert ( NULL != m_Document && "Tried to rotate a NULL document."); 290 291 m_Document->rotateLeft (); 292 showPage (); 293 } 294 295 /// 296 /// @brief The "Rotate Right" was activated. 297 /// 298 void 299 MainPter::rotateRightActivated () 300 { 301 g_assert ( NULL != m_Document && "Tried to rotate a NULL document."); 302 303 m_Document->rotateRight (); 304 showPage (); 305 } 306 307 /// 267 308 /// @brief Shows the current page. 268 309 /// trunk/src/MainPter.h
r29 r30 38 38 void goToPreviousPageActivated (void); 39 39 void openFileActivated (void); 40 void rotateLeftActivated (void); 41 void rotateRightActivated (void); 40 42 41 43 protected: trunk/tests/DumbDocument.cxx
r29 r30 66 66 "%s", IDocument::getErrorMessage (m_OpenError)); 67 67 } 68 m_Rotation = 0; 69 m_Scale = 1.0f; 68 70 return m_Loaded; 69 71 } … … 72 74 DumbDocument::getPageSize (gdouble *width, gdouble *height) 73 75 { 74 *width = 10 ;75 *height = 10;76 *width = 100; 77 *height = 250; 76 78 } 77 79 trunk/tests/MainPterTest.cxx
r29 r30 412 412 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 413 413 } 414 415 /// 416 /// @brief Test the rotation of the page. 417 /// 418 /// This is a very simple test about page rotation. 419 /// 420 void 421 MainPterTest::pageRotate () 422 { 423 m_View->setOpenFileName ("/tmp/test.pdf"); 424 m_MainPter->openFileActivated (); 425 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 426 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 427 CPPUNIT_ASSERT_EQUAL (m_Document->getRotation (), 0); 428 429 m_MainPter->rotateRightActivated (); 430 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 431 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 432 CPPUNIT_ASSERT_EQUAL (m_Document->getRotation (), 90); 433 434 m_MainPter->rotateLeftActivated (); 435 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 436 CPPUNIT_ASSERT (!m_View->hasImagePageView ()); 437 CPPUNIT_ASSERT_EQUAL (m_Document->getRotation (), 0); 438 } trunk/tests/MainPterTest.h
r29 r30 34 34 CPPUNIT_TEST (goodPassword); 35 35 CPPUNIT_TEST (pageNavigation); 36 CPPUNIT_TEST (pageRotate); 36 37 CPPUNIT_TEST_SUITE_END(); 37 38 … … 48 49 void goodPassword (void); 49 50 void pageNavigation (void); 51 void pageRotate (void); 50 52 51 53 private:
