diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-04 03:33:56 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-04 03:33:56 +0400 |
commit | 5587e9bd09d7e23526775cd01b8e7bb75578e7d1 (patch) | |
tree | 63602cb79203f6baaa1e1ecae8f21c60ae720c01 /source/blender/editors/space_buttons/space_buttons.c | |
parent | 4df00c670ef2e03d3dc55b67594e96cc49766831 (diff) |
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.
Diffstat (limited to 'source/blender/editors/space_buttons/space_buttons.c')
-rw-r--r-- | source/blender/editors/space_buttons/space_buttons.c | 11 |
1 files changed, 8 insertions, 3 deletions
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"); |