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