From bc0ca65db8a9e2b1b62c355cf12ca4ffd9877eb9 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 1 Mar 2005 13:14:37 +0000 Subject: [PATCH] Bug fix #2248 Pressing AKEY in channel buttons (names) of IpoWindow did not show all or hide all anymore. Was due to commit last july, which enabled unlimited amount of channels. --- source/blender/makesdna/DNA_ipo_types.h | 2 -- source/blender/src/drawipo.c | 5 +++-- source/blender/src/editipo.c | 23 +++++++++-------------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h index 206c531d77f..5dccadb00ab 100644 --- a/source/blender/makesdna/DNA_ipo_types.h +++ b/source/blender/makesdna/DNA_ipo_types.h @@ -364,7 +364,5 @@ typedef short IPO_Channel; #define IPO_EDIT 4 #define IPO_LOCK 8 -#define IPO_IS_SELECTED 6 /* note, this is number of bit! */ - #endif diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c index 8c5b9291236..cadd6ed20b1 100644 --- a/source/blender/src/drawipo.c +++ b/source/blender/src/drawipo.c @@ -823,11 +823,12 @@ static void draw_ipobuts(SpaceIpo *sipo) ei= sipo->editipo; y= area->winy-30+sipo->butofs; for(a=0; atotipo; a++, ei++, y-=IPOBUTY) { - - but= uiDefButS(block, TOG|BIT|6, a+1, ei->name, v2d->mask.xmax+18, y, IPOBUTX-15, IPOBUTY-1, &(ei->flag), 0, 0, 0, 0, ""); + // this button defines visiblity, bit zero of flag (IPO_VISIBLE) + but= uiDefButS(block, TOG|BIT|0, a+1, ei->name, v2d->mask.xmax+18, y, IPOBUTX-15, IPOBUTY-1, &(ei->flag), 0, 0, 0, 0, ""); // no hilite, its not visible, but most of all the winmatrix is not correct later on... uiButSetFlag(but, UI_TEXT_LEFT|UI_NO_HILITE); + // this fake button defines selection of curves if(ei->icu) { cpack(ei->col); diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c index 8bffeda1b0c..6aac31360f2 100644 --- a/source/blender/src/editipo.c +++ b/source/blender/src/editipo.c @@ -1164,7 +1164,7 @@ void make_editipo() ei= G.sipo->editipo; for(a=0; atotipo; a++, ei++) { - if(ei->flag & IPO_VISIBLE) ei->flag |= (1<flag & IPO_VISIBLE) ei->flag |= IPO_SELECT; if(ei->icu) ei->icu->flag= ei->flag; } @@ -1311,24 +1311,16 @@ void get_status_editipo() } } - - void update_editipo_flags() { EditIpo *ei; IpoKey *ik; - short flag;/*unsigned int flag;*/ int a; ei= G.sipo->editipo; if(ei) { for(a=0; atotipo; a++, ei++) { - ei->flag &= ~IPO_VISIBLE; - flag= (1<flag & flag ) ei->flag |= IPO_VISIBLE; - if(ei->icu) ei->icu->flag= ei->flag; - } } if(G.sipo->showkey) { @@ -1491,7 +1483,7 @@ void swap_visible_editipo() if(totipo_vis==0) { if(ei->icu) { ei->flag |= IPO_VISIBLE; - ei->flag |= (1<flag |= IPO_SELECT; } } else ei->flag &= ~IPO_VISIBLE; @@ -1685,16 +1677,19 @@ void move_to_frame() /* *********************************** */ +/* handling of right-hand channel/curve buttons in ipo window */ void do_ipowin_buts(short event) { EditIpo *ei = 0; int a; + + /* without shift, all other channels are made invisible */ if((G.qual & LR_SHIFTKEY)==0) { if(event>G.sipo->totipo) return; ei = G.sipo->editipo; for(a=0; atotipo; a++) { - if(a==event) ei->flag |= (1<flag &= ~(1<flag &= ~IPO_VISIBLE; + else ei->flag |= IPO_VISIBLE; ei++; } } @@ -1709,6 +1704,7 @@ void do_ipowin_buts(short event) } +/* the fake buttons to the left of channel names, for select/deselect curves */ void do_ipo_selectbuttons() { EditIpo *ei, *ei1; @@ -1733,8 +1729,7 @@ void do_ipo_selectbuttons() if(ei->icu) { if((ei->flag & IPO_VISIBLE)==0) { - ei->flag |= IPO_VISIBLE; - ei->flag |= (1<flag |= IPO_VISIBLE|IPO_SELECT; } if((G.qual & LR_SHIFTKEY)==0) {