1da5dc6100f4c53ab51c1751964233f9fb08af8e
[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 static int viewmovetemp = 0;
75
76 void do_oops_buttons(short event)
77 {
78         float dx, dy;
79         
80         if(curarea->win==0) return;
81
82         switch(event) {
83         case B_OOPSHOME:
84                 init_v2d_oops(curarea, curarea->spacedata.first);       // forces min/max to be reset
85                 boundbox_oops();
86                 G.v2d->cur= G.v2d->tot;
87                 dx= 0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin);
88                 dy= 0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin);
89                 G.v2d->cur.xmin-= dx;
90                 G.v2d->cur.xmax+= dx;
91                 G.v2d->cur.ymin-= dy;
92                 G.v2d->cur.ymax+= dy;           
93                 test_view2d(G.v2d, curarea->winx, curarea->winy);
94                 scrarea_queue_winredraw(curarea);
95                 break;
96
97         case B_NEWOOPS:
98                 scrarea_queue_winredraw(curarea);
99                 scrarea_queue_headredraw(curarea);
100                 G.soops->lockpoin= 0;
101                 break;
102         }
103 }
104
105 static void do_oops_viewmenu(void *arg, int event)
106 {
107
108         switch(event) {
109         case 0: /* Shuffle Selected Blocks */
110                 shuffle_oops();
111                 break;
112         case 1: /* Shrink Selected Blocks */
113         shrink_oops();
114         break;
115     case 2: /* View All */
116                 do_oops_buttons(B_OOPSHOME);
117                 break;
118         case 3: /* Maximize Window */
119                 /* using event B_FULL */
120                 break;
121         case 4: /* show outliner */
122                 {
123                         SpaceOops *soops= curarea->spacedata.first;
124                         if(soops->type==SO_OOPS || soops->type==SO_DEPSGRAPH) soops->type= SO_OUTLINER;
125                         else soops->type= SO_OOPS;
126                         init_v2d_oops(curarea, soops);
127                         test_view2d(G.v2d, curarea->winx, curarea->winy);
128                         scrarea_queue_winredraw(curarea);
129                 }
130                 break;
131         case 5:
132                 outliner_toggle_visible(curarea);
133                 break;
134         case 6:
135                 outliner_show_hierarchy(curarea);
136                 break;
137         case 7:
138                 outliner_show_active(curarea);
139                 break;
140         case 8:
141                 outliner_one_level(curarea, 1);
142                 break;
143         case 9:
144                 outliner_one_level(curarea, -1);
145                 break;
146 #ifdef SHOWDEPGRAPH
147         case 10:
148                 // show deps
149                 {
150                         SpaceOops *soops= curarea->spacedata.first;
151                         if(soops->type==SO_OOPS) {
152                                 soops->type= SO_DEPSGRAPH;
153                                 soops->deps_flags = DAG_RL_ALL_BUT_DATA_MASK;
154                         } else 
155                                 soops->type= SO_OOPS;
156                         init_v2d_oops(curarea, soops);
157                         test_view2d(G.v2d, curarea->winx, curarea->winy);
158                         scrarea_queue_winredraw(curarea);
159                 }
160                 break;
161 #endif
162         }
163 }                       
164
165 static uiBlock *oops_viewmenu(void *arg_unused)
166 {
167         SpaceOops *soops= curarea->spacedata.first;
168         uiBlock *block;
169         short yco= 0, menuwidth=120;
170         
171         block= uiNewBlock(&curarea->uiblocks, "oops_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
172         uiBlockSetButmFunc(block, do_oops_viewmenu, NULL);
173         
174         if(soops->type==SO_OOPS) {
175                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Outliner", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
176 #ifdef SHOWDEPGRAPH
177                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Dependancies", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
178 #endif
179                 uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
180
181                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shuffle Selected Blocks|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
182                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink Selected Blocks|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
183
184                 uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
185
186                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
187         }
188 #ifdef SHOWDEPGRAPH
189         else if(soops->type==SO_DEPSGRAPH) {
190                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Outliner", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
191                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Oops Schematic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
192         }
193 #endif
194         else {
195                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Oops Schematic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
196                 
197                 uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
198                 
199                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Expand One Level|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
200                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse One Level|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
201                 
202                 uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
203
204                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show/Hide All", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
205                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hierarchy|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
206                 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Active|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
207         }
208         
209         uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");  
210         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, 3, "");
211         else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
212         
213         if(curarea->headertype==HEADERTOP) {
214                 uiBlockSetDirection(block, UI_DOWN);
215         }
216         else {
217                 uiBlockSetDirection(block, UI_TOP);
218                 uiBlockFlipOrder(block);
219         }
220
221         uiTextBoundsBlock(block, 50);
222         
223         return block;
224 }
225
226
227 static void do_oops_selectmenu(void *arg, int event)
228 {       
229
230         switch(event)
231         {
232         case 0: /* Border Select */
233                 borderselect_oops();
234                 break;
235         case 1: /* Select/Deselect All */
236                 swap_select_all_oops();
237                 break;
238         case 2: /* Linked to Selected */
239                 select_linked_oops();
240                 break;
241         case 3: /* Users of Selected */
242                 select_backlinked_oops();
243                 break;
244         }
245 }
246
247 static uiBlock *oops_selectmenu(void *arg_unused)
248 {
249         uiBlock *block;
250         short yco= 0, menuwidth=120;
251
252         block= uiNewBlock(&curarea->uiblocks, "oops_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
253         uiBlockSetButmFunc(block, do_oops_selectmenu, NULL);
254
255         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
256         
257         uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
258
259         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
260
261         uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");    
262
263         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked to Selected|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
264         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Users of Selected|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
265
266         if(curarea->headertype==HEADERTOP) {
267                 uiBlockSetDirection(block, UI_DOWN);
268         }
269         else {
270                 uiBlockSetDirection(block, UI_TOP);
271                 uiBlockFlipOrder(block);
272         }
273
274         uiTextBoundsBlock(block, 50);
275
276         return block;
277 }
278
279 static void do_oops_blockmenu(void *arg, int event)
280 {       
281         switch(event)
282         {
283         case 0: /* grab/move */
284                 transform_oops('g', 0);
285                 break;
286         case 1: /* scale */
287                 transform_oops('s', 0);
288                 break;
289         }
290 }
291
292 static uiBlock *oops_blockmenu(void *arg_unused)
293 {
294         uiBlock *block;
295         short yco= 0, menuwidth=120;
296
297         block= uiNewBlock(&curarea->uiblocks, "oops_blockmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
298         uiBlockSetButmFunc(block, do_oops_blockmenu, NULL);
299
300         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
301         uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
302
303         if(curarea->headertype==HEADERTOP) {
304                 uiBlockSetDirection(block, UI_DOWN);
305         }
306         else {
307                 uiBlockSetDirection(block, UI_TOP);
308                 uiBlockFlipOrder(block);
309         }
310
311         uiTextBoundsBlock(block, 50);
312
313         return block;
314 }
315
316
317 void oops_buttons(void)
318 {       
319         SpaceOops *soops;
320         Oops *oops;
321         uiBlock *block;
322         short xco, xmax;
323         char naam[256];
324
325         soops= curarea->spacedata.first;
326
327         sprintf(naam, "header %d", curarea->headwin);
328         block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
329
330         if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
331         else uiBlockSetCol(block, TH_HEADERDESEL);
332
333         curarea->butspacetype= SPACE_OOPS;
334
335         xco = 8;
336         
337         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.");
338
339         xco+= XIC+14;
340
341         uiBlockSetEmboss(block, UI_EMBOSSN);
342         if(curarea->flag & HEADER_NO_PULLDOWN) {
343                 uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
344                                 xco,2,XIC,YIC-2,
345                                 &(curarea->flag), 0, 0, 0, 0, "Show pulldown menus");
346         } else {
347                 uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
348                                 xco,2,XIC,YIC-2,
349                                 &(curarea->flag), 0, 0, 0, 0, "Hide pulldown menus");
350         }
351         uiBlockSetEmboss(block, UI_EMBOSS);
352         xco+=XIC;
353
354         if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
355                 /* pull down menus */
356                 uiBlockSetEmboss(block, UI_EMBOSSP);
357         
358                 xmax= GetButStringLength("View");
359                 uiDefPulldownBut(block, oops_viewmenu, NULL, "View", xco, -2, xmax-3, 24, "");
360                 xco+= xmax;
361                 
362                 if(soops->type==SO_OOPS) {
363                         xmax= GetButStringLength("Select");
364                         uiDefPulldownBut(block, oops_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
365                         xco+= xmax;
366                         
367                         xmax= GetButStringLength("Block");
368                         uiDefPulldownBut(block, oops_blockmenu, NULL, "Block", xco, -2, xmax-3, 24, "");
369                         xco+= xmax;
370                 }
371         }
372
373         uiBlockSetEmboss(block, UI_EMBOSS);
374
375         if(soops->type==SO_OOPS) {
376                 /* ZOOM and BORDER */
377                 uiBlockBeginAlign(block);
378                 uiDefIconButI(block, TOG, B_VIEW2DZOOM, ICON_VIEWZOOM,  (short)(xco),0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Zooms view (Ctrl MiddleMouse)");
379                 uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE,  (short)(xco+=XIC),0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to area");
380                 uiBlockEndAlign(block);
381                 
382                 xco+= 8;
383                 
384                 /* VISIBLE */
385                 uiBlockBeginAlign(block);
386                 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");
387                 xco+= 20;
388                 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");
389                 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");
390                 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");
391                 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");
392                 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");
393                 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");
394                 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");
395                 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");
396                 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");
397                 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");
398                 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");
399                 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");
400
401                 uiBlockEndAlign(block);
402           
403                 /* name */
404                 if(G.soops->lockpoin) {
405                         oops= G.soops->lockpoin;
406                         if(oops->type==ID_LI) strcpy(naam, ((Library *)oops->id)->name);
407                         else strcpy(naam, oops->id->name);
408                         
409                         cpack(0x0);
410                         glRasterPos2i(xco+=XIC+10,      5);
411                         BMF_DrawString(uiBlockGetCurFont(block), naam);
412
413                 }
414         }
415 #ifdef SHOWDEPGRAPH
416         else if(soops->type==SO_DEPSGRAPH) {
417                 // cpack colors : 0x00FF00 0xFF0000 0xFFFF00 0x000000 0x0000FF 0x00FFFF
418                 static unsigned char colr[21] ={0x00, 0xFF, 0x00, 
419                                                                                 0x00, 0x00, 0xFF,
420                                                                                 0x00, 0xFF, 0xFF,
421                                                                                 0x00, 0x00, 0x00,
422                                                                                 0xFF, 0x00, 0x00,
423                                                                                 0xFF, 0xFF, 0x00,
424                                                                                 0xFF, 0x00, 0x00};
425                 
426                 uiDefButC(      block, COL, 0, "", (short)(xco+=10),0, 5,YIC, colr, 0, 1, 0, 0,  "");
427                 uiDefButS(      block, TOG|BIT|2, B_REDR, "parent", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "parent");
428                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+3, 0, 1, 0, 0,  "");
429                 uiDefButS(      block, TOG|BIT|1, B_REDR, "data", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "data");
430                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+6, 0, 1, 0, 0,  "");
431                 uiDefButS(      block, TOG|BIT|3, B_REDR, "track", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "track");
432                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+9, 0, 1, 0, 0,  "");
433                 uiDefButS(      block, TOG|BIT|4, B_REDR, "path", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "path");
434                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+12, 0, 1, 0, 0,  "");
435                 uiDefButS(      block, TOG|BIT|5, B_REDR, "cons.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "constraint");
436                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+15, 0, 1, 0, 0,  "");
437                 uiDefButS(      block, TOG|BIT|6, B_REDR, "hook.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "hook");
438                 uiDefButC(      block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+18, 0, 1, 0, 0,  "");
439                 uiDefButS(      block, TOG|BIT|7, B_REDR, "d cons.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0,  "d cons");
440         } 
441 #endif
442         else {
443                 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, "");
444         }
445         
446         /* always do as last */
447         curarea->headbutlen= xco+2*XIC;
448
449         uiDrawBlock(block);
450 }
451