示例#1
0
Bool WSetEditWindowMenuEntry( WMenuEditInfo *einfo, WMenuEntry *entry )
{
    Bool        ok;
    Bool        pop_sep;
    MenuFlags   flags;
    uint_16     id;
    char        *text;

    ok = (einfo != NULL && einfo->edit_dlg != NULL && entry != NULL);

    if( ok ) {
        if( entry->item->IsPopup ) {
            flags = entry->item->Item.Popup.ItemFlags;
            text = entry->item->Item.Popup.ItemText;
        } else {
            flags = entry->item->Item.Normal.ItemFlags;
            id = entry->item->Item.Normal.ItemID;
            text = entry->item->Item.Normal.ItemText;
        }
        ok = WSetEditWindowText( einfo->edit_dlg, flags, text );
    }

    if( ok ) {
        ok = WSetEditWindowFlags( einfo->edit_dlg, flags, FALSE );
    }

    if( ok ) {
        pop_sep = (entry->item->IsPopup || (flags & MENU_SEPARATOR));
        ok = WSetEditWindowID( einfo->edit_dlg, id, pop_sep, entry->symbol );
    }

    return( ok );
}
示例#2
0
Bool WResetEditWindowFlags( HWND dlg )
{
    Bool ok;

    ok = (dlg != (HWND)NULL);

    if( ok ) {
        ok = WSetEditWindowFlags( dlg, 0, TRUE );
    }

    return( ok );
}
示例#3
0
bool WSetEditWindowKeyEntry( WAccelEditInfo *einfo, WAccelEntry *entry )
{
    bool    ok;
    uint_16 key, flags, id;

    ok = (einfo != NULL && einfo->edit_dlg != NULL && entry != NULL);

    if( ok ) {
        if( entry->is32bit ) {
            key = entry->u.entry32.Ascii;
            flags = entry->u.entry32.Flags;
            id = entry->u.entry32.Id;
        } else {
            key = entry->u.entry.Ascii;
            flags = entry->u.entry.Flags;
            id = (uint_16)entry->u.entry.Id;
        }
        ok = WSetEditWindowKey( einfo->edit_dlg, key, flags );
        if( !ok ) {
            WSetStatusByID( einfo->wsb, -1, W_INVALIDACCEL );
            memcpy( entry, &DefaultEntry, sizeof( WAccelEntry ) );
            key = entry->u.entry.Ascii;
            flags = entry->u.entry.Flags;
            id = (uint_16)entry->u.entry.Id;
            ok = WSetEditWindowKey( einfo->edit_dlg, key, flags );
        }
    }

    if( ok ) {
        ok = WSetEditWindowID( einfo->edit_dlg, entry->symbol, id );
    }

    if( ok ) {
        ok = WSetEditWindowFlags( einfo->edit_dlg, flags );
    }

    return( ok );
}