Ignore:
Timestamp:
Sep 10, 2006, 4:36:23 PM (15 years ago)
Author:
Eugene Romanenko
Message:

added 'zoom mode' to zoom in/out with mouse click/ctrl+click (no toolbar button yet)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/lucide.cpp

    r112 r122  
    158158    WinEnableMenuItem( hWndMenu, CM_FITWIDTH, scalable );
    159159    WinSendMsg( hToolBar, TBM_ENABLEITEM, MPFROMSHORT(CM_FITWIDTH), (MPARAM)scalable );
     160    WinEnableMenuItem( hWndMenu, CM_ZOOM_IN_OUT, scalable );
    160161    WinEnableControl( hToolBar, TBID_ZOOM, scalable );
    161162    BOOL rotable = doc->isRotable( ev );
     
    255256        WinEnableMenuItem( hWndMenu, CM_FITWIDTH, FALSE );
    256257        WinSendMsg( hToolBar, TBM_ENABLEITEM, MPFROMSHORT(CM_FITWIDTH), (MPARAM)FALSE );
     258        WinEnableMenuItem( hWndMenu, CM_ZOOM_IN_OUT, FALSE );
    257259        WinEnableControl( hToolBar, TBID_ZOOM, FALSE );
    258260
     
    605607}
    606608
     609void Lucide::toggleZoom()
     610{
     611    if ( ( doc != NULL ) && doc->isScalable( ev ) )
     612    {
     613        bool isZoom = !docViewer->isZoomMode();
     614
     615        WinSendMsg( hWndMenu, MM_SETITEMATTR, MPFROM2SHORT( CM_ZOOM_IN_OUT, TRUE ),
     616                MPFROM2SHORT( MIA_CHECKED, isZoom ? MIA_CHECKED : FALSE ) );
     617        docViewer->setZoomMode( isZoom );
     618    }
     619}
     620
    607621static MRESULT EXPENTRY splProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
    608622{
     
    757771                    return (MRESULT)FALSE;
    758772
     773                case CM_ZOOM_IN_OUT:
     774                    Lucide::toggleZoom();
     775                    return (MRESULT)FALSE;
     776
    759777                case CM_SINGLEPAGE:
    760778                    Lucide::setPageLayout( SinglePage );
Note: See TracChangeset for help on using the changeset viewer.