예제 #1
0
bool ResWriteMenuItem( const MenuItem *curritem, bool use_unicode,
                                             WResFileID handle )
/******************************************************************/
{
    bool    error;

    if( curritem->IsPopup ) {
        error = ResWriteMenuItemPopup( &(curritem->Item.Popup), use_unicode, handle );
    } else {
        error = ResWriteMenuItemNormal( &(curritem->Item.Normal), use_unicode, handle );
    }

    return( error );
}
예제 #2
0
static int SemWriteMenuItem( FullMenuItem *item, int islastitem,
                             int *err_code, uint_16 tokentype )
/****************************************************************/
{
    int     error = 0;

    if( item->IsPopup ) {
        SemCheckMenuItemPopup( item, tokentype );
        if( islastitem ) {
            item->item.popup.item.menuData.ItemFlags |= MENU_ENDMENU;
        }
        if( tokentype == Y_MENU ) {
            error = ResWriteMenuItemPopup( &(item->item.popup.item.menuData),
                            item->UseUnicode, CurrResFile.handle );
        } else if( tokentype == Y_MENU_EX ) {
            error = ResWriteMenuExItemPopup( &(item->item.popup.item.menuData),
                      &(item->item.popup.item.menuExData), item->UseUnicode,
                      CurrResFile.handle );
        }
    } else {
        SemCheckMenuItemNormal( item, tokentype );
        if( islastitem ) {
            item->item.normal.menuData.ItemFlags |= MENU_ENDMENU;
        }
        if( tokentype == Y_MENU ) {
            error = ResWriteMenuItemNormal( &(item->item.normal.menuData),
                        item->UseUnicode, CurrResFile.handle );
        } else if( tokentype == Y_MENU_EX ) {
            error = ResWriteMenuExItemNormal( &(item->item.normal.menuData),
                         &(item->item.normal.menuExData), item->UseUnicode,
                         CurrResFile.handle );
        }
    }
    *err_code = LastWresErr();
    return( error );
}