2.6 UI code:

* Get rid of subrow/subcol variable names in the C UI code as well, use sub instead. This is shorter and sufficient. 
* Minor layout alignment fixes.
* Greying out in NLA editor was doing nothing for "strip_time" property.
This commit is contained in:
Thomas Dinges 2011-11-23 19:05:52 +00:00
parent 086b231f48
commit 808bd3ea25
6 changed files with 148 additions and 156 deletions

@ -569,7 +569,7 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
/* draw settings for stepped interpolation modifier */ /* draw settings for stepped interpolation modifier */
static void draw_modifier__stepped(uiLayout *layout, ID *id, FModifier *fcm, short UNUSED(width)) static void draw_modifier__stepped(uiLayout *layout, ID *id, FModifier *fcm, short UNUSED(width))
{ {
uiLayout *col, *subcol; uiLayout *col, *sub;
PointerRNA ptr; PointerRNA ptr;
/* init the RNA-pointer */ /* init the RNA-pointer */
@ -584,17 +584,17 @@ static void draw_modifier__stepped(uiLayout *layout, ID *id, FModifier *fcm, sho
col= uiLayoutColumn(layout, 1); col= uiLayoutColumn(layout, 1);
uiItemR(col, &ptr, "use_frame_start", 0, NULL, ICON_NONE); uiItemR(col, &ptr, "use_frame_start", 0, NULL, ICON_NONE);
subcol = uiLayoutColumn(col, 1); sub = uiLayoutColumn(col, 1);
uiLayoutSetActive(subcol, RNA_boolean_get(&ptr, "use_frame_start")); uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_frame_start"));
uiItemR(subcol, &ptr, "frame_start", 0, NULL, ICON_NONE); uiItemR(sub, &ptr, "frame_start", 0, NULL, ICON_NONE);
/* block 3: end range settings */ /* block 3: end range settings */
col= uiLayoutColumn(layout, 1); col= uiLayoutColumn(layout, 1);
uiItemR(col, &ptr, "use_frame_end", 0, NULL, ICON_NONE); uiItemR(col, &ptr, "use_frame_end", 0, NULL, ICON_NONE);
subcol = uiLayoutColumn(col, 1); sub = uiLayoutColumn(col, 1);
uiLayoutSetActive(subcol, RNA_boolean_get(&ptr, "use_frame_end")); uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_frame_end"));
uiItemR(subcol, &ptr, "frame_end", 0, NULL, ICON_NONE); uiItemR(sub, &ptr, "frame_end", 0, NULL, ICON_NONE);
} }
/* --------------- */ /* --------------- */
@ -602,7 +602,7 @@ static void draw_modifier__stepped(uiLayout *layout, ID *id, FModifier *fcm, sho
void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifiers, FModifier *fcm) void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifiers, FModifier *fcm)
{ {
FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm);
uiLayout *box, *row, *subrow, *col; uiLayout *box, *row, *sub, *col;
uiBlock *block; uiBlock *block;
uiBut *but; uiBut *but;
short width= 314; short width= 314;
@ -620,30 +620,30 @@ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifie
block= uiLayoutGetBlock(row); // err... block= uiLayoutGetBlock(row); // err...
/* left-align -------------------------------------------- */ /* left-align -------------------------------------------- */
subrow= uiLayoutRow(row, 1); sub= uiLayoutRow(row, 1);
uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_LEFT); uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT);
uiBlockSetEmboss(block, UI_EMBOSSN); uiBlockSetEmboss(block, UI_EMBOSSN);
/* expand */ /* expand */
uiItemR(subrow, &ptr, "show_expanded", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); uiItemR(sub, &ptr, "show_expanded", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
/* checkbox for 'active' status (for now) */ /* checkbox for 'active' status (for now) */
uiItemR(subrow, &ptr, "active", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); uiItemR(sub, &ptr, "active", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
/* name */ /* name */
if (fmi) if (fmi)
uiItemL(subrow, fmi->name, ICON_NONE); uiItemL(sub, fmi->name, ICON_NONE);
else else
uiItemL(subrow, "<Unknown Modifier>", ICON_NONE); uiItemL(sub, "<Unknown Modifier>", ICON_NONE);
/* right-align ------------------------------------------- */ /* right-align ------------------------------------------- */
subrow= uiLayoutRow(row, 1); sub= uiLayoutRow(row, 1);
uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT); uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_RIGHT);
/* 'mute' button */ /* 'mute' button */
uiItemR(subrow, &ptr, "mute", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); uiItemR(sub, &ptr, "mute", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
uiBlockSetEmboss(block, UI_EMBOSSN); uiBlockSetEmboss(block, UI_EMBOSSN);

@ -95,8 +95,8 @@ static void gp_ui_dellayer_cb (bContext *C, void *gpd, void *gpl)
static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, const short is_v3d) static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, const short is_v3d)
{ {
uiLayout *box=NULL, *split=NULL; uiLayout *box=NULL, *split=NULL;
uiLayout *col=NULL, *subcol=NULL; uiLayout *col=NULL;
uiLayout *row=NULL, *subrow=NULL; uiLayout *row=NULL, *sub=NULL;
uiBlock *block; uiBlock *block;
uiBut *but; uiBut *but;
PointerRNA ptr; PointerRNA ptr;
@ -120,17 +120,17 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
uiBlockSetEmboss(block, UI_EMBOSSN); uiBlockSetEmboss(block, UI_EMBOSSN);
/* left-align ............................... */ /* left-align ............................... */
subrow= uiLayoutRow(row, 0); sub= uiLayoutRow(row, 0);
/* active */ /* active */
block= uiLayoutGetBlock(subrow); block= uiLayoutGetBlock(sub);
icon= (gpl->flag & GP_LAYER_ACTIVE) ? ICON_RADIOBUT_ON : ICON_RADIOBUT_OFF; icon= (gpl->flag & GP_LAYER_ACTIVE) ? ICON_RADIOBUT_ON : ICON_RADIOBUT_OFF;
but= uiDefIconBut(block, BUT, 0, icon, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Set active layer"); but= uiDefIconBut(block, BUT, 0, icon, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Set active layer");
uiButSetFunc(but, gp_ui_activelayer_cb, gpd, gpl); uiButSetFunc(but, gp_ui_activelayer_cb, gpd, gpl);
/* locked */ /* locked */
icon= (gpl->flag & GP_LAYER_LOCKED) ? ICON_LOCKED : ICON_UNLOCKED; icon= (gpl->flag & GP_LAYER_LOCKED) ? ICON_LOCKED : ICON_UNLOCKED;
uiItemR(subrow, &ptr, "lock", 0, "", icon); uiItemR(sub, &ptr, "lock", 0, "", icon);
/* when layer is locked or hidden, only draw header */ /* when layer is locked or hidden, only draw header */
if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) { if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) {
@ -138,7 +138,7 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
/* visibility button (only if hidden but not locked!) */ /* visibility button (only if hidden but not locked!) */
if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED)) if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED))
uiItemR(subrow, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_ON); uiItemR(sub, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_ON);
/* name */ /* name */
@ -146,14 +146,14 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
sprintf(name, "%s (Hidden)", gpl->info); sprintf(name, "%s (Hidden)", gpl->info);
else else
sprintf(name, "%s (Locked)", gpl->info); sprintf(name, "%s (Locked)", gpl->info);
uiItemL(subrow, name, ICON_NONE); uiItemL(sub, name, ICON_NONE);
/* delete button (only if hidden but not locked!) */ /* delete button (only if hidden but not locked!) */
if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED)) { if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED)) {
/* right-align ............................... */ /* right-align ............................... */
subrow= uiLayoutRow(row, 1); sub= uiLayoutRow(row, 1);
uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT); uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_RIGHT);
block= uiLayoutGetBlock(subrow); // XXX... err... block= uiLayoutGetBlock(sub); // XXX... err...
but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer"); but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl); uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl);
@ -163,24 +163,24 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
else { else {
/* draw rest of header -------------------------------- */ /* draw rest of header -------------------------------- */
/* visibility button */ /* visibility button */
uiItemR(subrow, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_OFF); uiItemR(sub, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_OFF);
/* frame locking */ /* frame locking */
// TODO: this needs its own icons... // TODO: this needs its own icons...
icon= (gpl->flag & GP_LAYER_FRAMELOCK) ? ICON_RENDER_STILL : ICON_RENDER_ANIMATION; icon= (gpl->flag & GP_LAYER_FRAMELOCK) ? ICON_RENDER_STILL : ICON_RENDER_ANIMATION;
uiItemR(subrow, &ptr, "lock_frame", 0, "", icon); uiItemR(sub, &ptr, "lock_frame", 0, "", icon);
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);
/* name */ /* name */
uiItemR(subrow, &ptr, "info", 0, "", ICON_NONE); uiItemR(sub, &ptr, "info", 0, "", ICON_NONE);
/* delete 'button' */ /* delete 'button' */
uiBlockSetEmboss(block, UI_EMBOSSN); uiBlockSetEmboss(block, UI_EMBOSSN);
/* right-align ............................... */ /* right-align ............................... */
subrow= uiLayoutRow(row, 1); sub= uiLayoutRow(row, 1);
uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT); uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_RIGHT);
block= uiLayoutGetBlock(subrow); // XXX... err... block= uiLayoutGetBlock(sub); // XXX... err...
but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer"); but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl); uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl);
@ -196,32 +196,29 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
col= uiLayoutColumn(split, 0); col= uiLayoutColumn(split, 0);
/* color */ /* color */
subcol= uiLayoutColumn(col, 1); sub= uiLayoutColumn(col, 1);
uiItemR(subcol, &ptr, "color", 0, "", ICON_NONE); uiItemR(sub, &ptr, "color", 0, "", ICON_NONE);
uiItemR(subcol, &ptr, "alpha", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(sub, &ptr, "alpha", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
/* stroke thickness */ /* stroke thickness */
subcol= uiLayoutColumn(col, 1); uiItemR(col, &ptr, "line_width", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
uiItemR(subcol, &ptr, "line_width", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
/* debugging options */ /* debugging options */
if (G.f & G_DEBUG) { if (G.f & G_DEBUG) {
subcol= uiLayoutColumn(col, 1); uiItemR(col, &ptr, "show_points", 0, NULL, ICON_NONE);
uiItemR(subcol, &ptr, "show_points", 0, NULL, ICON_NONE);
} }
/* right column ................... */ /* right column ................... */
col= uiLayoutColumn(split, 0); col= uiLayoutColumn(split, 0);
/* onion-skinning */ /* onion-skinning */
subcol= uiLayoutColumn(col, 1); sub= uiLayoutColumn(col, 1);
uiItemR(subcol, &ptr, "use_onion_skinning", 0, "Onion Skinning", ICON_NONE); uiItemR(sub, &ptr, "use_onion_skinning", 0, "Onion Skinning", ICON_NONE);
uiItemR(subcol, &ptr, "ghost_range_max", 0, "Frames", ICON_NONE); // XXX shorter name here? i.e. GStep uiItemR(sub, &ptr, "ghost_range_max", 0, "Frames", ICON_NONE); // XXX shorter name here? i.e. GStep
/* 3d-view specific drawing options */ /* 3d-view specific drawing options */
if (is_v3d) { if (is_v3d) {
subcol= uiLayoutColumn(col, 0); uiItemR(col, &ptr, "show_x_ray", 0, "X-Ray", ICON_NONE);
uiItemR(subcol, &ptr, "show_x_ray", 0, "X-Ray", ICON_NONE);
} }
} }

@ -136,7 +136,7 @@ static void graph_panel_view(const bContext *C, Panel *pa)
SpaceIpo *sipo= CTX_wm_space_graph(C); SpaceIpo *sipo= CTX_wm_space_graph(C);
Scene *scene= CTX_data_scene(C); Scene *scene= CTX_data_scene(C);
PointerRNA spaceptr, sceneptr; PointerRNA spaceptr, sceneptr;
uiLayout *col, *subcol, *row; uiLayout *col, *sub, *row;
/* get RNA pointers for use when creating the UI elements */ /* get RNA pointers for use when creating the UI elements */
RNA_id_pointer_create(&scene->id, &sceneptr); RNA_id_pointer_create(&scene->id, &sceneptr);
@ -146,16 +146,16 @@ static void graph_panel_view(const bContext *C, Panel *pa)
col= uiLayoutColumn(pa->layout, 0); col= uiLayoutColumn(pa->layout, 0);
uiItemR(col, &spaceptr, "show_cursor", 0, NULL, ICON_NONE); uiItemR(col, &spaceptr, "show_cursor", 0, NULL, ICON_NONE);
subcol= uiLayoutColumn(col, 1); sub= uiLayoutColumn(col, 1);
uiLayoutSetActive(subcol, RNA_boolean_get(&spaceptr, "show_cursor")); uiLayoutSetActive(sub, RNA_boolean_get(&spaceptr, "show_cursor"));
uiItemO(subcol, "Cursor from Selection", ICON_NONE, "GRAPH_OT_frame_jump"); uiItemO(sub, "Cursor from Selection", ICON_NONE, "GRAPH_OT_frame_jump");
subcol= uiLayoutColumn(col, 1); sub= uiLayoutColumn(col, 1);
uiLayoutSetActive(subcol, RNA_boolean_get(&spaceptr, "show_cursor")); uiLayoutSetActive(sub, RNA_boolean_get(&spaceptr, "show_cursor"));
row= uiLayoutSplit(subcol, 0.7, 1); row= uiLayoutSplit(sub, 0.7, 1);
uiItemR(row, &sceneptr, "frame_current", 0, "Cursor X", ICON_NONE); uiItemR(row, &sceneptr, "frame_current", 0, "Cursor X", ICON_NONE);
uiItemEnumO(row, "GRAPH_OT_snap", "To Keys", 0, "type", GRAPHKEYS_SNAP_CFRA); uiItemEnumO(row, "GRAPH_OT_snap", "To Keys", 0, "type", GRAPHKEYS_SNAP_CFRA);
row= uiLayoutSplit(subcol, 0.7, 1); row= uiLayoutSplit(sub, 0.7, 1);
uiItemR(row, &spaceptr, "cursor_position_y", 0, "Cursor Y", ICON_NONE); uiItemR(row, &spaceptr, "cursor_position_y", 0, "Cursor Y", ICON_NONE);
uiItemEnumO(row, "GRAPH_OT_snap", "To Keys", 0, "type", GRAPHKEYS_SNAP_VALUE); uiItemEnumO(row, "GRAPH_OT_snap", "To Keys", 0, "type", GRAPHKEYS_SNAP_VALUE);
} }
@ -168,7 +168,7 @@ static void graph_panel_properties(const bContext *C, Panel *pa)
FCurve *fcu; FCurve *fcu;
PointerRNA fcu_ptr; PointerRNA fcu_ptr;
uiLayout *layout = pa->layout; uiLayout *layout = pa->layout;
uiLayout *col, *row, *subrow; uiLayout *col, *row, *sub;
uiBlock *block; uiBlock *block;
char name[256]; char name[256];
int icon = 0; int icon = 0;
@ -201,9 +201,9 @@ static void graph_panel_properties(const bContext *C, Panel *pa)
row= uiLayoutRow(col, 1); row= uiLayoutRow(col, 1);
uiItemR(row, &fcu_ptr, "color_mode", 0, "", ICON_NONE); uiItemR(row, &fcu_ptr, "color_mode", 0, "", ICON_NONE);
subrow= uiLayoutRow(row, 1); sub= uiLayoutRow(row, 1);
uiLayoutSetEnabled(subrow, (fcu->color_mode==FCURVE_COLOR_CUSTOM)); uiLayoutSetEnabled(sub, (fcu->color_mode==FCURVE_COLOR_CUSTOM));
uiItemR(subrow, &fcu_ptr, "color", 0, "", ICON_NONE); uiItemR(sub, &fcu_ptr, "color", 0, "", ICON_NONE);
MEM_freeN(ale); MEM_freeN(ale);
} }
@ -562,7 +562,7 @@ static void graph_panel_driverVar__transChan(uiLayout *layout, ID *id, DriverVar
DriverTarget *dtar= &dvar->targets[0]; DriverTarget *dtar= &dvar->targets[0];
Object *ob = (Object *)dtar->id; Object *ob = (Object *)dtar->id;
PointerRNA dtar_ptr; PointerRNA dtar_ptr;
uiLayout *col, *subcol; uiLayout *col, *sub;
/* initialise RNA pointer to the target */ /* initialise RNA pointer to the target */
RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr); RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr);
@ -578,9 +578,9 @@ static void graph_panel_driverVar__transChan(uiLayout *layout, ID *id, DriverVar
uiItemPointerR(col, &dtar_ptr, "bone_target", &tar_ptr, "bones", "", ICON_BONE_DATA); uiItemPointerR(col, &dtar_ptr, "bone_target", &tar_ptr, "bones", "", ICON_BONE_DATA);
} }
subcol= uiLayoutColumn(layout, 1); sub= uiLayoutColumn(layout, 1);
uiItemR(subcol, &dtar_ptr, "transform_type", 0, NULL, ICON_NONE); uiItemR(sub, &dtar_ptr, "transform_type", 0, NULL, ICON_NONE);
uiItemR(subcol, &dtar_ptr, "transform_space", 0, "Space", ICON_NONE); uiItemR(sub, &dtar_ptr, "transform_space", 0, "Space", ICON_NONE);
} }
/* driver settings for active F-Curve (only for 'Drivers' mode) */ /* driver settings for active F-Curve (only for 'Drivers' mode) */

