Пример #1
0
WMenuInfo *WMenuGetEInfo( WMenuHandle hndl, Bool keep )
{
    WMenuEditInfo   *einfo;
    WMenuInfo       *info;
    int             ok;

    info = NULL;

    einfo = (WMenuEditInfo *)WGetEditSessionInfo( hndl );

    ok = (einfo != NULL);

    if( ok ) {
        info = einfo->info;
        ok = (info != NULL);
    }

    if( ok ) {
        if( einfo->info->modified ) {
            if( info->data != NULL ) {
                WMemFree( info->data );
                info->data = NULL;
            }
            info->data_size = 0;
            WMakeDataFromMenu( einfo->menu, &info->data, &info->data_size );
        }
        if( !keep ) {
            WUnRegisterEditSession( hndl );
            WFreeMenuEInfo( einfo );
        }
    }

    return( info );
}
Пример #2
0
WAccelInfo *WAccelGetEInfo( WAccelHandle hndl, bool keep )
{
    WAccelEditInfo  *einfo;
    WAccelInfo      *info;
    bool            ok;

    info = NULL;

    einfo = (WAccelEditInfo *)WGetEditSessionInfo( hndl );

    ok = (einfo != NULL);

    if( ok ) {
        info = einfo->info;
        ok = (info != NULL);
    }

    if( ok ) {
        if( einfo->info->modified ) {
            if( info->data != NULL ) {
                WRMemFree( info->data );
            }
            info->data = NULL;
            info->data_size = 0;
            WMakeDataFromAccelTable( einfo->tbl, &info->data, &info->data_size );
        }
        if( !keep ) {
            WUnRegisterEditSession( hndl );
            WFreeAccelEInfo( einfo );
        }
    }

    return( info );
}
Пример #3
0
WStringInfo *WStringGetEInfo( WStringHandle hndl, bool keep )
{
    WStringEditInfo     *einfo;
    WStringInfo         *info;
    bool                ok;

    info = NULL;

    einfo = (WStringEditInfo *)WGetEditSessionInfo( hndl );

    ok = (einfo != NULL);

    if( ok ) {
        info = einfo->info;
        ok = (info != NULL);
    }

    if( ok ) {
        if( einfo->info->modified ) {
            WFreeStringNodes( info );
            info->tables = WMakeStringNodes( einfo->tbl );
        }
        if( !keep ) {
            WUnRegisterEditSession( hndl );
            WFreeStringEInfo( einfo );
        }
    }

    return( info );
}
Пример #4
0
Bool WHandleWM_CLOSE( WMenuEditInfo *einfo, Bool force_exit )
{
    Bool        ret;

    ret = TRUE;

    if( einfo != NULL ) {
        if( einfo->info->modified || WRIsHashTableDirty( einfo->info->symbol_table ) ) {
            ret = WQuerySave( einfo, force_exit );
        }
        if( ret ) {
            SendMessage( einfo->info->parent, MENU_I_HAVE_CLOSED, 0, (LPARAM)einfo->hndl );
            WUnRegisterEditSession( WGetEditSessionHandle( einfo ) );
        }
    }

    return( ret );
}