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