~ubuntu-branches/ubuntu/maverick/blender/maverick

« back to all changes in this revision

Viewing changes to source/blender/src/header_action.c

  • Committer: Bazaar Package Importer
  • Author(s): Khashayar Naderehvandi, Khashayar Naderehvandi, Alessio Treglia
  • Date: 2009-01-22 16:53:59 UTC
  • mfrom: (14.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090122165359-v0996tn7fbit64ni
Tags: 2.48a+dfsg-1ubuntu1
[ Khashayar Naderehvandi ]
* Merge from debian experimental (LP: #320045), Ubuntu remaining changes:
  - Add patch correcting header file locations.
  - Add libvorbis-dev and libgsm1-dev to Build-Depends.
  - Use avcodec_decode_audio2() in source/blender/src/hddaudio.c

[ Alessio Treglia ]
* Add missing previous changelog entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * Functions to draw the "Action Editor" window header
5
5
 * and handle user events sent to it.
6
6
 * 
7
 
 * $Id: header_action.c 14666 2008-05-03 02:50:07Z aligorith $
 
7
 * $Id: header_action.c 16931 2008-10-05 11:49:09Z aligorith $
8
8
 *
9
9
 * ***** BEGIN GPL LICENSE BLOCK *****
10
10
 *
50
50
#include "DNA_screen_types.h"
51
51
#include "DNA_space_types.h"
52
52
 
 
53
#include "BIF_gl.h"
 
54
#include "BIF_glutil.h"
53
55
#include "BIF_editaction.h"
54
56
#include "BIF_interface.h"
 
57
#include "BIF_language.h"
55
58
#include "BIF_poseobject.h"
56
59
#include "BIF_resources.h"
57
60
#include "BIF_screen.h"
76
79
#include "blendef.h"
77
80
#include "mydevice.h"
78
81
 
 
82
/* ------------------------------- */
79
83
/* enums declaring constants that are used as menu event codes  */
80
84
 
81
85
enum {
212
216
        ACTMENU_MARKERS_LOCALMOVE
213
217
};
214
218
 
 
219
/* ------------------------------- */
 
220
/* macros for easier state testing (only for use here) */
 
221
 
 
222
/* test if active action editor is showing any markers */
 
223
#define G_SACTION_HASMARKERS \
 
224
        ((G.saction->action && G.saction->action->markers.first) \
 
225
         || (G.scene->markers.first))
 
226
 
 
227
/* ------------------------------- */
 
228
 
215
229
void do_action_buttons(unsigned short event)
216
230
{
217
231
        Object *ob= OBACT;
271
285
                        
272
286
                /* copy/paste buttons in Action Editor header */
273
287
                case B_ACTCOPYKEYS:
274
 
                        copy_actdata();
 
288
                        if (G.saction->mode == SACTCONT_GPENCIL)
 
289
                                copy_gpdata();
 
290
                        else
 
291
                                copy_actdata();
275
292
                        break;
276
293
                case B_ACTPASTEKEYS:
277
 
                        paste_actdata();
 
294
                        if (G.saction->mode == SACTCONT_GPENCIL)
 
295
                                paste_gpdata();
 
296
                        else
 
297
                                paste_actdata();
278
298
                        break;
279
299
 
280
300
                case B_ACTPIN:  /* __PINFAKE */
398
418
        
399
419
        uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
400
420
        
401
 
        uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_SLIDERS)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, 
402
 
                                         "Show Sliders|", 0, yco-=20, 
403
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 
404
 
                                         ACTMENU_VIEW_SLIDERS, "");
405
 
                                         
406
 
        uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NOHIDE)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, 
407
 
                                         "Show Hidden Channels|", 0, yco-=20, 
408
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 
409
 
                                         ACTMENU_VIEW_NOHIDE, "");
410
 
                                         
411
 
        uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NODRAWGCOLORS)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, 
412
 
                                         "Use Group Colors|", 0, yco-=20, 
413
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 
414
 
                                         ACTMENU_VIEW_GCOLORS, "");
415
 
                                         
416
 
                // this option may get removed in future
417
 
        uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_HORIZOPTIMISEON)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, 
418
 
                                         "Cull Out-of-View Keys (Time)|", 0, yco-=20, 
419
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 
420
 
                                         ACTMENU_VIEW_HORIZOPTIMISE, "");
 