@ -791,16 +791,15 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr)
/* some settings depend on this being a scene thats rendered */ /* some settings depend on this being a scene thats rendered */
const short is_render_out= (id && GS(id->name) == ID_SCE); const short is_render_out= (id && GS(id->name) == ID_SCE);
uiLayout *col, *row, *colsub, *rowsub; uiLayout *col, *row, *split, *sub;
col= uiLayoutColumn(layout, 0); col= uiLayoutColumn(layout, 0);
row= uiLayoutSplit(col, 0.5f, 0); split= uiLayoutSplit(col, 0.5f, 0);
colsub= uiLayoutColumn(row, 0);
uiItemR(colsub, imfptr, "file_format", 0, "", ICON_NONE); uiItemR(split, imfptr, "file_format", 0, "", ICON_NONE);
colsub= uiLayoutColumn(row, 0); sub= uiLayoutRow(split, 0);
rowsub= uiLayoutRow(colsub, 0); uiItemR(sub, imfptr, "color_mode", UI_ITEM_R_EXPAND, "Color", ICON_NONE);
uiItemR(rowsub, imfptr, "color_mode", UI_ITEM_R_EXPAND, "Color", ICON_NONE);
/* only display depth setting if multiple depths can be used */ /* only display depth setting if multiple depths can be used */
if((ELEM6(depth_ok, if((ELEM6(depth_ok,

@ -3222,7 +3222,7 @@ static int is_sensor_linked(uiBlock *block, bSensor *sens)
static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *logic_ptr) static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *logic_ptr)
{ {
uiLayout *box, *row, *subrow; uiLayout *box, *row, *sub;
bSensor *sens= (bSensor *)ptr->data; bSensor *sens= (bSensor *)ptr->data;
box= uiLayoutBox(layout); box= uiLayoutBox(layout);
@ -3237,15 +3237,15 @@ static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *lo
uiItemL(row, sens->name, ICON_NONE); uiItemL(row, sens->name, ICON_NONE);
} }
subrow= uiLayoutRow(row, 0); sub= uiLayoutRow(row, 0);
uiLayoutSetActive(subrow, ((RNA_boolean_get(logic_ptr, "show_sensors_active_states") uiLayoutSetActive(sub, ((RNA_boolean_get(logic_ptr, "show_sensors_active_states")
&& RNA_boolean_get(ptr, "show_expanded")) || RNA_boolean_get(ptr, "pin"))); && RNA_boolean_get(ptr, "show_expanded")) || RNA_boolean_get(ptr, "pin")));
uiItemR(subrow, ptr, "pin", UI_ITEM_R_NO_BG, "", ICON_NONE); uiItemR(sub, ptr, "pin", UI_ITEM_R_NO_BG, "", ICON_NONE);
if(RNA_boolean_get(ptr, "show_expanded")==0) { if(RNA_boolean_get(ptr, "show_expanded")==0) {
subrow= uiLayoutRow(row, 1); sub= uiLayoutRow(row, 1);
uiItemEnumO(subrow, "LOGIC_OT_sensor_move", "", ICON_TRIA_UP, "direction", 1); // up uiItemEnumO(sub, "LOGIC_OT_sensor_move", "", ICON_TRIA_UP, "direction", 1); // up
uiItemEnumO(subrow, "LOGIC_OT_sensor_move", "", ICON_TRIA_DOWN, "direction", 2); // down uiItemEnumO(sub, "LOGIC_OT_sensor_move", "", ICON_TRIA_DOWN, "direction", 2); // down
} }
uiItemO(row, "", ICON_X, "LOGIC_OT_sensor_remove"); uiItemO(row, "", ICON_X, "LOGIC_OT_sensor_remove");
@ -3253,7 +3253,7 @@ static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *lo
static void draw_sensor_internal_header(uiLayout *layout, PointerRNA *ptr) static void draw_sensor_internal_header(uiLayout *layout, PointerRNA *ptr)
{ {
uiLayout *box, *split, *subrow, *row; uiLayout *box, *split, *sub, *row;
box= uiLayoutBox(layout); box= uiLayoutBox(layout);
split = uiLayoutSplit(box, 0.45, 0); split = uiLayoutSplit(box, 0.45, 0);
@ -3262,17 +3262,16 @@ static void draw_sensor_internal_header(uiLayout *layout, PointerRNA *ptr)
uiItemR(row, ptr, "use_pulse_true_level", 0, "", ICON_DOTSUP); uiItemR(row, ptr, "use_pulse_true_level", 0, "", ICON_DOTSUP);
uiItemR(row, ptr, "use_pulse_false_level", 0, "", ICON_DOTSDOWN); uiItemR(row, ptr, "use_pulse_false_level", 0, "", ICON_DOTSDOWN);
subrow=uiLayoutRow(row, 0); sub=uiLayoutRow(row, 0);
uiLayoutSetActive(subrow, (RNA_boolean_get(ptr, "use_pulse_true_level") uiLayoutSetActive(sub, (RNA_boolean_get(ptr, "use_pulse_true_level")
|| RNA_boolean_get(ptr, "use_pulse_false_level"))); || RNA_boolean_get(ptr, "use_pulse_false_level")));
uiItemR(subrow, ptr, "frequency", 0, "Freq", ICON_NONE); uiItemR(sub, ptr, "frequency", 0, "Freq", ICON_NONE);
row= uiLayoutRow(split, 1); row= uiLayoutRow(split, 1);
uiItemR(row, ptr, "use_level", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); uiItemR(row, ptr, "use_level", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
uiItemR(row, ptr, "use_tap", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); uiItemR(row, ptr, "use_tap", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
row= uiLayoutRow(split, 1); uiItemR(split, ptr, "invert", UI_ITEM_R_TOGGLE, "Invert", ICON_NONE);
uiItemR(row, ptr, "invert", UI_ITEM_R_TOGGLE, "Invert", ICON_NONE);
} }
/* sensors in alphabetical order */ /* sensors in alphabetical order */
@ -3577,7 +3576,7 @@ static void draw_brick_sensor(uiLayout *layout, PointerRNA *ptr, bContext *C)
/* Controller code */ /* Controller code */
static void draw_controller_header(uiLayout *layout, PointerRNA *ptr, int xco, int width, int yco) static void draw_controller_header(uiLayout *layout, PointerRNA *ptr, int xco, int width, int yco)
{ {
uiLayout *box, *row, *subrow; uiLayout *box, *row, *sub;
bController *cont= (bController *)ptr->data; bController *cont= (bController *)ptr->data;
char state[3]; char state[3];
@ -3601,9 +3600,9 @@ static void draw_controller_header(uiLayout *layout, PointerRNA *ptr, int xco, i
uiItemR(row, ptr, "use_priority", 0, "", ICON_NONE); uiItemR(row, ptr, "use_priority", 0, "", ICON_NONE);
if(RNA_boolean_get(ptr, "show_expanded")==0) { if(RNA_boolean_get(ptr, "show_expanded")==0) {
subrow= uiLayoutRow(row, 1); sub= uiLayoutRow(row, 1);
uiItemEnumO(subrow, "LOGIC_OT_controller_move", "", ICON_TRIA_UP, "direction", 1); // up uiItemEnumO(sub, "LOGIC_OT_controller_move", "", ICON_TRIA_UP, "direction", 1); // up
uiItemEnumO(subrow, "LOGIC_OT_controller_move", "", ICON_TRIA_DOWN, "direction", 2); // down uiItemEnumO(sub, "LOGIC_OT_controller_move", "", ICON_TRIA_DOWN, "direction", 2); // down
} }
uiItemO(row, "", ICON_X, "LOGIC_OT_controller_remove"); uiItemO(row, "", ICON_X, "LOGIC_OT_controller_remove");
} }
@ -3615,7 +3614,7 @@ static void draw_controller_expression(uiLayout *layout, PointerRNA *ptr)
static void draw_controller_python(uiLayout *layout, PointerRNA *ptr) static void draw_controller_python(uiLayout *layout, PointerRNA *ptr)
{ {
uiLayout *split, *subsplit; uiLayout *split, *sub;
split = uiLayoutSplit(layout, 0.3, 1); split = uiLayoutSplit(layout, 0.3, 1);
uiItemR(split, ptr, "mode", 0, "", ICON_NONE); uiItemR(split, ptr, "mode", 0, "", ICON_NONE);
@ -3623,9 +3622,9 @@ static void draw_controller_python(uiLayout *layout, PointerRNA *ptr)
uiItemR(split, ptr, "text", 0, "", ICON_NONE); uiItemR(split, ptr, "text", 0, "", ICON_NONE);
} }
else { else {
subsplit = uiLayoutSplit(split, 0.8, 0); sub = uiLayoutSplit(split, 0.8, 0);
uiItemR(subsplit, ptr, "module", 0, "", ICON_NONE); uiItemR(sub, ptr, "module", 0, "", ICON_NONE);
uiItemR(subsplit, ptr, "use_debug", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); uiItemR(sub, ptr, "use_debug", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
} }
} }
@ -3670,7 +3669,7 @@ static void draw_brick_controller(uiLayout *layout, PointerRNA *ptr)
/* Actuator code */ /* Actuator code */
static void draw_actuator_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *logic_ptr) static void draw_actuator_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *logic_ptr)
{ {
uiLayout *box, *row, *subrow; uiLayout *box, *row, *sub;
bActuator *act= (bActuator *)ptr->data; bActuator *act= (bActuator *)ptr->data;
box= uiLayoutBox(layout); box= uiLayoutBox(layout);
@ -3685,15 +3684,15 @@ static void draw_actuator_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *
uiItemL(row, act->name, ICON_NONE); uiItemL(row, act->name, ICON_NONE);
} }
subrow= uiLayoutRow(row, 0); sub= uiLayoutRow(row, 0);
uiLayoutSetActive(subrow, ((RNA_boolean_get(logic_ptr, "show_actuators_active_states") uiLayoutSetActive(sub, ((RNA_boolean_get(logic_ptr, "show_actuators_active_states")
&& RNA_boolean_get(ptr, "show_expanded")) || RNA_boolean_get(ptr, "pin"))); && RNA_boolean_get(ptr, "show_expanded")) || RNA_boolean_get(ptr, "pin")));
uiItemR(subrow, ptr, "pin", UI_ITEM_R_NO_BG, "", ICON_NONE); uiItemR(sub, ptr, "pin", UI_ITEM_R_NO_BG, "", ICON_NONE);
if(RNA_boolean_get(ptr, "show_expanded")==0) { if(RNA_boolean_get(ptr, "show_expanded")==0) {
subrow= uiLayoutRow(row, 1); sub= uiLayoutRow(row, 1);
uiItemEnumO(subrow, "LOGIC_OT_actuator_move", "", ICON_TRIA_UP, "direction", 1); // up uiItemEnumO(sub, "LOGIC_OT_actuator_move", "", ICON_TRIA_UP, "direction", 1); // up
uiItemEnumO(subrow, "LOGIC_OT_actuator_move", "", ICON_TRIA_DOWN, "direction", 2); // down uiItemEnumO(sub, "LOGIC_OT_actuator_move", "", ICON_TRIA_DOWN, "direction", 2); // down
} }
uiItemO(row, "", ICON_X, "LOGIC_OT_actuator_remove"); uiItemO(row, "", ICON_X, "LOGIC_OT_actuator_remove");
} }
@ -3702,20 +3701,20 @@ static void draw_actuator_action(uiLayout *layout, PointerRNA *ptr)
{ {
Object *ob = (Object *)ptr->id.data; Object *ob = (Object *)ptr->id.data;
PointerRNA settings_ptr; PointerRNA settings_ptr;
uiLayout *row, *subrow, *col; uiLayout *row, *sub, *col;
RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr); RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
row= uiLayoutRow(layout, 0); row= uiLayoutRow(layout, 0);
uiItemR(row, ptr, "play_mode", 0, "", ICON_NONE); uiItemR(row, ptr, "play_mode", 0, "", ICON_NONE);
subrow= uiLayoutRow(row, 1); sub= uiLayoutRow(row, 1);
uiItemR(subrow, ptr, "use_force", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); uiItemR(sub, ptr, "use_force", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
uiItemR(subrow, ptr, "use_additive", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); uiItemR(sub, ptr, "use_additive", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
col = uiLayoutColumn(subrow, 0); row = uiLayoutColumn(sub, 0);
uiLayoutSetActive(col, (RNA_boolean_get(ptr, "use_additive") || RNA_boolean_get(ptr, "use_force"))); uiLayoutSetActive(row, (RNA_boolean_get(ptr, "use_additive") || RNA_boolean_get(ptr, "use_force")));
uiItemR(col, ptr, "use_local", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); uiItemR(row, ptr, "use_local", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
row= uiLayoutRow(layout, 0); row= uiLayoutRow(layout, 0);
uiItemR(row, ptr, "action", 0, "", ICON_NONE); uiItemR(row, ptr, "action", 0, "", ICON_NONE);
@ -3740,11 +3739,10 @@ static void draw_actuator_action(uiLayout *layout, PointerRNA *ptr)
uiItemR(row, ptr, "layer", 0, NULL, ICON_NONE); uiItemR(row, ptr, "layer", 0, NULL, ICON_NONE);
uiItemR(row, ptr, "layer_weight", 0, NULL, ICON_NONE); uiItemR(row, ptr, "layer_weight", 0, NULL, ICON_NONE);
row= uiLayoutRow(layout, 0);
uiItemPointerR(layout, ptr, "frame_property", &settings_ptr, "properties", NULL, ICON_NONE); uiItemPointerR(layout, ptr, "frame_property", &settings_ptr, "properties", NULL, ICON_NONE);
#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
uiItemR(row, "stride_length", 0, NULL, ICON_NONE); uiItemR(layout, "stride_length", 0, NULL, ICON_NONE);
#endif #endif
} }
@ -3829,7 +3827,7 @@ static void draw_actuator_camera(uiLayout *layout, PointerRNA *ptr)
static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext *C) static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext *C)
{ {
uiLayout *row, *col, *subcol, *split; uiLayout *row, *col, *sub, *split;
PointerRNA main_ptr; PointerRNA main_ptr;
RNA_main_pointer_create(CTX_data_main(C), &main_ptr); RNA_main_pointer_create(CTX_data_main(C), &main_ptr);
@ -3855,15 +3853,15 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext
uiItemR(row, ptr, "use_normal", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); uiItemR(row, ptr, "use_normal", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
row = uiLayoutRow(layout, 0); row = uiLayoutRow(layout, 0);
col = uiLayoutColumn(row, 0); col = uiLayoutColumn(row, 1);
uiItemL(col, "Range:", ICON_NONE); uiItemL(col, "Range:", ICON_NONE);
uiItemR(col, ptr, "range", 0, "", ICON_NONE); uiItemR(col, ptr, "range", 0, "", ICON_NONE);
col = uiLayoutColumn(row, 1); col = uiLayoutColumn(row, 1);
uiItemR(col, ptr, "use_force_distance", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); uiItemR(col, ptr, "use_force_distance", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
subcol = uiLayoutColumn(col, 0); sub = uiLayoutColumn(col, 0);
uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "use_force_distance")==1); uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_force_distance")==1);
uiItemR(subcol, ptr, "distance", 0, "", ICON_NONE); uiItemR(sub, ptr, "distance", 0, "", ICON_NONE);
uiItemR(layout, ptr, "damping", UI_ITEM_R_SLIDER , NULL, ICON_NONE); uiItemR(layout, ptr, "damping", UI_ITEM_R_SLIDER , NULL, ICON_NONE);
@ -3931,7 +3929,7 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext
static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr) static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr)
{ {
Object *ob = (Object *)ptr->id.data; Object *ob = (Object *)ptr->id.data;
uiLayout *row, *split, *subsplit; uiLayout *row, *split, *sub;
uiItemR(layout, ptr, "mode", 0, NULL, ICON_NONE); uiItemR(layout, ptr, "mode", 0, NULL, ICON_NONE);
switch (RNA_enum_get(ptr, "mode")) switch (RNA_enum_get(ptr, "mode"))
@ -3967,9 +3965,9 @@ static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr)
case ACT_EDOB_TRACK_TO: case ACT_EDOB_TRACK_TO:
split = uiLayoutSplit(layout, 0.5, 0); split = uiLayoutSplit(layout, 0.5, 0);
uiItemR(split, ptr, "track_object", 0, NULL, ICON_NONE); uiItemR(split, ptr, "track_object", 0, NULL, ICON_NONE);
subsplit = uiLayoutSplit(split, 0.7, 0); sub = uiLayoutSplit(split, 0.7, 0);
uiItemR(subsplit, ptr, "time", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "time", 0, NULL, ICON_NONE);
uiItemR(subsplit, ptr, "use_3d_tracking", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); uiItemR(sub, ptr, "use_3d_tracking", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
break; break;
case ACT_EDOB_DYNAMICS: case ACT_EDOB_DYNAMICS:
if(ob->type != OB_MESH) { if(ob->type != OB_MESH) {
@ -4041,7 +4039,7 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
{ {
Object *ob; Object *ob;
PointerRNA settings_ptr; PointerRNA settings_ptr;
uiLayout *split, *row, *col, *subcol; uiLayout *split, *row, *col, *sub;
int physics_type; int physics_type;
ob = (Object *)ptr->id.data; ob = (Object *)ptr->id.data;
@ -4100,24 +4098,24 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
row = uiLayoutRow(layout, 0); row = uiLayoutRow(layout, 0);
col = uiLayoutColumn(row, 0); col = uiLayoutColumn(row, 0);
uiItemR(col, ptr, "use_servo_limit_x", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); uiItemR(col, ptr, "use_servo_limit_x", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
subcol = uiLayoutColumn(col, 1); sub = uiLayoutColumn(col, 1);
uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "use_servo_limit_x")==1); uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_x")==1);
uiItemR(subcol, ptr, "force_max_x", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "force_max_x", 0, NULL, ICON_NONE);
uiItemR(subcol, ptr, "force_min_x", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "force_min_x", 0, NULL, ICON_NONE);
col = uiLayoutColumn(row, 0); col = uiLayoutColumn(row, 0);
uiItemR(col, ptr, "use_servo_limit_y", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); uiItemR(col, ptr, "use_servo_limit_y", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
subcol = uiLayoutColumn(col, 1); sub = uiLayoutColumn(col, 1);
uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "use_servo_limit_y")==1); uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_y")==1);
uiItemR(subcol, ptr, "force_max_y", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "force_max_y", 0, NULL, ICON_NONE);
uiItemR(subcol, ptr, "force_min_y", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "force_min_y", 0, NULL, ICON_NONE);
col = uiLayoutColumn(row, 0); col = uiLayoutColumn(row, 0);
uiItemR(col, ptr, "use_servo_limit_z", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); uiItemR(col, ptr, "use_servo_limit_z", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
subcol = uiLayoutColumn(col, 1); sub = uiLayoutColumn(col, 1);
uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "use_servo_limit_z")==1); uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_z")==1);
uiItemR(subcol, ptr, "force_max_z", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "force_max_z", 0, NULL, ICON_NONE);
uiItemR(subcol, ptr, "force_min_z", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "force_min_z", 0, NULL, ICON_NONE);
//XXXACTUATOR missing labels from original 2.49 ui (e.g. Servo, Min, Max, Fast) //XXXACTUATOR missing labels from original 2.49 ui (e.g. Servo, Min, Max, Fast)
//Layout designers willing to help on that, please compare with 2.49 ui //Layout designers willing to help on that, please compare with 2.49 ui
@ -4133,7 +4131,7 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
static void draw_actuator_parent(uiLayout *layout, PointerRNA *ptr) static void draw_actuator_parent(uiLayout *layout, PointerRNA *ptr)
{ {
uiLayout *row, *subrow; uiLayout *row, *sub;
uiItemR(layout, ptr, "mode", 0, NULL, ICON_NONE); uiItemR(layout, ptr, "mode", 0, NULL, ICON_NONE);
@ -4142,9 +4140,9 @@ static void draw_actuator_parent(uiLayout *layout, PointerRNA *ptr)
row = uiLayoutRow(layout, 0); row = uiLayoutRow(layout, 0);
uiItemR(row, ptr, "use_compound", 0, NULL, ICON_NONE); uiItemR(row, ptr, "use_compound", 0, NULL, ICON_NONE);
subrow= uiLayoutRow(row, 0); sub= uiLayoutRow(row, 0);
uiLayoutSetActive(subrow, RNA_boolean_get(ptr, "use_compound")==1); uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_compound")==1);
uiItemR(subrow, ptr, "use_ghost", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "use_ghost", 0, NULL, ICON_NONE);
} }
} }
@ -4156,7 +4154,7 @@ static void draw_actuator_property(uiLayout *layout, PointerRNA *ptr)
Object *ob_from= pa->ob; Object *ob_from= pa->ob;
PointerRNA settings_ptr, obj_settings_ptr; PointerRNA settings_ptr, obj_settings_ptr;
uiLayout *row, *subrow; uiLayout *row, *sub;
RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr); RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
@ -4181,9 +4179,9 @@ static void draw_actuator_property(uiLayout *layout, PointerRNA *ptr)
uiItemPointerR(row, ptr, "object_property", &obj_settings_ptr, "properties", NULL, ICON_NONE); uiItemPointerR(row, ptr, "object_property", &obj_settings_ptr, "properties", NULL, ICON_NONE);
}else }else
{ {
subrow= uiLayoutRow(row, 0); sub= uiLayoutRow(row, 0);
uiLayoutSetActive(subrow, 0); uiLayoutSetActive(sub, 0);
uiItemR(subrow, ptr, "object_property", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "object_property", 0, NULL, ICON_NONE);
} }
break; break;
} }

