diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-10-27 14:46:46 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-10-27 14:46:46 +0300 |
commit | ba8ff9a339af4d2241fc31550481ae9a481a7daa (patch) | |
tree | 581ab65f57f6a99fee3fea3034abb9e7afb1f811 /source/blender/editors/space_graph/graph_buttons.c | |
parent | 90957ed0dddbfbfa1eb09cc55fbc1b6df4f394c3 (diff) |
Graph Editor: Added panel for numerically adjusting the cursor position
Diffstat (limited to 'source/blender/editors/space_graph/graph_buttons.c')
-rw-r--r-- | source/blender/editors/space_graph/graph_buttons.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 87a11305bd9..e2eb40b1137 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -105,6 +105,8 @@ static void do_graph_region_buttons(bContext *C, void *arg, int event) //WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob); } +/* -------------- */ + static int graph_panel_context(const bContext *C, bAnimListElem **ale, FCurve **fcu) { bAnimContext ac; @@ -136,6 +138,37 @@ static int graph_panel_poll(const bContext *C, PanelType *pt) return graph_panel_context(C, NULL, NULL); } +/* -------------- */ + +/* Graph Editor View Settings */ +static void graph_panel_view(const bContext *C, Panel *pa) +{ + bScreen *sc= CTX_wm_screen(C); + SpaceIpo *sipo= CTX_wm_space_graph(C); + Scene *scene= CTX_data_scene(C); + PointerRNA spaceptr, sceneptr; + uiLayout *col, *subcol; + + /* get RNA pointers for use when creating the UI elements */ + RNA_id_pointer_create(&scene->id, &sceneptr); + RNA_pointer_create(&sc->id, &RNA_SpaceGraphEditor, sipo, &spaceptr); + + /* 2D-Cursor */ + col= uiLayoutColumn(pa->layout, 0); + uiItemR(col, NULL, 0, &spaceptr, "show_cursor", 0); + + subcol= uiLayoutColumn(col, 1); + uiLayoutSetActive(subcol, RNA_boolean_get(&spaceptr, "show_cursor")); + uiItemR(subcol, "Cursor X", 0, &sceneptr, "current_frame", 0); + uiItemR(subcol, "Cursor Y", 0, &spaceptr, "cursor_value", 0); + + subcol= uiLayoutColumn(col, 1); + uiLayoutSetActive(subcol, RNA_boolean_get(&spaceptr, "show_cursor")); + uiItemO(subcol, "Cursor from Selection", 0, "GRAPH_OT_frame_jump"); +} + +/* ******************* active F-Curve ************** */ + static void graph_panel_properties(const bContext *C, Panel *pa) { bAnimListElem *ale; @@ -413,6 +446,12 @@ void graph_buttons_register(ARegionType *art) { PanelType *pt; + pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel view"); + strcpy(pt->idname, "GRAPH_PT_view"); + strcpy(pt->label, "View"); + pt->draw= graph_panel_view; + BLI_addtail(&art->paneltypes, pt); + pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel properties"); strcpy(pt->idname, "GRAPH_PT_properties"); strcpy(pt->label, "Properties"); |