421
        if (G.saction->mode == SACTCONT_GPENCIL) {
 
422
                        // this option may get removed in future
 
423
                uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_HORIZOPTIMISEON)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, 
 
424
                                                 "Cull Out-of-View Keys (Time)|", 0, yco-=20, 
 
425
                                                 menuwidth, 19, NULL, 0.0, 0.0, 1, 
 
426
                                                 ACTMENU_VIEW_HORIZOPTIMISE, "");
 
427
        }
 
428
        else {
 
429
                uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_SLIDERS)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, 
 
430
                                                 "Show Sliders|", 0, yco-=20, 
 
431
                                                 menuwidth, 19, NULL, 0.0, 0.0, 1, 
 
432
                                                 ACTMENU_VIEW_SLIDERS, "");
 
433
                                                 
 
434
                uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NOHIDE)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, 
 
435
                                                 "Show Hidden Channels|", 0, yco-=20, 
 
436
                                                 menuwidth, 19, NULL, 0.0, 0.0, 1, 
 
437
                                                 ACTMENU_VIEW_NOHIDE, "");
 
438
                                                 
 
439
                uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NODRAWGCOLORS)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, 
 
440
                                                 "Use Group Colors|", 0, yco-=20, 
 
441
                                                 menuwidth, 19, NULL, 0.0, 0.0, 1, 
 
442
                                                 ACTMENU_VIEW_GCOLORS, "");
 
443
                                                 
 
444
                        // this option may get removed in future
 
445
                uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_HORIZOPTIMISEON)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, 
 
446
                                                 "Cull Out-of-View Keys (Time)|", 0, yco-=20, 
 
447
                                                 menuwidth, 19, NULL, 0.0, 0.0, 1, 
 
448
                                                 ACTMENU_VIEW_HORIZOPTIMISE, "");
 
449
                
 
450
                uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NOTRANSKEYCULL)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, 
 
451
                                                 "AutoMerge Keyframes|", 0, yco-=20, 
 
452
                                                 menuwidth, 19, NULL, 0.0, 0.0, 1, 
 
453
                                                 ACTMENU_VIEW_TRANSDELDUPS, "");
 
454
        }       
421
455
        
422
 
        uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NOTRANSKEYCULL)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, 
423
 
                                         "AutoMerge Keyframes|", 0, yco-=20, 
424
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 
425
 
                                         ACTMENU_VIEW_TRANSDELDUPS, "");
426
 
                        
427
456
                
428
457
        uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, 
429
458
                                         "Lock Time to Other Windows|", 0, yco-=20, 
476
505
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 
477
506
                                         ACTMENU_VIEW_PREVRANGECLEAR, "");
478
507
                
479
 
        if (G.saction->action) {
 
508
        if ((G.saction->mode == SACTCONT_ACTION) && (G.saction->action)) {
480
509
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
481
510
                                         "Preview Range from Action Length|Ctrl Alt P", 0, yco-=20, 
482
511
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 
550
579
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
551
580
                                         "On Current Frame|Ctrl K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,  
552
581
                                         ACTMENU_SEL_COLUMN_CFRA, "");
553
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
554
 
                                         "On Selected Markers|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 
555
 
                                         ACTMENU_SEL_COLUMN_MARKERSCOLUMN, "");
556
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
557
 
                                         "Between Selected Markers|Alt K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 
558
 
                                         ACTMENU_SEL_COLUMN_MARKERSBETWEEN, "");
559
582
        
 
583
        if (G_SACTION_HASMARKERS) {
 
584
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
 
585
                                                 "On Selected Markers|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 
 
586
                                                 ACTMENU_SEL_COLUMN_MARKERSCOLUMN, "");
 
587
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
 
588
                                                 "Between Selected Markers|Alt K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 
 
589
                                                 ACTMENU_SEL_COLUMN_MARKERSBETWEEN, "");
 
590
        }
560
591
        
561
592
        uiBlockSetDirection(block, UI_RIGHT);
562
593
        uiTextBoundsBlock(block, 60);
659
690
                                         "Border Select Keys|B", 0, yco-=20, 
660
691
                                         menuwidth, 19, NULL, 0.0, 0.0, 0, 
661
692
                                         ACTMENU_SEL_BORDER, "");
662
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
663
 
                                         "Border Select Channels|B", 0, yco-=20, 
