Ignore:
Timestamp:
May 7, 2006, 11:24:03 AM (15 years ago)
Author:
Eugene Romanenko
Message:

implemented continuous view (synch/asynch), text search and selection doesn't work yet in continuous view

File:
1 edited

Legend:

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

    r2 r18  
    147147void Lucide::checkMenus()
    148148{
    149     // currently only "single page" mode
    150     WinSendMsg( hWndMenu, MM_SETITEMATTR,
    151                 MPFROM2SHORT( CM_SINGLEPAGE, TRUE ),
    152                 MPFROM2SHORT( MIA_CHECKED, MIA_CHECKED ) );
    153 
    154149    // pre-set "Actual size"
    155150    setZoomChecks( CM_ACTSIZE, 0, 0 );
     
    157152    if ( doc == NULL )
    158153    {
     154        // "single page" mode by default
     155        WinSendMsg( hWndMenu, MM_SETITEMATTR,
     156                    MPFROM2SHORT( CM_SINGLEPAGE, TRUE ),
     157                    MPFROM2SHORT( MIA_CHECKED, MIA_CHECKED ) );
     158
    159159        WinEnableMenuItem( hWndMenu, CM_SAVEAS, FALSE );
    160160        WinEnableMenuItem( hWndMenu, CM_EXPORTTOPS, FALSE );
     
    212212    WinEnableMenuItem( hWndMenu, CM_FIND, haveText );
    213213    WinSendMsg( hToolBar, TBM_ENABLEITEM, MPFROMSHORT(CM_FIND), (MPARAM)haveText );
     214
     215    WinEnableMenuItem( hWndMenu, CM_SINGLEPAGE, TRUE );
     216    WinEnableMenuItem( hWndMenu, CM_CONTINUOUS, TRUE );
    214217}
    215218
     
    234237    indexWin->setDocument( _doc );
    235238    Lucide::checkMenus();
     239}
     240
     241void Lucide::setViewMode( ViewMode mode )
     242{
     243    if ( mode == SinglePage )
     244    {
     245        WinSendMsg( hWndMenu, MM_SETITEMATTR,
     246                    MPFROM2SHORT( CM_SINGLEPAGE, TRUE ),
     247                    MPFROM2SHORT( MIA_CHECKED, MIA_CHECKED ) );
     248        WinSendMsg( hWndMenu, MM_SETITEMATTR,
     249                    MPFROM2SHORT( CM_CONTINUOUS, TRUE ),
     250                    MPFROM2SHORT( MIA_CHECKED, FALSE ) );
     251    }
     252    else
     253    {
     254        WinSendMsg( hWndMenu, MM_SETITEMATTR,
     255                    MPFROM2SHORT( CM_SINGLEPAGE, TRUE ),
     256                    MPFROM2SHORT( MIA_CHECKED, FALSE ) );
     257        WinSendMsg( hWndMenu, MM_SETITEMATTR,
     258                    MPFROM2SHORT( CM_CONTINUOUS, TRUE ),
     259                    MPFROM2SHORT( MIA_CHECKED, MIA_CHECKED ) );
     260    }
     261
     262    docViewer->setViewMode( mode );
    236263}
    237264
     
    387414                    return (MRESULT)FALSE;
    388415
     416                case CM_SINGLEPAGE:
     417                    Lucide::setViewMode( SinglePage );
     418                    return (MRESULT)FALSE;
     419
     420                case CM_CONTINUOUS:
     421                    Lucide::setViewMode( Continuous );
     422                    return (MRESULT)FALSE;
    389423            }
    390424        }
Note: See TracChangeset for help on using the changeset viewer.