Changeset 31 for trunk/src/MainPter.cxx

Show
Ignore:
Timestamp:
04/11/06 14:53:06 (3 years ago)
Author:
jordi
Message:

The presenter is now able to control the Zoom: In, Out, toFit and toWidth.
The ZoomIn? and ZoomOut? controls also get sensitived depending if we can zoom in/out or not.

This puts an end to the presenter. I still need to check why compiling MainPterTest?.cxx takes this insane amount of time.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/MainPter.cxx

    r30 r31  
    306306 
    307307/// 
     308/// @brief The "Zoom Fit Best" was activated. 
     309/// 
     310void 
     311MainPter::zoomFitActivated (void) 
     312{ 
     313    g_assert ( NULL != m_Document && "Tried to zoom fit a NULL document."); 
     314 
     315    gint width; 
     316    gint height; 
     317    getView ().getPageViewSize (&width, &height); 
     318    m_Document->zoomToFit (width, height); 
     319    showPage (); 
     320} 
     321 
     322/// 
     323/// @brief The "Zoom In" was activated. 
     324/// 
     325void 
     326MainPter::zoomInActivated (void) 
     327{ 
     328    g_assert ( NULL != m_Document && "Tried to zoom in a NULL document."); 
     329 
     330    m_Document->zoomIn (); 
     331    showPage (); 
     332} 
     333 
     334/// 
     335/// @brief The "Zoom Out" was activated. 
     336/// 
     337void 
     338MainPter::zoomOutActivated (void) 
     339{ 
     340    g_assert ( NULL != m_Document && "Tried to zoom out a NULL document."); 
     341 
     342    m_Document->zoomOut (); 
     343    showPage (); 
     344} 
     345 
     346/// 
     347/// @brief The "Zoom Fit Width" was activated. 
     348/// 
     349void 
     350MainPter::zoomWidthActivated (void) 
     351{ 
     352    g_assert ( NULL != m_Document && "Tried to zoom width a NULL document."); 
     353 
     354    gint width; 
     355    gint height; 
     356    getView ().getPageViewSize (&width, &height); 
     357    m_Document->zoomToWidth (width); 
     358    showPage (); 
     359} 
     360 
     361/// 
    308362/// @brief Shows the current page. 
    309363/// 
     
    332386    view.sensitiveGoToLastPage (m_Document->getNumPages() > currentPage); 
    333387    view.sensitiveGoToNextPage (m_Document->getNumPages() > currentPage); 
     388    // And the zoom sentitivity. 
     389    view.sensitiveZoomIn (m_Document->canZoomIn ()); 
     390    view.sensitiveZoomOut (m_Document->canZoomOut ()); 
    334391     
    335392    DocumentPage *page = m_Document->renderPage ();