@ -294,7 +294,7 @@ static void nla_panel_properties(const bContext *C, Panel *pa)
{ {
PointerRNA strip_ptr; PointerRNA strip_ptr;
uiLayout *layout= pa->layout; uiLayout *layout= pa->layout;
uiLayout *column, *row, *subcol; uiLayout *column, *row, *sub;
uiBlock *block; uiBlock *block;
short showEvalProps = 1; short showEvalProps = 1;
@ -339,10 +339,10 @@ static void nla_panel_properties(const bContext *C, Panel *pa)
uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_influence")==0); uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_influence")==0);
uiItemR(column, &strip_ptr, "use_auto_blend", 0, NULL, ICON_NONE); // XXX as toggle? uiItemR(column, &strip_ptr, "use_auto_blend", 0, NULL, ICON_NONE); // XXX as toggle?
subcol= uiLayoutColumn(column, 1); sub= uiLayoutColumn(column, 1);
uiLayoutSetActive(subcol, RNA_boolean_get(&strip_ptr, "use_auto_blend")==0); uiLayoutSetActive(sub, RNA_boolean_get(&strip_ptr, "use_auto_blend")==0);
uiItemR(subcol, &strip_ptr, "blend_in", 0, NULL, ICON_NONE); uiItemR(sub, &strip_ptr, "blend_in", 0, NULL, ICON_NONE);
uiItemR(subcol, &strip_ptr, "blend_out", 0, NULL, ICON_NONE); uiItemR(sub, &strip_ptr, "blend_out", 0, NULL, ICON_NONE);
/* settings */ /* settings */
column= uiLayoutColumn(layout, 1); column= uiLayoutColumn(layout, 1);
@ -395,7 +395,7 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa)
{ {
PointerRNA strip_ptr; PointerRNA strip_ptr;
uiLayout *layout= pa->layout; uiLayout *layout= pa->layout;
uiLayout *column, *subcolumn, *subrow; uiLayout *col, *sub;
uiBlock *block; uiBlock *block;
/* check context and also validity of pointer */ /* check context and also validity of pointer */
@ -405,23 +405,21 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa)
block= uiLayoutGetBlock(layout); block= uiLayoutGetBlock(layout);
uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
column= uiLayoutColumn(layout, 1); col= uiLayoutColumn(layout, 1);
uiItemR(column, &strip_ptr, "use_animated_influence", 0, NULL, ICON_NONE); uiItemR(col, &strip_ptr, "use_animated_influence", 0, NULL, ICON_NONE);
subcolumn= uiLayoutColumn(column, 1);
uiLayoutSetEnabled(subcolumn, RNA_boolean_get(&strip_ptr, "use_animated_influence"));
uiItemR(subcolumn, &strip_ptr, "influence", 0, NULL, ICON_NONE);
column= uiLayoutColumn(layout, 1); sub= uiLayoutColumn(col, 1);
subrow= uiLayoutRow(column, 0); uiLayoutSetEnabled(sub, RNA_boolean_get(&strip_ptr, "use_animated_influence"));
uiItemR(subrow, &strip_ptr, "use_animated_time", 0, NULL, ICON_NONE); uiItemR(sub, &strip_ptr, "influence", 0, NULL, ICON_NONE);
uiItemR(subrow, &strip_ptr, "use_animated_time_cyclic", 0, NULL, ICON_NONE);
subcolumn= uiLayoutColumn(column, 1); col= uiLayoutColumn(layout, 1);
subrow= uiLayoutRow(subcolumn, 0); sub= uiLayoutRow(col, 0);
uiLayoutSetEnabled(subrow, RNA_boolean_get(&strip_ptr, "use_animated_time")); uiItemR(sub, &strip_ptr, "use_animated_time", 0, NULL, ICON_NONE);
uiItemR(subcolumn, &strip_ptr, "strip_time", 0, NULL, ICON_NONE); uiItemR(sub, &strip_ptr, "use_animated_time_cyclic", 0, NULL, ICON_NONE);
sub= uiLayoutRow(col, 0);
uiLayoutSetEnabled(sub, RNA_boolean_get(&strip_ptr, "use_animated_time"));
uiItemR(sub, &strip_ptr, "strip_time", 0, NULL, ICON_NONE);
} }
/* F-Modifiers for active NLA-Strip */ /* F-Modifiers for active NLA-Strip */