664
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 0, 
665
 
                                         ACTMENU_SEL_BORDERC, "");
666
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
667
 
                                         "Border Select Markers|Ctrl B", 0, yco-=20, 
668
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 0, 
669
 
                                         ACTMENU_SEL_BORDERM, "");
 
693
        if (G_SACTION_HASMARKERS) {
 
694
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
 
695
                                                 "Border Select Markers|Ctrl B", 0, yco-=20, 
 
696
                                                 menuwidth, 19, NULL, 0.0, 0.0, 0, 
 
697
                                                 ACTMENU_SEL_BORDERM, "");
 
698
        }
 
699
        if (G.saction->mode != SACTCONT_SHAPEKEY) {
 
700
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
 
701
                                                 "Border Select Channels|B", 0, yco-=20, 
 
702
                                                 menuwidth, 19, NULL, 0.0, 0.0, 0, 
 
703
                                                 ACTMENU_SEL_BORDERC, "");
 
704
        }
670
705
                                         
671
706
        uiDefBut(block, SEPR, 0, "", 0, yco-=6, 
672
707
                         menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
675
710
                                         "Select/Deselect All Keys|A", 0, yco-=20, 
676
711
                                         menuwidth, 19, NULL, 0.0, 0.0, 0, 
677
712
                                         ACTMENU_SEL_ALL_KEYS, "");
678
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
679
 
                                         "Select/Deselect All Markers|Ctrl A", 0, yco-=20, 
680
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 0, 
681
 
                                         ACTMENU_SEL_ALL_MARKERS, "");
682
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
683
 
                                         "Select/Deselect All Channels|A", 0, yco-=20, 
684
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 0, 
685
 
                                         ACTMENU_SEL_ALL_CHAN, "");
 
713
        if (G_SACTION_HASMARKERS) {
 
714
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
 
715
                                                 "Select/Deselect All Markers|Ctrl A", 0, yco-=20, 
 
716
                                                 menuwidth, 19, NULL, 0.0, 0.0, 0, 
 
717
                                                 ACTMENU_SEL_ALL_MARKERS, "");
 
718
        }
 
719
        if (G.saction->mode != SACTCONT_SHAPEKEY) {
 
720
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
 
721
                                                 "Select/Deselect All Channels|A", 0, yco-=20, 
 
722
                                                 menuwidth, 19, NULL, 0.0, 0.0, 0, 
 
723
                                                 ACTMENU_SEL_ALL_CHAN, "");
 
724
        }
686
725
                                         
687
726
        uiDefBut(block, SEPR, 0, "", 0, yco-=6, 
688
727
                         menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
691
730
                                         "Inverse Keys|Ctrl I", 0, yco-=20, 
692
731
                                         menuwidth, 19, NULL, 0.0, 0.0, 0, 
693
732
                                         ACTMENU_SEL_INVERSE_KEYS, "");
694
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
695
 
                                         "Inverse Markers|Ctrl Shift I", 0, yco-=20, 
696
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 0, 
697
 
                                         ACTMENU_SEL_INVERSE_MARKERS, "");
698
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
699
 
                                         "Inverse All Channels|Ctrl I", 0, yco-=20, 
700
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 0, 
701
 
                                         ACTMENU_SEL_INVERSE_CHANNELS, "");
 
733
        if (G_SACTION_HASMARKERS) {
 
734
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
 
735
                                                 "Inverse Markers|Ctrl Shift I", 0, yco-=20, 
 
736
                                                 menuwidth, 19, NULL, 0.0, 0.0, 0, 
 
737
                                                 ACTMENU_SEL_INVERSE_MARKERS, "");
 
738
        }
 
739
        if (G.saction->mode != SACTCONT_SHAPEKEY) {
 
740
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
 
741
                                                 "Inverse All Channels|Ctrl I", 0, yco-=20, 
 
742
                                                 menuwidth, 19, NULL, 0.0, 0.0, 0, 
 
743
                                                 ACTMENU_SEL_INVERSE_CHANNELS, "");
 
744
        }
702
745
                
703
746
        uiDefBut(block, SEPR, 0, "", 0, yco-=6, 
704
747
                         menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
971
1014
        return block;
972
1015
}
973
1016
 
 
1017
/* note: uses do_action_channelmenu too... */
 
1018
static uiBlock *action_gplayermenu(void *arg_unused)
 
