Ignore:
Timestamp:
Feb 24, 2009, 3:52:22 PM (13 years ago)
Author:
Eugene Romanenko
Message:

close menuitem

File:
1 edited

Legend:

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

    r238 r267  
    263263
    264264        WinEnableMenuItem( hWndMenu, CM_SAVEAS, FALSE );
     265        WinEnableMenuItem( hWndMenu, CM_CLOSE, FALSE );
    265266        WinEnableMenuItem( hWndMenu, CM_PRINT, FALSE );
    266267        WinSendMsg( hToolBar, TBM_ENABLEITEM, MPFROMSHORT(CM_PRINT), (MPARAM)FALSE );
     
    313314    WinSendMsg( hToolBar, TBM_ENABLEITEM, MPFROMSHORT(CM_PRINT), (MPARAM)TRUE );
    314315    WinEnableMenuItem( hWndMenu, CM_SAVEAS, doc->isSaveable( ev ) );
     316    WinEnableMenuItem( hWndMenu, CM_CLOSE, TRUE );
    315317    setOfPages( doc->getPageCount( ev ) );
    316318    WinEnableMenuItem( hWndMenu, CM_FONTSINFO, doc->isHaveFontInfo( ev ) );
     
    365367void Lucide::closeDocument()
    366368{
    367     docViewer->close();
    368     delete doc;
    369     doc = NULL;
    370     WinSetWindowText( hWndFrame, title );
    371     checkMenus( false );
     369    if ( doc != NULL ) {   
     370        docViewer->close();
     371        delete doc;
     372        doc = NULL;
     373        WinSetWindowText( hWndFrame, title );
     374        checkMenus( false );
     375    }
    372376
    373377    if ( thumbnailData != NULL ) {
     
    961965                    Lucide::saveDocumentAs();
    962966                    return (MRESULT)FALSE;
     967                   
     968                case CM_CLOSE:
     969                    Lucide::closeDocument();
     970                    return (MRESULT)FALSE;
    963971
    964972                case CM_PRINT:
Note: See TracChangeset for help on using the changeset viewer.