Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2009-02-07 22:37:29 +0300
committerTon Roosendaal <ton@blender.org>2009-02-07 22:37:29 +0300
commit2f0f8c8bae8c6f55290966d9fb29c3d2a4c51793 (patch)
tree59bf5bd438f84dcaac3e39d7a269b03151c5a3d4 /source/blender/editors/space_info/info_header.c
parentf78aa0ab65524f70ab7d0610835068718fb5a56f (diff)
2.5
- Screen browse button back - Several fixes in using screens in more windows. Still has loose ends, but things are definitely more stable!
Diffstat (limited to 'source/blender/editors/space_info/info_header.c')
-rw-r--r--source/blender/editors/space_info/info_header.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/source/blender/editors/space_info/info_header.c b/source/blender/editors/space_info/info_header.c
index 59e30d87407..096374a82c4 100644
--- a/source/blender/editors/space_info/info_header.c
+++ b/source/blender/editors/space_info/info_header.c
@@ -103,10 +103,66 @@ static void do_info_buttons(bContext *C, void *arg, int event)
}
}
+static void screen_idpoin_handle(bContext *C, ID *id, int event)
+{
+
+ switch(event) {
+ case UI_ID_BROWSE:
+ /* exception: can't set screens inside of area/region handers */
+ WM_event_add_notifier(C, NC_SCREEN|ND_SCREENBROWSE, id);
+ break;
+ case UI_ID_DELETE:
+ ED_undo_push(C, "");
+ break;
+ case UI_ID_RENAME:
+ break;
+ case UI_ID_ADD_NEW:
+ /* XXX not implemented */
+ break;
+ case UI_ID_OPEN:
+ /* XXX not implemented */
+ break;
+ case UI_ID_ALONE:
+ /* XXX not implemented */
+ break;
+ case UI_ID_PIN:
+ break;
+ }
+}
+
+static void scene_idpoin_handle(bContext *C, ID *id, int event)
+{
+
+ switch(event) {
+ case UI_ID_BROWSE:
+ WM_event_add_notifier(C, NC_SCREEN|ND_SCENEBROWSE, CTX_wm_screen(C));
+ break;
+ case UI_ID_DELETE:
+ ED_undo_push(C, "");
+ break;
+ case UI_ID_RENAME:
+ break;
+ case UI_ID_ADD_NEW:
+ /* XXX not implemented */
+ break;
+ case UI_ID_OPEN:
+ /* XXX not implemented */
+ break;
+ case UI_ID_ALONE:
+ /* XXX not implemented */
+ break;
+ case UI_ID_PIN:
+ break;
+ }
+}
+
void info_header_buttons(const bContext *C, ARegion *ar)
{
+ wmWindow *win= CTX_wm_window(C);
+ bScreen *screen= CTX_wm_screen(C);
ScrArea *sa= CTX_wm_area(C);
+ SpaceInfo *si= sa->spacedata.first;
uiBlock *block;
int xco, yco= 3;
@@ -147,6 +203,17 @@ void info_header_buttons(const bContext *C, ARegion *ar)
}
uiBlockSetEmboss(block, UI_EMBOSS);
+
+ if(screen->full==NULL) {
+ si->screen= win->screen;
+ xco= uiDefIDPoinButs(block, CTX_data_main(C), NULL, (ID**)&si->screen, ID_SCR, NULL, xco, yco,
+ screen_idpoin_handle, UI_ID_BROWSE|UI_ID_RENAME|UI_ID_ADD_NEW|UI_ID_DELETE);
+ xco += 8;
+ si->scene= screen->scene;
+ xco= uiDefIDPoinButs(block, CTX_data_main(C), NULL, (ID**)&si->scene, ID_SCE, NULL, xco, yco,
+ scene_idpoin_handle, UI_ID_BROWSE|UI_ID_RENAME|UI_ID_ADD_NEW|UI_ID_DELETE);
+ xco += 8;
+ }
if(WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C))) {
uiDefIconTextBut(block, BUT, B_STOPRENDER, ICON_REC, "Render", xco+5,yco,75,19, NULL, 0.0f, 0.0f, 0, 0, "Stop rendering");