1019
{
 
1020
        uiBlock *block;
 
1021
        short yco= 0, menuwidth=120;
 
1022
 
 
1023
        block= uiNewBlock(&curarea->uiblocks, "action_gplayermenu", 
 
1024
                                          UI_EMBOSSP, UI_HELV, curarea->headwin);
 
1025
        uiBlockSetButmFunc(block, do_action_channelmenu, NULL);
 
1026
        
 
1027
        uiDefIconTextBlockBut(block, action_channelmenu_settingsmenu, 
 
1028
                                                  NULL, ICON_RIGHTARROW_THIN, 
 
1029
                                                  "Settings", 0, yco-=20, 120, 20, ""); 
 
1030
        
 
1031
        uiDefBut(block, SEPR, 0, "", 0, yco-=6, 
 
1032
                                        menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
 
1033
        
 
1034
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
 
1035
                        "Delete|X", 0, yco-=20,
 
1036
                        menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_CHANNELS_DELETE, "");
 
1037
        
 
1038
        if (curarea->headertype==HEADERTOP) {
 
1039
                uiBlockSetDirection(block, UI_DOWN);
 
1040
        }
 
1041
        else {
 
1042
                uiBlockSetDirection(block, UI_TOP);
 
1043
                uiBlockFlipOrder(block);
 
1044
        }
 
1045
 
 
1046
        uiTextBoundsBlock(block, 50);
 
1047
 
 
1048
        return block;
 
1049
}
 
1050
 
974
1051
static void do_action_keymenu_transformmenu(void *arg, int event)
975
1052
{       
976
1053
        switch (event)
1400
1477
        return block;
1401
1478
}
1402
1479
 
 
1480
/* note: uses do_action_keymenu too! */
 
1481
static uiBlock *action_framemenu(void *arg_unused)
 
1482
{
 
1483
        uiBlock *block;
 
1484
        short yco= 0, menuwidth=120;
 
1485
 
 
1486
        block= uiNewBlock(&curarea->uiblocks, "action_framemenu", 
 
1487
                                          UI_EMBOSSP, UI_HELV, curarea->headwin);
 
1488
        uiBlockSetButmFunc(block, do_action_keymenu, NULL);
 
1489
        
 
1490
        uiDefIconTextBlockBut(block, action_keymenu_transformmenu, 
 
1491
                                                  NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 20, "");
 
1492
        
 
1493
        uiDefIconTextBlockBut(block, action_keymenu_snapmenu, 
 
1494
                                                  NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 20, "");
 
1495
        
 
1496
        uiDefIconTextBlockBut(block, action_keymenu_mirrormenu, 
 
1497
                                                  NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 20, "");
 
1498
        
 
1499
        uiDefBut(block, SEPR, 0, "", 0, yco-=6, 
 
1500
                         menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
 
1501
                                        
 
1502
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
 
1503
                                        "Duplicate|Shift D", 0, yco-=20, 
 
1504
                                        menuwidth, 19, NULL, 0.0, 0.0, 0, 
 
1505
                                        ACTMENU_KEY_DUPLICATE, "");
 
1506
        
 
1507
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, 
 
1508
                                        "Delete|X", 0, yco-=20, 
 
1509
                                        menuwidth, 19, NULL, 0.0, 0.0, 0, 
 
1510
                                        ACTMENU_KEY_DELETE, "");
 
1511
        
 
1512
        if(curarea->headertype==HEADERTOP) {
 
1513
                uiBlockSetDirection(block, UI_DOWN);
 
1514
        }
 
1515
        else {
 
1516
                uiBlockSetDirection(block, UI_TOP);
 
1517
                uiBlockFlipOrder(block);
 
1518
        }
 
1519
 
 
1520
        uiTextBoundsBlock(block, 50);
 
1521
 
 
1522
        return block;
 
1523
}
 
1524
 
1403
1525
static void do_action_markermenu(void *arg, int event)
1404
1526
{       
1405
1527
        switch(event)
1452
1574
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_ADD, "");
1453
1575
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20, 
1454
1576
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_DUPLICATE, "");
1455
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20,
 
1577
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|Shift X", 0, yco-=20,
1456
1578
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_DELETE, "");
1457
1579
                                        
1458
1580
        uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1461
1583
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_NAME, "");
1462
1584
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Ctrl G", 0, yco-=20,
1463
1585
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_MOVE, "");
1464
 
                                         
1465
 
        uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1466
 
        
