6316d6d6bac4786fd4ad00af7eeee0aabb5efb1b
[blender.git] / source / blender / src / header_oops.c
1 /**
2  * header_oops.c oct-2003
3  *
4  * Functions to draw the "OOPS Schematic" window header
5  * and handle user events sent to it.
6  * 
7  * $Id$
8  *
9  * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version. The Blender
15  * Foundation also sells licenses for use in proprietary software under
16  * the Blender License.  See http://www.blender.org/BL/ for information
17  * about this.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software Foundation,
26  * Inc., 59 Temple Place - Suite 330, Boston, MA        02111-1307, USA.
27  *
28  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
29  * All rights reserved.
30  *
31  * The Original Code is: all of this file.
32  *
33  * Contributor(s): none yet.
34  *
35  * ***** END GPL/BL DUAL LICENSE BLOCK *****
36  */
37
38 #include <stdlib.h>
39 #include <string.h>
40 #include <stdio.h>
41
42 #ifdef HAVE_CONFIG_H
43 #include <config.h>
44 #endif
45
46 #include "BMF_Api.h"
47 #include "BIF_language.h"
48
49 #include "DNA_ID.h"
50 #include "DNA_oops_types.h"
51 #include "DNA_screen_types.h"
52 #include "DNA_space_types.h"
53
54 #include "BKE_global.h"
55 #include "BKE_main.h"
56
57 #include "BIF_gl.h"
58 #include "BIF_interface.h"
59 #include "BIF_resources.h"
60 #include "BIF_screen.h"
61 #include "BIF_editoops.h"
62 #include "BIF_oops.h"
63 #include "BIF_outliner.h"
64 #include "BIF_space.h"
65
66 #include "BSE_drawipo.h"
67 #include "BSE_drawoops.h"
68 #include "BSE_headerbuttons.h"
69
70 #include "blendef.h"
71
72 #include "BKE_depsgraph.h"
73
74 #include "BPY_extern.h"
75 #include "BPY_menus.h"
76
77 static int viewmovetemp = 0;
78
79 void do_oops_buttons(short event)
80 {
81         float dx, dy;
82         
83         if(curarea->win==0) return;
84
85         switch(event) {
86         case B_OOPSHOME:
87                 init_v2d_oops(curarea, curarea->spacedata.first);       // forces min/max to be reset
88                 boundbox_oops(0);
89                 G.v2d->cur= G.v2d->tot;
90                 dx= 0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin);
91                 dy= 0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin);
92                 G.v2d->cur.xmin-= dx;
93                 G.v2d->cur.xmax+= dx;
94                 G.v2d->cur.ymin-= dy;
95                 G.v2d->cur.ymax+= dy;           
96                 test_view2d(G.v2d, curarea->winx, curarea->winy);
97                 scrarea_queue_winredraw(curarea);
98                 break;
99         
100         case B_OOPSVIEWSEL:
101                 init_v2d_oops(curarea, curarea->spacedata.first);       // forces min/max to be reset
102                 boundbox_oops(1);
103                 G.v2d->cur= G.v2d->tot;
104                 dx= 0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin);
105                 dy= 0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin);
106                 G.v2d->cur.xmin-= dx;
107                 G.v2d->cur.xmax+= dx;
108                 G.v2d->cur.ymin-= dy;
109                 G.v2d->cur.ymax+= dy;           
110                 test_view2d(G.v2d, curarea->winx, curarea->winy);
111                 scrarea_queue_winredraw(curarea);
112                 break;
113         
114         case B_NEWOOPS:
115                 scrarea_queue_winredraw(curarea);
116                 scrarea_queue_headredraw(curarea);
117                 G.soops->lockpoin= 0;
118                 break;
119         }
120 }
121
122 static void do_oops_viewmenu(void *arg, int event)
123 {
124
125         switch(event) {
126         case 0: /* Shuffle Selected Blocks */
127                 shuffle_oops();
128                 break;
129         case 1: /* Shrink Selected Blocks */
130         shrink_oops();
131         break;
132     case 2: /* View All */
133                 do_oops_buttons(B_OOPSHOME);
134                 break;
135     case 3: /* View All */
136                 do_oops_buttons(B_OOPSVIEWSEL);
137                 break;
138         case 4: /* Maximize Window */
139                 /* using event B_FULL */
140                 break;
141         case 5: /* show outliner */
142                 {
143                         SpaceOops *soops= curarea->spacedata.first;
144                         if(soops->type==SO_OOPS || soops->type==SO_DEPSGRAPH) soops->type= SO_OUTLINER;
145                         else soops->type= SO_OOPS;
146                         init_v2d_oops(curarea, soops);
147                         test_view2d(G.v2d, curarea->winx, curarea->winy);
148                         scrarea_queue_winredraw(curarea);
149                 }
150                 break;
151         case 6:
152                 outliner_toggle_visible(curarea);
153                 break;
154         case 7:
155                 outliner_show_hierarchy(curarea);
156                 break;
157         case 8:
158                 outliner_show_active(curarea);
159                 break;
160         case 9:
161                 outliner_one_level(curarea, 1);
162                 break;
163         case 10:
164                 outliner_one_level(curarea, -1);
165                 break;
166 #ifdef SHOWDEPGRAPH
167         case 11:
168                 // show deps
169                 {
170                         SpaceOops *soops= curarea->spacedata.first;
171                         if(soops->type==SO_OOPS) {
172                                 soops->type= SO_DEPSGRAPH;
173                                 soops->deps_flags = DAG_RL_ALL_BUT_DATA_MASK;
174                         } else 
175                                 soops->type= SO_OOPS;
176                         init_v2d_oops(curarea, soops);
177                         test_view2d(G.v2d, curarea->winx, curarea->winy);
178                         scrarea_queue_winredraw(curarea);
179                 }
180                 break;
181 #endif
182         }
183 }                       
184
185 static uiBlock *oops_viewmenu(void *arg_unused)
186 {
187         SpaceOops *soops= curarea->spacedata.first;
188         uiBlock *block;
189         short yco= 0, menuwidth=120;
190         
191         block= uiNewBlock(&curarea->uiblocks, "oops_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
192         uiBlockSetButmFunc(block, do_oops_viewmenu, NULL);
193         
194         if(soops->type==SO_OOPS) {
195                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Outliner", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
196 #ifdef SHOWDEPGRAPH
197                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Dependancies", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
198 #endif
199                 uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
200
201                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shuffle Selected Blocks|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
202                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink Selected Blocks|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
203
204                 uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
205
206                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
207                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
208         }
209 #ifdef SHOWDEPGRAPH
210         else if(soops->type==SO_DEPSGRAPH) {
211                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Outliner", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
212                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Oops Schematic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
213         }
214 #endif
215         else {
216                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Oops Schematic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
217                 
218                 uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
219                 
220                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Expand One Level|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
221                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse One Level|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
222                 
223                 uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
224
225                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show/Hide All", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
226                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hierarchy|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
227                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Active|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
228         }
229         
230         uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
231         if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
232         else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
233         
234         if(curarea->headertype==HEADERTOP) {
235                 uiBlockSetDirection(block, UI_DOWN);
236         }
237         else {
238                 uiBlockSetDirection(block, UI_TOP);
239                 uiBlockFlipOrder(block);
240         }
241
242         uiTextBoundsBlock(block, 50);
243         
244         return block;
245 }
246
247
248 static void do_oops_selectmenu(void *arg, int event)
249 {       
250
251         switch(event)
252         {
253         case 0: /* Border Select */
254                 borderselect_oops();
255                 break;
256         case 1: /* Select/Deselect All */
257                 swap_select_all_oops();
258                 break;
259         case 2: /* Linked to Selected */
260                 select_linked_oops();
261                 break;
262         case 3: /* Users of Selected */
263                 select_backlinked_oops();
264                 break;
265         }
266 }
267
268 static uiBlock *oops_selectmenu(void *arg_unused)
269 {
270         uiBlock *block;
271         short yco= 0, menuwidth=120;
272
273         block= uiNewBlock(&curarea->uiblocks, "oops_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
274         uiBlockSetButmFunc(block, do_oops_selectmenu, NULL);
275
276         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
277         
278         uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
279
280         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
281
282         uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");    
283
284         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked to Selected|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
285         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Users of Selected|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
286
287         if(curarea->headertype==HEADERTOP) {
288                 uiBlockSetDirection(block, UI_DOWN);
289         }
290         else {
291                 uiBlockSetDirection(block, UI_TOP);
292                 uiBlockFlipOrder(block);
293         }
294
295         uiTextBoundsBlock(block, 50);
296
297         return block;
298 }
299
300 static void do_oops_blockmenu(void *arg, int event)
301 {       
302         switch(event)
303         {
304         case 0: /* grab/move */
305                 transform_oops('g', 0);
306                 break;
307         case 1: /* scale */
308                 transform_oops('s', 0);
309                 break;
310         }
311 }
312
313 static uiBlock *oops_blockmenu(void *arg_unused)
314 {
315         uiBlock *block;
316         short yco= 0, menuwidth=120;
317
318         block= uiNewBlock(&curarea->uiblocks, "oops_blockmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
319         uiBlockSetButmFunc(block, do_oops_blockmenu, NULL);
320
321         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
322         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
323
324         if(curarea->headertype==HEADERTOP) {
325                 uiBlockSetDirection(block, UI_DOWN);
326         }
327         else {
328                 uiBlockSetDirection(block, UI_TOP);
329                 uiBlockFlipOrder(block);
330         }
331
332         uiTextBoundsBlock(block, 50);
333
334         return block;
335 }
336
337
338
339 void oops_buttons(void)
340 {       
341         SpaceOops *soops;
342         Oops *oops;
343         uiBlock *block;
344         short xco, xmax;
345         char naam[256];
346
347         soops= curarea->spacedata.first;
348
349         sprintf(naam, "header %d", curarea->headwin);
350         block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
351
352         if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
353         else uiBlockSetCol(block, TH_HEADERDESEL);
354
355         curarea->butspacetype= SPACE_OOPS;
356
357         xco = 8;
358         
359         uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
360
361         xco+= XIC+14;
362
363         uiBlockSetEmboss(block, UI_EMBOSSN);
364         if(curarea->flag & HEADER_NO_PULLDOWN) {
365                 uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
366                                 xco,2,XIC,YIC-2,
367                                 &(curarea->flag), 0, 0, 0, 0, "Show pulldown menus");
368         } else {
369                 uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
370                                 xco,2,XIC,YIC-2,
371                                 &(curarea->flag), 0, 0, 0, 0, "Hide pulldown menus");
372         }
373         uiBlockSetEmboss(block, UI_EMBOSS);
374         xco+=XIC;
375
376         if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
377                 /* pull down menus */
378                 uiBlockSetEmboss(block, UI_EMBOSSP);
379         
380                 xmax= GetButStringLength("View");
381                 uiDefPulldownBut(block, oops_viewmenu, NULL, "View", xco, -2, xmax-3, 24, "");
382                 xco+= xmax;
383                 
384                 if(soops->type==SO_OOPS) {
385                         xmax= GetButStringLength("Select");
386                         uiDefPulldownBut(block, oops_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
387                         xco+= xmax;
388                         
389                         xmax= GetButStringLength("Block");
390                         uiDefPulldownBut(block, oops_blockmenu, NULL, "Block", xco, -2, xmax-3, 24, "");
391                         xco+= xmax;
392                         
393                 }
394         }
395
396         uiBlockSetEmboss(block, UI_EMBOSS);
397
398         if(soops->type==SO_OOPS) {
399                 /* ZOOM and BORDER */
400                 uiBlockBeginAlign(block);
401                 uiDefIconButI(block, TOG, B_VIEW2DZOOM, ICON_VIEWZOOM,  (short)(xco),0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Zooms view (Ctrl MiddleMouse)");
402                 uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE,  (short)(xco+=XIC),0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to area");
403                 uiBlockEndAlign(block);
404                 
405                 xco+= 8;
406                 
407                 /* VISIBLE */
408                 uiBlockBeginAlign(block);
409                 uiDefButBitS(block, TOG, OOPS_LAY, B_NEWOOPS, "Layer",          (short)(xco+=XIC),0,XIC+20,YIC, &soops->visiflag, 0, 0, 0, 0, "Only show object datablocks on visible layers");
410                 xco+= 20;
411                 uiDefIconButBitS(block, TOG, OOPS_SCE, B_NEWOOPS, ICON_SCENE_HLT,       (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Scene datablocks");
412                 uiDefIconButBitS(block, TOG, OOPS_OB, B_NEWOOPS, ICON_OBJECT_HLT,       (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Object datablocks");
413                 uiDefIconButBitS(block, TOG, OOPS_ME, B_NEWOOPS, ICON_MESH_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Mesh datablocks");
414                 uiDefIconButBitS(block, TOG, OOPS_CU, B_NEWOOPS, ICON_CURVE_HLT,        (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Curve/Surface/Font datablocks");
415                 uiDefIconButBitS(block, TOG, OOPS_MB, B_NEWOOPS, ICON_MBALL_HLT,        (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Metaball datablocks");
416                 uiDefIconButBitS(block, TOG, OOPS_LT, B_NEWOOPS, ICON_LATTICE_HLT,      (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Lattice datablocks");
417                 uiDefIconButBitS(block, TOG, OOPS_LA, B_NEWOOPS, ICON_LAMP_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Lamp datablocks");
418                 uiDefIconButBitS(block, TOG, OOPS_MA, B_NEWOOPS, ICON_MATERIAL_HLT,     (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Material datablocks");
419                 uiDefIconButBitS(block, TOG, OOPS_TE, B_NEWOOPS, ICON_TEXTURE_HLT,      (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Texture datablocks");
420                 uiDefIconButBitS(block, TOG, OOPS_IP, B_NEWOOPS, ICON_IPO_HLT,  (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Ipo datablocks");
421                 uiDefIconButBitS(block, TOG, OOPS_IM, B_NEWOOPS, ICON_IMAGE_HLT,        (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Image datablocks");
422                 uiDefIconButBitS(block, TOG, OOPS_LI, B_NEWOOPS, ICON_LIBRARY_HLT,      (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Library datablocks");
423
424                 uiBlockEndAlign(block);
425           
426                 /* name */
427                 if(G.soops->lockpoin) {
428                         oops= G.soops->lockpoin;
429                         if(oops->type==ID_LI) strcpy(naam, ((Library *)oops->id)->name);
430                         else strcpy(naam, oops->id->name);
431                         
432                         cpack(0x0);
433                         glRasterPos2i(xco+=XIC+10,      5);
434                         BMF_DrawString(uiBlockGetCurFont(block), naam);
435
436                 }
437         }
438 #ifdef SHOWDEPGRAPH
439         else if(soops->type==SO_DEPSGRAPH) {
440                 // cpack colors : 0x00FF00 0xFF0000 0xFFFF00 0x000000 0x0000FF 0x00FFFF
441                 static unsigned char colr[21] ={0x00, 0xFF, 0x00, 
442                                                                                 0x00, 0x00, 0xFF,
443                                                                                 0x00, 0xFF, 0xFF,
444                                                                                 0x00, 0x00, 0x00,
445                                                                                 0xFF, 0x00, 0x00,
446                                                                                 0xFF, 0xFF, 0x00,
447                                                                                 0xFF, 0x00, 0x00};
448                 
449                 uiDefButC(      block, COL, 0, "", (short)(xco+=10),0, 5,YIC, colr, 0, 1, 0, 0,  "");
450                 uiDefButS(      block, TOG|BIT|2, B_REDR, "parent", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "parent");
451                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+3, 0, 1, 0, 0,  "");
452                 uiDefButS(      block, TOG|BIT|1, B_REDR, "data", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "data");
453                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+6, 0, 1, 0, 0,  "");
454                 uiDefButS(      block, TOG|BIT|3, B_REDR, "track", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "track");
455                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+9, 0, 1, 0, 0,  "");
456                 uiDefButS(      block, TOG|BIT|4, B_REDR, "path", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "path");
457                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+12, 0, 1, 0, 0,  "");
458                 uiDefButS(      block, TOG|BIT|5, B_REDR, "cons.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "constraint");
459                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+15, 0, 1, 0, 0,  "");
460                 uiDefButS(      block, TOG|BIT|6, B_REDR, "hook.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "hook");
461                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+18, 0, 1, 0, 0,  "");
462                 uiDefButS(      block, TOG|BIT|7, B_REDR, "d cons.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "d cons");
463         } 
464 #endif
465         else {
466                 uiDefButS(block, MENU, B_REDR, "Outliner Display%t|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Same Types %x5|Selected %x3|Active %x4",  xco, 0, 100, 20,  &soops->outlinevis, 0, 0, 0, 0, "");
467         }
468         
469         /* always do as last */
470         curarea->headbutlen= xco+2*XIC;
471
472         uiDrawBlock(block);
473 }
474