From 5587e9bd09d7e23526775cd01b8e7bb75578e7d1 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 3 Jun 2009 23:33:56 +0000 Subject: UI: * First step for buttons context browsing, read-only still. * Drawn in a panel now, though this should become a separate region. * Path of the context is constructed as an array of RNA pointers and then used for drawing and context lookups from python. --- source/blender/editors/space_buttons/space_buttons.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_buttons/space_buttons.c') diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 838316fd4af..57ca7cc23d8 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -122,9 +122,10 @@ static void buttons_free(SpaceLink *sl) if (sbuts->ri->rect) MEM_freeN(sbuts->ri->rect); MEM_freeN(sbuts->ri); } - -} + if(sbuts->path) + MEM_freeN(sbuts->path); +} /* spacetype; init callback */ static void buttons_init(struct wmWindowManager *wm, ScrArea *sa) @@ -146,6 +147,7 @@ static SpaceLink *buttons_duplicate(SpaceLink *sl) /* clear or remove stuff from old */ sbutsn->ri= NULL; + sbutsn->path= NULL; return (SpaceLink *)sbutsn; } @@ -168,6 +170,8 @@ static void buttons_main_area_draw(const bContext *C, ARegion *ar) SpaceButs *sbuts= (SpaceButs*)CTX_wm_space_data(C); int vertical= (sbuts->align == BUT_VERTICAL); + buttons_context_compute(C, sbuts); + if(sbuts->mainb == BCONTEXT_SCENE) ED_region_panels(C, ar, vertical, "scene"); else if(sbuts->mainb == BCONTEXT_WORLD) @@ -191,7 +195,6 @@ static void buttons_main_area_draw(const bContext *C, ARegion *ar) sbuts->re_align= 0; sbuts->mainbo= sbuts->mainb; - sbuts->tabo= sbuts->tab[sbuts->mainb]; } void buttons_operatortypes(void) @@ -282,6 +285,8 @@ void ED_spacetype_buttons(void) art->listener= buttons_area_listener; art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES; BLI_addhead(&st->regiontypes, art); + + buttons_context_register(art); /* regions: header */ art= MEM_callocN(sizeof(ARegionType), "spacetype buttons region"); -- cgit v1.2.3