1467
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Pose Marker|Shift L", 0, yco-=20, 
1468
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALADD, "");
1469
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rename Pose Marker|Ctrl Shift L", 0, yco-=20, 
1470
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALRENAME, "");
1471
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Pose Marker|Alt L", 0, yco-=20,
1472
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALDELETE, "");
1473
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Pose Marker|Ctrl L", 0, yco-=20, 
1474
 
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALMOVE, "");
 
1586
                
 
1587
        if (G.saction->mode == SACTCONT_ACTION) {
 
1588
                uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
 
1589
                
 
1590
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Pose Marker|Shift L", 0, yco-=20, 
 
1591
                                                 menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALADD, "");
 
1592
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rename Pose Marker|Ctrl Shift L", 0, yco-=20, 
 
1593
                                                 menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALRENAME, "");
 
1594
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Pose Marker|Alt L", 0, yco-=20,
 
1595
                                                 menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALDELETE, "");
 
1596
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Pose Marker|Ctrl L", 0, yco-=20, 
 
1597
                                                 menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALMOVE, "");
 
1598
        }
1475
1599
        
1476
1600
        if(curarea->headertype==HEADERTOP) {
1477
1601
                uiBlockSetDirection(block, UI_DOWN);
1498
1622
                return;
1499
1623
 
1500
1624
        /* copied from drawactionspace.... */
 
1625
        // FIXME: do for gpencil too?
1501
1626
        if (!G.saction->pin) {
1502
1627
                if (OBACT)
1503
1628
                        G.saction->action = OBACT->action;
1558
1683
                                          "Select", xco, -2, xmax-3, 24, "");
1559
1684
                xco+= xmax;
1560
1685
                
1561
 
                if (G.saction->action) {
 
1686
                if ((G.saction->action) && (G.saction->mode==SACTCONT_ACTION)) {
1562
1687
                        xmax= GetButStringLength("Channel");
1563
1688
                        uiDefPulldownBut(block, action_channelmenu, NULL, 
1564
1689
                                                  "Channel", xco, -2, xmax-3, 24, "");
1565
1690
                        xco+= xmax;
1566
1691
                }
 
1692
                else if (G.saction->mode==SACTCONT_GPENCIL) {
 
1693
                        xmax= GetButStringLength("Channel");
 
1694
                        uiDefPulldownBut(block, action_gplayermenu, NULL, 
 
1695
                                                  "Channel", xco, -2, xmax-3, 24, "");
 
1696
                        xco+= xmax;
 
1697
                }
1567
1698
                
1568
1699
                xmax= GetButStringLength("Marker");
1569
1700
                uiDefPulldownBut(block, action_markermenu, NULL, 
1570
1701
                                          "Marker", xco, -2, xmax-3, 24, "");
1571
1702
                xco+= xmax;
1572
1703
                
1573
 
                xmax= GetButStringLength("Key");
1574
 
                uiDefPulldownBut(block, action_keymenu, NULL, 
1575
 
                                          "Key", xco, -2, xmax-3, 24, "");
1576
 
                xco+= xmax;
 
1704
                if (G.saction->mode == SACTCONT_GPENCIL) {
 
1705
                        xmax= GetButStringLength("Frame");
 
1706
                        uiDefPulldownBut(block, action_framemenu, NULL, 
 
1707
                                                  "Frame", xco, -2, xmax-3, 24, "");
 
1708
                        xco+= xmax;
 
1709
 
 
1710
                }
 
1711
                else {
 
1712
                        xmax= GetButStringLength("Key");
 
1713
                        uiDefPulldownBut(block, action_keymenu, NULL, 
 
1714
                                                  "Key", xco, -2, xmax-3, 24, "");
 
1715
                        xco+= xmax;
 
1716
                }
1577
1717
        }
1578
1718
 
1579
1719
        uiBlockSetEmboss(block, UI_EMBOSS);
1580
1720
        
1581
 
        /* NAME ETC */
1582
 
        ob= OBACT;
1583
 
        from = (ID *)ob;
1584
 
 
1585
 
        xco= std_libbuttons(block, xco, 0, B_ACTPIN, &G.saction->pin, 
1586
 
                                                B_ACTIONBROWSE, ID_AC, 0, (ID*)G.saction->action, 
1587
 
                                                from, &(G.saction->actnr), B_ACTALONE, 
1588
 
                                                B_ACTLOCAL, B_ACTIONDELETE, 0, B_KEEPDATA);     
1589
 
 
1590
 
        uiClearButLock();
1591
 
 
1592
 
        xco += 8;
 
1721
        /* MODE SELECTOR */
 
1722
        uiDefButC(block, MENU, B_REDR, 
 
1723
                        "Editor Mode %t|Action Editor %x0|ShapeKey Editor %x1|Grease Pencil %x2", 
 
1724
                        xco,0,90,YIC, &(G.saction->mode), 0, 1, 0, 0, 
 
1725
                        "Editing modes for this editor");
 
1726
 
 
1727
        
 
1728
        xco += (90 + 8);
 
1729
        
 
1730
        /* MODE-DEPENDENT DRAWING */
 
1731
        if (G.saction->mode != SACTCONT_GPENCIL) {
 
1732
                /* NAME ETC */
 
1733
                ob= OBACT;
 
1734
                from = (ID *)ob;
 
1735
                
 
1736
                xco= std_libbuttons(block, xco, 0, B_ACTPIN, &G.saction->pin, 
 
1737
                                                        B_ACTIONBROWSE, ID_AC, 0, (ID*)G.saction->action, 
 
1738
                                                        from, &(G.saction->actnr), B_ACTALONE, 
 
1739
                                                        B_ACTLOCAL, B_ACTIONDELETE, 0, B_KEEPDATA);     
 
1740
                
 
1741
                uiClearButLock();
 
1742
                
 
1743
                xco += 8;
 
1744
        }
 
1745
        
1593
1746
        
1594
1747
        /* COPY PASTE */
1595
1748
        uiBlockBeginAlign(block);
1604
1757
        uiBlockEndAlign(block);
1605
1758
        xco += (XIC + 8);
1606
1759
        
1607
 
        /* draw AUTOSNAP */
1608
 
        if (G.saction->flag & SACTION_DRAWTIME) {
1609
 
                uiDefButS(block, MENU, B_REDR,
1610
 
                                "Auto-Snap Keyframes %t|No Snap %x0|Second Step %x1|Nearest Second %x2|Nearest Marker %x3", 
1611
 
                                xco,0,70,YIC, &(G.saction->autosnap), 0, 1, 0, 0, 
1612
 
                                "Auto-snapping mode for keyframes when transforming");
1613
 
        }
1614
 
        else {
1615
 
                uiDefButS(block, MENU, B_REDR, 
1616
 
                                "Auto-Snap Keyframes %t|No Snap %x0|Frame Step %x1|Nearest Frame %x2|Nearest Marker %x3", 
1617
 
                                xco,0,70,YIC, &(G.saction->autosnap), 0, 1, 0, 0, 
1618
 
                                "Auto-snapping mode for keyframes when transforming");
1619
 
        }
1620
1760
        
1621
 
        xco += (70 + 8);
 
1761
        if (G.saction->mode != SACTCONT_GPENCIL) {
 
1762
                /* draw AUTOSNAP */
 
1763
                if (G.saction->flag & SACTION_DRAWTIME) {
 
1764
                        uiDefButC(block, MENU, B_REDR,
 
1765
                                        "Auto-Snap Keyframes %t|No Snap %x0|Second Step %x1|Nearest Second %x2|Nearest Marker %x3", 
 
1766
                                        xco,0,70,YIC, &(G.saction->autosnap), 0, 1, 0, 0, 
 
1767
                                        "Auto-snapping mode for keyframes when transforming");
 
1768
                }
 
1769
                else {
 
1770
                        uiDefButC(block, MENU, B_REDR, 
 
1771
                                        "Auto-Snap Keyframes %t|No Snap %x0|Frame Step %x1|Nearest Frame %x2|Nearest Marker %x3", 
 
1772
                                        xco,0,70,YIC, &(G.saction->autosnap), 0, 1, 0, 0, 
 
1773
                                        "Auto-snapping mode for keyframes when transforming");
 
1774
                }
 
1775
                
 
1776
                xco += (70 + 8);
 
1777
        }
1622
1778
        
1623
1779
        /* draw LOCK */
1624
1780
        uiDefIconButS(block, ICONTOG, 1, ICON_UNLOCKED, xco, 0, XIC, YIC,