Changeset 132 for trunk/Lucide/SOURCE


Ignore:
Timestamp:
Sep 24, 2006, 9:51:48 AM (15 years ago)
Author:
Eugene Romanenko
Message:

checkmenu calls cleanup

File:
1 edited

Legend:

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

    r129 r132  
    171171    if ( cmd != -1 )
    172172    {
    173         WinSendMsg( hWndMenu, MM_SETITEMATTR, MPFROM2SHORT( cmd, TRUE ),
    174                             MPFROM2SHORT( MIA_CHECKED, MIA_CHECKED ) );
     173        WinCheckMenuItem( hWndMenu, cmd, TRUE );
    175174        WinSendMsg( hToolBar, TBM_SETCHECK, MPFROMSHORT( cmd ), (MPARAM)TRUE );
    176175    }
     
    195194    double zoom = docViewer->getZoom();
    196195
    197     WinSendMsg( hWndMenu, MM_SETITEMATTR, MPFROM2SHORT( CM_FITWINDOW, TRUE ),
    198                         MPFROM2SHORT( MIA_CHECKED, FALSE ) );
     196    WinCheckMenuItem( hWndMenu, CM_FITWINDOW, FALSE );
    199197    WinSendMsg( hToolBar, TBM_SETCHECK, MPFROMSHORT(CM_FITWINDOW), (MPARAM)FALSE );
    200     WinSendMsg( hWndMenu, MM_SETITEMATTR, MPFROM2SHORT( CM_ACTSIZE, TRUE ),
    201                         MPFROM2SHORT( MIA_CHECKED, FALSE ) );
     198    WinCheckMenuItem( hWndMenu, CM_ACTSIZE, FALSE );
    202199    WinSendMsg( hToolBar, TBM_SETCHECK, MPFROMSHORT(CM_ACTSIZE), (MPARAM)FALSE );
    203     WinSendMsg( hWndMenu, MM_SETITEMATTR, MPFROM2SHORT( CM_FITWIDTH, TRUE ),
    204                         MPFROM2SHORT( MIA_CHECKED, FALSE ) );
     200    WinCheckMenuItem( hWndMenu, CM_FITWIDTH, FALSE );
    205201    WinSendMsg( hToolBar, TBM_SETCHECK, MPFROMSHORT(CM_FITWIDTH), (MPARAM)FALSE );
    206202
     
    224220    {
    225221        // "single page" mode by default
    226         WinSendMsg( hWndMenu, MM_SETITEMATTR,
    227                     MPFROM2SHORT( CM_SINGLEPAGE, TRUE ),
    228                     MPFROM2SHORT( MIA_CHECKED, MIA_CHECKED ) );
     222        WinCheckMenuItem( hWndMenu, CM_SINGLEPAGE, TRUE );
    229223
    230224        WinEnableMenuItem( hWndMenu, CM_SAVEAS, FALSE );
     
    315309void Lucide::setPageLayout( PgLayout layout )
    316310{
    317     if ( layout == SinglePage )
    318     {
    319         WinSendMsg( hWndMenu, MM_SETITEMATTR,
    320                     MPFROM2SHORT( CM_SINGLEPAGE, TRUE ),
    321                     MPFROM2SHORT( MIA_CHECKED, MIA_CHECKED ) );
    322         WinSendMsg( hWndMenu, MM_SETITEMATTR,
    323                     MPFROM2SHORT( CM_CONTINUOUS, TRUE ),
    324                     MPFROM2SHORT( MIA_CHECKED, FALSE ) );
    325     }
    326     else
    327     {
    328         WinSendMsg( hWndMenu, MM_SETITEMATTR,
    329                     MPFROM2SHORT( CM_SINGLEPAGE, TRUE ),
    330                     MPFROM2SHORT( MIA_CHECKED, FALSE ) );
    331         WinSendMsg( hWndMenu, MM_SETITEMATTR,
    332                     MPFROM2SHORT( CM_CONTINUOUS, TRUE ),
    333                     MPFROM2SHORT( MIA_CHECKED, MIA_CHECKED ) );
     311    if ( layout == SinglePage ) {
     312        WinCheckMenuItem( hWndMenu, CM_SINGLEPAGE, TRUE );
     313        WinCheckMenuItem( hWndMenu, CM_CONTINUOUS, FALSE );
     314    }
     315    else {
     316        WinCheckMenuItem( hWndMenu, CM_SINGLEPAGE, FALSE );
     317        WinCheckMenuItem( hWndMenu, CM_CONTINUOUS, TRUE );
    334318    }
    335319
     
    506490void Lucide::checkNavpane()
    507491{
    508     if ( Lucide::showIndex )
    509     {
    510         WinSendMsg( hWndMenu, MM_SETITEMATTR, MPFROM2SHORT( CM_NAVPANE, TRUE ),
    511                 MPFROM2SHORT( MIA_CHECKED, MIA_CHECKED ) );
     492    if ( Lucide::showIndex ) {
     493        WinCheckMenuItem( hWndMenu, CM_NAVPANE, TRUE );
    512494        WinSendMsg( hToolBar, TBM_SETCHECK, MPFROMSHORT( CM_NAVPANE ), (MPARAM)TRUE );
    513495    }
    514     else
    515     {
    516         WinSendMsg( hWndMenu, MM_SETITEMATTR, MPFROM2SHORT( CM_NAVPANE, TRUE ),
    517                 MPFROM2SHORT( MIA_CHECKED, FALSE ) );
     496    else {
     497        WinCheckMenuItem( hWndMenu, CM_NAVPANE, FALSE );
    518498        WinSendMsg( hToolBar, TBM_SETCHECK, MPFROMSHORT( CM_NAVPANE ), (MPARAM)FALSE );
    519499    }
     
    615595        bool isZoom = !docViewer->isZoomMode();
    616596
    617         WinSendMsg( hWndMenu, MM_SETITEMATTR, MPFROM2SHORT( CM_ZOOM_IN_OUT, TRUE ),
    618                 MPFROM2SHORT( MIA_CHECKED, isZoom ? MIA_CHECKED : FALSE ) );
     597        WinCheckMenuItem( hWndMenu, CM_ZOOM_IN_OUT, isZoom );
    619598        WinSendMsg( hToolBar, TBM_SETCHECK, MPFROMSHORT( CM_ZOOM_IN_OUT ), (MPARAM)isZoom );
    620599        docViewer->setZoomMode( isZoom );
Note: See TracChangeset for help on using the changeset viewer.