Another mega commit... loadsof restructure, and a pretty good one! :)
authorTon Roosendaal <ton@blender.org>
Mon, 20 Oct 2003 15:40:20 +0000 (15:40 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 20 Oct 2003 15:40:20 +0000 (15:40 +0000)
- changed the BIF_DrawString() function. it used to work different for
  AA fonts  as for default fonts. Now it's identical. Setting color for fonts
  can just be done with OpenGL, for both font types.
  Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color

- removed entirely the silly old color system (BIFColorID). All color
  calls can now be done with a BIF_ThemeColor() call, including fonts and
  buttons and opengl stuff

- all buttons in button header have headercolor by default

- recoded drawing icons, it was a really bad & old loop doing manually
  colorshading and blending... which was per pixel a load of code!
  Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
  but have a different alpha to blend in (when not active)

- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
  1. main drawing function for text and icons
  2. free definable callback for button itself
  3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
  callback system

- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
  UI_EMBOSS : the themable drawing style
  UI_EMBOSSP: the pulldown menu system (apart from color not themable)
  UI_EMBOSSN: draw nothing, only text and/or icon
  UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
  this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.

TODO: make UI API call for button alignment

(plus removed another series of warnings from code...)

Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'

44 files changed:
source/blender/ftfont/FTF_Api.h
source/blender/ftfont/intern/FTF_Api.cpp
source/blender/ftfont/intern/FTF_TTFont.cpp
source/blender/ftfont/intern/FTF_TTFont.h
source/blender/include/BIF_interface.h
source/blender/include/BIF_language.h
source/blender/include/BIF_resources.h
source/blender/include/interface.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/src/buttons_editing.c
source/blender/src/buttons_logic.c
source/blender/src/buttons_object.c
source/blender/src/buttons_scene.c
source/blender/src/buttons_script.c
source/blender/src/buttons_shading.c
source/blender/src/drawaction.c
source/blender/src/drawimasel.c
source/blender/src/drawipo.c
source/blender/src/drawobject.c
source/blender/src/drawview.c
source/blender/src/editscreen.c
source/blender/src/filesel.c
source/blender/src/header_action.c
source/blender/src/header_buttonswin.c
source/blender/src/header_filesel.c
source/blender/src/header_image.c
source/blender/src/header_imasel.c
source/blender/src/header_info.c
source/blender/src/header_ipo.c
source/blender/src/header_nla.c
source/blender/src/header_oops.c
source/blender/src/header_seq.c
source/blender/src/header_sound.c
source/blender/src/header_text.c
source/blender/src/header_view3d.c
source/blender/src/headerbuttons.c
source/blender/src/interface.c
source/blender/src/interface_draw.c [new file with mode: 0644]
source/blender/src/interface_panel.c
source/blender/src/language.c
source/blender/src/resources.c
source/blender/src/space.c
source/blender/src/toolbox.c
source/blender/src/view.c

index 4fa97f0acba4eeafd3754dd14461c5dffa4795cb..5272697c777be0cd338f42e7ac36958ba821574a 100644 (file)
@@ -88,16 +88,8 @@ FTF_EXPORT void FTF_TransConvString(char* str, char* ustr, unsigned int flag);
  * @param mode flag to forward to FTF_TransConvString()
  * @return Width drawing
  */
-FTF_EXPORT float FTF_DrawString(char* str, unsigned int flag, int select);
+FTF_EXPORT float FTF_DrawString(char* str, unsigned int flag);
 
-/**
- * Draws a string at the current raster postion with rgb coloring.
- * @param str The string to draw
- * @param rgb Floats to manipulate the the glyph pixmap coloring.
- * @param mode flag to forward to FTF_TransConvString()
- * @return Width drawing
- */
-FTF_EXPORT float FTF_DrawStringRGB(char* str, unsigned int flag, float r, float g, float b);
 
 /**
  * Get a character width
index ac158ae191fba8f2a8dbc0fbc38724f8e6962db9..42fac0c406191e4307a9f248d50ee572d4df9015 100644 (file)
@@ -84,15 +84,10 @@ FTF_EXPORT float FTF_DrawCharacter(char c, unsigned int flag)
 */
 
 
-FTF_EXPORT float FTF_DrawString(char* str, unsigned int flag, int select)
+/* does color too, using glGet */
+FTF_EXPORT float FTF_DrawString(char* str, unsigned int flag)
 {
-       return ttfont.DrawString(str, flag, select);
-}
-
-
-FTF_EXPORT float FTF_DrawStringRGB(char* str, unsigned int flag, float r, float g, float b)
-{
-       return ttfont.DrawStringRGB(str, flag, r, g, b);
+       return ttfont.DrawString(str, flag);
 }
 
 
index 6f50c2e084178cb8a6106b2ba8a19e7318230044..3233082cca7bec43e2375b1302576debf95275fd 100644 (file)
@@ -225,12 +225,12 @@ int FTF_TTFont::GetSize(void)
 
 int FTF_TTFont::Ascender(void)
 {
-       return font->Ascender();
+       return (int)font->Ascender();
 }
 
 int FTF_TTFont::Descender(void)
 {
-       return font->Descender();
+       return (int)font->Descender();
 }
 
 
@@ -240,8 +240,9 @@ int FTF_TTFont::TransConvString(char* str, char* ustr, unsigned int flag)
 }
 
 
-float FTF_TTFont::DrawString(char* str, unsigned int flag, int select)
+float FTF_TTFont::DrawString(char* str, unsigned int flag)
 {
+       float color[4];
        wchar_t wstr[FTF_MAX_STR_SIZE-1]={'\0'};
        int len=0;
   
@@ -250,37 +251,11 @@ float FTF_TTFont::DrawString(char* str, unsigned int flag, int select)
        else 
                len=utf8towchar(wstr,str);
 
-       if(!select) {
-               glPixelTransferf(GL_RED_SCALE, 0.0);
-               glPixelTransferf(GL_GREEN_SCALE, 0.0);
-               glPixelTransferf(GL_BLUE_SCALE, 0.0);
-       }
+       glGetFloatv(GL_CURRENT_COLOR, color);
        
-       font->Render(wstr);
-  
-       if(!select) {
-               glPixelTransferf(GL_RED_SCALE, 1.0);
-               glPixelTransferf(GL_GREEN_SCALE, 1.0);
-               glPixelTransferf(GL_BLUE_SCALE, 1.0);
-       }
-
-       return font->Advance(wstr);
-}
-
-
-float FTF_TTFont::DrawStringRGB(char* str, unsigned int flag, float r, float g, float b)
-{
-       wchar_t wstr[FTF_MAX_STR_SIZE-1]={'\0'};
-       int len=0;
-  
-       if (FTF_USE_GETTEXT & flag) 
-               len=utf8towchar(wstr,gettext(str));
-       else 
-               len=utf8towchar(wstr,str);
-
-       glPixelTransferf(GL_RED_SCALE, r);
-       glPixelTransferf(GL_GREEN_SCALE, g);
-       glPixelTransferf(GL_BLUE_SCALE, b);
+       glPixelTransferf(GL_RED_SCALE, color[0]);
+       glPixelTransferf(GL_GREEN_SCALE, color[1]);
+       glPixelTransferf(GL_BLUE_SCALE, color[2]);
        
        font->Render(wstr);
   
index 9492e326a7ef57754ebcb33da31fd0ed314251b7..e4cdfd75b16d67116e4809971863a5c24fe21e2d 100644 (file)
@@ -68,13 +68,11 @@ public:
        int TransConvString(char* str, char* ustr, unsigned int flag);
 
        /**
-        * Draws a string at the current raster position.
+        * Draws a string at the current raster position in current opengl color.
         * @param str   The string to draw.
         * @param flag  Whether use gettext and UTF8 or system encoding.
         */
-       float DrawString(char* str, unsigned int flag, int select);
-//     float DrawString(char* str, unsigned char r, unsigned char g, unsigned char b, unsigned int flag);
-       float DrawStringRGB(char* str, unsigned int flag, float r, float g, float b);
+       float DrawString(char* str, unsigned int flag);
 
        float GetStringWidth(char* str, unsigned int flag);
 
index 579810a59036fec78bac2e1eeb2afea604cfd6dd..60c5fab0e063d69f8e6ceb0070f30528d77dfd9d 100644 (file)
@@ -38,18 +38,12 @@ struct ListBase;
 struct ScrArea;
 
 /* uiBlock->dt */
-#define UI_EMBOSSX             0       /* Rounded embossed button */
-#define UI_EMBOSSW             1       /* Flat bordered button */
-#define UI_EMBOSSN             2       /* No border */
-
-#define UI_EMBOSSM             4       /* Colored Border */
-#define UI_EMBOSSP             5       /* Borderless coloured button */
-#define UI_EMBOSSA             6       /* same as EMBOSSX but with arrows to simulate */
-#define UI_EMBOSSTABL  7
-#define UI_EMBOSSTABM  8
-#define UI_EMBOSSTABR  9
-#define UI_EMBOSST             10
-#define UI_EMBOSSMB            11      /* emboss menu button */
+#define UI_EMBOSS              0       /* use one of the themes for drawing */
+#define UI_EMBOSSN             1       /* Nothing */
+#define UI_EMBOSSM             2       /* Minimal builtin emboss, also for logic buttons */
+#define UI_EMBOSSP             3       /* Pulldown */
+
+#define UI_EMBOSSX             0       /* for a python file, which i can't change.... duh! */
 
 /* uiBlock->direction */
 #define UI_TOP         0
index 91cdc18673d1a54dbee705fa96908923d31e1124..414207c2e44ffc53a82e248c17cd965ca43985bc 100644 (file)
@@ -45,8 +45,7 @@ void lang_setlanguage(void);          /* usiblender.c */
 char *language_pup(void);
 char *fontsize_pup(void);
 
-int BIF_DrawString(struct BMF_Font* font, char *str, int translate, int col);
-int BIF_DrawStringRGB(struct BMF_Font* font, char *str, int translate, float r, float g, float b);
+int BIF_DrawString(struct BMF_Font* font, char *str, int translate);
 float BIF_GetStringWidth(struct BMF_Font* font, char *str, int translate);
 
 #endif /* BIF_LANGUAGE_H */
index f329dffea177c613928dc81a4a70c40c9d4df2dc..78cef040fde142a9fbc024b8b0bd75bbff24fead 100644 (file)
@@ -258,87 +258,41 @@ typedef enum {
 #define BIFNICONIDS                    (BIFICONID_LAST-BIFICONID_FIRST + 1)
 } BIFIconID;
 
-typedef enum {
-#define BIFCOLORSHADE_FIRST    (COLORSHADE_DARK)
-       COLORSHADE_DARK,
-       COLORSHADE_GREY,
-       COLORSHADE_LGREY,
-       COLORSHADE_LMEDIUM,
-       COLORSHADE_MEDIUM,
-       COLORSHADE_HILITE,
-       COLORSHADE_LIGHT,
-       COLORSHADE_WHITE,
-       
-#define BIFCOLORSHADE_LAST     (COLORSHADE_WHITE)
-#define BIFNCOLORSHADES                (BIFCOLORSHADE_LAST-BIFCOLORSHADE_FIRST + 1)
-} BIFColorShade;
-
-typedef enum {
-#define BIFCOLORID_FIRST       (BUTGREY)
-       BUTGREY,
-       BUTGREEN,
-       BUTBLUE,
-       BUTSALMON,
-       MIDGREY,
-       BUTPURPLE,
-       BUTYELLOW,
-       REDALERT,
-       BUTRUST,
-       BUTWHITE,
-       BUTDBLUE,
-       BUTPINK,
-       BUTDPINK,
-       BUTMACTIVE,
-
-       ACTIONBUTCOL,
-       NUMBUTCOL,
-       TEXBUTCOL,
-       TOGBUTCOL,
-       SLIDERCOL,
-       TABCOL,
-       MENUCOL,
-       MENUACTIVECOL,
-
-       BUTIPO,
-       BUTAUDIO,
-       BUTCAMERA,
-       BUTRANDOM,
-       BUTEDITOBJECT,
-       BUTPROPERTY,
-       BUTSCENE,
-       BUTMOTION,
-       BUTMESSAGE,
-       BUTACTION,
-       BUTCD,
-       BUTGAME,
-       BUTVISIBILITY,
-       BUTYUCK,
-       BUTSEASICK,
-       BUTCHOKE,
-       
-       HEADERCOL,
-       HEADERCOLSEL,
-       
-       BUTIMPERIAL,
-#define BIFCOLORID_LAST                (BUTIMPERIAL)
-#define BIFNCOLORIDS           (BIFCOLORID_LAST-BIFCOLORID_FIRST + 1)
-} BIFColorID;
-
 
 /* ---------- theme ----------- */
 
+enum {
+       TH_AUTO,        /* for buttons, to signal automatic color assignment */
+       
 // uibutton colors
-
-
-#define TH_THEMEUI     99
-
+       TH_BUT_NEUTRAL,
+       TH_BUT_ACTION,
+       TH_BUT_SETTING,
+       TH_BUT_SETTING1,
+       TH_BUT_SETTING2,
+       TH_BUT_NUM,
+       TH_BUT_TEXTFIELD,
+       TH_BUT_POPUP,
+       TH_BUT_TEXT,
+       TH_BUT_TEXT_HI,
+       TH_MENU_BACK,
+       TH_MENU_ITEM,
+       TH_MENU_HILITE,
+       TH_MENU_TEXT,
+       TH_MENU_TEXT_HI,
+       
+       TH_BUT_DRAWTYPE,
+       
+       TH_REDALERT,
+       
+       TH_THEMEUI,
 // common colors among spaces
-
-enum {
-       TH_BACK = 100,
+       
+       TH_BACK,
        TH_TEXT,
        TH_TEXT_HI,
        TH_HEADER,
+       TH_HEADERDESEL,
        TH_PANEL,
        TH_SHADE1,
        TH_SHADE2,
@@ -377,7 +331,8 @@ void        BIF_ThemeColorShade(int colorid, int offset);
 void   BIF_ThemeColorBlend(int colorid1, int colorid2, float fac);
 
 // returns one value, not scaled
-float  BIF_GetThemeColorf(int colorid);
+float  BIF_GetThemeValuef(int colorid);
+int    BIF_GetThemeValue(int colorid);
 
 // get three color values, scaled to 0.0-1.0 range
 void   BIF_GetThemeColor3fv(int colorid, float *col);
@@ -398,9 +353,7 @@ void        BIF_resources_free              (void);
 int            BIF_get_icon_width              (BIFIconID icon);
 int            BIF_get_icon_height             (BIFIconID icon);
 void   BIF_draw_icon                   (BIFIconID icon);
-void   BIF_draw_icon_blended   (BIFIconID icon, BIFColorID color, BIFColorShade shade);
-
-void   BIF_set_color                   (BIFColorID color, BIFColorShade shade);
+void   BIF_draw_icon_blended   (BIFIconID icon, int colorid, int shade);
 
 /* only for buttons in theme editor! */
 char   *BIF_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
index b9cbbbc5332094df777dd7cec8b73ba96823a2b7..02fdd9c2e25bcf0f78ae59d490a045dbe406c327 100644 (file)
@@ -128,16 +128,18 @@ struct uiBut {
        void *func_arg1;
        void *func_arg2;
 
-       void (*embossfunc)(BIFColorID, float, float, float, float, float, int);
+       void (*embossfunc)(int , int , float, float, float, float, float, int);
+       void (*sliderfunc)(int , float, float, float, float, float, float, int);
 
        uiLink *link;
        
        char *tip, *lockstr;
 
-       BIFColorID col;
+       int themecol;   /* themecolor id */
        void *font;
 
        BIFIconID icon;
+       short but_align;        /* aligning buttons, horiz/vertical */
        short lock, win;
        short iconadd;
 
@@ -179,7 +181,8 @@ struct uiBlock {
        /* extra draw function for custom blocks */
        void (*drawextra)();
 
-       BIFColorID col;
+       int themecol;   /* themecolor id */
+       short but_align;        /* aligning buttons, horiz/vertical */
        short font;     /* indices */
        int afterval;
        void *curfont;
@@ -195,6 +198,7 @@ struct uiBlock {
 
 /* interface.c */
 extern void ui_check_but(uiBut *but);
+extern double ui_get_but_val(uiBut *but);
 extern void ui_autofill(uiBlock *block);
 extern void ui_graphics_to_window(int win, float *x, float *y);
 extern void ui_window_to_graphics(int win, float *x, float *y);
@@ -203,7 +207,9 @@ extern void ui_window_to_graphics(int win, float *x, float *y);
 extern void ui_draw_panel(uiBlock *block);
 extern void ui_do_panel(uiBlock *block, uiEvent *uevent);
 
-
+/* interface_draw.c */
+extern void ui_set_embossfunc(uiBut *but, int drawtype);
+extern void ui_draw_but(uiBut *but);
 
 
 #endif
index da4799e48a1aed458c6a4fd8afa84d1d9e13b8fa..0fef8490b797fd79b0591929867db2acc0e91d65 100644 (file)
 // global, button colors
 
 typedef struct ThemeUI {
-       char back[4];
+       char neutral[4];
+       char action[4];
+       char setting[4];
+       char setting1[4];
+       char setting2[4];
+       char num[4];
+       char textfield[4];
+       char popup[4];
        char text[4];
+       char text_hi[4];
+       char menu_back[4];
+       char menu_item[4];
+       char menu_hilite[4];
+       char menu_text[4];
+       char menu_text_hi[4];
+
+       char but_drawtype, pad;
+       short pad1;
 
 } ThemeUI;
 
index 83611318cb4987bb7b0aa0e7e63154a72635893d..315325358b22ad597fb9fcb161e230b706f3c716 100644 (file)
@@ -370,21 +370,18 @@ static void editing_panel_mesh_type(Object *ob, Mesh *me)
        uiBlock *block;
        float val;
        
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_type", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_type", UI_EMBOSS, UI_HELV, curarea->win);
        if( uiNewPanel(curarea, block, "Mesh", "Editing", 320, 0, 318, 204)==0) return;
 
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, TOG|BIT|5, REDRAWVIEW3D, "Auto Smooth",10,178,130,17, &me->flag, 0, 0, 0, 0, "Treats all faces with angles less than Degr: as 'smooth' during render");
-       uiBlockSetCol(block, BUTGREY);
+
        uiDefButS(block, NUM, B_DIFF, "Degr:",                                  10,156,130,17, &me->smoothresh, 1, 80, 0, 0, "Defines maximum angle between face normals that 'Auto Smooth' will operate on");
-       uiBlockSetCol(block, BUTGREEN);
+
        uiDefButS(block, TOG|BIT|7, B_MAKEDISP, "SubSurf",              10,124,130,17, &me->flag, 0, 0, 0, 0, "Treats the active object as a Catmull-Clark Subdivision Surface");
-       uiBlockSetCol(block, BUTGREY);
+
        uiDefButS(block, NUM, B_MAKEDISP, "Subdiv:",                    10,104,100,18, &me->subdiv, 0, 12, 0, 0, "Defines the level of subdivision to display in real time interactively");
        uiDefButS(block, NUM, B_MAKEDISP, "",                                   110, 104, 30, 18, &me->subdivr, 0, 12, 0, 0, "Defines the level of subdivision to apply during rendering");
        
-       uiBlockSetCol(block, BUTSALMON);
-       
        if(me->msticky) val= 1.0; else val= 0.0;
        uiDefBut(block, LABEL, 0, "Sticky", 10,57,70,20, 0, val, 0, 0, 0, "");
        if(me->msticky==0) {
@@ -416,15 +413,14 @@ static void editing_panel_mesh_type(Object *ob, Mesh *me)
                if( (dl=ob->disp.first) && dl->mesh);
                else decim_faces= tottria;
        
-               uiBlockSetCol(block, BUTPURPLE);
+               uiBlockSetCol(block, TH_BUT_SETTING2);
                uiDefButI(block, NUMSLI,B_DECIM_FACES, "Decimator: ",   173,176,233,19, &decim_faces, 4.0, tottria, 10, 10, "Defines the number of triangular faces to decimate the active Mesh object to");
-               uiBlockSetCol(block, BUTSALMON);
+               uiBlockSetCol(block, TH_AUTO);
                uiDefBut(block, BUT,B_DECIM_CANCEL, "Cancel",   290,156,116,18, 0, 0, 0, 0, 0, "Restores the Mesh to its original number of faces");
                uiDefBut(block, BUT,B_DECIM_APPLY, "Apply",             173,156,115,18, 0, 0, 0, 0, 0, "Applies the decimation to the active Mesh object");
        }
 
        
-       uiBlockSetCol(block, BUTGREY);
        uiDefIDPoinBut(block, test_meshpoin_but, 0, "TexMesh: ",        174,120,234,19, &me->texcomesh, "Enter the name of a Meshblock");
 
        if(me->key) {
@@ -432,17 +428,13 @@ static void editing_panel_mesh_type(Object *ob, Mesh *me)
                uiDefButS(block, TOG, B_RELKEY, "Relative Keys",                174,55,100,19, &me->key->type, 0, 0, 0, 0, "");
        }
 
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT, B_SLOWERDRAW,"SlowerDraw",                 174,35,100,19, 0, 0, 0, 0, 0, "Displays the active object with all possible edges shown");
        uiDefBut(block, BUT, B_FASTERDRAW,"FasterDraw",                 175,15,100,19, 0, 0, 0, 0, 0, "Displays the active object faster by omitting some edges when drawing");
 
-
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT,B_DOCENTRE, "Centre",                                       275, 95, 133, 19, 0, 0, 0, 0, 0, "Shifts object data to be centered about object's origin");
        uiDefBut(block, BUT,B_DOCENTRENEW, "Centre New",                        275, 75, 133, 19, 0, 0, 0, 0, 0, "Shifts object's origin to center of object data");
        uiDefBut(block, BUT,B_DOCENTRECURSOR, "Centre Cursor",          275, 55, 133, 19, 0, 0, 0, 0, 0, "Shifts object's origin to cursor location");
 
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, TOG|BIT|2, REDRAWVIEW3D, "Double Sided",       275,35,133,19, &me->flag, 0, 0, 0, 0, "Toggles selected faces as doublesided or single-sided");
        uiDefButS(block, TOG|BIT|1, REDRAWVIEW3D, "No V.Normal Flip",275,15,133,19, &me->flag, 0, 0, 0, 0, "Disables flipping of vertexnormals during render");
 
@@ -642,17 +634,14 @@ static void editing_panel_font_type(Object *ob, Curve *cu)
        char *strp;
        static int packdummy = 0;
 
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_font_type", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_font_type", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Font", "Editing", 640, 0, 318, 204)==0) return;
        
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, ROW,B_MAKEFONT, "Left",                484,139,53,18, &cu->spacemode, 0.0,0.0, 0, 0, "");
        uiDefButS(block, ROW,B_MAKEFONT, "Middle",      604,139,61,18, &cu->spacemode, 0.0,1.0, 0, 0, "");
        uiDefButS(block, ROW,B_MAKEFONT, "Right",               540,139,62,18, &cu->spacemode, 0.0,2.0, 0, 0, "");
        uiDefButS(block, ROW,B_MAKEFONT, "Flush",               665,139,61,18, &cu->spacemode, 0.0,3.0, 0, 0, "");
 
-       uiBlockSetCol(block, BUTGREY);
-
        uiDefIDPoinBut(block, test_obpoin_but, B_TEXTONCURVE, "TextOnCurve:",   484,115,243,19, &cu->textoncurve, "");
        uiDefBut(block, TEX,REDRAWVIEW3D, "Ob Family:", 484,85,243,19, cu->family, 0.0, 20.0, 0, 0, "");
 
@@ -663,11 +652,8 @@ static void editing_panel_font_type(Object *ob, Curve *cu)
        uiDefButF(block, NUM,B_MAKEFONT, "Shear:",      482,12,121,19, &cu->shear, -1.0,1.0, 10, 0, "");
        uiDefButF(block, NUM,B_MAKEFONT, "X offset:",   605,12,121,19, &cu->xof, -50.0,50.0, 10, 0, "");
 
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT, B_TOUPPER, "ToUpper",              623,163,103,23, 0, 0, 0, 0, 0, "");
        
-       uiBlockSetCol(block, BUTGREY);
-
        G.buts->texnr= give_vfontnr(cu->vfont);
        
        strp= give_vfontbutstr();
@@ -680,12 +666,10 @@ static void editing_panel_font_type(Object *ob, Curve *cu)
                packdummy = 0;
        }
        
-       uiBlockSetCol(block, BUTYELLOW);
        uiDefIconButI(block, TOG|BIT|0, B_PACKFONT, ICON_PACKAGE,       706,191,20,20, &packdummy, 0, 0, 0, 0, "Pack/Unpack this Vectorfont");
        
        MEM_freeN(strp);
        
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT,B_LOADFONT, "Load Font",    484,163,103,23, 0, 0, 0, 0, 0, "");
 
 }
@@ -859,10 +843,9 @@ static void editing_panel_curve_tools(Object *ob, Curve *cu)
        uiBlock *block;
        short *sp;
        
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_curve_tools", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_curve_tools", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Curve Tools", "Editing", 640, 0, 318, 204)==0) return;
        
-       uiBlockSetCol(block, BUTSALMON);
        if(ob->type==OB_CURVE) {
                uiDefBut(block, LABEL, 0, "Convert",    463,173,72, 18, 0, 0, 0, 0, 0, "");
                uiDefBut(block, BUT,B_CONVERTPOLY,"Poly",               467,152,72, 18, 0, 0, 0, 0, 0, "");
@@ -880,7 +863,7 @@ static void editing_panel_curve_tools(Object *ob, Curve *cu)
        uiDefBut(block, BUT,B_BEZV,"V",         670,112,50, 18, 0, 0, 0, 0, 0, "");
 
        uiDefBut(block, BUT,B_SETWEIGHT,"Set Weight",   465,11,95,49, 0, 0, 0, 0, 0, "");
-       uiBlockSetCol(block, BUTGREY);
+
        uiDefButF(block, NUM,0,"Weight:",       564,36,102,22, &editbutweight, 0.01, 10.0, 10, 0, "");
        uiDefBut(block, BUT,B_SETW1,"1.0",              669,36,50,22, 0, 0, 0, 0, 0, "");
        uiDefBut(block, BUT,B_SETW2,"sqrt(2)/4",564,11,57,20, 0, 0, 0, 0, 0, "");
@@ -909,17 +892,14 @@ static void editing_panel_curve_tools1(Object *ob, Curve *cu)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_curve_tools1", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_curve_tools1", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Curve Tools1", "Editing", 960, 0, 318, 204)==0) return;
        
-       uiBlockSetCol(block, BUTSALMON);
-
        uiDefBut(block, BUT, B_SUBDIVCURVE, "Subdivide", 400,180,150,20, 0, 0, 0, 0, 0, "");
        if(ob->type==OB_SURF) {
                uiDefBut(block, BUT, B_SPINNURB, "Spin",         400,160,150,20, 0, 0, 0, 0, 0, "");
        }
        
-       uiBlockSetCol(block, BUTGREY);
        uiDefBut(block, BUT,B_HIDE,             "Hide",                 400,120,150,18, 0, 0, 0, 0, 0, "Hides selected faces");
        uiDefBut(block, BUT,B_REVEAL,   "Reveal",               400,100,150,18, 0, 0, 0, 0, 0, "Reveals selected faces");
        uiDefBut(block, BUT,B_SELSWAP,  "Select Swap",  400,80,150,18, 0, 0, 0, 0, 0, "Selects unselected faces, and deselects selected faces");
@@ -932,21 +912,19 @@ static void editing_panel_curve_type(Object *ob, Curve *cu)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_curve_type", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_curve_type", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Curve and Surface", "Editing", 320, 0, 318, 204)==0) return;
        
        uiDefButS(block, TOG|BIT|5, 0, "UV Orco",                                       543,160,130,18, &cu->flag, 0, 0, 0, 0, "");
        if(ob->type==OB_SURF) 
                uiDefButS(block, TOG|BIT|6, REDRAWVIEW3D, "No Puno Flip",       543,140,130,18, &cu->flag, 0, 0, 0, 0, "");
 
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT,B_DOCENTRE, "Centre",                                       543, 115, 140, 19, 0, 0, 0, 0, 0, "Shifts object data to be centered about object's origin");
        uiDefBut(block, BUT,B_DOCENTRENEW, "Centre New",                        543, 95, 140, 19, 0, 0, 0, 0, 0, "Shifts object's origin to center of object data");
        uiDefBut(block, BUT,B_DOCENTRECURSOR, "Centre Cursor",          543, 75, 140, 19, 0, 0, 0, 0, 0, "Shifts object's origin to cursor location");
 
        if(ob->type==OB_SURF) {
                if(cu->key) {
-                       uiBlockSetCol(block, BUTGREEN);
                        /* uiDefButS(block, NUM, B_DIFF, "Slurph:",                     543,25,140,19, &(cu->key->slurph), -500.0, 500.0,0,0); ,""*/
                        uiDefButS(block, TOG, B_RELKEY, "Relative Keys",        543,45,140,19, &cu->key->type, 0, 0, 0, 0, "");
                }
@@ -957,29 +935,24 @@ static void editing_panel_curve_type(Object *ob, Curve *cu)
                if(ob->type==OB_CURVE) {
                        static float prlen;
                        char str[32];
-                       uiBlockSetCol(block, BUTGREY);
                        uiDefButS(block, NUM, B_RECALCPATH, "PathLen:",                 543,50,140,19, &cu->pathlen, 1.0, 9000.0, 0, 0, "");
-                       uiBlockSetCol(block, BUTGREEN);
                        uiDefButS(block, TOG|BIT|3, B_RECALCPATH, "CurvePath",  543,30,70,19 , &cu->flag, 0, 0, 0, 0, "");
                        uiDefButS(block, TOG|BIT|4, REDRAWVIEW3D, "CurveFollow",613,30,70,19, &cu->flag, 0, 0, 0, 0, "");
-                       uiBlockSetCol(block, BUTGREY);
                        sprintf(str, "%.4f", prlen);
                        uiDefBut(block, BUT, B_PRINTLEN,                "PrintLen",     543,10,70,19, 0, 0, 0, 0, 0, "");
                        uiDefBut(block, LABEL, 0, str,                                          613,10,70,19, 0, 1.0, 0, 0, 0, "");
                }
                uiDefButS(block, NUM, B_MAKEDISP, "DefResolU:", 752,163,132,21, &cu->resolu, 1.0, 128.0, 0, 0, "");
-               uiBlockSetCol(block, BUTSALMON);
                uiDefBut(block, BUT, B_SETRESOLU, "Set",                                887,163,29,21, 0, 0, 0, 0, 0, "");
                
-               uiBlockSetCol(block, BUTGREY);
                uiDefButS(block, NUM, B_MAKEDISP, "BevResol:",  753,30,163,18, &cu->bevresol, 0.0, 10.0, 0, 0, "");
 
                uiDefIDPoinBut(block, test_obcurpoin_but, B_MAKEDISP, "BevOb:",         753,10,163,18, &cu->bevobj, "");
                uiDefButF(block, NUM, B_MAKEDISP, "Width:",             753,90,163,18, &cu->width, 0.0, 2.0, 1, 0, "");
                uiDefButF(block, NUM, B_MAKEDISP, "Ext1:",              753,70,163,18, &cu->ext1, 0.0, 5.0, 10, 0, "");
                uiDefButF(block, NUM, B_MAKEDISP, "Ext2:",              753,50,163,18, &cu->ext2, 0.0, 2.0, 1, 0, "");
-               uiBlockSetCol(block, BUTBLUE);
 
+               uiBlockSetCol(block, TH_BUT_SETTING1);
                uiDefButS(block, TOG|BIT|0, B_CU3D, "3D",                       867,130,47,18, &cu->flag, 0, 0, 0, 0, "");
                uiDefButS(block, TOG|BIT|1, B_MAKEDISP, "Front",        810,130,55,18, &cu->flag, 0, 0, 0, 0, "");
                uiDefButS(block, TOG|BIT|2, B_MAKEDISP, "Back", 753,130,53,18, &cu->flag, 0, 0, 0, 0, "");
@@ -1001,7 +974,7 @@ static void editing_panel_camera_type(Object *ob, Camera *cam)
        if(G.vd) grid= G.vd->grid; 
        if(grid<1.0) grid= 1.0;
        
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_camera_type", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_camera_type", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Camera", "Editing", 320, 0, 318, 204)==0) return;
 
 
@@ -1010,19 +983,16 @@ static void editing_panel_camera_type(Object *ob, Camera *cam)
        uiDefButF(block, NUM,REDRAWVIEW3D, "ClipEnd:", 470,125,160,20, &cam->clipend, 1.0, 5000.0*grid, 100, 0, "Specify the endvalue of the the field of view");
        uiDefButF(block, NUM,REDRAWVIEW3D, "DrawSize:", 470,90,160,20, &cam->drawsize, 0.1*grid, 10.0, 10, 0, "Specify the drawsize of the camera");
 
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, TOG, REDRAWVIEW3D, "Ortho", 470,49,61,40, &cam->type, 0, 0, 0, 0, "Render orthogonally");
 
        uiDefButS(block, TOG|BIT|0,REDRAWVIEW3D, "ShowLimits", 533,69,97,20, &cam->flag, 0, 0, 0, 0, "Draw the field of view");
        uiDefButS(block, TOG|BIT|1,REDRAWVIEW3D, "Show Mist", 533,49,97,20, &cam->flag, 0, 0, 0, 0, "Draw a line that indicates the mist area");
        
        if(G.special1 & G_HOLO) {
-               uiBlockSetCol(block, BUTGREY);
                if(cam->netend==0.0) cam->netend= EFRA;
                uiDefButF(block, NUM, REDRAWVIEW3D, "Anim len",         670,80,100,20, &cam->netend, 1.0, 2500.0, 0, 0, "");
                uiDefButF(block, NUM, REDRAWVIEW3D, "Path len:",                670,160,100,20, &cam->hololen, 0.1, 25.0, 10, 0, "");
                uiDefButF(block, NUM, REDRAWVIEW3D, "Shear fac:",               670,140,100,20, &cam->hololen1, 0.1, 5.0, 10, 0, "");
-               uiBlockSetCol(block, BUTGREEN);
                uiDefButS(block, TOG|BIT|4, REDRAWVIEW3D, "Holo 1",     670,120,100,20, &cam->flag, 0.0, 0.0, 0, 0, "");
                uiDefButS(block, TOG|BIT|5, REDRAWVIEW3D, "Holo 2",     670,100,100,20, &cam->flag, 0.0, 0.0, 0, 0, "");
                
@@ -1046,7 +1016,7 @@ static void editing_panel_mball_type(Object *ob, MetaBall *mb)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_mball_type", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_mball_type", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "MetaBall", "Editing", 320, 0, 318, 204)==0) return;
        
        if (ob==find_basis_mball(ob)) {
@@ -1054,12 +1024,11 @@ static void editing_panel_mball_type(Object *ob, MetaBall *mb)
                uiDefButF(block, NUMSLI, 0, "Rendersize:",                      470,158,250,19, &mb->rendersize, 0.05, 1.0, 0, 0, "");
                uiDefButF(block, NUMSLI, B_RECALCMBALL, "Threshold:", 470,138,250,19, &mb->thresh, 0.0001, 5.0, 0, 0, "");
 
-               uiBlockSetCol(block, BUTBLUE);
+               uiBlockSetCol(block, TH_BUT_SETTING1);
                uiDefBut(block, LABEL, 0, "Update:",            471,108,120,19, 0, 0, 0, 0, 0, "");
                uiDefButS(block, ROW, B_DIFF, "Always", 471, 85, 120, 19, &mb->flag, 0.0, 0.0, 0, 0, "");
                uiDefButS(block, ROW, B_DIFF, "Half Res",       471, 65, 120, 19, &mb->flag, 0.0, 1.0, 0, 0, "");
                uiDefButS(block, ROW, B_DIFF, "Fast",           471, 45, 120, 19, &mb->flag, 0.0, 2.0, 0, 0, "");
-               uiBlockSetCol(block, BUTGREY);
        }
        
 }
@@ -1069,7 +1038,7 @@ static void editing_panel_mball_tools(Object *ob, MetaBall *mb)
        extern MetaElem *lastelem;
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_mball_tools", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_mball_tools", UI_EMBOSS, UI_HELV, curarea->win);
        if( uiNewPanel(curarea, block, "MetaBall tools", "Editing", 640, 0, 318, 204)==0) return;
        
        if(ob==G.obedit && lastelem) {
@@ -1082,7 +1051,6 @@ static void editing_panel_mball_tools(Object *ob, MetaBall *mb)
                if((lastelem->type==MB_CUBE)||(lastelem->type==MB_ELIPSOID))
                uiDefButF(block, NUMSLI, B_RECALCMBALL, "dz:",          750,118,250,19, &lastelem->expz, 0.0, 20.0, 0, 0, "");
 
-               uiBlockSetCol(block, BUTGREEN);
                uiDefButS(block, TOG|BIT|1, B_RECALCMBALL, "Negative",753,16,60,19, &lastelem->flag, 0, 0, 0, 0, "");
 
                uiDefButS(block, ROW, B_RECALCMBALL, "Ball",                    753,83,60,19, &lastelem->type, 1.0, 0.0, 0, 0, "");
@@ -1134,7 +1102,7 @@ static void editing_panel_lattice_type(Object *ob, Lattice *lt)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_lattice_type", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_lattice_type", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Latice", "Editing", 320, 0, 318, 204)==0) return;
        
 
@@ -1145,7 +1113,6 @@ static void editing_panel_lattice_type(Object *ob, Lattice *lt)
        uiDefButS(block, NUM, B_RESIZELAT,      "W:",                   470,138,100,19, &lt->pntsw, 1.0, 64.0, 0, 0, "");
        uiClearButLock();
        
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButC(block, ROW, B_LATTCHANGED,            "Lin",          572, 178, 40, 19, &lt->typeu, 1.0, (float)KEY_LINEAR, 0, 0, "");
        uiDefButC(block, ROW, B_LATTCHANGED,            "Card",         612, 178, 40, 19, &lt->typeu, 1.0, (float)KEY_CARDINAL, 0, 0, "");
        uiDefButC(block, ROW, B_LATTCHANGED,            "B",            652, 178, 40, 19, &lt->typeu, 1.0, (float)KEY_BSPLINE, 0, 0, "");
@@ -1158,10 +1125,8 @@ static void editing_panel_lattice_type(Object *ob, Lattice *lt)
        uiDefButC(block, ROW, B_LATTCHANGED,            "Card",         612, 138, 40, 19, &lt->typew, 3.0, (float)KEY_CARDINAL, 0, 0, "");
        uiDefButC(block, ROW, B_LATTCHANGED,            "B",            652, 138, 40, 19, &lt->typew, 3.0, (float)KEY_BSPLINE, 0, 0, "");
        
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT, B_RESIZELAT,       "Make Regular",         470,101,99,32, 0, 0, 0, 0, 0, "");
 
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, TOG|BIT|1, B_LATTCHANGED, "Outside",   571,101,120,31, &lt->flag, 0, 0, 0, 0, "");
 
        if(lt->key) {
@@ -1324,10 +1289,9 @@ static void editing_panel_armature_type(Object *ob, bArmature *arm)
        uiBlock         *block;
        int                     bx=148, by=100;
 
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_armature_type", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_armature_type", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Armature", "Editing", 320, 0, 318, 204)==0) return;
                
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButI(block, TOG|BIT|ARM_RESTPOSBIT,REDRAWVIEW3D, "Rest Pos", bx,by,97,20, &arm->flag, 0, 0, 0, 0, "Disable all animation for this object");
        uiDefButI(block, TOG|BIT|ARM_DRAWAXESBIT,REDRAWVIEW3D, "Draw Axes", bx,by-46,97,20, &arm->flag, 0, 0, 0, 0, "Draw bone axes");
        uiDefButI(block, TOG|BIT|ARM_DRAWNAMESBIT,REDRAWVIEW3D, "Draw Names", bx,by-69,97,20, &arm->flag, 0, 0, 0, 0, "Draw bone names");
@@ -1348,7 +1312,7 @@ static void editing_panel_armature_bones(Object *ob, bArmature *arm)
 
        /* Draw the bone name block */
 
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_armature_bones", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_armature_bones", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Armature Bones", "Editing", 640, 0, 318, 204)==0) return;
 
        /* this is a variable height panel, newpanel doesnt force new size on existing panels */
@@ -1362,11 +1326,9 @@ static void editing_panel_armature_bones(Object *ob, bArmature *arm)
                if (curBone->flag & (BONE_SELECTED)) {
 
                        /* Hide in posemode flag */
-                       uiBlockSetCol(block, BUTGREEN);
                        uiDefButI(block, TOG|BIT|BONE_HIDDENBIT, REDRAWVIEW3D, "Hide", bx-55,by,45,18, &curBone->flag, 0, 0, 0, 0, "Toggles display of this bone in posemode");
                        
                        /*      Bone naming button */
-                       uiBlockSetCol(block, BUTGREY);
                        strcpy (curBone->oldname, curBone->name);
                        but=uiDefBut(block, TEX, REDRAWVIEW3D, "BO:", bx-10,by,117,18, &curBone->name, 0, 24, 0, 0, "Change the bone name");
                        uiButSetFunc(but, validate_editbonebutton_cb, curBone, NULL);
@@ -1384,13 +1346,11 @@ static void editing_panel_armature_bones(Object *ob, bArmature *arm)
 
                        /* IK to parent flag */
                        if (curBone->parent){
-                               uiBlockSetCol(block, BUTGREEN);
                                but=uiDefButI(block, TOG|BIT|BONE_IK_TOPARENTBIT, REDRAWVIEW3D, "IK", bx+300,by,32,18, &curBone->flag, 0.0, 0.0, 0.0, 0.0, "IK link to parent");
                                uiButSetFunc(but, attach_bone_to_parent_cb, curBone, NULL);
                        }
 
                        /* Dist and weight buttons */
-                       uiBlockSetCol(block, BUTGREY);
                        but=uiDefButS(block, MENU, REDRAWVIEW3D,
                                                        "Skinnable %x0|"
                                                        "Unskinnable %x1|"
@@ -1413,7 +1373,6 @@ static void editing_panel_armature_bones(Object *ob, bArmature *arm)
                                                        "Classification of armature element");
                        
                        /* Dist and weight buttons */
-                       uiBlockSetCol(block, BUTGREY);
                        uiDefButF(block, NUM,REDRAWVIEW3D, "Dist:", bx+110, by-19, 
                                                105, 18, &curBone->dist, 0.0, 1000.0, 10.0, 0.0, 
                                                "Bone deformation distance");
@@ -1625,13 +1584,10 @@ static void editing_panel_mesh_tools(Object *ob, Mesh *me)
 {
        uiBlock *block;
 
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_tools", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_tools", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Mesh Tools", "Editing", 640, 0, 318, 204)==0) return;
        
-
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, TOG|BIT|2, 0, "Beauty",                477,195,80,19, &editbutflag, 0, 0, 0, 0, "Causes 'Subdivide' to split faces in halves instead of quarters");
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT,B_SPLIT,"Split",                    477,175,80,19, 0, 0, 0, 0, 0, "Separates selected faces from unselected faces");
        uiDefBut(block, BUT,B_TOSPHERE,"To Sphere",             477,155,80,19, 0, 0, 0, 0, 0, "Moves selected vertices outwards into a spherical shape");
        uiDefBut(block, BUT,B_SUBDIV,"Subdivide",               477,135,80,19, 0, 0, 0, 0, 0, "Splits selected faces into halves or quarters");
@@ -1642,21 +1598,16 @@ static void editing_panel_mesh_tools(Object *ob, Mesh *me)
        uiDefBut(block, BUT,B_XSORT,"Xsort",                    557,135,80,19, 0, 0, 0, 0, 0, "Sorts selected vertice data in the X direction");
 
        uiDefBut(block, BUT,B_HASH,"Hash",                              637,195,80,19, 0, 0, 0, 0, 0, "Randomizes selected vertice sequence data");
-       uiBlockSetCol(block, BUTGREY);
        uiDefButF(block, NUM, B_DIFF, "Limit:",                 637,175,80,19, &doublimit, 0.0001, 1.0, 10, 0, "Specifies the max distance 'Rem Doubles' will consider vertices as 'doubled'");
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT,B_REMDOUB,"Rem Doubles",    637,155,80,19, 0, 0, 0, 0, 0, "Removes duplicates from selected vertices");
        uiDefBut(block, BUT,B_FLIPNORM,"Flip Normals",  637,135,80,19, 0, 0, 0, 0, 0, "Toggles the direction of the selected face's normals");
 
-
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT,B_EXTR,"Extrude",                   477,100,249,24, 0, 0, 0, 0, 0, "Converts selected edges to faces and selects the new vertices");
        uiDefBut(block, BUT,B_SPINDUP,"Spin Dupe",              639,75,87,24, 0, 0, 0, 0, 0, "Creates copies of the selected vertices in a circle around the cursor in the indicated viewport");
        uiDefBut(block, BUT,B_SPIN, "Spin",                             558,75,78,24, 0, 0, 0, 0, 0, "Extrudes the selected vertices in a circle around the cursor in the indicated viewport");
        uiDefBut(block, BUT,B_SCREW,"Screw",                    477,75,79,24, 0, 0, 0, 0, 0, "Activates the screw tool");  // Bish - This could use some more definition
        uiDefBut(block, BUT,B_EXTREP, "Extrude Dupe",   477,15,128,19, 0, 0, 0, 0, 0, "Creates copies of the selected vertices in a straight line away from the current viewport");
 
-       uiBlockSetCol(block, BUTGREY);
        uiDefButS(block, NUM, B_DIFF, "Degr:",          477,55,78,19, &degr,10.0,360.0, 0, 0, "Specifies the number of degrees 'Spin' revolves");
        uiDefButS(block, NUM, B_DIFF, "Steps:",         558,55,78,19, &step,1.0,180.0, 0, 0, "Specifies the total number of 'Spin' slices");
        uiDefButS(block, NUM, B_DIFF, "Turns:",         639,55,86,19, &turn,1.0,360.0, 0, 0, "Specifies the number of revolutions the screw turns");
@@ -1679,18 +1630,15 @@ static void editing_panel_mesh_tools1(Object *ob, Mesh *me)
        uiBlock *block;
 
 
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_tools1", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_tools1", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Mesh Tools 1", "Editing", 960, 0, 318, 204)==0) return;
 
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT,B_DOCENTRE, "Centre",                               1091, 200, 100, 19, 0, 0, 0, 0, 0, "Shifts object data to be centered about object's origin");
 
-
        uiDefBut(block, BUT,B_HIDE,             "Hide",         1091,152,77,18, 0, 0, 0, 0, 0, "Hides selected faces");
        uiDefBut(block, BUT,B_REVEAL,   "Reveal",       1171,152,86,18, 0, 0, 0, 0, 0, "Reveals selected faces");
        uiDefBut(block, BUT,B_SELSWAP,  "Select Swap",  1091,129,166,18, 0, 0, 0, 0, 0, "Selects unselected faces, and deselects selected faces");
 
-       uiBlockSetCol(block, BUTGREY);
        uiDefButF(block, NUM,             REDRAWVIEW3D, "NSize:",               1090, 90, 164, 19, &editbutsize, 0.001, 2.0, 10, 0, "Sets the length to use when displaying face normals");
        uiDefButI(block, TOG|BIT|6, REDRAWVIEW3D, "Draw Normals",       1090,70,164,19, &G.f, 0, 0, 0, 0, "Displays face normals as lines");
        uiDefButI(block, TOG|BIT|7, REDRAWVIEW3D, "Draw Faces", 1090,50,164,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades");
@@ -1707,7 +1655,6 @@ static void editing_panel_mesh_tools1(Object *ob, Mesh *me)
                bDeformGroup *dg;
                int min, by=210, index;
                
-               uiBlockSetCol(block, BUTGREY);
                uiDefBut(block, LABEL,0,"Vertex Groups",        940,by-=19,113,18, 0, 0, 0, 0, 0, "");
 
                defCount=BLI_countlist(&ob->defbase);
@@ -1738,16 +1685,13 @@ static void editing_panel_mesh_tools1(Object *ob, Mesh *me)
 
                if (G.obedit && G.obedit==ob){
 
-                       uiBlockSetCol(block, BUTSALMON);
        /*              uiDefBut(block, BUT,B_AUTOVGROUP,"Auto Weight",                 740,by-=22,93,18, 0, 0, 0, 0, 0, "Automatically assigns deformation groups"); */
                        uiDefBut(block, BUT,B_NEWVGROUP,"New",                          940,by-=22,45,18, 0, 0, 0, 0, 0, "Creates a new vertex group");
                        uiDefBut(block, BUT,B_DELVGROUP,"Delete",                       988,by,45,18, 0, 0, 0, 0, 0, "Removes the current vertex group");
        
-                       uiBlockSetCol(block, BUTSALMON);
                        uiDefBut(block, BUT,B_ASSIGNVGROUP,"Assign",            940,by-=22,93,18, 0, 0, 0, 0, 0, "Assigns selected vertices to the current vertex group");
                        uiDefBut(block, BUT,B_REMOVEVGROUP,"Remove",            940,by-=22,93,18, 0, 0, 0, 0, 0, "Removes selected vertices from the current vertex group");
        
-                       uiBlockSetCol(block, BUTGREY);
                        uiDefBut(block, BUT,B_SELVGROUP,"Select",                       940,by-=22,93,18, 0, 0, 0, 0, 0, "Selects vertices belonging to the current vertex group");
                        uiDefBut(block, BUT,B_DESELVGROUP,"Deselect",           940,by-=22,93,18, 0, 0, 0, 0, 0, "Deselects vertices belonging to the current vertex group");
                }
@@ -1766,7 +1710,7 @@ static void editing_panel_materials(Object *ob)
        char str[64];
        uiBut *but;
        
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_materials", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_materials", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Link and Materials", "Editing", 0, 0, 318, 204)==0) return;
 
        buttons_active_id(&id, &idfrom);
@@ -1806,12 +1750,10 @@ static void editing_panel_materials(Object *ob)
                        alone= B_LATTALONE;
                        local= B_LATTLOCAL;
                }
-               uiBlockSetCol(block, BUTPURPLE);
                xco= std_libbuttons(block, 143, 180, 0, NULL, browse, id, idfrom, &(G.buts->menunr), alone, local, 0, 0, B_KEEPDATA);
                        
        }
        if(ob) {
-               uiBlockSetCol(block, BUTGREY);
                but = uiDefBut(block, TEX, B_IDNAME, "OB:",     xco, 180, 454-xco, YIC, ob->id.name+2, 0.0, 19.0, 0, 0, "Displays Active Object name. Click to change.");
                uiButSetFunc(but, test_idbutton_cb, ob->id.name, NULL);
        }
@@ -1839,12 +1781,10 @@ static void editing_panel_materials(Object *ob)
        uiDefButC(block, NUM, B_REDR,   str,            318,123,103,30, &ob->actcol, min, (float)(ob->totcol), 0, 0, "Displays total number of material indices and the current index");
        uiDefBut(block, BUT,B_MATWICH,  "?",            423,123,31,30, 0, 0, 0, 0, 0, "In EditMode, sets the active material index from selected faces");
        
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT,B_MATNEW,   "New",          292,101,80,21, 0, 0, 0, 0, 0, "Adds a new Material index");
        uiDefBut(block, BUT,B_MATDEL,   "Delete",       374,101,80,21, 0, 0, 0, 0, 0, "Deletes this Material index");
        uiDefBut(block, BUT,B_MATASS,   "Assign",       291,47,162,26, 0, 0, 0, 0, 0, "In EditMode, assigns the active index to selected faces");
 
-       uiBlockSetCol(block, BUTGREY);
        uiDefBut(block, BUT,B_MATSEL,   "Select",       292,76,79,22, 0, 0, 0, 0, 0, "In EditMode, selects faces that have the active index");
        uiDefBut(block, BUT,B_MATDESEL, "Deselect",     373,76,79,21, 0, 0, 0, 0, 0, "Deselects everything with current indexnumber");
 
@@ -1954,11 +1894,9 @@ static void editing_panel_mesh_paint(void)
        extern VPaint Gvp;         /* from vpaint */
        uiBlock *block;
 
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_paint", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_paint", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Paint", "Editing", 640, 0, 318, 204)==0) return;
 
-       uiBlockSetCol(block, BUTGREY);
-
        uiDefButF(block, NUMSLI, 0, "R ",                       979,160,194,19, &Gvp.r, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of red used for painting");
        uiDefButF(block, NUMSLI, 0, "G ",                       979,140,194,19, &Gvp.g, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of green used for painting");
        uiDefButF(block, NUMSLI, 0, "B ",                       979,120,194,19, &Gvp.b, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of blue used for painting");
@@ -1973,18 +1911,14 @@ static void editing_panel_mesh_paint(void)
        uiDefButS(block, ROW, B_DIFF, "Mul",                    1212, 100,63,19, &Gvp.mode, 1.0, 3.0, 0, 0, "Multiply the vertex colour");
        uiDefButS(block, ROW, B_DIFF, "Filter",         1212, 80,63,19, &Gvp.mode, 1.0, 4.0, 0, 0, "Mix the colours with an alpha factor");
 
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, TOG|BIT|1, 0, "Area",          980,50,80,19, &Gvp.flag, 0, 0, 0, 0, "Set the area the brush covers");
        uiDefButS(block, TOG|BIT|2, 0, "Soft",          1061,50,112,19, &Gvp.flag, 0, 0, 0, 0, "Use a soft brush");
        uiDefButS(block, TOG|BIT|3, 0, "Normals",       1174,50,102,19, &Gvp.flag, 0, 0, 0, 0, "Use vertex normal for painting");
 
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT, B_VPGAMMA, "Set",  980,30,80,19, 0, 0, 0, 0, 0, "Apply Mul and Gamma to vertex colours");
-       uiBlockSetCol(block, BUTGREY);
        uiDefButF(block, NUM, B_DIFF, "Mul:",           1061,30,112,19, &Gvp.mul, 0.1, 50.0, 10, 0, "Set the number to multiply vertex colours with");
        uiDefButF(block, NUM, B_DIFF, "Gamma:",         1174,30,102,19, &Gvp.gamma, 0.1, 5.0, 10, 0, "Change the clarity of the vertex colours");
        
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT, B_SET_VCOL, "Set VertCol", 980,5,103,28, 0, 0, 0, 0, 0, "Set Vertex colour of selection to current (Shift+K)");
 
 }
@@ -1995,13 +1929,12 @@ static void editing_panel_mesh_texface(void)
        uiBlock *block;
        extern TFace *lasttface;
        
-       block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_texface", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_texface", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Texture face", "Editing", 640, 0, 318, 204)==0) return;
 
        set_lasttface();        // checks for ob type
        if(lasttface) {
                
-               uiBlockSetCol(block, BUTGREEN);
                uiDefButS(block, TOG|BIT|2, B_REDR_3D_IMA, "Tex",       600,160,60,19, &lasttface->mode, 0, 0, 0, 0, "Render face with texture");
                uiDefButS(block, TOG|BIT|7, B_REDR_3D_IMA, "Tiles",     660,160,60,19, &lasttface->mode, 0, 0, 0, 0, "Use tilemode for face");
                uiDefButS(block, TOG|BIT|4, REDRAWVIEW3D, "Light",      720,160,60,19, &lasttface->mode, 0, 0, 0, 0, "Use light for face");
@@ -2017,13 +1950,13 @@ static void editing_panel_mesh_texface(void)
                uiDefButS(block, TOG|BIT|13, REDRAWVIEW3D, "Shadow", 720,120,60,19, &lasttface->mode, 0, 0, 0, 0, "Face is used for shadow");
                uiDefButS(block, TOG|BIT|14, REDRAWVIEW3D, "Text", 780,120,60,19, &lasttface->mode, 0, 0, 0, 0, "Enable bitmap text on face");
 
-               uiBlockSetCol(block, BUTPURPLE);
+               uiBlockSetCol(block, TH_BUT_SETTING2);
                uiDefButC(block, ROW, REDRAWVIEW3D, "Opaque",   600,100,60,19, &lasttface->transp, 2.0, 0.0, 0, 0, "Render colour of textured face as colour");
                uiDefButC(block, ROW, REDRAWVIEW3D, "Add",              660,100,60,19, &lasttface->transp, 2.0, 1.0, 0, 0, "Render face transparent and add colour of face");
                uiDefButC(block, ROW, REDRAWVIEW3D, "Alpha",            720,100,60,19, &lasttface->transp, 2.0, 2.0, 0, 0, "Render polygon transparent, depending on alpha channel of the texture");
                /* uiDefButC(block, ROW, REDRAWVIEW3D, "Sub",   780,100,60,19, &lasttface->transp, 2.0, 3.0, 0, 0); ,""*/
-
-               uiBlockSetCol(block, BUTSALMON);
+               uiBlockSetCol(block, TH_AUTO);
+               
                uiDefBut(block, BUT, B_COPY_TF_MODE, "Copy DrawMode", 600,7,117,28, 0, 0, 0, 0, 0, "Copy the drawmode");
                uiDefBut(block, BUT, B_COPY_TF_UV, "Copy UV+tex",         721,7,85,28, 0, 0, 0, 0, 0, "Copy UV information and textures");
                uiDefBut(block, BUT, B_COPY_TF_COL, "Copy VertCol",       809,7,103,28, 0, 0, 0, 0, 0, "Copy vertex colours");
index e1d0276be0877f8bc0190ea082326836bebc731f..46190719af932eb5755e2850ece9d57102eafe59 100644 (file)
@@ -872,27 +872,27 @@ static ID **get_selected_and_linked_obs(short *count, short scavisflag)
 }
 
 
-static BIFColorID get_col_sensor(int type)
+static int get_col_sensor(int type)
 {
        switch(type) {
-       case SENS_ALWAYS:               return BUTACTION;
-       case SENS_TOUCH:                return BUTCAMERA;
-       case SENS_COLLISION:    return BUTCAMERA;
-       case SENS_NEAR:                 return BUTRANDOM
-       case SENS_KEYBOARD:             return BUTIPO;
-       case SENS_PROPERTY:             return BUTPROPERTY;
-       case SENS_MOUSE:                return BUTAUDIO;
-       case SENS_RADAR:                return BUTEDITOBJECT;
-       case SENS_RANDOM:               return BUTSCENE;
-       case SENS_RAY:                  return BUTMOTION;
-       case SENS_MESSAGE:              return BUTMESSAGE;
-       default:                                return BUTGREY;
+       case SENS_ALWAYS:               return TH_BUT_ACTION;
+       case SENS_TOUCH:                return TH_BUT_NEUTRAL;
+       case SENS_COLLISION:    return TH_BUT_SETTING;
+       case SENS_NEAR:                 return TH_BUT_SETTING1
+       case SENS_KEYBOARD:             return TH_BUT_SETTING2;
+       case SENS_PROPERTY:             return TH_BUT_NUM;
+       case SENS_MOUSE:                return TH_BUT_TEXTFIELD;
+       case SENS_RADAR:                return TH_BUT_POPUP;
+       case SENS_RANDOM:               return TH_BUT_NEUTRAL;
+       case SENS_RAY:                  return TH_BUT_SETTING1;
+       case SENS_MESSAGE:              return TH_BUT_SETTING2;
+       default:                                return TH_BUT_NEUTRAL;
        }
 }
 static void set_col_sensor(int type, int medium)
 {
-       BIFColorID col= get_col_sensor(type);
-       BIF_set_color(col, medium?COLORSHADE_LIGHT:COLORSHADE_MEDIUM);
+       int col= get_col_sensor(type);
+       BIF_ThemeColorShade(col, medium?30:0);
 }
 
 /**
@@ -943,7 +943,7 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short
        
        /* yco is at the top of the rect, draw downwards */
        
-       uiBlockSetEmboss(block, UI_EMBOSSW);
+       uiBlockSetEmboss(block, UI_EMBOSSM);
        
        set_col_sensor(sens->type, 0);
        
@@ -1091,7 +1091,7 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short
                        uiDefBut(block, LABEL, 0, "Hold",         xco, yco-68, 40, 19, NULL, 0, 0, 0, 0, "");
                        
                        /* part of line 1 */
-                       uiBlockSetCol(block, BUTPURPLE);
+                       uiBlockSetCol(block, TH_BUT_SETTING2);
                        uiDefButS(block, TOG|BIT|0, 0, "All keys",        xco+40+(width/2), yco-44, (width/2)-50, 19,
                                &ks->type, 0, 0, 0, 0, "");
                        
@@ -1260,7 +1260,7 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short
        }
        
        uiBlockSetEmboss(block, UI_EMBOSSM);
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_AUTO);
        
        return yco-4;
 }
@@ -1273,13 +1273,13 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco
        bPythonCont *pc;
        short ysize;
        
-       uiBlockSetEmboss(block, UI_EMBOSSW);
+       uiBlockSetEmboss(block, UI_EMBOSSM);
        
        switch (cont->type) {
        case CONT_EXPRESSION:
                ysize= 28;
 
-               BIF_set_color(BUTPROPERTY, COLORSHADE_GREY);
+               BIF_ThemeColor(TH_BUT_SETTING);
                glRects(xco, yco-ysize, xco+width, yco);
                uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
                
@@ -1298,7 +1298,7 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco
                if(cont->data==NULL) init_controller(cont);
                pc= cont->data;
                
-               BIF_set_color(BUTMESSAGE, COLORSHADE_GREY);
+               BIF_ThemeColor(TH_BUT_SETTING1);
                glRects(xco, yco-ysize, xco+width, yco);
                uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
 
@@ -1310,7 +1310,7 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco
        default:
                ysize= 4;
 
-               BIF_set_color(BUTIPO, COLORSHADE_GREY);
+               BIF_ThemeColor(TH_BUT_NEUTRAL);
                glRects(xco, yco-ysize, xco+width, yco);
                uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
                
@@ -1318,39 +1318,37 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco
        }
        
        uiBlockSetEmboss(block, UI_EMBOSSM);
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_AUTO);
 
        return yco;
 }
 
-static BIFColorID get_col_actuator(int type)
+static int get_col_actuator(int type)
 {
        switch(type) {
-       case ACT_ACTION:                return BUTACTION;
-       case ACT_OBJECT:                return BUTMOTION;
-       case ACT_IPO:                   return BUTIPO;
-       case ACT_PROPERTY:              return BUTPROPERTY;
-       case ACT_SOUND:                 return BUTAUDIO;
-       case ACT_CD:                    return BUTCD;
-       case ACT_CAMERA:                return BUTCAMERA;
-       case ACT_EDIT_OBJECT:   return BUTEDITOBJECT;
-       case ACT_GROUP:                 return BUTYELLOW;
-       case ACT_RANDOM:                return BUTRANDOM;
-       case ACT_SCENE:                 return BUTSCENE;
-       case ACT_MESSAGE:               return BUTMESSAGE;
-       case ACT_GAME:                  return BUTGAME;
-       case ACT_VISIBILITY:                    return BUTVISIBILITY;
-       default:                                return BUTGREY;
+       case ACT_ACTION:                return TH_BUT_ACTION;
+       case ACT_OBJECT:                return TH_BUT_NEUTRAL;
+       case ACT_IPO:                   return TH_BUT_SETTING;
+       case ACT_PROPERTY:              return TH_BUT_SETTING1;
+       case ACT_SOUND:                 return TH_BUT_SETTING2;
+       case ACT_CD:                    return TH_BUT_NUM;
+       case ACT_CAMERA:                return TH_BUT_TEXTFIELD;
+       case ACT_EDIT_OBJECT:   return TH_BUT_POPUP;
+       case ACT_GROUP:                 return TH_BUT_ACTION;
+       case ACT_RANDOM:                return TH_BUT_NEUTRAL;
+       case ACT_SCENE:                 return TH_BUT_SETTING;
+       case ACT_MESSAGE:               return TH_BUT_SETTING1;
+       case ACT_GAME:                  return TH_BUT_SETTING2;
+       case ACT_VISIBILITY:    return TH_BUT_NUM;
+       case ACT_CONSTRAINT:    return TH_BUT_ACTION;
+       default:                                return TH_BUT_NEUTRAL;
        }
 }
 static void set_col_actuator(int item, int medium) 
 {
-       if (item==ACT_CONSTRAINT) {
-               BIF_set_color(BUTRUST, medium?COLORSHADE_HILITE:COLORSHADE_MEDIUM);
-       } else {
-               BIFColorID col= get_col_actuator(item);
-               BIF_set_color(col, medium?COLORSHADE_MEDIUM:COLORSHADE_GREY);
-       }
+       int col= get_col_actuator(item);
+       BIF_ThemeColorShade(col, medium?30:10);
+       
 }
 
 static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, short yco, short width)
@@ -1377,7 +1375,7 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho
        int myline;
 
        /* yco is at the top of the rect, draw downwards */
-       uiBlockSetEmboss(block, UI_EMBOSSW);
+       uiBlockSetEmboss(block, UI_EMBOSSM);
        set_col_actuator(act->type, 0);
        
        switch (act->type)
@@ -1388,7 +1386,6 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho
                        
                        glRects(xco, yco-ysize, xco+width, yco);
                        uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1);
-                       uiBlockSetCol(block, BUTGREY);
                        
                        oa = act->data;
                        wval = (width-100)/3;
@@ -1423,7 +1420,6 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho
                        uiDefButF(block, NUM, 0, "",            xco+45+wval, yco-125, wval, 19, oa->angularvelocity+1, -10000.0, 10000.0, 10, 0, "");
                        uiDefButF(block, NUM, 0, "",            xco+45+2*wval, yco-125, wval, 19, oa->angularvelocity+2, -10000.0, 10000.0, 10, 0, "");
                        
-                       uiBlockSetCol(block, BUTGREEN);
                        uiDefButI(block, TOG|BIT|0, 0, "L",             xco+45+3*wval, yco-22, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
                        uiDefButI(block, TOG|BIT|1, 0, "L",             xco+45+3*wval, yco-41, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
                        uiDefButI(block, TOG|BIT|2, 0, "L",             xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
@@ -1431,9 +1427,7 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho
                        uiDefButI(block, TOG|BIT|4, 0, "L",             xco+45+3*wval, yco-106, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
                        uiDefButI(block, TOG|BIT|5, 0, "L",             xco+45+3*wval, yco-125, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation");
                        
-                       uiBlockSetCol(block, BUTGREEN);
                        uiDefButI(block, TOG|BIT|6, 0, "add",xco+45+3*wval+15, yco-106, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV");
-                       uiBlockSetCol(block, BUTGREY);
                        
                        yco-= ysize;
                        break;
@@ -1453,7 +1447,6 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho
                        aa = act->data;
                        wval = (width-60)/3;
                        
-                       uiBlockSetCol(block, BUTGREY);
                        //              str= "Action types   %t|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6";
 #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR
                        str= "Action types   %t|Play %x0|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6|Displacement %x7";
@@ -1503,18 +1496,15 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho
                        str = "Ipo types   %t|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6";
                        
                        uiDefButS(block, MENU, B_REDR, str,             xco+20, yco-24, width-40 - (width-40)/3, 19, &ia->type, 0, 0, 0, 0, "");
-                       uiBlockSetCol(block, BUTGREEN);
                        uiDefButS(block, TOG|BIT|ACT_IPOCHILD_BIT, B_REDR, 
                                "Child",        xco+20+0.666*(width-40), yco-24, (width-40)/3, 19, 
                                &ia->flag, 0, 0, 0, 0, 
                                "Add all children Objects as well");
-                       uiBlockSetCol(block, BUTGREY);
                        /* 
                        Key2key was disabled.... the settings below should not be reused without 
                        thought, because they interfere with other variables.
                        
                          if(ia->type==ACT_IPO_KEY2KEY) {
-                         uiBlockSetCol(block, BUTGREEN);
                          
                                uiDefButS(block, TOG|BIT|0, 0, "Prev", xco+20, yco-44, (width-40)/3, 19, &ia->flag, 0, 0, 0, 0, "Play backwards");
                                uiDefButS(block, TOG|BIT|1, 0, "Cycl", xco+20+(width-40)/3, yco-44, (width-40)/3, 19, &ia->flag, 0, 0, 0, 0, "Play cyclic");
@@ -1539,7 +1529,6 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho
                                        &ia->end, 0.0, 18000.0, 0, 0, 
                                        "End frame");
                                
-                               uiBlockSetCol(block, BUTGREEN);
                                uiDefButS(block, TOG|BIT|ACT_IPOFORCE_BIT, B_REDR, 
                                        "Force", xco+width-78, yco-44, 43, 19, 
                                        &ia->flag, 0, 0, 0, 0, 
@@ -1735,9 +1724,7 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho
         
                        uiDefIDPoinBut(block, test_obpoin_but, 1, "OB:",                xco+10, yco-44, (width-20)/2, 19, &(eoa->ob), "Track to this Object");
                        uiDefButI(block, NUM, 0, "Time:",       xco+10+(width-20)/2, yco-44, (width-20)/2-40, 19, &eoa->time, 0.0, 2000.0, 0, 0, "Duration the tracking takes");
-                       uiBlockSetCol(block, BUTGREEN);
                        uiDefButS(block, TOG, 0, "3D",  xco+width-50, yco-44, 40, 19, &eoa->flag, 0.0, 0.0, 0, 0, "Enable 3D tracking");
-                       uiBlockSetCol(block, BUTGREY);
                }
                
                str= "Edit Object %t|Add Object %x0|End Object %x1|Replace Mesh %x2|Track to %x3";
@@ -2113,7 +2100,6 @@ static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, sho
        }
 
        uiBlockSetEmboss(block, UI_EMBOSSM);
-       uiBlockSetCol(block, BUTGREY);
 
        return yco-4;
 }
@@ -2154,7 +2140,6 @@ static uiBlock *sensor_menu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "filemenu", UI_EMBOSSP, UI_HELV, curarea->win);
        uiBlockSetButmFunc(block, do_sensor_menu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefBut(block, BUTM, 1, "Show Objects",        0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefBut(block, BUTM, 1, "Hide Objects",        0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -2203,7 +2188,6 @@ static uiBlock *controller_menu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "filemenu", UI_EMBOSSP, UI_HELV, curarea->win);
        uiBlockSetButmFunc(block, do_controller_menu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefBut(block, BUTM, 1, "Show Objects",        0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefBut(block, BUTM, 1, "Hide Objects",        0,(short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -2252,7 +2236,6 @@ static uiBlock *actuator_menu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "filemenu", UI_EMBOSSP, UI_HELV, curarea->win);
        uiBlockSetButmFunc(block, do_actuator_menu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefBut(block, BUTM, 1, "Show Objects",        0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefBut(block, BUTM, 1, "Hide Objects",        0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -2292,12 +2275,10 @@ void logic_buts(void)
        uiSetButLock(ob->id.lib!=0, "Can't edit library data");
 
        sprintf(name, "buttonswin %d", curarea->win);
-       block= uiNewBlock(&curarea->uiblocks, name, UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, name, UI_EMBOSS, UI_HELV, curarea->win);
        
-       uiBlockSetCol(block, BUTPURPLE);
-       // uiDefButI(block, TOG|BIT|0, B_REDR, "X",
-       //               15,205,10,19, &ob->gameflag2, 0, 0, 0, 0,
-       //               "Toggle to always ignore activity culling.");
+       uiBlockSetCol(block, TH_BUT_SETTING2);
+
        uiDefButI(block, TOG|BIT|2, B_REDR, "Actor",
                         25,205,60,19, &ob->gameflag, 0, 0, 0, 0,
                         "Objects that are evaluated by the engine ");
@@ -2313,8 +2294,6 @@ void logic_buts(void)
                        uiDefButI(block, TOG|BIT|6, B_DIFF, "Do Fh",            10,185,50,19, &ob->gameflag, 0, 0, 0, 0, "Use Fh settings in Materials");
                        uiDefButI(block, TOG|BIT|7, B_DIFF, "Rot Fh",   60,185,50,19, &ob->gameflag, 0, 0, 0, 0, "Use face normal to rotate Object");
        
-                       uiBlockSetCol(block, BUTGREY);
-
                        uiDefButF(block, NUM, B_DIFF, "Mass:",                  110, 185, 80, 19, &ob->mass, 0.01, 100.0, 10, 0, "The mass of the Object");
                        uiDefButF(block, NUM, REDRAWVIEW3D, "Size:",            190, 185, 80, 19, &ob->inertia, 0.01, 10.0, 10, 0, "Bounding sphere size");
                        uiDefButF(block, NUM, B_DIFF, "Form:",                  270, 185, 80, 19, &ob->formfactor, 0.01, 100.0, 10, 0, "Form factor");
@@ -2339,7 +2318,7 @@ void logic_buts(void)
                                 "Relative friction coefficient in the z-direction.");
        }
        
-       uiBlockSetCol(block, BUTSALMON);
+       uiBlockSetCol(block, TH_AUTO);
        uiDefBut(block, BUT, B_ADD_PROP, "ADD property",                10, 110, 340, 24,
                         NULL, 0.0, 100.0, 100, 0,
                         "");
@@ -2350,10 +2329,8 @@ void logic_buts(void)
        prop= ob->prop.first;
        while(prop) {
                
-               uiBlockSetCol(block, BUTSALMON);
                but= uiDefBut(block, BUT, 1, "Del",             10, (short)(90-20*a), 40, 19, NULL, 0.0, 0.0, 1, (float)a, "");
                uiButSetFunc(but, del_property, prop, NULL);
-               uiBlockSetCol(block, BUTGREY);
                uiDefButS(block, MENU, B_CHANGE_PROP, pupstr,           50, (short)(90-20*a), 60, 19, &prop->type, 0, 0, 0, 0, "");
                but= uiDefBut(block, TEX, 1, "Name:",                                   110, (short)(90-20*a), 105, 19, prop->name, 0, 31, 0, 0, "");
                uiButSetFunc(but, make_unique_prop_names_cb, prop->name, (void*) 1);
@@ -2365,10 +2342,8 @@ void logic_buts(void)
                }
 
                if(prop->type==PROP_BOOL) {
-                       uiBlockSetCol(block, BUTGREEN);
                        uiDefButI(block, TOG|BIT|0, B_REDR, "True",             215, (short)(90-20*a), 55, 19, &prop->data, 0, 0, 0, 0, "");
                        uiDefButI(block, TOGN|BIT|0, B_REDR, "False",   270, (short)(90-20*a), 55, 19, &prop->data, 0, 0, 0, 0, "");
-                       uiBlockSetCol(block, BUTGREY);
                }
                else if(prop->type==PROP_INT) 
                        uiDefButI(block, NUM, butreturn, "",                    215, (short)(90-20*a), 110, 19, &prop->data, -10000, 10000, 0, 0, "");
@@ -2392,11 +2367,9 @@ void logic_buts(void)
        /* ******************************* */
        xco= 375; yco= 170; width= 230;
 
-       uiBlockSetCol(block, BUTGREY);
        uiBlockSetEmboss(block, UI_EMBOSSP);
        uiDefBlockBut(block, sensor_menu, NULL, "Sensors", xco-10, yco+35, 80, 19, "");
-       uiBlockSetCol(block, BUTGREEN);
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
        uiDefButS(block, TOG|BIT|0, B_REDR, "Sel", xco+110, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show all selected Objects");
        uiDefButS(block, TOG|BIT|1, B_REDR, "Act", xco+110+(width-100)/3, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object");
        uiDefButS(block, TOG|BIT|2, B_REDR, "Link", xco+110+2*(width-100)/3, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller");
@@ -2409,13 +2382,10 @@ void logic_buts(void)
                if( (ob->scavisflag & OB_VIS_SENS) == 0) continue;
                
                /* presume it is only objects for now */
-               uiBlockSetEmboss(block, UI_EMBOSSX);
-               uiBlockSetCol(block, BUTGREY);
+               uiBlockSetEmboss(block, UI_EMBOSS);
                if(ob->sensors.first) uiSetCurFont(block, UI_HELVB);
-               uiBlockSetCol(block, MIDGREY);
                uiDefButS(block, TOG|BIT|6, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), 19, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors");
                if(ob->sensors.first) uiSetCurFont(block, UI_HELV);
-               uiBlockSetCol(block, BUTSALMON);
                uiDefButS(block, TOG|BIT|8, B_ADD_SENS, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Sensor");
                yco-=20;
                
@@ -2423,23 +2393,18 @@ void logic_buts(void)
                        
                        sens= ob->sensors.first;
                        while(sens) {
-                               uiBlockSetEmboss(block, UI_EMBOSSW);
-                               uiBlockSetCol(block, BUTSALMON);
+                               uiBlockSetEmboss(block, UI_EMBOSSM);
                                uiDefIconButS(block, TOG|BIT|1, B_DEL_SENS, ICON_X,     xco, yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Delete Sensor");
-                               uiBlockSetCol(block, BUTGREY);
                                uiDefIconButS(block, ICONTOG|BIT|0, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Sensor settings");
 
                                ycoo= yco;
                                if(sens->flag & SENS_SHOW)
                                {
-                                       uiBlockSetCol(block, BUTYELLOW);
-
                                        uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(),     (short)(xco+22), yco, 100, 19, &sens->type, 0, 0, 0, 0, "Sensor type");
                                        but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, sens->name, 0, 31, 0, 0, "Sensor name");
                                        uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0);
 
                                        sens->otype= sens->type;
-                                       uiBlockSetCol(block, BUTGREY);
                                        yco= draw_sensorbuttons(sens, block, xco, yco, width,ob->id.name);
                                        if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2;
                                }
@@ -2466,11 +2431,9 @@ void logic_buts(void)
        /* ******************************* */
        xco= 675; yco= 170; width= 230;
 
-       uiBlockSetCol(block, BUTGREY);
        uiBlockSetEmboss(block, UI_EMBOSSP);
        uiDefBlockBut(block, controller_menu, NULL, "Controllers", xco-10, yco+35, 100, 19, "");
-       uiBlockSetCol(block, BUTGREEN);
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
        uiDefButS(block, TOG|BIT|3, B_REDR, "Sel", xco+110, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show all selected Objects");
        uiDefButS(block, TOG|BIT|4, B_REDR, "Act", xco+110+(width-100)/3, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object");
        uiDefButS(block, TOG|BIT|5, B_REDR, "Link", xco+110+2*(width-100)/3, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Sensor/Actuator");
@@ -2484,10 +2447,8 @@ void logic_buts(void)
                if( (ob->scavisflag & OB_VIS_CONT) == 0) continue;
 
                /* presume it is only objects for now */
-               uiBlockSetEmboss(block, UI_EMBOSSX);
-               uiBlockSetCol(block, BUTSALMON);
+               uiBlockSetEmboss(block, UI_EMBOSS);
                uiDefButS(block, TOG|BIT|9, B_ADD_CONT, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Controller");
-               uiBlockSetCol(block, MIDGREY);
                if(ob->controllers.first) uiSetCurFont(block, UI_HELVB);
                uiDefButS(block, TOG|BIT|11, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), 19, &ob->scaflag, 0, 0, 0, 0, "Active Object name");
                if(ob->controllers.first) uiSetCurFont(block, UI_HELV);
@@ -2497,19 +2458,15 @@ void logic_buts(void)
                
                        cont= ob->controllers.first;
                        while(cont) {
-                               uiBlockSetEmboss(block, UI_EMBOSSW);
-                               uiBlockSetCol(block, BUTSALMON);
+                               uiBlockSetEmboss(block, UI_EMBOSSM);
                                uiDefIconButS(block, TOG|BIT|1, B_DEL_CONT, ICON_X,     xco, yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Delete Controller");
-                               uiBlockSetCol(block, BUTGREY);
                                uiDefIconButS(block, ICONTOG|BIT|0, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Controller settings");
                
                                if(cont->flag & CONT_SHOW) {
-                                       uiBlockSetCol(block, BUTYELLOW);
                                        cont->otype= cont->type;
                                        uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 100, 19, &cont->type, 0, 0, 0, 0, "Controller type");
                                        but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, cont->name, 0, 31, 0, 0, "Controller name");
                                        uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0);
-                                       uiBlockSetCol(block, BUTGREY);
                
                                        ycoo= yco;
                                        yco= draw_controllerbuttons(cont, block, xco, yco, width);
@@ -2541,11 +2498,9 @@ void logic_buts(void)
        /* ******************************* */
        xco= 985; yco= 170; width= 280;
        
-       uiBlockSetCol(block, BUTGREY);
        uiBlockSetEmboss(block, UI_EMBOSSP);
        uiDefBlockBut(block, actuator_menu, NULL, "Actuators", xco-10, yco+35, 100, 19, "");
-       uiBlockSetCol(block, BUTGREEN);
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
        uiDefButS(block, TOG|BIT|6, B_REDR, "Sel", xco+110, yco+35, (width-110)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show all selected Objects");
        uiDefButS(block, TOG|BIT|7, B_REDR, "Act", xco+110+(width-110)/3, yco+35, (width-110)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object");
        uiDefButS(block, TOG|BIT|8, B_REDR, "Link", xco+110+2*(width-110)/3, yco+35, (width-110)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller");
@@ -2557,13 +2512,10 @@ void logic_buts(void)
                if( (ob->scavisflag & OB_VIS_ACT) == 0) continue;
 
                /* presume it is only objects for now */
-               uiBlockSetEmboss(block, UI_EMBOSSX);
-               uiBlockSetCol(block, BUTGREY);
+               uiBlockSetEmboss(block, UI_EMBOSS);
                if(ob->actuators.first) uiSetCurFont(block, UI_HELVB);
-               uiBlockSetCol(block, MIDGREY);
                uiDefButS(block, TOG|BIT|7, B_REDR, ob->id.name+2,(short)(xco-10), yco,(short)(width-30), 19, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators");
                if(ob->actuators.first) uiSetCurFont(block, UI_HELV);
-               uiBlockSetCol(block, BUTSALMON);
                uiDefButS(block, TOG|BIT|10, B_ADD_ACT, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Actuator");
                yco-=20;
                
@@ -2571,19 +2523,15 @@ void logic_buts(void)
                        
                        act= ob->actuators.first;
                        while(act) {
-                               uiBlockSetEmboss(block, UI_EMBOSSW);
-                               uiBlockSetCol(block, BUTSALMON);
+                               uiBlockSetEmboss(block, UI_EMBOSSM);
                                uiDefIconButS(block, TOG|BIT|1, B_DEL_ACT, ICON_X,      xco, yco, 22, 19, &act->flag, 0, 0, 0, 0, "Delete Actuator");
-                               uiBlockSetCol(block, BUTGREY);
                                uiDefIconButS(block, ICONTOG|BIT|0, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &act->flag, 0, 0, 0, 0, "Actuator settings");
 
                                if(act->flag & ACT_SHOW) {
-                                       uiBlockSetCol(block, BUTYELLOW);
                                        act->otype= act->type;
                                        uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob),  (short)(xco+22), yco, 100, 19, &act->type, 0, 0, 0, 0, "Actuator type");
                                        but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, act->name, 0, 31, 0, 0, "Actuator name");
                                        uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0);
-                                       uiBlockSetCol(block, BUTGREY);
 
                                        ycoo= yco;
                                        yco= draw_actuatorbuttons(act, block, xco, yco, width);
index abb211818600ae9a02492707caab9ab305b7835a..637220c27e6609561cb6500adeee9850d791572d 100644 (file)
@@ -284,23 +284,23 @@ static void get_constraint_typestring (char *str, bConstraint *con)
        }
 }
 
-static BIFColorID get_constraint_col(bConstraint *con)
+static int get_constraint_col(bConstraint *con)
 {
        switch (con->type) {
        case CONSTRAINT_TYPE_NULL:
-               return BUTWHITE;
+               return TH_BUT_NEUTRAL;
        case CONSTRAINT_TYPE_KINEMATIC:
-               return BUTPURPLE;
+               return TH_BUT_SETTING2;
        case CONSTRAINT_TYPE_TRACKTO:
-               return BUTGREEN;
+               return TH_BUT_SETTING;
        case CONSTRAINT_TYPE_ROTLIKE:
-               return BUTBLUE;
+               return TH_BUT_SETTING1;
        case CONSTRAINT_TYPE_LOCLIKE:
-               return BUTYELLOW;
+               return TH_BUT_POPUP;
        case CONSTRAINT_TYPE_ACTION:
-               return BUTPINK;
+               return TH_BUT_ACTION;
        default:
-               return REDALERT;
+               return TH_REDALERT;
        }
 }
 
@@ -309,27 +309,25 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
        uiBut *but;
        char typestr[64];
        short height, width = 238;
-       BIFColorID curCol;
+       int curCol;
 
        /* there is something weird in this function... opengl draw (glrects) doesnt match the buttons... */
 
-       uiBlockSetEmboss(block, UI_EMBOSSW);
+       uiBlockSetEmboss(block, UI_EMBOSSM);
 
        get_constraint_typestring (typestr, con);
 
        curCol = get_constraint_col(con);
        /* Draw constraint header */
-       uiBlockSetCol(block, BUTSALMON);
 
        but = uiDefIconBut(block, BUT, B_CONSTRAINT_REDRAW, ICON_X, *xco, *yco, 20, 20, list, 0.0, 0.0, 0.0, 0.0, "Delete constraint");
 
        uiButSetFunc(but, del_constraint_func, con, list);
 
        if (con->flag & CONSTRAINT_EXPAND) {
-               uiBlockSetCol(block, BUTYELLOW);
                
                if (con->flag & CONSTRAINT_DISABLE)
-                       uiBlockSetCol(block, REDALERT);
+                       uiBlockSetCol(block, TH_REDALERT);
                
                if (type==TARGET_BONE)
                        but = uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Bone Constraint%t|Track To%x2|IK Solver%x3|Copy Rotation%x8|Copy Location%x9|Action%x12|Null%x0", *xco+20, *yco, 100, 20, &con->type, 0.0, 0.0, 0.0, 0.0, "Constraint type"); 
@@ -344,14 +342,13 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
        }       
        else{
                uiBlockSetEmboss(block, UI_EMBOSSP);
-               uiBlockSetCol(block, BUTGREY);
 
                if (con->flag & CONSTRAINT_DISABLE) {
-                       uiBlockSetCol(block, REDALERT);
-                       BIF_set_color(REDALERT, COLORSHADE_MEDIUM);
+                       uiBlockSetCol(block, TH_REDALERT);
+                       BIF_ThemeColor(TH_REDALERT);
                }
                else
-                       BIF_set_color(curCol, COLORSHADE_MEDIUM);
+                       BIF_ThemeColor(curCol);
 
                glRects(*xco+34, *yco-12, *xco+266, *yco+5);
                
@@ -361,9 +358,9 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
                uiButSetFunc(but, move_constraint_func, con, NULL);
        }
 
-       uiBlockSetCol(block, BUTGREY);  
+       uiBlockSetCol(block, TH_AUTO);  
        
-       uiBlockSetEmboss(block, UI_EMBOSSW);
+       uiBlockSetEmboss(block, UI_EMBOSSM);
        uiDefIconButS(block, ICONTOG|BIT|CONSTRAINT_EXPAND_BIT, B_CONSTRAINT_REDRAW, ICON_RIGHTARROW, *xco+248, *yco, 20, 20, &con->flag, 0.0, 0.0, 0.0, 0.0, "Collapse");
 
 
@@ -390,7 +387,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
                        bArmature *arm;
 
                        height = 86;
-                       BIF_set_color(curCol, COLORSHADE_MEDIUM);
+                       BIF_ThemeColor(curCol);
                        glRects(*xco+34, *yco-height-16, *xco+width+24, *yco-14);
                        uiEmboss((float)*xco+34, (float)*yco-height-16, (float)*xco+width+24, (float)*yco-14, 1);
 
@@ -422,7 +419,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
                        bLocateLikeConstraint *data = con->data;
                        bArmature *arm;
                        height = 66;
-                       BIF_set_color(curCol, COLORSHADE_MEDIUM);
+                       BIF_ThemeColor(curCol);
                        glRects(*xco+34, *yco-height-16, *xco+width+24, *yco-14);
                        uiEmboss((float)*xco+34, (float)*yco-height-16, (float)*xco+width+24, (float)*yco-14, 1);
 
@@ -447,7 +444,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
                        bRotateLikeConstraint *data = con->data;
                        bArmature *arm;
                        height = 46;
-                       BIF_set_color(curCol, COLORSHADE_MEDIUM);
+                       BIF_ThemeColor(curCol);
                        glRects(*xco+34, *yco-height-16, *xco+width+24, *yco-14);
                        uiEmboss((float)*xco+34, (float)*yco-height-16, (float)*xco+width+24, (float)*yco-14, 1);
 
@@ -468,7 +465,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
                        bArmature *arm;
                        
                        height = 66;
-                       BIF_set_color(curCol, COLORSHADE_MEDIUM);
+                       BIF_ThemeColor(curCol);
                        glRects(*xco+34, *yco-height-16, *xco+width+24, *yco-14);
                        uiEmboss((float)*xco+34, (float)*yco-height-16, (float)*xco+width+24, (float)*yco-14, 1);
                        
@@ -489,7 +486,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
        case CONSTRAINT_TYPE_NULL:
                {
                        height = 20;
-                       BIF_set_color(curCol, COLORSHADE_MEDIUM);
+                       BIF_ThemeColor(curCol);
                        glRects(*xco+34, *yco-height-16, *xco+width+24, *yco-14);
                        uiEmboss((float)*xco+34, (float)*yco-height-16, (float)*xco+width+24, (float)*yco-14, 1);
                }
@@ -500,7 +497,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
                        bArmature *arm;
 
                        height = 46;
-                       BIF_set_color(curCol, COLORSHADE_MEDIUM);
+                       BIF_ThemeColor(curCol);
                        glRects(*xco+34, *yco-height-16, *xco+width+24, *yco-14);
                        uiEmboss((float)*xco+34, (float)*yco-height-16, (float)*xco+width+24, (float)*yco-14, 1);
                        
@@ -592,7 +589,7 @@ static void object_panel_constraint(void)
        short xco, yco, type;
        char ownerstr[64];
        
-       block= uiNewBlock(&curarea->uiblocks, "object_panel_constraint", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "object_panel_constraint", UI_EMBOSS, UI_HELV, curarea->win);
        uiNewPanelTabbed("Effects", "Object");
        if(uiNewPanel(curarea, block, "Constraints", "Object", 640, 0, 318, 204)==0) return;
 
@@ -604,7 +601,6 @@ static void object_panel_constraint(void)
        
        if (conlist) {
                 
-               uiBlockSetCol(block, BUTSALMON);
                uiDefBut(block, BUT, B_CONSTRAINT_ADD, "Add", 10, 190, 95, 20, 0, 0.0, 0, 0, 0,"Add new constraint");
                
                /* Go through the list of constraints and draw them */
@@ -907,7 +903,7 @@ void object_panel_draw(Object *ob)
        int xco, a, dx, dy;
        
        
-       block= uiNewBlock(&curarea->uiblocks, "object_panel_draw", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "object_panel_draw", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Draw", "Object", 320, 0, 318, 204)==0) return;
 
        /* LAYERS */
@@ -925,7 +921,6 @@ void object_panel_draw(Object *ob)
        id= ob->data;
        if(id && id->lib) uiSetButLock(1, "Can't edit library data");
 
-       uiBlockSetCol(block, BUTGREY);
        uiDefBut(block, LABEL, 0, "Drawtype",                                           28,200,100,18, 0, 0, 0, 0, 0, "");
        uiDefButC(block, MENU, REDRAWVIEW3D, "Drawtype%t|Bounds %x1|Wire %x2|Solid %x3|Shaded %x4",     
                                                                                                                                28,180,100,18, &ob->dt, 0, 0, 0, 0, "Sets the drawing type of the active object");
@@ -938,7 +933,6 @@ void object_panel_draw(Object *ob)
        uiDefButC(block, TOG|BIT|2, REDRAWVIEW3D, "TexSpace",   28, 60, 100, 18, &ob->dtx, 0, 0, 0, 0, "Displays the active object's texture space");
        uiDefButC(block, TOG|BIT|3, REDRAWVIEW3D, "Name",               28, 40, 100, 18, &ob->dtx, 0, 0, 0, 0, "Displays the active object's name");
        
-       uiBlockSetCol(block, BUTGREY);
        
 }
 
@@ -1136,11 +1130,9 @@ void object_panel_effects(Object *ob)
        int a;
        short x, y;
        
-       block= uiNewBlock(&curarea->uiblocks, "object_panel_effects", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "object_panel_effects", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Effects", "Object", 640, 0, 418, 204)==0) return;
 
-       uiBlockSetCol(block, BUTSALMON);
-       
        /* EFFECTS */
        
        if (ob->type == OB_MESH) {
@@ -1148,8 +1140,6 @@ void object_panel_effects(Object *ob)
                uiDefBut(block, BUT, B_DELEFFECT, "Delete", 676,187,62,27, 0, 0, 0, 0, 0, "Delete the effect");
        }
 
-       uiBlockSetCol(block, BUTGREY);
-       
        /* select effs */
        eff= ob->effect.first;
        a= 0;
@@ -1186,12 +1176,10 @@ void object_panel_effects(Object *ob)
                        
                        wav= (WaveEff *)eff;
                        
-                       uiBlockSetCol(block, BUTGREEN);
                        uiDefButS(block, TOG|BIT|1, B_CALCEFFECT, "X",          782,135,54,23, &wav->flag, 0, 0, 0, 0, "Enable X axis");
                        uiDefButS(block, TOG|BIT|2, B_CALCEFFECT, "Y",          840,135,47,23, &wav->flag, 0, 0, 0, 0, "Enable Y axis");
                        uiDefButS(block, TOG|BIT|3, B_CALCEFFECT, "Cycl",               890,135,111,23, &wav->flag, 0, 0, 0, 0, "Enable cyclic wave efefct");
                        
-                       uiBlockSetCol(block, BUTGREY);
                        uiDefButF(block, NUM, B_CALCEFFECT, "Sta x:",           550,135,113,24, &wav->startx, -100.0, 100.0, 100, 0, "Starting position for the X axis");
                        uiDefButF(block, NUM, B_CALCEFFECT, "Sta y:",           665,135,104,24, &wav->starty, -100.0, 100.0, 100, 0, "Starting position for the Y axis");
                        
@@ -1212,9 +1200,7 @@ void object_panel_effects(Object *ob)
                        paf= (PartEff *)eff;
                        
                        uiDefBut(block, BUT, B_RECALCAL, "RecalcAll", 741,187,67,27, 0, 0, 0, 0, 0, "Update the particle system");
-                       uiBlockSetCol(block, BUTGREEN);
                        uiDefButS(block, TOG|BIT|2, B_CALCEFFECT, "Static",     825,187,67,27, &paf->flag, 0, 0, 0, 0, "Make static particles");
-                       uiBlockSetCol(block, BUTGREY);
                        
                        uiDefButI(block, NUM, B_CALCEFFECT, "Tot:",             550,146,91,20, &paf->totpart, 1.0, 100000.0, 0, 0, "Set the total number of particles");
                        if(paf->flag & PAF_STATIC) {
@@ -1227,9 +1213,7 @@ void object_panel_effects(Object *ob)
                        uiDefButF(block, NUM, B_CALCEFFECT, "Life:",            831,146,88,20, &paf->lifetime, 1.0, 9000.0, 100, 0, "Specify the life span of the particles");
                        uiDefButI(block, NUM, B_CALCEFFECT, "Keys:",            922,146,80,20, &paf->totkey, 1.0, 32.0, 0, 0, "Specify the number of key positions");
                        
-                       uiBlockSetCol(block, BUTGREEN);
                        uiDefButS(block, NUM, B_REDR,           "CurMul:",              550,124,91,20, &paf->curmult, 0.0, 3.0, 0, 0, "Multiply the particles");
-                       uiBlockSetCol(block, BUTGREY);
                        uiDefButS(block, NUM, B_CALCEFFECT, "Mat:",             644,124,84,20, paf->mat+paf->curmult, 1.0, 8.0, 0, 0, "Specify the material used for the particles");
                        uiDefButF(block, NUM, B_CALCEFFECT, "Mult:",            730,124,98,20, paf->mult+paf->curmult, 0.0, 1.0, 10, 0, "Probability \"dying\" particle spawns a new one.");
                        uiDefButS(block, NUM, B_CALCEFFECT, "Child:",   922,124,80,20, paf->child+paf->curmult, 1.0, 600.0, 100, 0, "Specify the number of children of a particle that multiply itself");
@@ -1239,30 +1223,28 @@ void object_panel_effects(Object *ob)
                        uiDefButI(block, NUM, B_CALCEFFECT, "Seed:",            652,96,80,20, &paf->seed, 0.0, 255.0, 0, 0, "Set an offset in the random table");
 
                        uiDefButF(block, NUM, B_DIFF,                   "VectSize",             885,96,116,20, &paf->vectsize, 0.0, 1.0, 10, 0, "Set the speed for Vect");      
-                       uiBlockSetCol(block, BUTGREEN);
                        uiDefButS(block, TOG|BIT|3, B_CALCEFFECT, "Face",                               735,96,46,20, &paf->flag, 0, 0, 0, 0, "Emit particles also from faces");
                        uiDefButS(block, TOG|BIT|1, B_CALCEFFECT, "Bspline",                    782,96,54,20, &paf->flag, 0, 0, 0, 0, "Use B spline formula for particle interpolation");
                        uiDefButS(block, TOG, REDRAWVIEW3D, "Vect",                                     837,96,45,20, &paf->stype, 0, 0, 0, 0, "Give the particles a rotation direction");
                        
-                       uiBlockSetCol(block, BUTPURPLE);
+                       uiBlockSetCol(block, TH_BUT_SETTING2);
                        uiDefButF(block, NUM, B_CALCEFFECT, "Norm:",            550,67,96,20, &paf->normfac, -2.0, 2.0, 10, 0, "Let the mesh give the particle a starting speed");
                        uiDefButF(block, NUM, B_CALCEFFECT, "Ob:",              649,67,86,20, &paf->obfac, -1.0, 1.0, 10, 0, "Let the object give the particle a starting speed");
                        uiDefButF(block, NUM, B_CALCEFFECT, "Rand:",            738,67,86,20, &paf->randfac, 0.0, 2.0, 10, 0, "Give the startingspeed a random variation");
                        uiDefButF(block, NUM, B_CALCEFFECT, "Tex:",             826,67,85,20, &paf->texfac, 0.0, 2.0, 10, 0, "Let the texture give the particle a starting speed");
                        uiDefButF(block, NUM, B_CALCEFFECT, "Damp:",            913,67,89,20, &paf->damp, 0.0, 1.0, 10, 0, "Specify the damping factor");
-
-                       uiBlockSetCol(block, BUTGREY);
+                       uiBlockSetCol(block, TH_AUTO);
+                       
                        uiDefButF(block, NUM, B_CALCEFFECT, "X:",                       550,31,72,20, paf->force, -1.0, 1.0, 1, 0, "Specify the X axis of a continues force");
                        uiDefButF(block, NUM, B_CALCEFFECT, "Y:",                       624,31,78,20, paf->force+1,-1.0, 1.0, 1, 0, "Specify the Y axis of a continues force");
                        uiDefBut(block, LABEL, 0, "Force:",                                             550,9,72,20, 0, 1.0, 0, 0, 0, "");
                        uiDefButF(block, NUM, B_CALCEFFECT, "Z:",                       623,9,79,20, paf->force+2, -1.0, 1.0, 1, 0, "Specify the Z axis of a continues force");
 
                        uiDefBut(block, LABEL, 0, "Texture:",                           722,9,74,20, 0, 1.0, 0, 0, 0, "");
-                       uiBlockSetCol(block, BUTGREEN);
                        uiDefButS(block, ROW, B_CALCEFFECT, "Int",              875,9,32,43, &paf->texmap, 14.0, 0.0, 0, 0, "Use texture intensity as a factor for texture force");
                        uiDefButS(block, ROW, B_CALCEFFECT, "RGB",              911,31,45,20, &paf->texmap, 14.0, 1.0, 0, 0, "Use RGB values as a factor for particle speed");
                        uiDefButS(block, ROW, B_CALCEFFECT, "Grad",             958,31,44,20, &paf->texmap, 14.0, 2.0, 0, 0, "Use texture gradient as a factor for particle speed");
-                       uiBlockSetCol(block, BUTGREY);
+
                        uiDefButF(block, NUM, B_CALCEFFECT, "Nabla:",           911,9,91,20, &paf->nabla, 0.0001, 1.0, 1, 0, "Specify the dimension of the area for gradient calculation");
                        uiDefButF(block, NUM, B_CALCEFFECT, "X:",                       722,31,74,20, paf->defvec, -1.0, 1.0, 1, 0, "Specify the X axis of a force, determined by the texture");
                        uiDefButF(block, NUM, B_CALCEFFECT, "Y:",                       798,31,74,20, paf->defvec+1,-1.0, 1.0, 1, 0, "Specify the Y axis of a force, determined by the texture");
@@ -1277,10 +1259,9 @@ static void object_panel_anim(Object *ob)
        uiBlock *block;
        char str[32];
        
-       block= uiNewBlock(&curarea->uiblocks, "object_panel_anim", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "object_panel_anim", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Anim settings", "Object", 0, 0, 318, 204)==0) return;
        
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButC(block, ROW,REDRAWVIEW3D,"TrackX",     27,190,58,17, &ob->trackflag, 12.0, 0.0, 0, 0, "Specify the axis that points to another object");
        uiDefButC(block, ROW,REDRAWVIEW3D,"Y",          85,190,19,17, &ob->trackflag, 12.0, 1.0, 0, 0, "Specify the axis that points to another object");
        uiDefButC(block, ROW,REDRAWVIEW3D,"Z",          104,190,19,17, &ob->trackflag, 12.0, 2.0, 0, 0, "Specify the axis that points to another object");
@@ -1291,39 +1272,30 @@ static void object_panel_anim(Object *ob)
        uiDefButC(block, ROW,REDRAWVIEW3D,"Y",          274,190,20,17, &ob->upflag, 13.0, 1.0, 0, 0, "Specify the axis that points up");
        uiDefButC(block, ROW,REDRAWVIEW3D,"Z",          297,190,19,17, &ob->upflag, 13.0, 2.0, 0, 0, "Specify the axis that points up");
 
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButC(block, TOG|BIT|0, REDRAWVIEW3D, "Draw Key",           25,160,70,19, &ob->ipoflag, 0, 0, 0, 0, "Draw object as key position");
        uiDefButC(block, TOG|BIT|1, REDRAWVIEW3D, "Draw Key Sel",       97,160,81,20, &ob->ipoflag, 0, 0, 0, 0, "Limit the drawing of object keys");
        uiDefButS(block, TOG|BIT|4, 0, "SlowPar",                       261,160,56,20, &ob->partype, 0, 0, 0, 0, "Create a delay in the parent relationship");
        uiDefButC(block, TOG|BIT|7, REDRAWVIEW3D, "Powertrack", 180,160,78,19, &ob->transflag, 0, 0, 0, 0, "Switch objects rotation off");
 
-
-       uiBlockSetCol(block, BUTGREY);
        uiDefButC(block, TOG|BIT|3, REDRAWVIEW3D, "DupliFrames",        24,128,88,19, &ob->transflag, 0, 0, 0, 0, "Make copy of object for every frame");
        uiDefButC(block, TOG|BIT|4, REDRAWVIEW3D, "DupliVerts",         114,128,82,19, &ob->transflag, 0, 0, 0, 0, "Duplicate child objects on all vertices");
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButC(block, TOG|BIT|5, REDRAWVIEW3D, "Rot",                200,128,31,20, &ob->transflag, 0, 0, 0, 0, "Rotate dupli according to facenormal");
        uiDefButC(block, TOG|BIT|6, REDRAWVIEW3D, "No Speed",   234,128,82,19, &ob->transflag, 0, 0, 0, 0, "Set dupliframes to still, regardless of frame");
 
-       uiBlockSetCol(block, BUTGREY);
        uiDefButS(block, NUM, REDRAWVIEW3D, "DupSta:",          24,105,141,18, &ob->dupsta, 1.0, 1500.0, 0, 0, "Specify startframe for Dupliframes");
        uiDefButS(block, NUM, REDRAWVIEW3D, "DupEnd",           24,83,140,19, &ob->dupend, 1.0, 2500.0, 0, 0, "Specify endframe for Dupliframes");
        uiDefButS(block, NUM, REDRAWVIEW3D, "DupOn:",           169,104,146,19, &ob->dupon, 1.0, 1500.0, 0, 0, "");
        uiDefButS(block, NUM, REDRAWVIEW3D, "DupOff",           169,82,145,19, &ob->dupoff, 0.0, 1500.0, 0, 0, "");
 
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButC(block, TOG|BIT|2, REDRAWALL, "Offs Ob",                       23,51,56,20, &ob->ipoflag, 0, 0, 0, 0, "Let the timeoffset work on its own objectipo");
        uiDefButC(block, TOG|BIT|6, REDRAWALL, "Offs Par",                      82,51,56,20 , &ob->ipoflag, 0, 0, 0, 0, "Let the timeoffset work on the parent");
        uiDefButC(block, TOG|BIT|7, REDRAWALL, "Offs Particle",         141,51,103,20, &ob->ipoflag, 0, 0, 0, 0, "Let the timeoffset work on the particle effect");
 
-       uiBlockSetCol(block, BUTGREY);
        sprintf(str, "%.4f", prspeed);
        uiDefBut(block, LABEL, 0, str,                                                  247,40,63,31, 0, 1.0, 0, 0, 0, "");
        uiDefBut(block, BUT, B_PRINTSPEED,      "PrSpeed",                      246,17,67,31, 0, 0, 0, 0, 0, "Print objectspeed");
 
-       uiBlockSetCol(block, BUTGREY);
        uiDefButF(block, NUM, REDRAWALL, "TimeOffset:",                 23,17,114,30, &ob->sf, -9000.0, 9000.0, 100, 0, "Specify an offset in frames");
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT, B_AUTOTIMEOFS, "Automatic Time",   139,17,104,31, 0, 0, 0, 0, 0, "Generate automatic timeoffset values for all selected frames");
                
 #if 0  
@@ -1343,8 +1315,6 @@ static void object_panel_anim(Object *ob)
                }
        }
        
-       uiBlockSetCol(block, BUTGREY);
-       
                sprintf(str, "%.3f", G.sipo->v2d.tot.xmin);
                uiDefBut(block, LABEL, 0, str,                  1020, 140, 100, 19, 0, 0, 0, 0, 0, "");
                sprintf(str, "%.3f", G.sipo->v2d.tot.xmax);
@@ -1361,15 +1331,12 @@ static void object_panel_anim(Object *ob)
                uiDefButF(block, NUM, B_DIFF, "Ymin:",          1020, 80, 100, 19, &G.sipo->tot.ymin, -G.sipo->v2d.max[1], G.sipo->v2d.max[1], 100, 0, "");
                uiDefButF(block, NUM, B_DIFF, "Ymax:",          1120, 80, 100, 19, &G.sipo->tot.ymax, -G.sipo->v2d.max[1], G.sipo->v2d.max[1], 100, 0, "");
        
-               uiBlockSetCol(block, BUTSALMON);
                uiDefBut(block, BUT, B_MUL_IPO, "SET",          1220,79,50,62, 0, 0, 0, 0, 0, "");
                
                
                /* SPEED BUTTON */
-               uiBlockSetCol(block, BUTGREY);
                uiDefButF(block, NUM, B_DIFF, "Speed:",         1020,23,164,28, &hspeed, 0.0, 180.0, 1, 0, "");
                
-               uiBlockSetCol(block, BUTSALMON);
                uiDefBut(block, BUT, B_SETSPEED,        "SET",          1185,23,83,29, 0, 0, 0, 0, 0, "");
 
 #endif 
index 2256def0cd7703d23621f6ed515a7cd00c3ac3cb..559bf444918a6f1224a8351da0a1e5c1eb55ff0c 100644 (file)
@@ -264,10 +264,9 @@ static void sound_panel_listener()
        int xco= 100, yco=100, mixrate;
        char mixrateinfo[256];
        
-       block= uiNewBlock(&curarea->uiblocks, "sound_panel_listener", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "sound_panel_listener", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Listener", "Sound", 320, 0, 318, 204)==0) return;
 
-       uiBlockSetCol(block, BUTGREY);
        mixrate = sound_get_mixrate();
        sprintf(mixrateinfo, "Game Mixrate: %d Hz", mixrate);
        uiDefBut(block, LABEL, 0, mixrateinfo, xco,yco,295,20, 0, 0, 0, 0, 0, "");
@@ -295,7 +294,7 @@ static void sound_panel_sequencer()
        short xco, yco;
        char mixrateinfo[256];
        
-       block= uiNewBlock(&curarea->uiblocks, "sound_panel_sequencer", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "sound_panel_sequencer", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Sequencer", "Sound", 640, 0, 318, 204)==0) return;
 
        /* audio sequence engine settings ------------------------------------------------------------------ */
@@ -310,14 +309,11 @@ static void sound_panel_sequencer()
        uiDefBut(block, LABEL, 0, mixrateinfo, xco,yco,295,20, 0, 0, 0, 0, 0, "");
 
        yco -= 25;              
-       uiBlockSetCol(block, BUTGREY);
        uiDefButI(block, ROW, B_SOUND_RATECHANGED, "44.1 kHz",  xco,yco,75,20, &G.scene->audio.mixrate, 2.0, 44100.0, 0, 0, "Mix at 44.1 kHz");
        uiDefButI(block, ROW, B_SOUND_RATECHANGED, "48.0 kHz",          xco+80,yco,75,20, &G.scene->audio.mixrate, 2.0, 48000.0, 0, 0, "Mix at 48 kHz");
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT, B_SOUND_RECALC, "Recalc",          xco+160,yco,75,20, 0, 0, 0, 0, 0, "Recalculate samples");
 
        yco -= 25;
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, TOG|BIT|1, B_SOUND_CHANGED, "Sync",    xco,yco,115,20, &G.scene->audio.flag, 0, 0, 0, 0, "Use sample clock for syncing animation to audio");
        uiDefButS(block, TOG|BIT|2, B_SOUND_CHANGED, "Scrub",           xco+120,yco,115,20, &G.scene->audio.flag, 0, 0, 0, 0, "Scrub when changing frames");
 
@@ -325,7 +321,6 @@ static void sound_panel_sequencer()
        uiDefBut(block, LABEL, 0, "Main mix", xco,yco,295,20, 0, 0, 0, 0, 0, "");
 
        yco -= 25;              
-       uiBlockSetCol(block, BUTGREY);
        uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Main (dB): ",
                xco,yco,235,24,&G.scene->audio.main, -24.0, 6.0, 0, 0, "Set the audio master gain/attenuation in dB");
 
@@ -333,7 +328,6 @@ static void sound_panel_sequencer()
        uiDefButS(block, TOG|BIT|0, 0, "Mute",  xco,yco,235,24, &G.scene->audio.flag, 0, 0, 0, 0, "Mute audio from sequencer");         
        
        yco -= 35;
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT, B_SOUND_MIXDOWN, "MIXDOWN",        xco,yco,235,24, 0, 0, 0, 0, 0, "Create WAV file from sequenced audio");
        
 }
@@ -346,7 +340,7 @@ static void sound_panel_sound(bSound *sound)
        bSample *sample;
        char *strp, str[32], ch[256];
 
-       block= uiNewBlock(&curarea->uiblocks, "sound_panel_sound", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "sound_panel_sound", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Sound", "Sound", 0, 0, 318, 204)==0) return;
        
        uiDefBut(block, LABEL, 0, "Blender Sound block",10,180,195,20, 0, 0, 0, 0, 0, "");
@@ -394,14 +388,10 @@ static void sound_panel_sound(bSound *sound)
                uiDefIconButI(block, TOG|BIT|0, B_SOUND_UNPACK_SAMPLE, ICON_PACKAGE,
                        285, 120,25,24, &packdummy, 0, 0, 0, 0,"Pack/Unpack this sample");
                
-               uiBlockSetCol(block, BUTSALMON);
                uiDefBut(block, BUT, B_SOUND_LOAD_SAMPLE, "Load sample", 10, 95,150,24, 0, 0, 0, 0, 0, "Load a different sample file");
 
-               uiBlockSetCol(block, BUTPURPLE);
                uiDefBut(block, BUT, B_SOUND_PLAY_SAMPLE, "Play",       160, 95, 150, 24, 0, 0.0, 0, 0, 0, "Playback sample using settings below");
                
-
-               uiBlockSetCol(block, BUTGREY);
                uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Volume: ",
                        10,70,150,20, &sound->volume, 0.0, 1.0, 0, 0, "Set the volume of this sound");
 
@@ -409,7 +399,6 @@ static void sound_panel_sound(bSound *sound)
                        160,70,150,20, &sound->pitch, -12.0, 12.0, 0, 0, "Set the pitch of this sound");
 
                /* looping */
-               uiBlockSetCol(block, BUTGREEN);
                uiDefButI(block, TOG|BIT|SOUND_FLAGS_LOOP_BIT, B_SOUND_REDRAW, "Loop",
                        10, 50, 95, 20, &sound->flags, 0.0, 0.0, 0, 0, "Toggle between looping on/off");
 
@@ -423,12 +412,10 @@ static void sound_panel_sound(bSound *sound)
                /* 3D settings ------------------------------------------------------------------ */
 
                if (sound->sample->channels == 1) {
-                       uiBlockSetCol(block, BUTGREEN);
                        uiDefButI(block, TOG|BIT|SOUND_FLAGS_3D_BIT, B_SOUND_REDRAW, "3D Sound",
                                10, 10, 90, 20, &sound->flags, 0, 0, 0, 0, "Turns 3D sound on");
                        
                        if (sound->flags & SOUND_FLAGS_3D) {
-                               uiBlockSetCol(block, BUTGREY);
                                uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Scale: ",
                                        100,10,210,20, &sound->attenuation, 0.0, 5.0, 1.0, 0, "Sets the surround scaling factor for this sound");
                                
@@ -796,53 +783,29 @@ static uiBlock *edge_render_menu(void *arg_unused)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks,
-                         "edge render", UI_EMBOSSX, UI_HELV,
-                         curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "edge render", UI_EMBOSS, UI_HELV, curarea->win);
                
        /* use this for a fake extra empy space around the buttons */
-       uiDefBut(block, LABEL, 0, "",
-/*              285, -20, 230, 100, NULL, */
-                285, -20, 230, 120, NULL,
-                0, 0, 0, 0, "");
+       uiDefBut(block, LABEL, 0, "",  285, -20, 230, 120, NULL,  0, 0, 0, 0, "");
        
-       uiDefButS(block, NUM, 0,"Eint:",
-                 295,50,70,19,
-                 &G.scene->r.edgeint, 0.0, 255.0, 0, 0,
+       uiDefButS(block, NUM, 0,"Eint:",  295,50,70,19,  &G.scene->r.edgeint, 0.0, 255.0, 0, 0,
                  "Sets edge intensity for Toon shading");
-       uiBlockSetCol(block, BUTGREEN);
-       uiDefButI(block, TOG, 0,"Shift",
-                 365,50,70,19,
-                 &G.compat, 0, 0, 0, 0,
+       uiDefButI(block, TOG, 0,"Shift", 365,50,70,19,  &G.compat, 0, 0, 0, 0,
                  "For unified renderer: use old offsets for edges");
-       uiDefButI(block, TOG, 0,"All",          435,50,70,19,
-                 &G.notonlysolid, 0, 0, 0, 0,
-                 "For unified renderer: also consider transparent "
-                 "faces for toon shading");
+       uiDefButI(block, TOG, 0,"All",          435,50,70,19,  &G.notonlysolid, 0, 0, 0, 0,
+                 "For unified renderer: also consider transparent faces for toon shading");
 
        /* colour settings for the toon shading */
-       uiBlockSetCol(block, BUTGREY);
-       uiDefButF(block, COL, B_EDGECOLSLI, "",
-                 295,-10,30,60,
-                 &(G.scene->r.edgeR), 0, 0, 0, 0,
-                 "");
+       uiDefButF(block, COL, B_EDGECOLSLI, "", 295,-10,30,60,  &(G.scene->r.edgeR), 0, 0, 0, 0, "");
        
-       uiDefButF(block, NUMSLI, 0, "R ",
-                 325, 30, 180,19,
-                 &G.scene->r.edgeR, 0.0, 1.0, B_EDGECOLSLI, 0,
+       uiDefButF(block, NUMSLI, 0, "R ",   325, 30, 180,19,   &G.scene->r.edgeR, 0.0, 1.0, B_EDGECOLSLI, 0,
                  "For unified renderer: Colour for edges in toon shading mode.");
-       uiDefButF(block, NUMSLI, 0, "G ",
-                 325, 10, 180,19,
-                 &G.scene->r.edgeG, 0.0, 1.0, B_EDGECOLSLI, 0,
+       uiDefButF(block, NUMSLI, 0, "G ",  325, 10, 180,19,  &G.scene->r.edgeG, 0.0, 1.0, B_EDGECOLSLI, 0,
                  "For unified renderer: Colour for edges in toon shading mode.");
-       uiDefButF(block, NUMSLI, 0, "B ",
-                 325, -10, 180,19,
-                 &G.scene->r.edgeB, 0.0, 1.0, B_EDGECOLSLI, 0,
+       uiDefButF(block, NUMSLI, 0, "B ",  325, -10, 180,19,  &G.scene->r.edgeB, 0.0, 1.0, B_EDGECOLSLI, 0,
                  "For unified renderer: Colour for edges in toon shading mode.");
 
-       uiDefButS(block, NUM, 0,"AntiShift",
-                 365,70,140,19,
-                 &(G.scene->r.same_mat_redux), 0, 255.0, 0, 0,
+       uiDefButS(block, NUM, 0,"AntiShift",   365,70,140,19,  &(G.scene->r.same_mat_redux), 0, 255.0, 0, 0,
                  "For unified renderer: reduce intensity on boundaries "
                  "with identical materials with this number.");
        
@@ -855,17 +818,14 @@ static uiBlock *post_render_menu(void *arg_unused)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "post render", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "post render", UI_EMBOSS, UI_HELV, curarea->win);
                
        /* use this for a fake extra empy space around the buttons */
        uiDefBut(block, LABEL, 0, "",                   -10, 10, 200, 80, NULL, 0, 0, 0, 0, "");
        
-       uiDefButF(block, NUMSLI, 0,"Add:",              0,60,180,19,
-                        &G.scene->r.postadd, -1.0, 1.0, 0, 0, "");
-       uiDefButF(block, NUMSLI, 0,"Mul:",              0,40,180,19,
-                        &G.scene->r.postmul, 0.01, 4.0, 0, 0, "");
-       uiDefButF(block, NUMSLI, 0,"Gamma:",            0,20,180,19,
-                        &G.scene->r.postgamma, 0.2, 2.0, 0, 0, "");
+       uiDefButF(block, NUMSLI, 0,"Add:",              0,60,180,19,  &G.scene->r.postadd, -1.0, 1.0, 0, 0, "");
+       uiDefButF(block, NUMSLI, 0,"Mul:",              0,40,180,19,  &G.scene->r.postmul, 0.01, 4.0, 0, 0, "");
+       uiDefButF(block, NUMSLI, 0,"Gamma:",            0,20,180,19,  &G.scene->r.postgamma, 0.2, 2.0, 0, 0, "");
 
        uiBlockSetDirection(block, UI_TOP);
        
@@ -879,7 +839,7 @@ static uiBlock *framing_render_menu(void *arg_unused)
        short yco = 60, xco = 0;
        int randomcolorindex = 1234;
 
-       block= uiNewBlock(&curarea->uiblocks, "framing_options", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "framing_options", UI_EMBOSS, UI_HELV, curarea->win);
 
        /* use this for a fake extra empy space around the buttons */
        uiDefBut(block, LABEL, 0, "",                   -10, -10, 300, 100, NULL, 0, 0, 0, 0, "");
@@ -989,7 +949,7 @@ static void render_panel_output()
        char *strp;
 
 
-       block= uiNewBlock(&curarea->uiblocks, "render_panel_output", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "render_panel_output", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Output", "Render", 0, 0, 318, 204)==0) return;
        
        uiDefBut(block, TEX,0,"",                               30, 170, 268, 19,G.scene->r.pic, 0.0,79.0, 0, 0, "Directory/name to save rendered Pics to");
@@ -999,10 +959,8 @@ static void render_panel_output()
        uiDefBut(block, TEX,0,"",                               30, 125, 268, 19,G.scene->r.ftype,0.0,79.0, 0, 0, "Image to use with FTYPE Image type");
        uiDefBut(block, BUT,B_FS_FTYPE," ",             15, 125, 10, 19, 0, 0, 0, 0, 0, "Open Fileselect to get Ftype image");
        uiDefIconBut(block, BUT, B_CLEARSET, ICON_X, 131, 95, 20, 19, 0, 0, 0, 0, 0, "Remove Set link");
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT,B_IS_BACKBUF," ",   8, 148, 10, 19, 0, 0, 0, 0, 0, "Open Imageselect to get Backbuf image");
        uiDefBut(block, BUT,B_IS_FTYPE," ",             8, 125, 10, 19, 0, 0, 0, 0, 0, "Open Imageselect to get Ftype image");
-       uiBlockSetCol(block, BUTGREY);
 
        /* SET BUTTON */
        id= (ID *)G.scene->set;
@@ -1011,7 +969,7 @@ static void render_panel_output()
                uiDefButS(block, MENU, B_SETBROWSE, strp, 8, 96, 20, 19, &(G.buts->menunr), 0, 0, 0, 0, "Scene to link as a Set");
        MEM_freeN(strp);
 
-       uiBlockSetCol(block, BUTBLUE);
+       uiBlockSetCol(block, TH_BUT_SETTING1);
 
        if(G.scene->set) {
                uiSetButLock(1, NULL);
@@ -1022,7 +980,7 @@ static void render_panel_output()
 
        uiDefButS(block, TOG|BIT|0, 0,"Backbuf",        8, 70, 62, 19, &G.scene->r.bufflag, 0, 0, 0, 0, "Enable/Disable use of Backbuf image"); 
        
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_AUTO);
                        
        for(b=0; b<3; b++) 
                for(a=0; a<3; a++)
@@ -1053,15 +1011,11 @@ static void render_panel_render()
        uiBlock *block;
 
 
-       block= uiNewBlock(&curarea->uiblocks, "render_panel_render", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "render_panel_render", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Render", "Render", 320, 0, 318, 204)==0) return;
 
-       uiBlockSetCol(block, BUTSALMON);
-       
        uiDefBut(block, BUT,B_DORENDER,"RENDER",        369,142,192,47, 0, 0, 0, 0, 0, "Start the rendering");
        
-       uiBlockSetCol(block, BUTGREY);
-       
        uiDefButS(block, TOG|BIT|0, 0, "OSA",           369,114,124,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
        uiDefButF(block, NUM,B_DIFF,"Bf:",                                                      495,90,65,20,&G.scene->r.blurfac, 0.01, 5.0, 10, 0, "Sets motion blur factor");
        uiDefButS(block, TOG|BIT|14, 0, "MBLUR",        495,114,66,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Motion Blur calculation");
@@ -1078,7 +1032,6 @@ static void render_panel_render()
        uiDefButS(block, ROW,800,"Premul",      410,11,54,24,&G.scene->r.alphamode,3.0,1.0, 0, 0, "Multiply alpha in advance");
        uiDefButS(block, ROW,800,"Key",         467,11,44,24,&G.scene->r.alphamode,3.0,2.0, 0, 0, "Alpha and colour values remain unchanged");
 
-       uiBlockSetCol(block, BUTGREY);
        uiDefButS(block, TOG|BIT|1,0,"Shadow",  565,167,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable shadow calculation");
        uiDefButS(block, TOG|BIT|4,0,"EnvMap",  626,167,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable environment map renering");
        uiDefButS(block, TOG|BIT|10,0,"Pano",   565,142,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable panorama rendering (output width is multiplied by Xparts)");
@@ -1105,19 +1058,17 @@ static void render_panel_anim()
        uiBlock *block;
 
 
-       block= uiNewBlock(&curarea->uiblocks, "render_panel_anim", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "render_panel_anim", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Anim", "Render", 640, 0, 318, 204)==0) return;
 
 
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT,B_DOANIM,"ANIM",            692,142,192,47, 0, 0, 0, 0, 0, "Start rendering a sequence");
        
-       uiBlockSetCol(block, BUTBLUE);
-
+       uiBlockSetCol(block, TH_BUT_SETTING1);
        uiDefButS(block, TOG|BIT|0, 0, "Do Sequence",   692,114,192,20, &G.scene->r.scemode, 0, 0, 0, 0, "Enables sequence output rendering (Default: 3D rendering)");
        uiDefButS(block, TOG|BIT|1, 0, "Render Daemon", 692,90,192,20, &G.scene->r.scemode, 0, 0, 0, 0, "Let external network render current scene");
        
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_AUTO);
        uiDefBut(block, BUT,B_PLAYANIM, "PLAY", 692,40,94,33, 0, 0, 0, 0, 0, "Play animation of rendered images/avi (searches Pics: field)");
        uiDefButS(block, NUM, B_RTCHANGED, "rt:",       790,40,95,33, &G.rt, 0.0, 256.0, 0, 0, "General testing/debug button");
 
@@ -1132,7 +1083,7 @@ static void render_panel_format()
        int yofs;
 
 
-       block= uiNewBlock(&curarea->uiblocks, "render_panel_format", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "render_panel_format", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Format", "Render", 960, 0, 318, 204)==0) return;
 
        uiDefBlockBut(block, framing_render_menu, NULL, "Game framing settings |>> ", 892, 169, 227, 20, "Display game framing settings");
@@ -1148,15 +1099,11 @@ static void render_panel_format()
 #ifdef __sgi
        yofs = 76;
        uiDefButS(block, NUM,B_DIFF,"MaxSize:", 892,32,165,20, &G.scene->r.maximsize, 0.0, 500.0, 0, 0, "Maximum size per frame to save in an SGI movie");
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, TOG|BIT|12,0,"Cosmo", 1059,32,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Attempt to save SGI movies using Cosmo hardware");
-       uiBlockSetCol(block, BUTGREY);
 #endif
 
        uiDefButS(block, MENU,B_FILETYPEMENU,imagetype_pup(),   892,yofs,174,20, &G.scene->r.imtype, 0, 0, 0, 0, "Images are saved in this file format");
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, TOG|BIT|11,0, "Crop",          1068,yofs,51,20, &G.scene->r.mode, 0, 0, 0, 0, "Exclude border rendering from total image");
-       uiBlockSetCol(block, BUTGREY);
 
        yofs -= 22;
 
@@ -1246,7 +1193,7 @@ void anim_panels()
        uiBlock *block;
        
        
-       block= uiNewBlock(&curarea->uiblocks, "anim_panels", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "anim_panels", UI_EMBOSS, UI_HELV, curarea->win);
 
        uiDefButS(block, NUM,REDRAWSEQ,"Sta:",  320,17,93,27,&G.scene->r.sfra,1.0,18000.0, 0, 0, "Specify the start frame of the animation");
        uiDefButS(block, NUM,REDRAWSEQ,"End:",  416,17,95,27,&G.scene->r.efra,1.0,18000.0, 0, 0, "Specify the end frame of the animation");
@@ -1256,7 +1203,6 @@ void anim_panels()
 
        uiDefButS(block, NUM,REDRAWSEQ,"Frs/sec:",   320,47,93,19, &G.scene->r.frs_sec, 1.0, 120.0, 100.0, 0, "Frames per second");
        
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, TOG|BIT|1, B_SOUND_CHANGED, "Sync",    416,47,95,19, &G.scene->audio.flag, 0, 0, 0, 0, "Use sample clock for syncing animation to audio");
 
 
index 3a19442ad24b5d2a7efbbd8b5a93830001043fe0..33040d00708a21fac4574be7221516fa06c0925a 100644 (file)
@@ -228,8 +228,6 @@ void draw_scriptlink(uiBlock *block, ScriptLink *script, int sx, int sy, int sce
 {
        char str[256];
 
-       uiBlockSetCol(block, BUTGREY);
-
        if (script->totscript) {
                strcpy(str, "FrameChanged%x 1|");
                strcat(str, "Redraw%x 4|");
@@ -245,8 +243,6 @@ void draw_scriptlink(uiBlock *block, ScriptLink *script, int sx, int sy, int sce
        sprintf(str,"%d Scr:", script->totscript);
        uiDefButS(block, NUM, REDRAWBUTSSCRIPT, str, (short)(sx+140), (short)sy-20,60,19, &script->actscript, 1, script->totscript, 0, 0, "Total / Active Script link (LeftMouse + Drag to change)");
 
-       uiBlockSetCol(block, BUTSALMON);
-
        if (scene) {
                if (script->totscript<32767) 
                        uiDefBut(block, BUT, B_SSCRIPT_ADD, "New", (short)(sx+240), (short)sy-20, 40, 19, 0, 0, 0, 0, 0, "Add a new Script link");
@@ -276,7 +272,7 @@ static void  script_panel_scriptlink(void)
        Material *ma;
        int xco = 10;
        
-       block= uiNewBlock(&curarea->uiblocks, "script_panel_scriptlink", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "script_panel_scriptlink", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Scriptlinks", "Script", 0, 0, 318, 204)==0) return;
        
        
index a07663832214a95842251ddc8c67b30aae3b5bcd..34f528de0cefc37da8fa120bf99a190f043d0ad6 100644 (file)
@@ -628,7 +628,7 @@ static void texture_panel_plugin(Tex *tex)
        PluginTex *pit;
        short xco, yco, a;
        
-       block= uiNewBlock(&curarea->uiblocks, "texture_panel_plugin", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "texture_panel_plugin", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Plugin", "Texture", 640, 0, 318, 204)==0) return;
        uiSetButLock(tex->id.lib!=0, "Can't edit library data");
 
@@ -636,12 +636,10 @@ static void texture_panel_plugin(Tex *tex)
                
                pit= tex->plugin;
 
-               uiBlockSetCol(block, BUTGREEN);
                for(a=0; a<pit->stypes; a++) {
                        uiDefButS(block, ROW, B_MATPRV, pit->stnames+16*a, (350+75*a), 170, 75, 18, &tex->stype, 2.0, (float)a, 0, 0, "");
                }
                
-               uiBlockSetCol(block, BUTGREY);
                varstr= pit->varstr;
                if(varstr) {
                        for(a=0; a<pit->vars; a++, varstr++) {
@@ -654,7 +652,6 @@ static void texture_panel_plugin(Tex *tex)
                uiDefBut(block, TEX, B_NAMEPLUGIN, "",          350,130,290,24, pit->name, 0.0, 159.0, 0, 0, "");
        }
 
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT, B_LOADPLUGIN, "Load Plugin", 350,150,137,24, 0, 0, 0, 0, 0, "");
                        
 }
@@ -664,11 +661,10 @@ static void texture_panel_magic(Tex *tex)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "texture_panel_magic", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "texture_panel_magic", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Magic", "Texture", 640, 0, 318, 204)==0) return;
        uiSetButLock(tex->id.lib!=0, "Can't edit library data");
 
-       uiBlockSetCol(block, BUTGREY);
        uiDefButF(block, NUM, B_MATPRV, "Size :",               10, 110, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Set the dimension of the pattern");
        uiDefButS(block, NUM, B_MATPRV, "Depth:",               10, 90, 150, 19, &tex->noisedepth, 0.0, 10.0, 0, 0, "Set the depth of the pattern");
        uiDefButF(block, NUM, B_MATPRV, "Turbulence:",  10, 70, 150, 19, &tex->turbul, 0.0, 200.0, 10, 0, "Set the strength of the pattern");
@@ -678,11 +674,10 @@ static void texture_panel_blend(Tex *tex)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "texture_panel_blend", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "texture_panel_blend", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Blend", "Texture", 640, 0, 318, 204)==0) return;
        uiSetButLock(tex->id.lib!=0, "Can't edit library data");
 
-       uiBlockSetCol(block, BUTGREEN); 
        uiDefButS(block, ROW, B_MATPRV, "Lin",          10, 180, 75, 19, &tex->stype, 2.0, 0.0, 0, 0, "Use a linear progresion"); 
        uiDefButS(block, ROW, B_MATPRV, "Quad",         85, 180, 75, 19, &tex->stype, 2.0, 1.0, 0, 0, "Use a quadratic progression"); 
        uiDefButS(block, ROW, B_MATPRV, "Ease",         160, 180, 75, 19, &tex->stype, 2.0, 2.0, 0, 0, ""); 
@@ -700,11 +695,10 @@ static void texture_panel_wood(Tex *tex)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "texture_panel_wood", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "texture_panel_wood", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Wood", "Texture", 640, 0, 318, 204)==0) return;
        uiSetButLock(tex->id.lib!=0, "Can't edit library data");
 
-       uiBlockSetCol(block, BUTGREEN); 
        uiDefButS(block, ROW, B_MATPRV, "Bands",                10, 180, 75, 18, &tex->stype, 2.0, 0.0, 0, 0, "Use standard wood texture"); 
        uiDefButS(block, ROW, B_MATPRV, "Rings",                85, 180, 75, 18, &tex->stype, 2.0, 1.0, 0, 0, "Use wood rings"); 
        uiDefButS(block, ROW, B_MATPRV, "BandNoise",    160, 180, 75, 18, &tex->stype, 2.0, 2.0, 0, 0, "Add noise to standard wood"); 
@@ -713,7 +707,6 @@ static void texture_panel_wood(Tex *tex)
        uiDefButS(block, ROW, B_MATPRV, "Soft noise",   10, 160, 75, 19, &tex->noisetype, 12.0, 0.0, 0, 0, "Use soft noise");
        uiDefButS(block, ROW, B_MATPRV, "Hard noise",   85, 160, 75, 19, &tex->noisetype, 12.0, 1.0, 0, 0, "Use hard noise");
 
-       uiBlockSetCol(block, BUTGREY);  
        uiDefButF(block, NUM, B_MATPRV, "NoiseSize :",  10, 130, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Set the dimension of the noise table");
        uiDefButF(block, NUM, B_MATPRV, "Turbulence:",  160, 130, 150, 19, &tex->turbul, 0.0, 200.0, 10, 0, "Set the turbulence of the bandnoise and ringnoise types");
 
@@ -724,18 +717,16 @@ static void texture_panel_stucci(Tex *tex)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "texture_panel_stucci", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "texture_panel_stucci", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Stucci", "Texture", 640, 0, 318, 204)==0) return;
        uiSetButLock(tex->id.lib!=0, "Can't edit library data");
 
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, ROW, B_MATPRV, "Plastic",              10, 180, 100, 19, &tex->stype, 2.0, 0.0, 0, 0, "Use standard stucci");
        uiDefButS(block, ROW, B_MATPRV, "Wall In",              110, 180, 100, 19, &tex->stype, 2.0, 1.0, 0, 0, "Set start value"); 
        uiDefButS(block, ROW, B_MATPRV, "Wall Out",             210, 180, 100, 19, &tex->stype, 2.0, 2.0, 0, 0, "Set end value"); 
        uiDefButS(block, ROW, B_MATPRV, "Soft noise",   10, 160, 100, 19, &tex->noisetype, 12.0, 0.0, 0, 0, "Use soft noise");
        uiDefButS(block, ROW, B_MATPRV, "Hard noise",   110, 160, 100, 19, &tex->noisetype, 12.0, 1.0, 0, 0, "Use hard noise");
 
-       uiBlockSetCol(block, BUTGREY);  
        uiDefButF(block, NUM, B_MATPRV, "NoiseSize :",  10, 110, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Set the dimension of the noise table");
        uiDefButF(block, NUM, B_MATPRV, "Turbulence:",  10, 90, 150, 19, &tex->turbul, 0.0, 200.0, 10, 0, "Set the depth of the stucci");
 }
@@ -744,11 +735,10 @@ static void texture_panel_marble(Tex *tex)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "texture_panel_marble", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "texture_panel_marble", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Marble", "Texture", 640, 0, 318, 204)==0) return;
        uiSetButLock(tex->id.lib!=0, "Can't edit library data");
 
-       uiBlockSetCol(block, BUTGREEN); 
        uiDefButS(block, ROW, B_MATPRV, "Soft",                 10, 180, 75, 18, &tex->stype, 2.0, 0.0, 0, 0, "Use soft marble"); 
        uiDefButS(block, ROW, B_MATPRV, "Sharp",                85, 180, 75, 18, &tex->stype, 2.0, 1.0, 0, 0, "Use more clearly defined marble"); 
        uiDefButS(block, ROW, B_MATPRV, "Sharper",              160, 180, 75, 18, &tex->stype, 2.0, 2.0, 0, 0, "Use very clear defined marble"); 
@@ -756,7 +746,6 @@ static void texture_panel_marble(Tex *tex)
        uiDefButS(block, ROW, B_MATPRV, "Soft noise",   10, 160, 100, 19, &tex->noisetype, 12.0, 0.0, 0, 0, "Use soft noise");
        uiDefButS(block, ROW, B_MATPRV, "Hard noise",   110, 160, 100, 19, &tex->noisetype, 12.0, 1.0, 0, 0, "Use hard noise");
 
-       uiBlockSetCol(block, BUTGREY);  
        uiDefButF(block, NUM, B_MATPRV, "NoiseSize :",  10, 110, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Set the dimension of the noise table");
        uiDefButS(block, NUM, B_MATPRV, "NoiseDepth:",  10, 90, 150, 19, &tex->noisedepth, 0.0, 6.0, 0, 0, "Set the depth of the marble calculation");
        uiDefButF(block, NUM, B_MATPRV, "Turbulence:",  10, 70, 150, 19, &tex->turbul, 0.0, 200.0, 10, 0, "Set the turbulence of the sine bands");
@@ -768,17 +757,15 @@ static void texture_panel_clouds(Tex *tex)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "texture_panel_clouds", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "texture_panel_clouds", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Clouds", "Texture", 640, 0, 318, 204)==0) return;
        uiSetButLock(tex->id.lib!=0, "Can't edit library data");
 
-       uiBlockSetCol(block, BUTGREEN); 
        uiDefButS(block, ROW, B_MATPRV, "Default",              10, 180, 70, 18, &tex->stype, 2.0, 0.0, 0, 0, "Use standard noise"); 
        uiDefButS(block, ROW, B_MATPRV, "Color",                80, 180, 70, 18, &tex->stype, 2.0, 1.0, 0, 0, "Let Noise give RGB value"); 
        uiDefButS(block, ROW, B_MATPRV, "Soft noise",   155, 180, 75, 19, &tex->noisetype, 12.0, 0.0, 0, 0, "Use soft noise");
        uiDefButS(block, ROW, B_MATPRV, "Hard noise",   230, 180, 80, 19, &tex->noisetype, 12.0, 1.0, 0, 0, "Use hard noise");
 
-       uiBlockSetCol(block, BUTGREY);  
        uiDefButF(block, NUM, B_MATPRV, "NoiseSize :",  10, 130, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Set the dimension of the noise table");
        uiDefButS(block, NUM, B_MATPRV, "NoiseDepth:",  160, 130, 150, 19, &tex->noisedepth, 0.0, 6.0, 0, 0, "Set the depth of the cloud calculation");
 
@@ -793,7 +780,7 @@ static void texture_panel_envmap(Tex *tex)
        short a, xco, yco, dx, dy;
        char *strp, str[32];
        
-       block= uiNewBlock(&curarea->uiblocks, "texture_panel_envmap", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "texture_panel_envmap", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Envmap", "Texture", 640, 0, 318, 204)==0) return;
        uiSetButLock(tex->id.lib!=0, "Can't edit library data");
 
@@ -804,49 +791,41 @@ static void texture_panel_envmap(Tex *tex)
        if(tex->env) {
                env= tex->env;
                
-               uiBlockSetCol(block, BUTGREEN);
                uiDefButS(block, ROW, B_REDR,   "Static",       10, 180, 100, 19, &env->stype, 2.0, 0.0, 0, 0, "Calculate map only once");
                uiDefButS(block, ROW, B_REDR,   "Anim",         110, 180, 100, 19, &env->stype, 2.0, 1.0, 0, 0, "Calculate map each rendering");
                uiDefButS(block, ROW, B_ENV_FREE, "Load",       210, 180, 100, 19, &env->stype, 2.0, 2.0, 0, 0, "Load map from disk");
                
                if(env->stype==ENV_LOAD) {
                        /* file input */
-                       uiBlockSetCol(block, BUTGREY);
                        id= (ID *)tex->ima;
                        IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->image), id, &(G.buts->menunr));
                        if(strp[0])
                                uiDefButS(block, MENU, B_TEXIMABROWSE, strp, 10,135,23,20, &(G.buts->menunr), 0, 0, 0, 0, "Browse");
                        MEM_freeN(strp);
                
-                       uiBlockSetCol(block, BUTSALMON);
                        uiDefBut(block, BUT, B_LOADTEXIMA1, "Load Image", 10,115,130,20, 0, 0, 0, 0, 0, "Load image - file view");
-                       uiBlockSetCol(block, BUTPURPLE);
+                       uiBlockSetCol(block, TH_BUT_SETTING2);
                        uiDefBut(block, BUT, B_LOADTEXIMA, "",          140,115,20,20, 0, 0, 0, 0, 0, "Load image - thumb view");
+                       uiBlockSetCol(block, TH_AUTO);
                
                        if(tex->ima) {
                                uiDefBut(block, TEX, B_NAMEIMA, "",                     35,135,255,20, tex->ima->name, 0.0, 79.0, 0, 0, "Texture name");
                                sprintf(str, "%d", tex->ima->id.us);
                                uiDefBut(block, BUT, 0, str,                            290,135,20,20, 0, 0, 0, 0, 0, "Number of users");
-                               uiBlockSetCol(block, BUTSALMON);
                                uiDefBut(block, BUT, B_RELOADIMA, "Reload",     230,115,80,20, 0, 0, 0, 0, 0, "Reload");
                        
                                if (tex->ima->packedfile) packdummy = 1;
                                else packdummy = 0;
                                
-                               uiBlockSetCol(block, BUTGREY);
                                uiDefIconButI(block, TOG|BIT|0, B_PACKIMA, ICON_PACKAGE, 205,115,24,20, &packdummy, 0, 0, 0, 0, "Pack/Unpack this Image");
                        }
                }
                else {
-                       uiBlockSetCol(block, BUTSALMON);
                        uiDefBut(block, BUT, B_ENV_FREE, "Free Data",   10,135,100,20, 0, 0, 0, 0, 0, "Release all images associated with environment map");
-                       uiBlockSetCol(block, BUTGREY);
                        uiDefBut(block, BUT, B_ENV_SAVE, "Save EnvMap", 110,135,100,20, 0, 0, 0, 0, 0, "Save environment map");
-                       uiBlockSetCol(block, BUTSALMON);
                        uiDefBut(block, BUT, B_ENV_FREE_ALL, "Free all EnvMaps", 210,135,100,20, 0, 0, 0, 0, 0, "Frees all rendered environment maps");
                }
 
-               uiBlockSetCol(block, BUTGREY);
                uiDefIDPoinBut(block, test_obpoin_but, B_ENV_OB, "Ob:", 10,90,150,20, &(env->object), "Object name");
                if(env->stype!=ENV_LOAD) 
                        uiDefButS(block, NUM, B_ENV_FREE,       "CubeRes",              160,90,150,20, &env->cuberes, 50, 2048.0, 0, 0, "Set the resolution in pixels");
@@ -877,7 +856,7 @@ static void texture_panel_image1(Tex *tex)
        uiBlock *block;
        char str[32];
        
-       block= uiNewBlock(&curarea->uiblocks, "texture_panel1", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "texture_panel1", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Crop and Anim", "Texture", 960, 0, 318, 204)==0) return;
        uiSetButLock(tex->id.lib!=0, "Can't edit library data");
 
@@ -908,7 +887,6 @@ static void texture_panel_image1(Tex *tex)
                uiDefButS(block, NUM, B_MATPRV, "Fra:",         802,10,73,19, &(tex->fradur[3][0]), 0.0, 18000.0, 0, 0, "Montage mode: frame start");
                uiDefButS(block, NUM, B_MATPRV, "",                     879,10,37,19, &(tex->fradur[3][1]), 0.0, 250.0, 0, 0, "Montage mode: amount of displayed frames");
        
-               uiBlockSetCol(block, BUTGREEN);
                uiDefButS(block, TOG|BIT|6, 0, "Cyclic",                743,60,48,19, &tex->imaflag, 0, 0, 0, 0, "Repeat animation image");
        }
 }
@@ -920,13 +898,11 @@ static void texture_panel_image(Tex *tex)
        ID *id;
        char *strp, str[32];
        
-       block= uiNewBlock(&curarea->uiblocks, "texture_panel_image", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "texture_panel_image", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Image", "Texture", 640, 0, 318, 204)==0) return;
        uiSetButLock(tex->id.lib!=0, "Can't edit library data");
 
        /* types */
-       uiBlockSetCol(block, BUTGREEN);
-       
        uiDefButS(block, TOG|BIT|0, 0, "InterPol",                      10, 180, 75, 18, &tex->imaflag, 0, 0, 0, 0, "Interpolate pixels of the image");
        uiDefButS(block, TOG|BIT|1, B_MATPRV, "UseAlpha",       85, 180, 75, 18, &tex->imaflag, 0, 0, 0, 0, "Use the alpha layer");
        uiDefButS(block, TOG|BIT|5, B_MATPRV, "CalcAlpha",      160, 180, 75, 18, &tex->imaflag, 0, 0, 0, 0, "Calculate an alpha based on the RGB");
@@ -940,31 +916,26 @@ static void texture_panel_image(Tex *tex)
        uiDefButS(block, TOG|BIT|10, 0, "StField",                      260, 160, 50, 18, &tex->imaflag, 0, 0, 0, 0, "");
 
        /* file input */
-       uiBlockSetCol(block, BUTGREY);
        id= (ID *)tex->ima;
        IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->image), id, &(G.buts->menunr));
        if(strp[0])
                uiDefButS(block, MENU, B_TEXIMABROWSE, strp, 10,135,23,20, &(G.buts->menunr), 0, 0, 0, 0, "Browse");
        MEM_freeN(strp);
 
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block, BUT, B_LOADTEXIMA1, "Load Image", 10,115,130,20, 0, 0, 0, 0, 0, "Load image - file view");
-       uiBlockSetCol(block, BUTPURPLE);
+       uiBlockSetCol(block, TH_BUT_SETTING1);
        uiDefBut(block, BUT, B_LOADTEXIMA, "",          140,115,20,20, 0, 0, 0, 0, 0, "Load image - thumb view");
-
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_AUTO);
 
        if(tex->ima) {
                uiDefBut(block, TEX, B_NAMEIMA, "",                     35,135,255,20, tex->ima->name, 0.0, 79.0, 0, 0, "Texture name");
                sprintf(str, "%d", tex->ima->id.us);
                uiDefBut(block, BUT, 0, str,                            290,135,20,20, 0, 0, 0, 0, 0, "Number of users");
-               uiBlockSetCol(block, BUTSALMON);
                uiDefBut(block, BUT, B_RELOADIMA, "Reload",     230,115,80,20, 0, 0, 0, 0, 0, "Reload");
        
                if (tex->ima->packedfile) packdummy = 1;
                else packdummy = 0;
                
-               uiBlockSetCol(block, BUTGREY);
                uiDefIconButI(block, TOG|BIT|0, B_PACKIMA, ICON_PACKAGE, 205,115,24,20, &packdummy, 0, 0, 0, 0, "Pack/Unpack this Image");
        }
 
@@ -972,13 +943,11 @@ static void texture_panel_image(Tex *tex)
        
        uiDefButF(block, NUM, B_MATPRV, "Filter :",     10,92,135,19, &tex->filtersize, 0.1, 25.0, 0, 0, "Set the filter size used by mipmap and interpol");
        
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, ROW, 0, "Extend",                      10,70,75,19, &tex->extend, 4.0, 1.0, 0, 0, "Extend the colour of the edge");
        uiDefButS(block, ROW, 0, "Clip",                        85,70,75,19, &tex->extend, 4.0, 2.0, 0, 0, "Return alpha 0.0 outside image");
        uiDefButS(block, ROW, 0, "ClipCube",            160,70,75,19, &tex->extend, 4.0, 4.0, 0, 0, "Return alpha 0.0 outside cubeshaped area around image");
        uiDefButS(block, ROW, 0, "Repeat",                      235,70,75,19, &tex->extend, 4.0, 3.0, 0, 0, "Repeat image horizontally and vertically");
 
-       uiBlockSetCol(block, BUTGREY);
        uiDefButS(block, NUM, B_MATPRV, "Xrepeat:",     10,50,150,19, &tex->xrepeat, 1.0, 512.0, 0, 0, "Set the degree of repetition in the X direction");
        uiDefButS(block, NUM, B_MATPRV, "Yrepeat:",     160,50,150,19, &tex->yrepeat, 1.0, 512.0, 0, 0, "Set the degree of repetition in the Y direction");
 
@@ -1005,33 +974,27 @@ static void texture_panel_colors(Tex *tex)
        uiBlock *block;
        CBData *cbd;
        
-       block= uiNewBlock(&curarea->uiblocks, "texture_panel_colors", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "texture_panel_colors", UI_EMBOSS, UI_HELV, curarea->win);
        uiNewPanelTabbed("Texture", "Texture");
        if(uiNewPanel(curarea, block, "Colors", "Texture", 1280, 0, 318, 204)==0) return;
                
        
        /* COLORBAND */
-       uiBlockSetCol(block, BUTSALMON);
        uiDefButS(block, TOG|BIT|0, B_COLORBAND, "Colorband",10,180,100,20, &tex->flag, 0, 0, 0, 0, "Use colorband");
 
        if(tex->flag & TEX_COLORBAND) {
                uiDefBut(block, BUT, B_ADDCOLORBAND, "Add",             110,180,50,20, 0, 0, 0, 0, 0, "Add new colour to the colorband");
-               uiBlockSetCol(block, BUTGREY);
                uiDefButS(block, NUM, B_REDR,           "Cur:",         160,180,100,20, &tex->coba->cur, 0.0, (float)(tex->coba->tot-1), 0, 0, "The active colour from the colorband");
-               uiBlockSetCol(block, BUTSALMON);
                uiDefBut(block, BUT, B_DELCOLORBAND, "Del",             260,180,50,20, 0, 0, 0, 0, 0, "Delete the active colour");
-               uiBlockSetCol(block, BUTGREY);
                uiDefBut(block, LABEL, B_DOCOLORBAND, "",               10,150,300,20, 0, 0, 0, 0, 0, "Colorband"); /* only for event! */
                
                uiBlockSetDrawExtraFunc(block, drawcolorband_cb);
                cbd= tex->coba->data + tex->coba->cur;
                
                uiDefButF(block, NUM, B_CALCCBAND, "Pos",       10,120,80,20, &cbd->pos, 0.0, 1.0, 10, 0, "Set the position of the active colour");
-               uiBlockSetCol(block, BUTGREEN);
                uiDefButS(block, ROW, B_MATPRV, "E",            90,120,20,20, &tex->coba->ipotype, 5.0, 1.0, 0, 0, "Interpolation type Ease");
                uiDefButS(block, ROW, B_MATPRV, "L",            110,120,20,20, &tex->coba->ipotype, 5.0, 0.0, 0, 0, "Interpolation type Linear");
                uiDefButS(block, ROW, B_MATPRV, "S",            130,120,20,20, &tex->coba->ipotype, 5.0, 2.0, 0, 0, "Interpolation type Spline");
-               uiBlockSetCol(block, BUTGREY);
                uiDefButF(block, COL, B_BANDCOL, "",            150,120,30,20, &(cbd->r), 0, 0, 0, 0, "");
                uiDefButF(block, NUMSLI, B_MATPRV, "A ",        180,120,130,20, &cbd->a, 0.0, 1.0, 0, 0, "Set the alpha value");
                
@@ -1042,7 +1005,6 @@ static void texture_panel_colors(Tex *tex)
        }
 
        /* RGB-BRICON */
-       uiBlockSetCol(block, BUTGREY);
        if((tex->flag & TEX_COLORBAND)==0) {
                uiDefButF(block, NUMSLI, B_MATPRV, "R ",                60,80,200,20, &tex->rfac, 0.0, 2.0, 0, 0, "Set the red value");
                uiDefButF(block, NUMSLI, B_MATPRV, "G ",                60,60,200,20, &tex->gfac, 0.0, 2.0, 0, 0, "Set the green value");
@@ -1064,13 +1026,13 @@ static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *l
        char str[32], *strp;
        
 
-       block= uiNewBlock(&curarea->uiblocks, "texture_panel_texture", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "texture_panel_texture", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Texture", "Texture", 320, 0, 318, 204)==0) return;
 
        /* first do the browse but */
        buttons_active_id(&id, &idfrom);
 
-       uiBlockSetCol(block, BUTPURPLE);
+       uiBlockSetCol(block, TH_BUT_SETTING1);
        if(ma) {
                std_libbuttons(block, 10, 180, 0, NULL, B_TEXBROWSE, id, idfrom, &(G.buts->texnr), B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA);
        }
@@ -1080,7 +1042,7 @@ static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *l
        else if(la) {
                std_libbuttons(block, 10, 180, 0, NULL, B_LTEXBROWSE, id, idfrom, &(G.buts->texnr), B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA);
        }
-
+       uiBlockSetCol(block, TH_AUTO);
 
        /* From button: removed */
 
@@ -1116,8 +1078,6 @@ static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *l
                Tex *tex= mtex->tex;
                int xco;
 
-               uiBlockSetCol(block, BUTGREEN);
-               
                uiSetButLock(tex->id.lib!=0, "Can't edit library data");
                xco= 275;
                uiDefButS(block, ROW, B_TEXTYPE, texstr[0],                     160, 110, 70, 20, &tex->type, 1.0, 0.0, 0, 0, "Default");
@@ -1148,7 +1108,7 @@ static void texture_panel_preview(int preview)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "texture_panel_preview", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "texture_panel_preview", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Preview", "Texture", 0, 0, 318, 204)==0) return;
        
        if(preview) uiBlockSetDrawExtraFunc(block, BIF_previewdraw);
@@ -1156,8 +1116,6 @@ static void texture_panel_preview(int preview)
        // label to force a boundbox for buttons not to be centered
        uiDefBut(block, LABEL, 0, " ",  20,20,10,10, 0, 0, 0, 0, 0, "");
        
-       uiBlockSetCol(block, BUTGREEN);
-
        uiDefButC(block, ROW, B_TEXREDR_PRV, "Mat",             200,175,80,25, &G.buts->texfrom, 3.0, 0.0, 0, 0, "Display the texture of the active material");
        uiDefButC(block, ROW, B_TEXREDR_PRV, "World",   200,150,80,25, &G.buts->texfrom, 3.0, 1.0, 0, 0, "Display the texture of the world block");
        uiDefButC(block, ROW, B_TEXREDR_PRV, "Lamp",    200,125,80,25, &G.buts->texfrom, 3.0, 2.0, 0, 0, "Display the texture of the lamp");
@@ -1298,33 +1256,32 @@ static void radio_panel_calculation(Radio *rad, int flag)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "radio_panel_calculation", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "radio_panel_calculation", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Calculation", "Radio", 640, 0, 318, 204)==0) return;
        uiAutoBlock(block, 10, 10, 300, 200, UI_BLOCK_ROWS);
 
-       if(flag == RAD_PHASE_PATCHES) uiBlockSetCol(block, BUTSALMON);
+       if(flag != RAD_PHASE_PATCHES) uiBlockSetCol(block, TH_BUT_NEUTRAL);
        uiDefBut(block,  BUT, B_RAD_GO, "GO",                                   0, 0, 10, 15, NULL, 0, 0, 0, 0, "Start the radiosity simulation");
 
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_AUTO);
        uiDefButS(block,  NUM, 0, "SubSh Patch:",                               1, 0, 10, 10, &rad->subshootp, 0.0, 10.0, 0, 0, "Set the number of times the environment is tested to detect pathes");
        uiDefButS(block,  NUM, 0, "SubSh Element:",                     1, 0, 10, 10, &rad->subshoote, 0.0, 10.0, 0, 0, "Set the number of times the environment is tested to detect elements");
 
-       if(flag == RAD_PHASE_PATCHES) uiBlockSetCol(block, BUTSALMON);
-       else uiBlockSetCol(block, BUTGREY);
+       if(flag != RAD_PHASE_PATCHES) uiBlockSetCol(block, TH_BUT_NEUTRAL);
        uiDefBut(block,  BUT, B_RAD_SHOOTE, "Subdiv Shoot Element", 2, 0, 10, 10, NULL, 0, 0, 0, 0, "For pre-subdivision, detect high energy changes and subdivide Elements");
        uiDefBut(block,  BUT, B_RAD_SHOOTP, "Subdiv Shoot Patch",       2, 0, 10, 10, NULL, 0, 0, 0, 0, "For pre-subdivision, Detect high energy changes and subdivide Patches");
 
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_AUTO);
        uiDefButI(block,  NUM, 0, "MaxEl:",                                             3, 0, 10, 10, &rad->maxnode, 1.0, 250000.0, 0, 0, "Set the maximum allowed number of elements");
        uiDefButS(block,  NUM, 0, "Max Subdiv Shoot:",                  3, 0, 10, 10, &rad->maxsublamp, 1.0, 250.0, 0, 0, "Set the maximum number of initial shoot patches that are evaluated");
 
-       if(flag & RAD_PHASE_FACES) uiBlockSetCol(block, BUTSALMON);
-       else uiBlockSetCol(block, BUTGREY);
+       if(flag & RAD_PHASE_FACES);
+       else uiBlockSetCol(block, TH_BUT_NEUTRAL);
        uiDefBut(block,  BUT, B_RAD_FACEFILT, "FaceFilter",             4, 0, 10, 10, NULL, 0, 0, 0, 0, "Force an extra smoothing");
        uiDefBut(block,  BUT, B_RAD_NODEFILT, "Element Filter", 4, 0, 10, 10, NULL, 0, 0, 0, 0, "Filter elements to remove aliasing artefacts");
 
        uiDefBut(block,  BUT, B_RAD_NODELIM, "RemoveDoubles",   5, 0, 30, 10, NULL, 0.0, 50.0, 0, 0, "Join elements which differ less than 'Lim'");
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_AUTO);
        uiDefButS(block,  NUM, 0, "Lim:",                                               5, 0, 10, 10, &rad->nodelim, 0.0, 50.0, 0, 0, "Set the range for removing doubles");
 
 
@@ -1334,40 +1291,34 @@ static void radio_panel_tool(Radio *rad, int flag)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "radio_panel_tool", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "radio_panel_tool", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Radio Tool", "Radio", 320, 0, 318, 204)==0) return;
        uiAutoBlock(block, 10, 10, 300, 200, UI_BLOCK_ROWS);
 
-       if(flag & RAD_PHASE_PATCHES) uiBlockSetCol(block, BUTPURPLE);
-       else uiBlockSetCol(block, BUTSALMON);
+       if(flag & RAD_PHASE_PATCHES) uiBlockSetCol(block, TH_BUT_SETTING2);
        uiDefBut(block,  BUT, B_RAD_COLLECT, "Collect Meshes",  0, 0, 10, 15, NULL, 0, 0, 0, 0, "Convert selected and visible meshes to patches");
 
-       if(flag & RAD_PHASE_PATCHES) uiBlockSetCol(block, BUTSALMON);
-       else uiBlockSetCol(block, BUTGREY);
+       if(flag & RAD_PHASE_PATCHES)uiBlockSetCol(block, TH_AUTO);
+       else uiBlockSetCol(block, TH_BUT_NEUTRAL);
        uiDefBut(block,  BUT, B_RAD_FREE, "Free Radio Data",    0, 0, 10, 15, NULL, 0, 0, 0, 0, "Release all memory used by Radiosity");        
 
-       if(flag & RAD_PHASE_FACES) uiBlockSetCol(block, BUTSALMON);
-       else uiBlockSetCol(block, BUTGREY);
+       if(flag & RAD_PHASE_FACES) uiBlockSetCol(block, TH_AUTO);
+       else uiBlockSetCol(block, TH_BUT_NEUTRAL);
        uiDefBut(block,  BUT, B_RAD_REPLACE, "Replace Meshes",  1, 0, 10, 12, NULL, 0, 0, 0, 0, "Convert meshes to Mesh objects with vertex colours, changing input-meshes");
        uiDefBut(block,  BUT, B_RAD_ADDMESH, "Add new Meshes",  1, 0, 10, 12, NULL, 0, 0, 0, 0, "Convert meshes to Mesh objects with vertex colours, unchanging input-meshes");
 
-       uiBlockSetCol(block, BUTGREEN);
+       uiBlockSetCol(block, TH_AUTO);
        uiDefButS(block,  ROW, B_RAD_DRAW, "Wire",                      2, 0, 10, 10, &rad->drawtype, 0.0, 0.0, 0, 0, "Enable wireframe drawmode");
        uiDefButS(block,  ROW, B_RAD_DRAW, "Solid",                     2, 0, 10, 10, &rad->drawtype, 0.0, 1.0, 0, 0, "Enable solid drawmode");
        uiDefButS(block,  ROW, B_RAD_DRAW, "Gour",                      2, 0, 10, 10, &rad->drawtype, 0.0, 2.0, 0, 0, "Enable Gourad drawmode");
-       uiBlockSetCol(block, BUTGREY);
        uiDefButS(block,  TOG|BIT|0, B_RAD_DRAW, "ShowLim", 2, 0, 10, 10, &rad->flag, 0, 0, 0, 0, "Visualize patch and element limits");
        uiDefButS(block,  TOG|BIT|1, B_RAD_DRAW, "Z",           2, 0, 3, 10, &rad->flag, 0, 0, 0, 0, "Draw limits different");
 
-       uiBlockSetCol(block, BUTGREY);
        uiDefButS(block,  NUM, B_RAD_LIMITS, "ElMax:",          3, 0, 10, 10, &rad->elma, 1.0, 500.0, 0, 0, "Set maximum size of an element");
        uiDefButS(block,  NUM, B_RAD_LIMITS, "ElMin:",          3, 0, 10, 10, &rad->elmi, 1.0, 100.0, 0, 0, "Set minimum size of an element");
        uiDefButS(block,  NUM, B_RAD_LIMITS, "PaMax:",          3, 0, 10, 10, &rad->pama, 10.0, 1000.0, 0, 0, "Set maximum size of a patch");
        uiDefButS(block,  NUM, B_RAD_LIMITS, "PaMin:",          3, 0, 10, 10, &rad->pami, 10.0, 1000.0, 0, 0, "Set minimum size of a patch");
 
-
-
-       uiBlockSetCol(block, BUTSALMON);
        uiDefBut(block,  BUT, B_RAD_INIT, "Limit Subdivide", 5, 0, 10, 10, NULL, 0, 0, 0, 0, "Subdivide patches");
 }
 
@@ -1376,11 +1327,10 @@ static void radio_panel_render(Radio *rad)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "radio_panel_render", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "radio_panel_render", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Radio Render", "Radio", 0, 0, 318, 204)==0) return;
        uiAutoBlock(block, 210, 30, 230, 150, UI_BLOCK_ROWS);
 
-       uiBlockSetCol(block, BUTGREY);
        uiDefButS(block,  NUMSLI, B_RAD_LIMITS, "Hemires:", 0, 0, 10, 10, &rad->hemires, 100.0, 1000.0, 100, 0, "Set the size of a hemicube");
        uiDefButS(block,  NUM, 0, "Max Iterations:",            2, 0, 10, 15, &rad->maxiter, 0.0, 10000.0, 0, 0, "Maximum number of radiosity rounds");
        uiDefButF(block,  NUM, B_RAD_FAC, "Mult:",                      3, 0, 10, 15, &rad->radfac, 0.001, 250.0, 100, 0, "Mulitply the energy values");
@@ -1417,7 +1367,7 @@ static void world_panel_mapto(World *wrld)
        uiBlock *block;
        MTex *mtex;
        
-       block= uiNewBlock(&curarea->uiblocks, "world_panel_mapto", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "world_panel_mapto", UI_EMBOSS, UI_HELV, curarea->win);
        uiNewPanelTabbed("Texture and Input", "World");
        if(uiNewPanel(curarea, block, "Map To", "World", 1280, 0, 318, 204)==0) return;
 
@@ -1442,13 +1392,11 @@ static void world_panel_mapto(World *wrld)
        uiDefButF(block, NUMSLI, B_MATPRV, "DVar ",             920,10,163,18, &(mtex->def_var), 0.0, 1.0, 0, 0, "The value that an intensity texture blends with the current value");
        
        /* MAP TO */
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, TOG|BIT|0, B_MATPRV, "Blend",          1087,166,81,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture work on the colour progression in the sky");
        uiDefButS(block, TOG|BIT|1, B_MATPRV, "Hori",           1172,166,81,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture work on the colour of the horizon");
        uiDefButS(block, TOG|BIT|2, B_MATPRV, "ZenUp",          1087,147,81,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture work on the colour of the zenith above");
        uiDefButS(block, TOG|BIT|3, B_MATPRV, "ZenDo",          1172,147,81,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture work on the colour of the zenith below");
        
-       uiBlockSetCol(block, BUTGREY);
        uiDefButS(block, ROW, B_MATPRV, "Blend",                        1087,114,48,18, &(mtex->blendtype), 9.0, (float)MTEX_BLEND, 0, 0, "The texture blends the values");
        uiDefButS(block, ROW, B_MATPRV, "Mul",                  1136,114,44,18, &(mtex->blendtype), 9.0, (float)MTEX_MUL, 0, 0, "The texture multiplies the values");
        uiDefButS(block, ROW, B_MATPRV, "Add",                  1182,114,41,18, &(mtex->blendtype), 9.0, (float)MTEX_ADD, 0, 0, "The texture adds the values");
@@ -1468,13 +1416,13 @@ static void world_panel_texture(World *wrld)
        int a, loos;
        char str[64], *strp;
        
-       block= uiNewBlock(&curarea->uiblocks, "world_panel_texture", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "world_panel_texture", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Texture and Input", "World", 960, 0, 318, 204)==0) return;
 
        uiSetButLock(wrld->id.lib!=0, "Can't edit library data");
 
        /* TEX CHANNELS */
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_BUT_NEUTRAL);
        
        for(a= 0; a<6; a++) {
                mtex= wrld->mtex[a];
@@ -1492,6 +1440,7 @@ static void world_panel_texture(World *wrld)
        }
        
        /* TEXTUREBLOCK SELECT */
+       uiBlockSetCol(block, TH_BUT_SETTING2);
        id= (ID *)mtex->tex;
        IDnames_to_pupstring(&strp, NULL, "ADD NEW %x 32767", &(G.main->tex), id, &(G.buts->texnr));
        uiDefButS(block, MENU, B_WTEXBROWSE, strp, 100,140,20,19, &(G.buts->texnr), 0, 0, 0, 0, "Browse");
@@ -1506,19 +1455,17 @@ static void world_panel_texture(World *wrld)
                        if(wrld->id.lib) uiDefIconBut(block, BUT, 0, ICON_DATALIB,      1019,146,21,19, 0, 0, 0, 0, 0, "");
                        else uiDefIconBut(block, BUT, 0, ICON_PARLIB,   219,140,21,19, 0, 0, 0, 0, 0, "");      
                }
-               uiBlockSetCol(block, BUTSALMON);
+               uiBlockSetCol(block, TH_AUTO);
                uiDefBut(block, BUT, B_TEXCLEARWORLD, "Clear", 122, 140, 72, 19, 0, 0, 0, 0, 0, "Erase link to texture");
-               uiBlockSetCol(block, BUTGREY);
        }
+       uiBlockSetCol(block, TH_AUTO);
        
 
        /* TEXCO */
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, ROW, B_MATPRV, "View",                 100,110,50,19, &(mtex->texco), 4.0, (float)TEXCO_VIEW, 0, 0, "Pass camera view vector on to the texture");
        uiDefButS(block, ROW, B_MATPRV, "Object",               150,110,50,19, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "The name of the object used as a source for texture coordinates");
        uiDefIDPoinBut(block, test_obpoin_but, B_MATPRV, "", 100,110,100,19, &(mtex->object), "");
        
-       uiBlockSetCol(block, BUTGREY);  
        uiDefButF(block, NUM, B_MATPRV, "dX",           100,50,100,18, mtex->ofs, -20.0, 20.0, 10, 0, "Set the extra translation of the texture coordinate");
        uiDefButF(block, NUM, B_MATPRV, "dY",           100,30,100,18, mtex->ofs+1, -20.0, 20.0, 10, 0, "Set the extra translation of the texture coordinate");
        uiDefButF(block, NUM, B_MATPRV, "dZ",           100,10,100,18, mtex->ofs+2, -20.0, 20.0, 10, 0, "Set the extra translation of the texture coordinate");
@@ -1533,7 +1480,7 @@ static void world_panel_mistaph(World *wrld)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "world_panel_mistaph", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "world_panel_mistaph", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Mist Stars Physics", "World", 640, 0, 318, 204)==0) return;
 
        uiSetButLock(wrld->id.lib!=0, "Can't edit library data");
@@ -1545,23 +1492,23 @@ static void world_panel_mistaph(World *wrld)
        uiDefButF(block, NUMSLI,0, "Grav ", 150,180,150,19,     &(wrld->gravity), 0.0, 25.0, 0, 0,  "Gravitation constant of the game world.");
 
 
-       uiBlockSetCol(block, BUTBLUE);
+       uiBlockSetCol(block, TH_BUT_SETTING1);
        uiDefButS(block, TOG|BIT|0,REDRAWVIEW3D,"Mist", 10,110,140,19, &wrld->mode, 0, 0, 0, 0, "Enable mist");
+       uiBlockSetCol(block, TH_AUTO);
 
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, ROW, B_DIFF, "Qua", 10, 90, 40, 19, &wrld->mistype, 1.0, 0.0, 0, 0, "Use quadratic progression");
        uiDefButS(block, ROW, B_DIFF, "Lin", 50, 90, 50, 19, &wrld->mistype, 1.0, 1.0, 0, 0, "Use linear progression");
        uiDefButS(block, ROW, B_DIFF, "Sqr", 100, 90, 50, 19, &wrld->mistype, 1.0, 2.0, 0, 0, "Use inverse quadratic progression");
        
-       uiBlockSetCol(block, BUTGREY);
        uiDefButF(block, NUM,REDRAWVIEW3D, "Sta:",10,70,140,19, &wrld->miststa, 0.0, 1000.0, 10, 0, "Specify the starting distance of the mist");
        uiDefButF(block, NUM,REDRAWVIEW3D, "Di:",10,50,140,19, &wrld->mistdist, 0.0,1000.0, 10, 00, "Specify the depth of the mist");
        uiDefButF(block, NUM,B_DIFF,"Hi:",              10,30,140,19, &wrld->misthi,0.0,100.0, 10, 0, "Specify the factor for a less dense mist with increasing height");
        uiDefButF(block, NUMSLI, 0, "Misi",             10,10,140,19,   &(wrld->misi), 0., 1.0, 0, 0, "Set the mist intensity");
 
-       uiBlockSetCol(block, BUTBLUE);
+       uiBlockSetCol(block, TH_BUT_SETTING1);
        uiDefButS(block, TOG|BIT|1,B_DIFF,      "Stars",160,110,140,19, &wrld->mode, 0, 0, 0, 0, "Enable stars");
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_AUTO);
+       
        uiDefButF(block, NUM,B_DIFF,"StarDist:",        160,70,140,19, &(wrld->stardist), 2.0, 1000.0, 100, 0, "Specify the average distance between two stars");
        uiDefButF(block, NUM,B_DIFF,"MinDist:",         160,50,140,19, &(wrld->starmindist), 0.0, 1000.0, 100, 0, "Specify the minimum distance to the camera");
        uiDefButF(block, NUMSLI,B_DIFF,"Size:",         160,30,140,19, &(wrld->starsize), 0.0, 10.0, 10, 0, "Specify the average screen dimension");
@@ -1576,19 +1523,19 @@ static void world_panel_world(World *wrld)
        ID *id, *idfrom;
        short xco;
        
-       block= uiNewBlock(&curarea->uiblocks, "world_panel_world", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "world_panel_world", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "World", "World", 320, 0, 318, 204)==0) return;
 
        /* first do the browse but */
        buttons_active_id(&id, &idfrom);
 
-       uiBlockSetCol(block, BUTPURPLE);
+       uiBlockSetCol(block, TH_BUT_SETTING2);
        xco= std_libbuttons(block, 10, 180, 0, NULL, B_WORLDBROWSE, id, idfrom, &(G.buts->menunr), B_WORLDALONE, B_WORLDLOCAL, B_WORLDDELETE, 0, B_KEEPDATA);
 
        if(wrld==NULL) return;
        
        uiSetButLock(wrld->id.lib!=0, "Can't edit library data");
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_AUTO);
 
        uiDefButF(block, COL, B_COLHOR, "",                     10,150,150,19, &wrld->horr, 0, 0, 0, 0, "");
        uiDefButF(block, NUMSLI,B_MATPRV,"HoR ",        10,130,150,19,  &(wrld->horr), 0.0, 1.0, B_COLHOR,0, "The amount of red of the horizon colour");
@@ -1613,7 +1560,7 @@ static void world_panel_preview(World *wrld)
        uiBlock *block;
        
        /* name "Preview" is abused to detect previewrender offset panel */
-       block= uiNewBlock(&curarea->uiblocks, "world_panel_preview", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "world_panel_preview", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Preview", "World", 0, 0, 318, 204)==0) return;
        
        if(wrld==NULL) return;
@@ -1625,8 +1572,6 @@ static void world_panel_preview(World *wrld)
        // label to force a boundbox for buttons not to be centered
        uiDefBut(block, LABEL, 0, " ",  20,20,10,10, 0, 0, 0, 0, 0, "");
 
-       uiBlockSetCol(block, BUTGREEN);
-
        uiDefButS(block, TOG|BIT|1,B_MATPRV,"Real",     200,175,80,25, &wrld->skytype, 0, 0, 0, 0, "Render background with real horizon");
        uiDefButS(block, TOG|BIT|0,B_MATPRV,"Blend",200,150,80,19, &wrld->skytype, 0, 0, 0, 0, "Render background with natural progression");
        uiDefButS(block, TOG|BIT|2,B_MATPRV,"Paper",200,125,80,19, &wrld->skytype, 0, 0, 0, 0, "Flatten blend or texture coordinates");
@@ -1679,7 +1624,7 @@ static void lamp_panel_mapto(Object *ob, Lamp *la)
        uiBlock *block;
        MTex *mtex;
        
-       block= uiNewBlock(&curarea->uiblocks, "lamp_panel_mapto", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "lamp_panel_mapto", UI_EMBOSS, UI_HELV, curarea->win);
        uiNewPanelTabbed("Texture and Input", "Lamp");
        if(uiNewPanel(curarea, block, "Map To", "Lamp", 1280, 0, 318, 204)==0) return;
 
@@ -1704,10 +1649,8 @@ static void lamp_panel_mapto(Object *ob, Lamp *la)
        uiDefButF(block, NUMSLI, B_MATPRV, "DVar ",             920,10,163,18, &(mtex->def_var), 0.0, 1.0, 0, 0, "Set the value the texture blends with");
        
        /* MAP TO */
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, TOG|BIT|0, B_MATPRV, "Col",            1107,166,81,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture affect the colour of the lamp");
        
-       uiBlockSetCol(block, BUTGREY);
        uiDefButS(block, ROW, B_MATPRV, "Blend",                        1087,114,48,18, &(mtex->blendtype), 9.0, (float)MTEX_BLEND, 0, 0, "Mix the values");
        uiDefButS(block, ROW, B_MATPRV, "Mul",                  1136,114,44,18, &(mtex->blendtype), 9.0, (float)MTEX_MUL, 0, 0, "Multiply the values");
        uiDefButS(block, ROW, B_MATPRV, "Add",                  1182,114,41,18, &(mtex->blendtype), 9.0, (float)MTEX_ADD, 0, 0, "Add the values");
@@ -1728,13 +1671,13 @@ static void lamp_panel_texture(Object *ob, Lamp *la)
        int a, loos;
        char *strp, str[64];
        
-       block= uiNewBlock(&curarea->uiblocks, "lamp_panel_texture", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "lamp_panel_texture", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Texture and Input", "Lamp", 960, 0, 318, 204)==0) return;
 
        uiSetButLock(la->id.lib!=0, "Can't edit library data");
 
        /* TEX CHANNELS */
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_BUT_NEUTRAL);
        for(a= 0; a<6; a++) {
                mtex= la->mtex[a];
                if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos);
@@ -1751,6 +1694,7 @@ static void lamp_panel_texture(Object *ob, Lamp *la)
        }
 
        /* TEXTUREBLOK SELECT */
+       uiBlockSetCol(block, TH_BUT_SETTING2);
        id= (ID *)mtex->tex;
        IDnames_to_pupstring(&strp, NULL, "ADD NEW %x 32767", &(G.main->tex), id, &(G.buts->texnr));
        
@@ -1767,19 +1711,17 @@ static void lamp_panel_texture(Object *ob, Lamp *la)
                        if(la->id.lib) uiDefIconBut(block, BUT, 0, ICON_DATALIB,        219,140,21,19, 0, 0, 0, 0, 0, "");
                        else uiDefIconBut(block, BUT, 0, ICON_PARLIB,   219,140,21,19, 0, 0, 0, 0, 0, "");      
                }
-               uiBlockSetCol(block, BUTSALMON);
+               uiBlockSetCol(block, TH_AUTO);
                uiDefBut(block, BUT, B_TEXCLEARLAMP, "Clear", 122, 140, 72, 19, 0, 0, 0, 0, 0, "Erase link to texture");
-               uiBlockSetCol(block, BUTGREY);
        }
 
        /* TEXCO */
-       uiBlockSetCol(block, BUTGREEN);
+       uiBlockSetCol(block, TH_AUTO);
        uiDefButS(block, ROW, B_MATPRV, "Glob",                 100,110,60,20, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Generate texture coordinates from global coordinates");
        uiDefButS(block, ROW, B_MATPRV, "View",                 160,110,70,20, &(mtex->texco), 4.0, (float)TEXCO_VIEW, 0, 0, "Generate texture coordinates from view coordinates");
        uiDefButS(block, ROW, B_MATPRV, "Object",               230,110,70,20, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Use linked object's coordinates for texture coordinates");
        uiDefIDPoinBut(block, test_obpoin_but, B_MATPRV, "", 100,90,200,20, &(mtex->object), "");
        
-       uiBlockSetCol(block, BUTGREY);  
        uiDefButF(block, NUM, B_MATPRV, "dX",           100,50,100,18, mtex->ofs, -20.0, 20.0, 10, 0, "Set the extra translation of the texture coordinate");
        uiDefButF(block, NUM, B_MATPRV, "dY",           100,30,100,18, mtex->ofs+1, -20.0, 20.0, 10, 0, "Set the extra translation of the texture coordinate");
        uiDefButF(block, NUM, B_MATPRV, "dZ",           100,10,100,18, mtex->ofs+2, -20.0, 20.0, 10, 0, "Set the extra translation of the texture coordinate");
@@ -1794,7 +1736,7 @@ static void lamp_panel_spot(Object *ob, Lamp *la)
        uiBlock *block;
        float grid=0.0;
        
-       block= uiNewBlock(&curarea->uiblocks, "lamp_panel_spot", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "lamp_panel_spot", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Spot", "Lamp", 640, 0, 318, 204)==0) return;
 
        if(G.vd) grid= G.vd->grid; 
@@ -1802,13 +1744,13 @@ static void lamp_panel_spot(Object *ob, Lamp *la)
 
        uiSetButLock(la->id.lib!=0, "Can't edit library data");
 
-       uiBlockSetCol(block, BUTBLUE);
+       uiBlockSetCol(block, TH_BUT_SETTING1);
        uiDefButS(block, TOG|BIT|0, REDRAWVIEW3D, "Shadows",10,150,80,19,&la->mode, 0, 0, 0, 0, "Let lamp produce shadows");
        uiDefButS(block, TOG|BIT|5, 0,"OnlyShadow",                     10,130,80,19,&la->mode, 0, 0, 0, 0, "Render shadow only");
        uiDefButS(block, TOG|BIT|7, B_LAMPREDRAW,"Square",      10,90,80,19,&la->mode, 0, 0, 0, 0, "Use square spotbundles");
        uiDefButS(block, TOG|BIT|1, 0,"Halo",                           10,50,80,19,&la->mode, 0, 0, 0, 0, "Render spotlights with a volumetric halo"); 
 
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_AUTO);
        uiDefButF(block, NUMSLI,B_LAMPREDRAW,"SpotSi ", 100,180,200,19,&la->spotsize, 1.0, 180.0, 0, 0, "Set the angle of the spot beam in degrees");
        uiDefButF(block, NUMSLI,B_MATPRV,"SpotBl ",             100,160,200,19,&la->spotblend, 0.0, 1.0, 0, 0, "Set the softness of the spot edge");
        uiDefButF(block, NUMSLI,0,"HaloInt ",                   100,130,200,19,&la->haint, 0.0, 5.0, 0, 0, "Set the intensity of the spot halo");
@@ -1835,7 +1777,7 @@ static void lamp_panel_lamp(Object *ob, Lamp *la)
        float grid= 0.0;
        short xco;
        
-       block= uiNewBlock(&curarea->uiblocks, "lamp_panel_lamp", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "lamp_panel_lamp", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Lamp", "Lamp", 320, 0, 318, 204)==0) return;
 
        if(G.vd) grid= G.vd->grid; 
@@ -1846,13 +1788,13 @@ static void lamp_panel_lamp(Object *ob, Lamp *la)
        /* first do the browse but */
        buttons_active_id(&id, &idfrom);
 
-       uiBlockSetCol(block, BUTPURPLE);
+       uiBlockSetCol(block, TH_BUT_SETTING2);
        xco= std_libbuttons(block, 8, 180, 0, NULL, B_LAMPBROWSE, id, (ID *)ob, &(G.buts->menunr), B_LAMPALONE, B_LAMPLOCAL, 0, 0, 0);  
 
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_AUTO);
        uiDefButF(block, NUM,B_LAMPREDRAW,"Dist:",xco+10,180,104,20,&la->dist, 0.01, 5000.0, 100, 0, "Set the distance value");
 
-       uiBlockSetCol(block, BUTBLUE);
+       uiBlockSetCol(block, TH_BUT_SETTING1);
        uiDefButS(block, TOG|BIT|3, B_MATPRV,"Quad",            10,150,100,19,&la->mode, 0, 0, 0, 0, "Use inverse quadratic proportion");
        uiDefButS(block, TOG|BIT|6, REDRAWVIEW3D,"Sphere",      10,130,100,19,&la->mode, 0, 0, 0, 0, "Lamp only shines inside a sphere");
        uiDefButS(block, TOG|BIT|2, 0,"Layer",                          10,90,100,19,&la->mode, 0, 0, 0, 0, "Illuminate objects in the same layer only");
@@ -1861,7 +1803,7 @@ static void lamp_panel_lamp(Object *ob, Lamp *la)
        uiDefButS(block, TOG|BIT|12, 0,"No Specular",           10,10,100,19,&la->mode, 0, 0, 0, 0, "No specular shading of material");
 
 
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_AUTO);
        uiDefButF(block, NUMSLI,B_MATPRV,"Energy ",     120,150,180,20, &(la->energy), 0.0, 10.0, 0, 0, "Set the intensity of the light");
 
        uiDefButF(block, NUMSLI,B_MATPRV,"R ",          120,120,180,20,&la->r, 0.0, 1.0, B_COLLAMP, 0, "Set the red component of the light");
@@ -1880,7 +1822,7 @@ static void lamp_panel_preview(Object *ob, Lamp *la)
        uiBlock *block;
        
        /* name "Preview" is abused to detect previewrender offset panel */
-       block= uiNewBlock(&curarea->uiblocks, "lamp_panel_preview", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "lamp_panel_preview", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Preview", "Lamp", 0, 0, 318, 204)==0) return;
        
        uiSetButLock(la->id.lib!=0, "Can't edit library data");
@@ -1890,7 +1832,6 @@ static void lamp_panel_preview(Object *ob, Lamp *la)
        // label to force a boundbox for buttons not to be centered
        uiDefBut(block, LABEL, 0, " ",  20,20,10,10, 0, 0, 0, 0, 0, "");
 
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, ROW,B_LAMPREDRAW,"Lamp",       200,175,80,25,&la->type,1.0,(float)LA_LOCAL, 0, 0, "Use a point light source");
        uiDefButS(block, ROW,B_LAMPREDRAW,"Spot",       200,150,80,25,&la->type,1.0,(float)LA_SPOT, 0, 0, "Restrict lamp to conical space");
        uiDefButS(block, ROW,B_LAMPREDRAW,"Sun",        200,125,80,25,&la->type,1.0,(float)LA_SUN, 0, 0, "Light shines from constant direction");
@@ -1977,7 +1918,7 @@ static void material_panel_map_to(Material *ma)
        uiBlock *block;
        MTex *mtex;
        
-       block= uiNewBlock(&curarea->uiblocks, "material_panel_map_to", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "material_panel_map_to", UI_EMBOSS, UI_HELV, curarea->win);
        uiNewPanelTabbed("Texture", "Material");
        if(uiNewPanel(curarea, block, "Map To", "Material", 1600, 0, 318, 204)==0) return;
 
@@ -1995,13 +1936,11 @@ static void material_panel_map_to(Material *ma)
        uiDefButF(block, COL, B_MTEXCOL, "",                            900,100,163,12, &(mtex->r), 0, 0, 0, 0, "Browse datablocks");
 
        if(ma->colormodel==MA_HSV) {
-               uiBlockSetCol(block, BUTPURPLE);
+               uiBlockSetCol(block, TH_BUT_SETTING1);
                uiDefButF(block, HSVSLI, B_MATPRV, "H ",                        900,80,163,18, &(mtex->r), 0.0, 0.9999, B_MTEXCOL, 0, "");
-               uiBlockSetCol(block, BUTPURPLE);
                uiDefButF(block, HSVSLI, B_MATPRV, "S ",                        900,60,163,18, &(mtex->r), 0.0001, 1.0, B_MTEXCOL, 0, "");
-               uiBlockSetCol(block, BUTPURPLE);
                uiDefButF(block, HSVSLI, B_MATPRV, "V ",                        900,40,163,18, &(mtex->r), 0.0001, 1.0, B_MTEXCOL, 0, "");
-               uiBlockSetCol(block, BUTGREY);
+               uiBlockSetCol(block, TH_AUTO);
        }
        else {
                uiDefButF(block, NUMSLI, B_MATPRV, "R ",                        900,80,163,18, &(mtex->r), 0.0, 1.0, B_MTEXCOL, 0, "Set the amount of red the intensity texture blends with");
@@ -2012,7 +1951,6 @@ static void material_panel_map_to(Material *ma)
        uiDefButF(block, NUMSLI, B_MATPRV, "DVar ",             900,10,163,18, &(mtex->def_var), 0.0, 1.0, 0, 0, "Set the value the texture blends with the current value");
        
        /* MAP TO */
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, TOG|BIT|0, B_MATPRV, "Col",    900,166,35,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture affect basic colour of the material");
        uiDefButS(block, TOG3|BIT|1, B_MATPRV, "Nor",   935,166,35,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture affect the rendered normal");
        uiDefButS(block, TOG|BIT|2, B_MATPRV, "Csp",    970,166,40,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture affect the specularity colour");
@@ -2025,7 +1963,6 @@ static void material_panel_map_to(Material *ma)
        
 /*     uiDefButS(block, TOG|BIT|3, B_MATPRV, "Alpha Mix",1087,114,100,18, &(mtex->texflag), 0, 0, 0, 0); ,""*/
 
-       uiBlockSetCol(block, BUTGREY);
        uiDefButS(block, ROW, B_MATPRV, "Mix",                  1087,94,48,18, &(mtex->blendtype), 9.0, (float)MTEX_BLEND, 0, 0, "The texture blends the values or colour");
        uiDefButS(block, ROW, B_MATPRV, "Mul",                  1136,94,44,18, &(mtex->blendtype), 9.0, (float)MTEX_MUL, 0, 0, "The texture multiplies the values or colour");
        uiDefButS(block, ROW, B_MATPRV, "Add",                  1182,94,41,18, &(mtex->blendtype), 9.0, (float)MTEX_ADD, 0, 0, "The texture adds the values or colour");
@@ -2045,7 +1982,7 @@ static void material_panel_map_input(Material *ma)
        int a, xco;
        char str[32];
        
-       block= uiNewBlock(&curarea->uiblocks, "material_panel_map_input", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "material_panel_map_input", UI_EMBOSS, UI_HELV, curarea->win);
        uiNewPanelTabbed("Texture", "Material");
        if(uiNewPanel(curarea, block, "Map Input", "Material", 1280, 0, 318, 204)==0) return;
 
@@ -2056,7 +1993,6 @@ static void material_panel_map_input(Material *ma)
        }
        
        /* TEXCO */
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, ROW, B_MATPRV, "UV",                   630,166,40,18, &(mtex->texco), 4.0, (float)TEXCO_UV, 0, 0, "Use UV coordinates for texture coordinates");
        uiDefButS(block, ROW, B_MATPRV, "Object",               670,166,75,18, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Use linked object's coordinates for texture coordinates");
        uiDefIDPoinBut(block, test_obpoin_but, B_MATPRV, "",745,166,163,18, &(mtex->object), "");
@@ -2068,8 +2004,6 @@ static void material_panel_map_input(Material *ma)
        uiDefButS(block, ROW, B_MATPRV, "Nor",                  820,146,44,18, &(mtex->texco), 4.0, (float)TEXCO_NORM, 0, 0, "Use normal vector as texture coordinates");
        uiDefButS(block, ROW, B_MATPRV, "Refl",                 864,146,44,18, &(mtex->texco), 4.0, (float)TEXCO_REFL, 0, 0, "Use reflection vector as texture coordinates");
        
-       uiBlockSetCol(block, BUTGREY);
-       
        /* COORDS */
        uiDefButC(block, ROW, B_MATPRV, "Flat",                 666,114,48,18, &(mtex->mapping), 5.0, (float)MTEX_FLAT, 0, 0, "Map X and Y coordinates directly");
        uiDefButC(block, ROW, B_MATPRV, "Cube",                 717,114,50,18, &(mtex->mapping), 5.0, (float)MTEX_CUBE, 0, 0, "Map using the normal vector");
@@ -2109,11 +2043,11 @@ static void material_panel_texture(Material *ma)
        int a, xco;
        char str[64], *strp;
        
-       block= uiNewBlock(&curarea->uiblocks, "material_panel_texture", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "material_panel_texture", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Texture", "Material", 960, 0, 318, 204)==0) return;
 
        /* TEX CHANNELS */
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_BUT_NEUTRAL);
        xco= 665;
        for(a= 0; a<8; a++) {
                mtex= ma->mtex[a];
@@ -2124,12 +2058,12 @@ static void material_panel_texture(Material *ma)
                xco+= 65;
        }
        
+       
        uiDefIconBut(block, BUT, B_MTEXCOPY, ICON_COPYUP,       100,180,23,21, 0, 0, 0, 0, 0, "Copy the mapping settings to the buffer");
        uiDefIconBut(block, BUT, B_MTEXPASTE, ICON_PASTEUP,     125,180,23,21, 0, 0, 0, 0, 0, "Paste the mapping settings from the buffer");
 
-       uiBlockSetCol(block, BUTGREEN);
+       uiBlockSetCol(block, TH_AUTO);
        uiDefButC(block, TOG, B_MATPRV, "SepTex",               160, 180, 100, 20, &(ma->septex), 0, 0, 0, 0, "Render only use active texture channel");
-       uiBlockSetCol(block, BUTGREY);
        
        mtex= ma->mtex[ ma->texact ];
        if(mtex==0) {
@@ -2138,6 +2072,7 @@ static void material_panel_texture(Material *ma)
        }
 
        /* TEXTUREBLOK SELECT */
+       uiBlockSetCol(block, TH_BUT_SETTING2);
        if(G.main->tex.first==0)
                id= NULL;
        else
@@ -2155,25 +2090,25 @@ static void material_panel_texture(Material *ma)
                        if(ma->id.lib) uiDefIconBut(block, BUT, 0, ICON_DATALIB,        219,130,21,20, 0, 0, 0, 0, 0, "");
                        else uiDefIconBut(block, BUT, 0, ICON_PARLIB,   219,130,21,20, 0, 0, 0, 0, 0, "");              
                }
-               uiBlockSetCol(block, BUTSALMON);
+               uiBlockSetCol(block, TH_AUTO);
                uiDefBut(block, BUT, B_TEXCLEAR, "Clear", 122, 130, 72, 20, 0, 0, 0, 0, 0, "Erase link to datablock");
-               uiBlockSetCol(block, BUTGREY);
        }
        
+       uiBlockSetCol(block, TH_AUTO);
 }
 
 static void material_panel_shading(Material *ma)
 {
        uiBlock *block;
        
-       block= uiNewBlock(&curarea->uiblocks, "material_panel_shading", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "material_panel_shading", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Shaders", "Material", 640, 0, 318, 204)==0) return;
 
-       uiBlockSetCol(block, BUTPURPLE);
+       uiBlockSetCol(block, TH_BUT_SETTING1);
        uiDefButI(block, TOG|BIT|5, B_MATPRV_DRAW, "Halo",      245,180,65,18, &(ma->mode), 0, 0, 0, 0, "Render as a halo");
+       uiBlockSetCol(block, TH_AUTO);
 
        if(ma->mode & MA_HALO) {
-               uiBlockSetCol(block, BUTGREY);
                uiDefButF(block, NUM, B_MATPRV, "HaloSize: ",           10,155,190,18, &(ma->hasize), 0.0, 100.0, 10, 0, "Set the dimension of the halo");
                uiDefButS(block, NUMSLI, B_MATPRV, "Hard ",                     10,135,190,18, &(ma->har), 1.0, 127.0, 0, 0, "Set the hardness of the halo");
                uiDefButF(block, NUMSLI, B_MATPRV, "Add  ",                     10,115,190,18, &(ma->add), 0.0, 1.0, 0, 0, "Strength of the add effect");
@@ -2189,7 +2124,7 @@ static void material_panel_shading(Material *ma)
                        uiDefButC(block, NUM, B_MATPRV, "Fl.seed: ",            10,10,90,18, &(ma->seed2), 0.0, 255.0, 0, 0, "Specify an offset in the seed table");
                        uiDefButS(block, NUM, B_MATPRV, "Flares: ",                     100,10,100,18, &(ma->flarec), 1.0, 32.0, 0, 0, "Set the nuber of subflares");
                }
-               uiBlockSetCol(block, BUTBLUE);
+               uiBlockSetCol(block, TH_BUT_SETTING1);
                
                uiDefButI(block, TOG|BIT|15, B_MATPRV_DRAW, "Flare",            245,142,65,28, &(ma->mode), 0, 0, 0, 0, "Render halo as a lensflare");
                uiDefButI(block, TOG|BIT|8, B_MATPRV, "Rings",          245,123,65, 18, &(ma->mode), 0, 0, 0, 0, "Render rings over basic halo");
@@ -2205,7 +2140,6 @@ static void material_panel_shading(Material *ma)
                char *str2= "Specular Shader%t|CookTorr %x0|Phong %x1|Blinn %x2|Toon %x3";
                
                /* diff shader buttons */
-               uiBlockSetCol(block, BUTGREY);
                uiDefButS(block, MENU, B_MATPRV_DRAW, str1,             9, 155,78,19, &(ma->diff_shader), 0.0, 0.0, 0, 0, "Set a diffuse shader");
                uiDefButF(block, NUMSLI, B_MATPRV, "Ref   ",    90,155,150,19, &(ma->ref), 0.0, 1.0, 0, 0, "Set the amount of reflection");
 
@@ -2236,7 +2170,7 @@ static void material_panel_shading(Material *ma)
                uiDefButF(block, NUMSLI, B_MATPRV, "Add ",              9,10,117,19, &(ma->add), 0.0, 1.0, 0, 0, "Glow factor for transparant");
                uiDefButF(block, NUM, 0, "Zoffs:",                              133,10,110,19, &(ma->zoffs), 0.0, 10.0, 0, 0, "Give face an artificial offset");
        
-               uiBlockSetCol(block, BUTBLUE);
+               uiBlockSetCol(block, TH_BUT_SETTING1);
        
                uiDefButI(block, TOG|BIT|0, 0,  "Traceable",            245,161,65,18, &(ma->mode), 0, 0, 0, 0, "Make material visible for shadow lamps");
                uiDefButI(block, TOG|BIT|1, 0,  "Shadow",                       245,142,65,18, &(ma->mode), 0, 0, 0, 0, "Enable material for shadows");
@@ -2261,13 +2195,13 @@ static void material_panel_material(Object *ob, Material *ma)
        int rgbsel = 0, xco= 0;
        char str[30];
        
-       block= uiNewBlock(&curarea->uiblocks, "material_panel_material", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "material_panel_material", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Material", "Material", 320, 0, 318, 204)==0) return;
 
        /* first do the browse but */
        buttons_active_id(&id, &idfrom);
 
-       uiBlockSetCol(block, BUTPURPLE);
+       uiBlockSetCol(block, TH_BUT_SETTING2);
        xco= std_libbuttons(block, 8, 200, 0, NULL, B_MATBROWSE, id, idfrom, &(G.buts->menunr), B_MATALONE, B_MATLOCAL, B_MATDELETE, B_AUTOMATNAME, B_KEEPDATA);
 
        uiDefIconBut(block, BUT, B_MATCOPY, ICON_COPYUP,        xco+=XIC,198,XIC,YIC, 0, 0, 0, 0, 0, "Copies Material to the buffer");
@@ -2277,14 +2211,14 @@ static void material_panel_material(Object *ob, Material *ma)
        if(ob->actcol==0) ob->actcol= 1;        /* because of TOG|BIT button */
        
        /* indicate which one is linking a material */
-       uiBlockSetCol(block, BUTSALMON);
+       uiBlockSetCol(block, TH_BUT_ACTION);
        uiDefButS(block, TOG|BIT|(ob->actcol-1), B_MATFROM, "OB",       125,174,32,20, &ob->colbits, 0, 0, 0, 0, "Link material to object");
        idn= ob->data;
        strncpy(str, idn->name, 2);
        str[2]= 0;
-       uiBlockSetCol(block, BUTGREEN);
+       uiBlockSetCol(block, TH_BUT_SETTING);
        uiDefButS(block, TOGN|BIT|(ob->actcol-1), B_MATFROM, str,       158,174,32,20, &ob->colbits, 0, 0, 0, 0, "Show the block the material is linked to");
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_AUTO);
        
        /* id is the block from which the material is used */
        if( BTST(ob->colbits, ob->actcol-1) ) id= (ID *)ob;
@@ -2316,24 +2250,21 @@ static void material_panel_material(Object *ob, Material *ma)
 
                uiDefButF(block, NUM, 0,         "Fh Damp ",            8,120,100,20, &ma->xyfrict, 0.0, 1.0, 10, 0, "Damping of the Fh spring force");
                uiDefButF(block, NUM, 0, "Fh Dist ",                    8,98 ,100,20, &ma->fhdist, 0.0, 20.0, 10, 0, "Height of the Fh area");
-               uiBlockSetCol(block, BUTGREEN);
                uiDefButS(block, TOG|BIT|1, 0, "Fh Norm",               8,76 ,100,20, &ma->dynamode, 0.0, 0.0, 0, 0, "Add a horizontal spring force on slopes");
-               uiBlockSetCol(block, BUTGREY);
        }
        else {
                if(!(ma->mode & MA_HALO)) {
-                       uiBlockSetCol(block, BUTBLUE);
+                       uiBlockSetCol(block, TH_BUT_SETTING1);
                        uiDefButI(block, TOG|BIT|4, B_REDR,     "VCol Light",   8,146,75,20, &(ma->mode), 0, 0, 0, 0, "Add vertex colours as extra light");
                        uiDefButI(block, TOG|BIT|7, B_REDR, "VCol Paint",       85,146,72,20, &(ma->mode), 0, 0, 0, 0, "Replace basic colours with vertex colours");
                        uiDefButI(block, TOG|BIT|11, B_REDR, "TexFace",         160,146,62,20, &(ma->mode), 0, 0, 0, 0, "UV-Editor assigned texture gives color and texture info for the faces");
                        uiDefButI(block, TOG|BIT|2, B_MATPRV, "Shadeless",      223,146,80,20, &(ma->mode), 0, 0, 0, 0, "Make material insensitive to light or shadow");
                }
-               uiBlockSetCol(block, BUTGREY);
+               uiBlockSetCol(block, TH_AUTO);
                uiDefButF(block, COL, B_MATCOL, "",             8,115,72,24, &(ma->r), 0, 0, 0, 0, "");
                uiDefButF(block, COL, B_SPECCOL, "",    8,88,72,24, &(ma->specr), 0, 0, 0, 0, "");
                uiDefButF(block, COL, B_MIRCOL, "",             8,61,72,24, &(ma->mirr), 0, 0, 0, 0, "");
        
-               uiBlockSetCol(block, BUTGREEN);
                if(ma->mode & MA_HALO) {
                        uiDefButC(block, ROW, REDRAWBUTSSHADING, "Halo",                83,115,40,25, &(ma->rgbsel), 2.0, 0.0, 0, 0, "Mix the colour of the halo with the RGB sliders");
                        uiDefButC(block, ROW, REDRAWBUTSSHADING, "Line",                83,88,40,25, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Mix the colour of the lines with the RGB sliders");
@@ -2344,7 +2275,6 @@ static void material_panel_material(Object *ob, Material *ma)
                        uiDefButC(block, ROW, REDRAWBUTSSHADING, "Spe",                 83,88,40,25, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Set the colour of the specularity");
                        uiDefButC(block, ROW, REDRAWBUTSSHADING, "Mir",                 83,61,40,25, &(ma->rgbsel), 2.0, 2.0, 0, 0, "Use mirror colour");
                }
-               uiBlockSetCol(block, BUTGREY);
                
                if(ma->rgbsel==0) {colpoin= &(ma->r); rgbsel= B_MATCOL;}
                else if(ma->rgbsel==1) {colpoin= &(ma->specr); rgbsel= B_SPECCOL;}
@@ -2352,11 +2282,11 @@ static void material_panel_material(Object *ob, Material *ma)
                
                if(ma->rgbsel==0 && (ma->mode & (MA_VERTEXCOLP|MA_FACETEXTURE) && !(ma->mode & MA_HALO)));
                else if(ma->colormodel==MA_HSV) {
-                       uiBlockSetCol(block, BUTPURPLE);
+                       uiBlockSetCol(block, TH_BUT_SETTING1);
                        uiDefButF(block, HSVSLI, B_MATPRV, "H ",                128,120,175,20, colpoin, 0.0, 0.9999, rgbsel, 0, "");
                        uiDefButF(block, HSVSLI, B_MATPRV, "S ",                128,98,175,20, colpoin, 0.0001, 1.0, rgbsel, 0, "");
                        uiDefButF(block, HSVSLI, B_MATPRV, "V ",                128,76,175,20, colpoin, 0.0001, 1.0, rgbsel, 0, "");
-                       uiBlockSetCol(block, BUTGREY);
+                       uiBlockSetCol(block, TH_AUTO);
                }
                else {
                        uiDefButF(block, NUMSLI, B_MATPRV, "R ",                128,120,175,20, colpoin, 0.0, 1.0, rgbsel, 0, "");
@@ -2368,7 +2298,6 @@ static void material_panel_material(Object *ob, Material *ma)
                uiDefButF(block, NUMSLI, B_MATPRV, "SpecTra ",          128,32,175,20, &(ma->spectra), 0.0, 1.0, 0, 0, "Make specular areas opaque");
                
        }
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, ROW, REDRAWBUTSSHADING, "RGB",                 8,32,35,20, &(ma->colormodel), 1.0, (float)MA_RGB, 0, 0, "Create colour by red, green and blue");
        uiDefButS(block, ROW, REDRAWBUTSSHADING, "HSV",                 43,32,35,20, &(ma->colormodel), 1.0, (float)MA_HSV, 0, 0, "Mix colour with hue, saturation and value");
        uiDefButS(block, TOG|BIT|0, REDRAWBUTSSHADING, "DYN",   78,32,45,20, &(ma->dynamode), 0.0, 0.0, 0, 0, "Adjust parameters for dynamics options");
@@ -2380,7 +2309,7 @@ static void material_panel_preview(Material *ma)
        uiBlock *block;
        
        /* name "Preview" is abused to detect previewrender offset panel */
-       block= uiNewBlock(&curarea->uiblocks, "material_panel_preview", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "material_panel_preview", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Preview", "Material", 0, 0, 318, 204)==0) return;
        
        if(ma) {
@@ -2388,7 +2317,7 @@ static void material_panel_preview(Material *ma)
        
                // label to force a boundbox for buttons not to be centered
                uiDefBut(block, LABEL, 0, " ",  20,20,10,10, 0, 0, 0, 0, 0, "");
-       
+               uiBlockSetCol(block, TH_BUT_NEUTRAL);
                uiDefIconButC(block, ROW, B_MATPRV, ICON_MATPLANE,              210,180,25,22, &(ma->pr_type), 10, 0, 0, 0, "");
                uiDefIconButC(block, ROW, B_MATPRV, ICON_MATSPHERE,             210,150,25,22, &(ma->pr_type), 10, 1, 0, 0, "");
                uiDefIconButC(block, ROW, B_MATPRV, ICON_MATCUBE,               210,120,25,22, &(ma->pr_type), 10, 2, 0, 0, "");
index 33ddedd90fa4f4a437f5fbbfc95a14b8ed927318..fb07c245d28c3c6f1ee85bc9c17238842bb51eef 100644 (file)
@@ -129,14 +129,12 @@ void meshactionbuts(SpaceAction *saction, Key *key)
 
     sprintf(str, "actionbuttonswin %d", curarea->win);
     block= uiNewBlock (&curarea->uiblocks, str, 
-                       UI_EMBOSSX, UI_HELV, curarea->win);
+                       UI_EMBOSS, UI_HELV, curarea->win);
 
        x = NAMEWIDTH + 1;
     y = key->totkey*(CHANNELHEIGHT+CHANNELSKIP) 
          - CHANNELHEIGHT/2  - G.v2d->cur.ymin;
 
-    uiBlockSetCol(block, BUTGREY);
-
        /* make the little 'open the sliders' widget */
     glColor3f(RVKBGCOL); 
        glRects(2,            y + 2*CHANNELHEIGHT - 2,  
@@ -168,7 +166,7 @@ void meshactionbuts(SpaceAction *saction, Key *key)
                /* sliders are open so draw them */
                glColor3f(RVKBGCOL); 
                glRects(NAMEWIDTH,  0,  NAMEWIDTH+SLIDERWIDTH,  curarea->winy);
-               uiBlockSetEmboss(block, UI_EMBOSSX);
+               uiBlockSetEmboss(block, UI_EMBOSS);
                for (i=1 ; i < key->totkey ; ++ i) {
                        make_rvk_slider(block, key, i, 
                                                        x, y, SLIDERWIDTH-2, CHANNELHEIGHT-1);
index 77901e4d066e29bcbe37f4e5079deab9e4cee690..6c50b88585ff86667677e2fc2481fd6f724bacf6 100644 (file)
@@ -438,8 +438,8 @@ void draw_sima_area(SpaceImaSel *simasel)
        glClear(GL_COLOR_BUFFER_BIT);
        
        sprintf(naam, "win %d", curarea->win);
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->win);
-       uiBlockSetCol(block, BUTBLUE);
+       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->win);
+       uiBlockSetCol(block, TH_BUT_SETTING1);
        
        if (simasel->desx >  0){
                /*  DIR ENTRYS */
index dc8ecb1a513e9f401489c24613f0298246ce82a2..24b43bc15c917025b454b930ce8f3c5c8a60f42b 100644 (file)
@@ -761,7 +761,6 @@ static void draw_ipobuts(SpaceIpo *sipo)
        
        sprintf(naam, "ipowin %d", area->win);
        block= uiNewBlock(&area->uiblocks, naam, UI_EMBOSSN, UI_HELV, area->win);
-       uiBlockSetCol(block, BUTRUST);
        
        ei= sipo->editipo;
        y= area->winy-30+sipo->butofs;
index 02f01debb630d91684244d84f5b15cc0dc00c2ee..15b1c311bcfff8a43e28d7808529d45e1f5e9cac 100644 (file)
@@ -732,7 +732,7 @@ static void tekenvertslatt(short sel)
        float size;
        int a, uxt, u, vxt, v, wxt, w;
 
-       size= BIF_GetThemeColorf(TH_VERTEX_SIZE);
+       size= BIF_GetThemeValuef(TH_VERTEX_SIZE);
        glPointSize(size);
 
        if(sel) BIF_ThemeColor(TH_VERTEX_SELECT);
@@ -1036,7 +1036,7 @@ void tekenvertices(short sel)
        EditVert *eve;
        float size;
        
-       size= BIF_GetThemeColorf(TH_VERTEX_SIZE);
+       size= BIF_GetThemeValuef(TH_VERTEX_SIZE);
        glPointSize(size);
        
        if(sel) BIF_ThemeColor(TH_VERTEX_SELECT);
@@ -2788,7 +2788,7 @@ static void tekenvertsN(Nurb *nu, short sel)
        if(sel) BIF_ThemeColor(TH_VERTEX_SELECT);
        else BIF_ThemeColor(TH_VERTEX);
 
-       size= BIF_GetThemeColorf(TH_VERTEX_SIZE);
+       size= BIF_GetThemeValuef(TH_VERTEX_SIZE);
        glPointSize(size);
        
        glBegin(GL_POINTS);
index 166a8d5b728671d6b1e1b49dc16a02f59bb1b10b..1e315acc1d8954a65c15efe61995417fcb691ae2 100644 (file)
@@ -1071,7 +1071,7 @@ static void view3d_panel_object(short cntrl)      // VIEW3D_HANDLER_OBJECT
        
        if(ob==NULL) return;
 
-       block= uiNewBlock(&curarea->uiblocks, "view3d_panel_object", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "view3d_panel_object", UI_EMBOSS, UI_HELV, curarea->win);
        uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
        uiSetPanelHandler(VIEW3D_HANDLER_OBJECT);  // for close and esc
        if(uiNewPanel(curarea, block, "Transform Properties", "View3d", 10, 230, 318, 204)==0) return;
@@ -1112,7 +1112,7 @@ static void view3d_panel_settings(cntrl)  // VIEW3D_HANDLER_BACKGROUND
        
        vd= G.vd;
 
-       block= uiNewBlock(&curarea->uiblocks, "view3d_panel_settings", UI_EMBOSSX, UI_HELV, curarea->win);
+       block= uiNewBlock(&curarea->uiblocks, "view3d_panel_settings", UI_EMBOSS, UI_HELV, curarea->win);
        uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE  | cntrl);
        uiSetPanelHandler(VIEW3D_HANDLER_BACKGROUND);  // for close and esc
        if(uiNewPanel(curarea, block, "Backdrop and settings", "View3d", 10, 10, 318, 204)==0) return;
@@ -1124,9 +1124,7 @@ static void view3d_panel_settings(cntrl)  // VIEW3D_HANDLER_BACKGROUND
                        vd->bgpic->blend= 0.5;
                }
        }
-       uiBlockSetCol(block, BUTGREEN);
        uiDefButS(block, TOG|BIT|1, REDRAWVIEW3D, "BackGroundPic",      10,160,150,20 , &vd->flag, 0, 0, 0, 0, "Display a picture in the 3D background");
-       uiBlockSetCol(block, BUTGREY);
        
        if(vd->bgpic) {
                
@@ -1142,9 +1140,7 @@ static void view3d_panel_settings(cntrl)  // VIEW3D_HANDLER_BACKGROUND
                        uiDefBut(block, TEX,        0,"BGpic: ",                30,140,260,19,&vd->bgpic->ima->name,0.0,100.0, 0, 0, "The Selected BackGroundPic");
                        uiDefIconBut(block, BUT, B_BGPICCLEAR, ICON_X,  290,140,20,19, 0, 0, 0, 0, 0, "Remove background image link");
                }
-               uiBlockSetCol(block, BUTSALMON);
                uiDefBut(block, BUT,        B_LOADBGPIC, "LOAD",        10,120,100,19, 0, 0, 0, 0, 0, "Specify the BackGroundPic");
-               uiBlockSetCol(block, BUTGREY);
                uiDefButF(block, NUMSLI, B_BLENDBGPIC, "Blend:",        120,120,190,19,&vd->bgpic->blend, 0.0,1.0, 0, 0, "Set the BackGroundPic transparency");
                
                /* There is a bug here ... (what bug? where? what is this? - zr) */
index 679479e8ebb21511ad9da71cbe39d4fb4330ef2f..2d0d789917c1ccf344a02ec88bd07e8d2a401bee 100644 (file)
@@ -303,8 +303,8 @@ void headerbox(ScrArea *area)
        glClear(GL_COLOR_BUFFER_BIT);
 
        if(area_is_active_area(area)) BIF_ThemeColor(TH_HEADER);
-       else BIF_ThemeColorShade(TH_HEADER, -20);
-       
+       else BIF_ThemeColor(TH_HEADERDESEL);
+
        /* weird values here... is because of window matrix that centres buttons */
        if(area->headertype==HEADERTOP) {
                uiSetRoundBox(3);
index bd7584d177a31f1396043ca12966b53f28f668ab..a80ff50207431f260b39f5b032fcf1bc85e488ba 100644 (file)
@@ -1164,8 +1164,7 @@ void drawfilespace(ScrArea *sa, void *spacedata)
 
        /* HEADER */
        sprintf(name, "win %d", curarea->win);
-       block= uiNewBlock(&curarea->uiblocks, name, UI_EMBOSSX, UI_HELV, curarea->win);
-       uiBlockSetCol(block, BUTGREY);
+       block= uiNewBlock(&curarea->uiblocks, name, UI_EMBOSS, UI_HELV, curarea->win);
        
        uiSetButLock( sfile->type==FILE_MAIN && sfile->returnfunc, NULL);
 
index 7a20f9a9e7681cbef3d196745ee6cc1039e5f3ad..4a531123d7ef989d565f643502b754b9317b7a49 100644 (file)
@@ -173,8 +173,10 @@ void action_buttons(void)
        }
 
        sprintf(naam, "header %d", curarea->headwin);
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin);
-       uiBlockSetCol(block, BUTPINK);
+       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
+
+       if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
+       else uiBlockSetCol(block, TH_HEADERDESEL);
 
        curarea->butspacetype= SPACE_ACTION;
        
index ed88dd565168ca7d64eddf4fccd4e6425687f45f..68e218e33cb91eeea4ad5345759e9dabf907bc9b 100644 (file)
@@ -89,9 +89,6 @@
 
 Material matcopybuf;
 
-static void unique_bone_name(Bone *bone, bArmature *arm);
-static int bonename_exists(Bone *orig, char *name, ListBase *list);
-
 void clear_matcopybuf(void)
 {
        memset(&matcopybuf, 0, sizeof(Material));
@@ -295,6 +292,7 @@ void buttons_active_id(ID **id, ID **idfrom)
        }
 }
 
+#if 0
 static void validate_bonebutton(void *bonev, void *data2_unused){
        Bone *bone= bonev;
        bArmature *arm;
@@ -303,6 +301,7 @@ static void validate_bonebutton(void *bonev, void *data2_unused){
        unique_bone_name(bone, arm);
 }
 
+
 static int bonename_exists(Bone *orig, char *name, ListBase *list)
 {
        Bone *curbone;
@@ -360,7 +359,6 @@ static uiBlock *sbuts_context_menu(void *arg_unused)
        short yco = 0;
 
        block= uiNewBlock(&curarea->uiblocks, "context_options", UI_EMBOSSP, UI_HELV, curarea->headwin);
-       uiBlockSetCol(block, MENUCOL);
 
        /* should be branches from tree */
        uiDefIconTextButS(block, BUTM, B_REDR, ICON_SCENE_DEHLT, "Scene|F10", 0, yco-=22, 100, 20, &G.buts->mainb, 0.0, 0.0, 0, 0, "");
@@ -380,7 +378,7 @@ static uiBlock *sbuts_context_menu(void *arg_unused)
 
        return block;
 }
-
+#endif
 
 void buts_buttons(void)
 {
@@ -390,8 +388,10 @@ void buts_buttons(void)
        char naam[20];
 
        sprintf(naam, "header %d", curarea->headwin);
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin);
-       uiBlockSetCol(block, BUTGREY);
+       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
+
+       if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
+       else uiBlockSetCol(block, TH_HEADERDESEL);
 
        curarea->butspacetype= SPACE_BUTS;
        
@@ -411,9 +411,6 @@ void buts_buttons(void)
        
        /* mainb menu */
        /* (this could be done later with a dynamic tree and branches, also for python) */
-       uiBlockSetCol(block, MIDGREY);
-       // uiBlockSetEmboss(block, UI_EMBOSSMB);        // menu but
-
        //{
        //      char mainbname[8][12]= {" Scene", " Object", " Types", " Shading", " Editing", " Script", " Logic"};
        //      char mainbicon[8]= {ICON_SCENE_DEHLT, ICON_OBJECT, ICON_BBOX, ICON_MATERIAL_DEHLT, ICON_EDIT, ICON_SCRIPT, ICON_GAME};
@@ -433,7 +430,7 @@ void buts_buttons(void)
        // if(curarea->headertype==HEADERTOP)  t_base= -3; else t_base= 4;
        
        /* select the context to be drawn, per contex/tab the actual context is tested */
-       uiBlockSetEmboss(block, UI_EMBOSSX);    // normal
+       uiBlockSetEmboss(block, UI_EMBOSS);     // normal
        switch(G.buts->mainb) {
        case CONTEXT_SCENE:
                uiDefIconButC(block, ROW, B_REDR,               ICON_SCENE,     xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_RENDER, 0, 0, "Render buttons ");
index cb59284ae894caf9bcb667fc41313e8c60ed7a93..6f689ad48122d42cdc4777736388ebe70088d949 100644 (file)
@@ -104,8 +104,10 @@ void file_buttons(void)
        sfile= curarea->spacedata.first;
 
        sprintf(naam, "header %d", curarea->headwin);
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin);
-       uiBlockSetCol(block, BUTGREY);
+       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
+
+       if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
+       else uiBlockSetCol(block, TH_HEADERDESEL);
 
        curarea->butspacetype= SPACE_FILE;
        
@@ -128,7 +130,7 @@ void file_buttons(void)
        cpack(0x0);
        glRasterPos2i(xco+=XIC+10,      5);
 
-       BIF_DrawString(uiBlockGetCurFont(block), sfile->title, (U.transopts & TR_BUTTONS), 0);
+       BIF_DrawString(uiBlockGetCurFont(block), sfile->title, (U.transopts & TR_BUTTONS));
        xco+= BIF_GetStringWidth(G.font, sfile->title, (U.transopts & TR_BUTTONS));
        
        uiDefIconButS(block, ICONTOG|BIT|0, B_SORTFILELIST, ICON_LONGDISPLAY,xco+=XIC,0,XIC,YIC, &sfile->flag, 0, 0, 0, 0, "Toggles long info");
@@ -151,7 +153,7 @@ void file_buttons(void)
                cpack(0x0);
                glRasterPos2i(xco,      5);
 
-               BIF_DrawString(uiBlockGetCurFont(block), naam, 0, 0);
+               BIF_DrawString(uiBlockGetCurFont(block), naam, 0);
        }
        /* always do as last */
        curarea->headbutlen= xco+2*XIC;
index 9890bca5e68e76b7197b596661862979b2a9787f..1a4f3dfa37b478f18acf98bca44db58a9e1feedd 100644 (file)
@@ -361,8 +361,10 @@ void image_buttons(void)
        headerbuttons_packdummy = 0;
                
        sprintf(naam, "header %d", curarea->headwin);
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin);
-       uiBlockSetCol(block, BUTBLUE);
+       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
+
+       if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
+       else uiBlockSetCol(block, TH_HEADERDESEL);
 
        what_image(G.sima);
 
@@ -393,18 +395,18 @@ void image_buttons(void)
                xco += XIC;
        }
        
-       uiBlockSetCol(block, BUTSALMON);
+       uiBlockSetCol(block, TH_AUTO);
        uiDefBut(block, BUT, B_SIMAGELOAD, "Load",              xco+=XIC,0,2*XIC,YIC, 0, 0, 0, 0, 0, "Loads image - thumbnail view");
 
-       uiBlockSetCol(block, BUTGREY);
+       uiBlockSetCol(block, TH_HEADER);
        uiDefBut(block, BUT, B_SIMAGELOAD1, "",         (short)(xco+=2*XIC+2),0,10,YIC, 0, 0, 0, 0, 0, "Loads image - file select view");
        xco+=XIC/2;
 
        if (G.sima->image) {
-               uiBlockSetCol(block, BUTSALMON);
+               uiBlockSetCol(block, TH_AUTO);
                uiDefBut(block, BUT, B_SIMAGEREPLACE, "Replace",xco+=XIC,0,(short)(3*XIC),YIC, 0, 0, 0, 0, 0, "Replaces current image - thumbnail view");
                
-               uiBlockSetCol(block, BUTGREY);
+               uiBlockSetCol(block, TH_HEADER);
                uiDefBut(block, BUT, B_SIMAGEREPLACE1, "",      (short)(xco+=3*XIC+2),0,10,YIC, 0, 0, 0, 0, 0, "Replaces current image - file select view");
                xco+=XIC/2;
        
index 4f486ab5ff54659fddb673fbad2329bdb2e1817c..7a1d9921ff6f9f6ce9529f0ae57dfb6a4ee0bb98 100644 (file)
@@ -106,8 +106,10 @@ void imasel_buttons(void)
        simasel= curarea->spacedata.first;
 
        sprintf(naam, "header %d", curarea->headwin);
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin);
-       uiBlockSetCol(block, BUTBLUE);
+       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
+
+       if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
+       else uiBlockSetCol(block, TH_HEADERDESEL);
 
        curarea->butspacetype= SPACE_IMASEL;
 
index 91e3a53fbb5380e62df61f8d97c6391bc8785645..40986b4157541d070544e3f5f1465dfd72471456 100644 (file)
@@ -592,7 +592,6 @@ static uiBlock *info_file_optionsmenu(void *arg_unused)
        block= uiNewBlock(&curarea->uiblocks, "runtime_options", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_info_file_optionsmenu, NULL);
        uiBlockSetXOfs(block,-40);      // offset to parent button
-       uiBlockSetCol(block, MENUCOL);
        
        /* flags are case-values */
        uiDefBut(block, BUTM, 1, "Compress File",       xco, yco-=20, 100, 19, NULL, 0.0, 0.0, 0, G_FILE_COMPRESS_BIT, "Enables file compression");
@@ -606,7 +605,7 @@ static uiBlock *info_file_optionsmenu(void *arg_unused)
        
        yco= 0;
        xco -= 20;
-       uiBlockSetEmboss(block, UI_EMBOSSW);
+       uiBlockSetEmboss(block, UI_EMBOSSM);
        uiBlockSetButmFunc(block, NULL, NULL);
        /* flags are defines */
        uiDefIconButI(block, ICONTOG|BIT|G_FILE_COMPRESS_BIT, 0, ICON_CHECKBOX_DEHLT, xco, yco-=20, 19, 19, &G.fileflags, 0.0, 0.0, 0, 0, "");
@@ -626,8 +625,7 @@ static uiBlock *info_runtime_optionsmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "add_surfacemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetXOfs(block, -40);  // offset to parent button
-       uiBlockSetCol(block, MENUCOL);
-       uiBlockSetEmboss(block, UI_EMBOSSW);
+       uiBlockSetEmboss(block, UI_EMBOSSM);
 
        uiDefBut(block, LABEL, 0, "Size options:",              xco, yco-=20, 114, 19, 0, 0.0, 0.0, 0, 0, "");
        uiDefButS(block, NUM, 0, "X:",          xco+19, yco-=20, 95, 19,                &G.scene->r.xplay, 10.0, 2000.0, 0, 0, "Displays current X screen/window resolution. Click to change.");
@@ -688,7 +686,6 @@ static uiBlock *info_file_importmenu(void *arg_unused)
        block= uiNewBlock(&curarea->uiblocks, "importmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_info_file_importmenu, NULL);
        //uiBlockSetXOfs(block, -50);  // offset to parent button
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefBut(block, BUTM, 1, "Python scripts go here somehow!",     0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
 
@@ -731,7 +728,6 @@ static uiBlock *info_file_exportmenu(void *arg_unused)
        block= uiNewBlock(&curarea->uiblocks, "exportmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_info_file_exportmenu, NULL);
        //uiBlockSetXOfs(block, -50);  // offset to parent button
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefBut(block, BUTM, 1, "VRML 1.0...|Ctrl F2",         0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefBut(block, BUTM, 1, "DXF...|Shift F2",             0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -839,7 +835,6 @@ static uiBlock *info_filemenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "info_filemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_info_filemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "New|Ctrl X",                             0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Open...|F1",                             0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -939,7 +934,6 @@ static uiBlock *info_add_meshmenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "add_meshmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_info_add_meshmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Plane|",                         0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cube|",                          0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -996,7 +990,6 @@ static uiBlock *info_add_curvemenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "add_curvemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_info_add_curvemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bezier Curve|",  0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bezier Circle|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -1053,7 +1046,6 @@ static uiBlock *info_add_surfacemenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "add_surfacemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_info_add_surfacemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Curve|",           0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Circle|",          0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -1106,7 +1098,6 @@ static uiBlock *info_add_metamenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "add_metamenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_info_add_metamenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,"Meta Ball|",              0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta Tube|",             0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -1176,7 +1167,6 @@ static uiBlock *info_addmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "addmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_info_addmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBlockBut(block, info_add_meshmenu, NULL, ICON_RIGHTARROW_THIN, "Mesh", 0, yco-=20, 120, 19, "");
        uiDefIconTextBlockBut(block, info_add_curvemenu, NULL, ICON_RIGHTARROW_THIN, "Curve", 0, yco-=20, 120, 19, "");
@@ -1224,7 +1214,6 @@ static uiBlock *info_gamemenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "gamemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_info_gamemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, B_STARTGAME, ICON_BLANK1, "Start Game|P",  0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
        
@@ -1350,7 +1339,6 @@ static uiBlock *info_timelinemenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "timelinemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_info_timelinemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Keyframes|K",               0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show and Select Keyframes|Shift K",0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
@@ -1473,7 +1461,6 @@ static uiBlock *info_rendermenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "rendermenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_info_rendermenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Render Current Frame|F12",       0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Render Animation",               0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -1523,7 +1510,6 @@ static uiBlock *info_help_websitesmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "info_help_websitesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_info_help_websitesmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Blender Website *",                      0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Blender E-shop *",               0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -1580,7 +1566,6 @@ static uiBlock *info_helpmenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "info_helpmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_info_helpmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "-- Placeholders only --",        0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        
@@ -1665,23 +1650,23 @@ static void info_text(int x, int y)
 
        glRasterPos2i(x, y);
 
-       BIF_DrawString(G.font, headerstr, (U.transopts & TR_MENUS), 0);
+       BIF_DrawString(G.font, headerstr, (U.transopts & TR_MENUS));
                
        glRasterPos2i(x+122,    y);
 
-       BIF_DrawString(G.font, infostr, (U.transopts & TR_MENUS), 0);
+       BIF_DrawString(G.font, infostr, (U.transopts & TR_MENUS));
 }
 
 void info_buttons(void)
 {
        uiBlock *block;
        short xco= 42;
-       char naam[20];
        int xmax;
 
-       sprintf(naam, "header %d", curarea->headwin);   
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSN, UI_HELV, curarea->headwin);
-       uiBlockSetCol(block, BUTGREY);
+       block= uiNewBlock(&curarea->uiblocks, "header info", UI_EMBOSSN, UI_HELV, curarea->headwin);
+
+       if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
+       else uiBlockSetCol(block, TH_HEADERDESEL);
        
        if(U.uiflag & FLIPINFOMENU) {
                uiDefIconButS(block, TOG|BIT|6, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
@@ -1697,10 +1682,7 @@ void info_buttons(void)
        if(U.uiflag & FLIPINFOMENU) {
        } else {
                uiBlockSetEmboss(block, UI_EMBOSSP);
-               if(area_is_active_area(curarea)) uiBlockSetCol(block, HEADERCOLSEL);    
-               else uiBlockSetCol(block, HEADERCOL);   
 
-               
                /* the 'xmax - 3' rather than xmax is to prevent some weird flickering where the highlighted
                 * menu is drawn wider than it should be. The ypos of -1 is to make it properly fill the
                 * height of the header */
@@ -1731,19 +1713,16 @@ void info_buttons(void)
        }
 
        /* pack icon indicates a packed file */
-       uiBlockSetCol(block, BUTGREY);
        
        if (G.fileflags & G_AUTOPACK) {
                uiBlockSetEmboss(block, UI_EMBOSSN);
                uiDefIconBut(block, LABEL, 0, ICON_PACKAGE, xco, 0, XIC, YIC, &G.fileflags, 0.0, 0.0, 0, 0, "Indicates this is a Packed file. See File menu.");
                xco += XIC;
-               uiBlockSetEmboss(block, UI_EMBOSSX);
        }
 
-       uiBlockSetEmboss(block, UI_EMBOSSX);
-       
        if (curarea->full == 0) {
                curarea->butspacetype= SPACE_INFO;
+               uiBlockSetEmboss(block, UI_EMBOSS);
                uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), 8,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
                
                /* STD SCREEN BUTTONS */
@@ -1761,13 +1740,7 @@ void info_buttons(void)
        
        uiBlockSetEmboss(block, UI_EMBOSSN);
        uiDefIconBut(block, BUT, B_SHOWSPLASH, ICON_BLENDER, xco+7, 0,XIC,YIC, 0, 0, 0, 0, 0, "Click to display Splash Screen");
-       uiBlockSetEmboss(block, UI_EMBOSSX);
 
-/*
-       uiBlockSetEmboss(block, UI_EMBOSSN);
-       uiDefIconBut(block, LABEL, 0, ICON_PUBLISHER, xco+125, 0,XIC,YIC, 0, 0, 0, 0, 0, "");
-       uiBlockSetEmboss(block, UI_EMBOSSX);
-*/
        /* always do as last */
        curarea->headbutlen= xco+2*XIC;
        
index ce6c9e69582aa5ff208f89e1e012955c23e448f9..a9811c1a8c49abf6c437ff23c2b4381f08ac331a 100644 (file)
@@ -63,6 +63,8 @@
 #include "BIF_interface.h"
 #include "BIF_resources.h"
 #include "BIF_screen.h"
+#include "BIF_space.h"
+
 #include "BKE_global.h"
 #include "BKE_main.h"
 #include "BKE_material.h"
@@ -207,8 +209,10 @@ void ipo_buttons(void)
        char naam[20];
 
        sprintf(naam, "header %d", curarea->headwin);
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin);
-       uiBlockSetCol(block, BUTSALMON);
+       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
+
+       if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
+       else uiBlockSetCol(block, TH_HEADERDESEL);
 
        curarea->butspacetype= SPACE_IPO;
 
index 7130b50ee44a1c035f97c0087f07afab57483b8f..6f39cc93531868f9ecee26152e67d3df588bc425 100644 (file)
@@ -106,8 +106,10 @@ void nla_buttons(void)
        snla= curarea->spacedata.first;
        
        sprintf(naam, "header %d", curarea->headwin);
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin);
-       uiBlockSetCol(block, BUTCHOKE);
+       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
+
+       if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
+       else uiBlockSetCol(block, TH_HEADERDESEL);
 
        curarea->butspacetype= SPACE_NLA;
        
index c29921717327c77c78c60013340dfc9301a81b9a..cd0e1f272e113cb2f49a41f4f39e4153f7ebf0eb 100644 (file)
@@ -111,8 +111,10 @@ void oops_buttons(void)
        soops= curarea->spacedata.first;
 
        sprintf(naam, "header %d", curarea->headwin);
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin);
-       uiBlockSetCol(block, BUTGREEN);
+       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
+
+       if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
+       else uiBlockSetCol(block, TH_HEADERDESEL);
 
        curarea->butspacetype= SPACE_OOPS;
 
index e08c086b91d950218da740f12f66d88d69994a27..cdda34bd050c7aded57c3c90decbd0c499b54dd9 100644 (file)
@@ -102,8 +102,10 @@ void seq_buttons()
        sseq= curarea->spacedata.first;
 
        sprintf(naam, "header %d", curarea->headwin);
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin);
-       uiBlockSetCol(block, BUTPURPLE);
+       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
+
+       if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
+       else uiBlockSetCol(block, TH_HEADERDESEL);
 
        curarea->butspacetype= SPACE_SEQ;
 
index fafea6fbcce4580946029344edaeac2e4ba40d3a..d32ec760121485f91c740e8ee2692289431dd18f 100644 (file)
@@ -179,8 +179,10 @@ void sound_buttons(void)
        char ch[20];
        
        sprintf(naam, "header %d", curarea->headwin);
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin);
-       uiBlockSetCol(block, BUTYELLOW);
+       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
+
+       if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
+       else uiBlockSetCol(block, TH_HEADERDESEL);
 
        curarea->butspacetype= SPACE_SOUND;
        
index c87f2d294c8a91e69e9b827ccf2375633aabcbf7..7287ffb08328640bb1d0a9459fbc4ba0db089519 100644 (file)
@@ -192,8 +192,10 @@ void text_buttons(void)
        if (!st || st->spacetype != SPACE_TEXT) return;
 
        sprintf(naam, "header %d", curarea->headwin);
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin);
-       uiBlockSetCol(block, BUTGREY);
+       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);
+
+       if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
+       else uiBlockSetCol(block, TH_HEADERDESEL);
 
        curarea->butspacetype= SPACE_TEXT;
 
index 63abef2320d26ad94a759a9502e0bfa96f273fa7..582096d1514c6c6f260333cd2ba7522a623fac4c 100644 (file)
@@ -208,7 +208,6 @@ static uiBlock *view3d_view_cameracontrolsmenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_view_cameracontrolsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_view_cameracontrolsmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Left|NumPad 4",    0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Right|NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
@@ -301,7 +300,6 @@ static uiBlock *view3d_viewmenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_viewmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        if ((G.vd->viewbut == 0) && !(G.vd->persp == 2)) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "User",                    0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
        else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "User",                                              0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
@@ -406,11 +404,10 @@ static void do_view3d_select_object_typemenu(void *arg, int event)
 static uiBlock *view3d_select_object_typemenu(void *arg_unused)
 {
        uiBlock *block;
-       short xco= 0, yco = 20, menuwidth = 120;
+       short yco = 20, menuwidth = 120;
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_select_object_typemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_select_object_typemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mesh",           0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve",          0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -474,7 +471,6 @@ static uiBlock *view3d_select_object_layermenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_select_object_layermenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_select_object_layermenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
 
        uiDefBut(block, BUTM, 1, "1",           xco, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
        uiDefBut(block, BUTM, 1, "2",           xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
@@ -536,7 +532,6 @@ static uiBlock *view3d_select_objectmenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_select_objectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_select_objectmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B",                                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        
@@ -598,7 +593,6 @@ static uiBlock *view3d_select_meshmenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_select_meshmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_select_meshmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B",                                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        
@@ -659,7 +653,6 @@ static uiBlock *view3d_select_curvemenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_select_curvemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_select_curvemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B",                                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        
@@ -711,7 +704,6 @@ static uiBlock *view3d_select_metaballmenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_select_metaballmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_select_metaballmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B",                                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        
@@ -753,7 +745,6 @@ static uiBlock *view3d_select_latticemenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_select_latticemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_select_latticemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B",                                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        
@@ -795,7 +786,6 @@ static uiBlock *view3d_select_armaturemenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_select_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_select_armaturemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B",                                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        
@@ -837,7 +827,6 @@ static uiBlock *view3d_select_pose_armaturemenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_select_pose_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_select_pose_armaturemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B",                                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        
@@ -879,7 +868,6 @@ static uiBlock *view3d_select_faceselmenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_select_faceselmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_select_faceselmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B",                                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        
@@ -931,7 +919,6 @@ static uiBlock *view3d_edit_object_transformmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_edit_object_transformmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Size/Rotation|Ctrl A",                     0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Deformation|Ctrl Shift A",         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
@@ -968,7 +955,6 @@ static uiBlock *view3d_edit_object_parentmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_parentmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_edit_object_parentmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Parent...|Ctrl P",                  0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Parent...|Alt P",          0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
@@ -998,7 +984,6 @@ static uiBlock *view3d_edit_object_trackmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_trackmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_edit_object_trackmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Track...|Ctrl T",                   0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Track...|Alt T",           0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
@@ -1080,7 +1065,6 @@ static uiBlock *view3d_edit_objectmenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_objectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_edit_objectmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N",             0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, "");
        uiDefBut(block, SEPR, 0, "",                                    0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@@ -1162,7 +1146,6 @@ static uiBlock *view3d_edit_propfalloffmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_propfalloffmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_edit_propfalloffmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        if (prop_mode==0) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sharp|Shift O",  0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
@@ -1196,7 +1179,6 @@ static uiBlock *view3d_edit_mesh_undohistorymenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_undohistorymenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_edit_mesh_undohistorymenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo All Changes|Ctrl U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
        
@@ -1245,7 +1227,6 @@ static uiBlock *view3d_edit_mesh_verticesmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_verticesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_edit_mesh_verticesmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Merge...|Alt M",                 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Split|Y",                        0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
@@ -1302,7 +1283,6 @@ static uiBlock *view3d_edit_mesh_edgesmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_edgesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_edit_mesh_edgesmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Knife Subdivide...|Shift K",                     0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
        
@@ -1349,7 +1329,6 @@ static uiBlock *view3d_edit_mesh_facesmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_facesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_edit_mesh_facesmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Fill|Shift F",                   0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Beauty Fill|Alt F",              0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -1388,7 +1367,6 @@ static uiBlock *view3d_edit_mesh_normalsmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_normalsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_edit_mesh_normalsmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recalculate Outside|Ctrl N",                     0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recalculate Inside|Ctrl Shift N",                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -1427,7 +1405,6 @@ static uiBlock *view3d_edit_mesh_showhidemenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_edit_mesh_showhidemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden Vertices",                   0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected Vertices|H",               0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -1493,7 +1470,6 @@ static uiBlock *view3d_edit_meshmenu(void *arg_unused)
                
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_meshmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_edit_meshmenu, NULL);
-               uiBlockSetCol(block, MENUCOL);
                
        /*
        uiDefIconTextBlockBut(block, view3d_edit_mesh_facesmenu, NULL, ICON_RIGHTARROW_THIN, "Move", 0, yco-=20, 120, 19, "");
@@ -1593,7 +1569,6 @@ static uiBlock *view3d_edit_curve_controlpointsmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curve_controlpointsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_edit_curve_controlpointsmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        if (OBACT->type == OB_CURVE) {
                uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tilt|T",                         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
@@ -1635,7 +1610,6 @@ static uiBlock *view3d_edit_curve_segmentsmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curve_segmentsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_edit_curve_segmentsmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide",                              0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Switch Direction",                               0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -1668,7 +1642,6 @@ static uiBlock *view3d_edit_curve_showhidemenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curve_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_edit_curve_showhidemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden Control Points|Alt H",                       0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected Control Points|H",         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
@@ -1736,7 +1709,6 @@ static uiBlock *view3d_edit_curvemenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curvemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_edit_curvemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U",         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        
@@ -1818,8 +1790,6 @@ static uiBlock *view3d_edit_metaballmenu(void *arg_unused)
                
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_metaballmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_edit_metaballmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
-       
 
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D",                      0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X",                    0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
@@ -1906,7 +1876,6 @@ static uiBlock *view3d_edit_text_charsmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_text_charsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_edit_text_charsmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copyright|Alt C",                        0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Registered Trademark|Alt R",                     0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -1962,7 +1931,6 @@ static uiBlock *view3d_edit_textmenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_textmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_edit_textmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U",         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        
@@ -2020,7 +1988,6 @@ static uiBlock *view3d_edit_latticemenu(void *arg_unused)
                
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_latticemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_edit_latticemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U",         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        
@@ -2097,7 +2064,6 @@ static uiBlock *view3d_edit_armaturemenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_edit_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_edit_armaturemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U",         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        
@@ -2156,7 +2122,6 @@ static uiBlock *view3d_pose_armature_transformmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_pose_armature_transformmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Location|Alt G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Rotation|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
@@ -2198,7 +2163,6 @@ static uiBlock *view3d_pose_armaturemenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_pose_armaturemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        uiDefIconTextBlockBut(block, view3d_pose_armature_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
@@ -2250,7 +2214,6 @@ static uiBlock *view3d_paintmenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_paintmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_paintmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        if (G.f & G_VERTEXPAINT) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Vertex Painting|U",                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        if (G.f & G_WEIGHTPAINT) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Weight Painting|U",                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
@@ -2341,7 +2304,6 @@ static uiBlock *view3d_facesel_propertiesmenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_facesel_propertiesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_facesel_propertiesmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        if (lasttface->mode & TF_TEX) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Textured",                   0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
        else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Textured",                                          0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
@@ -2420,7 +2382,6 @@ static uiBlock *view3d_facesel_showhidemenu(void *arg_unused)
 
        block= uiNewBlock(&curarea->uiblocks, "view3d_facesel_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
        uiBlockSetButmFunc(block, do_view3d_facesel_showhidemenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden Faces|Alt H",                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected Faces|H",          0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
@@ -2498,7 +2459,6 @@ static uiBlock *view3d_faceselmenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_faceselmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_faceselmenu, NULL);
-       uiBlockSetCol(block, MENUCOL);
        
        uiDefIconTextBlockBut(block, view3d_facesel_propertiesmenu, NULL, ICON_RIGHTARROW_THIN, "Active Draw Mode", 0, yco-=20, 120, 19, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Draw Mode",         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
@@ -2966,12 +2926,12 @@ void view3d_buttons(void)
        uiBlock *block;
        int a;
        short xco = 0;
-       char naam[20];
        short xmax;
        
-       sprintf(naam, "header %d", curarea->headwin);
-       block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->headwin);
-       uiBlockSetCol(block, MIDGREY);  
+       block= uiNewBlock(&curarea->uiblocks, "header view3d", UI_EMBOSS, UI_HELV, curarea->headwin);
+
+       if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
+       else uiBlockSetCol(block, TH_HEADERDESEL);
 
        curarea->butspacetype= SPACE_VIEW3D;
        
@@ -2983,8 +2943,6 @@ void view3d_buttons(void)
 
        /* pull down menus */
        uiBlockSetEmboss(block, UI_EMBOSSP);
-       if(area_is_active_area(curarea)) uiBlockSetCol(block, HEADERCOLSEL);    
-       else uiBlockSetCol(block, HEADERCOL); 
        
        /* compensate for local mode when setting up the viewing menu/iconrow values */
        if(G.vd->view==7) G.vd->viewbut= 1;
@@ -3085,8 +3043,7 @@ void view3d_buttons(void)
        }
 
        /* end pulldowns, other buttons: */
-       uiBlockSetCol(block, MIDGREY);
-       uiBlockSetEmboss(block, UI_EMBOSSX);
+       uiBlockSetEmboss(block, UI_EMBOSS);
        
        /* mode */
        G.vd->modeselect = V3D_OBJECTMODE_SEL;
@@ -3168,7 +3125,7 @@ void view3d_buttons(void)
                xco+= 14;
                //uiDefIconButI(block, ICONTOG|BIT|14, B_PROPTOOL, ICON_GRID, xco+=XIC,0,XIC,YIC, &G.f, 0, 0, 0, 0, "Toggles Proportional Vertex Editing (OKEY)");
                if(G.f & G_PROPORTIONAL) {
-                       uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_SHARPCURVE, propfalloff_pup(), xco,0,XIC+10,YIC, &(prop_mode), 0, 1.0, 0, 0, "Proportional Edit Falloff (Hotkey: Shift O) ");
+                       uiDefIconTextButI(block, ICONTEXTROW,B_REDR, ICON_SHARPCURVE, propfalloff_pup(), xco,0,XIC+10,YIC, &(prop_mode), 0, 1.0, 0, 0, "Proportional Edit Falloff (Hotkey: Shift O) ");
                        // uiDefIconButI(block, ROW, 0, ICON_SHARPCURVE, xco+=XIC,0,XIC,YIC, &prop_mode, 4.0, 0.0, 0, 0, "Sharp Proportional falloff (Hotkey: Shift O)");
                        // uiDefIconButI(block, ROW, 0, ICON_SMOOTHCURVE,       xco+=XIC,0,XIC,YIC, &prop_mode, 4.0, 1.0, 0, 0, "Smooth Proportional falloff (Hotkey: Shift O)");
                }
index 57b10c642cd35a6b55d058f3b0885deb4648bd7c..a2b790c12455d366cd8a24640efe218a4f0be771 100644 (file)
@@ -301,10 +301,10 @@ int std_libbuttons(uiBlock *block, short xco, short yco,
                        lb= wich_libbase(G.main, GS(id->name));
                        
                        if(idwasnul) id= NULL;
-                       else if(id->us>1) uiBlockSetCol(block, BUTDBLUE);
+                       else if(id->us>1) uiBlockSetCol(block, TH_BUT_SETTING1);
 
                        if (pin && *pinpoin) {
-                               uiBlockSetCol(block, BUTDPINK);
+                               uiBlockSetCol(block, TH_BUT_SETTING2);
                        }
                        
                        if ELEM7( idtype, ID_SCE, ID_SCR, ID_MA, ID_TE, ID_WO, ID_IP, ID_AC) extrastr= "ADD NEW %x 32767";
@@ -375,13 +375,13 @@ int std_libbuttons(uiBlock *block, short xco, short yco,
        if(id) {
        
                /* name */
-               if(id->us>1) uiBlockSetCol(block, BUTDBLUE);
+               if(id->us>1) uiBlockSetCol(block, TH_BUT_SETTING1);
                /* Pinned data ? */
                if (pin && *pinpoin) {
-                       uiBlockSetCol(block, BUTDPINK);
+                       uiBlockSetCol(block, TH_BUT_SETTING2);
                }
                /* Redalert overrides pin color */
-               if(id->us<=0) uiBlockSetCol(block, REDALERT);
+               if(id->us<=0) uiBlockSetCol(block, TH_REDALERT);
 
                uiSetButLock(id->lib!=0, "Can't edit library data");
                
index 1079ee4ed1aa6129919158c8a0c0a55b3c1189b8..37e76c178242dd8447cc9607ccb1fdfc930c1fa7 100644 (file)
@@ -115,9 +115,6 @@ static uiBut *UIbuttip;
 /* ************* PROTOTYPES ***************** */
 
 static void ui_set_but_val(uiBut *but, double value);
-static double ui_get_but_val(uiBut *but);
-
-
 
 /* ****************************** */
 
@@ -134,6 +131,50 @@ static void uibut_do_func(uiBut *but)
        }
 }
 
+/* ************* window matrix ************** */
+
+
+void ui_graphics_to_window(int win, float *x, float *y)        /* for rectwrite  */
+{
+       float gx, gy;
+       int sx, sy;
+       int getsizex, getsizey;
+
+       bwin_getsize(win, &getsizex, &getsizey);
+       bwin_getsuborigin(win, &sx, &sy);
+
+       gx= *x;
+       gy= *y;
+       *x= sx + getsizex*(0.5+ 0.5*(gx*UIwinmat[0][0]+ gy*UIwinmat[1][0]+ UIwinmat[3][0]));
+       *y= sy + getsizey*(0.5+ 0.5*(gx*UIwinmat[0][1]+ gy*UIwinmat[1][1]+ UIwinmat[3][1]));
+}
+
+
+
+void ui_window_to_graphics(int win, float *x, float *y)        /* for mouse cursor */
+{
+       float a, b, c, d, e, f, px, py;
+       int getsizex, getsizey;
+               
+       bwin_getsize(win, &getsizex, &getsizey);
+
+       a= .5*getsizex*UIwinmat[0][0];
+       b= .5*getsizex*UIwinmat[1][0];
+       c= .5*getsizex*(1.0+UIwinmat[3][0]);
+
+       d= .5*getsizey*UIwinmat[0][1];
+       e= .5*getsizey*UIwinmat[1][1];
+       f= .5*getsizey*(1.0+UIwinmat[3][1]);
+       
+       px= *x;
+       py= *y;
+       
+       *y=  (a*(py-f) + d*(c-px))/(a*e-d*b);
+       *x= (px- b*(*y)- c)/a;
+       
+}
+
+
 /* ************* SAVE UNDER ************ */
 
 typedef struct {
@@ -185,52 +226,6 @@ static uiSaveUnder *ui_save_under(int x, int y, int sx, int sy)
 }
 
 
-
-
-
-/* ************* DRAW ************** */
-
-
-void ui_graphics_to_window(int win, float *x, float *y)        /* for rectwrite  */
-{
-       float gx, gy;
-       int sx, sy;
-       int getsizex, getsizey;
-
-       bwin_getsize(win, &getsizex, &getsizey);
-       bwin_getsuborigin(win, &sx, &sy);
-
-       gx= *x;
-       gy= *y;
-       *x= sx + getsizex*(0.5+ 0.5*(gx*UIwinmat[0][0]+ gy*UIwinmat[1][0]+ UIwinmat[3][0]));
-       *y= sy + getsizey*(0.5+ 0.5*(gx*UIwinmat[0][1]+ gy*UIwinmat[1][1]+ UIwinmat[3][1]));
-}
-
-
-
-void ui_window_to_graphics(int win, float *x, float *y)        /* for mouse cursor */
-{
-       float a, b, c, d, e, f, px, py;
-       int getsizex, getsizey;
-               
-       bwin_getsize(win, &getsizex, &getsizey);
-
-       a= .5*getsizex*UIwinmat[0][0];
-       b= .5*getsizex*UIwinmat[1][0];
-       c= .5*getsizex*(1.0+UIwinmat[3][0]);
-
-       d= .5*getsizey*UIwinmat[0][1];
-       e= .5*getsizey*UIwinmat[1][1];
-       f= .5*getsizey*(1.0+UIwinmat[3][1]);
-       
-       px= *x;
-       py= *y;
-       
-       *y=  (a*(py-f) + d*(c-px))/(a*e-d*b);
-       *x= (px- b*(*y)- c)/a;
-       
-}
-
 static uiSaveUnder *ui_bgnpupdraw(int startx, int starty, int endx, int endy, int cursor)
 {
        uiSaveUnder *su;
@@ -248,1852 +243,38 @@ static uiSaveUnder *ui_bgnpupdraw(int startx, int starty, int endx, int endy, in
        
        /* tinsy bit larger, 1 pixel on the edge */
        
-       glReadBuffer(GL_FRONT);
-       glDrawBuffer(GL_FRONT);
-       
-       /* for geforce and other cards */
-       glFinish();
-
-       su= ui_save_under(startx-1, starty-1, endx-startx+2, endy-starty+6);
-       if(su) su->oldwin= oldwin;
-       
-       if(su && cursor) {
-               su->oldcursor= get_cursor();
-               set_cursor(CURSOR_STD);
-       }
-       
-       return su;
-}
-
-static void ui_endpupdraw(uiSaveUnder *su)
-{
-
-       /* for geforce and other cards */
-
-       glReadBuffer(GL_FRONT);
-       glDrawBuffer(GL_FRONT);
-       
-       glFinish();
-
-       if(su) {
-               ui_paste_under(su);
-       }
-       glReadBuffer(GL_BACK);
-       glDrawBuffer(GL_BACK);
-}
-
-
-static void ui_draw_icon(uiBut *but, BIFIconID icon)
-{
-       float xs=0, ys=0;
-       
-       if(but->flag & UI_ICON_LEFT) {
-               if (but->type==BUTM) {
-                       xs= but->x1+1.0;
-               }
-               else if ((but->type==ICONROW) || (but->type==ICONTEXTROW)) {
-                       xs= but->x1+4.0;
-               }
-               else {
-                       xs= but->x1+6.0;
-               }
-               ys= (but->y1+but->y2- BIF_get_icon_height(icon))/2.0;
-       }
-       if(but->flag & UI_ICON_RIGHT) {
-               xs= but->x2-17.0;
-               ys= (but->y1+but->y2- BIF_get_icon_height(icon))/2.0;
-       }
-       if (!((but->flag & UI_ICON_RIGHT) || (but->flag & UI_ICON_LEFT))) {
-               xs= (but->x1+but->x2- BIF_get_icon_width(icon))/2.0;
-               ys= (but->y1+but->y2- BIF_get_icon_height(icon))/2.0;
-       }
-
-       glRasterPos2f(xs, ys);
-
-       if(but->aspect>1.1) glPixelZoom(1.0/but->aspect, 1.0/but->aspect);
-
-       glEnable(GL_BLEND);
-       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
-       if(but->flag & UI_SELECT) {
-               if(but->flag & UI_ACTIVE) {
-                       BIF_draw_icon_blended(icon, but->col, COLORSHADE_DARK);
-               } else {
-                       BIF_draw_icon_blended(icon, but->col, COLORSHADE_GREY);
-               }
-       }
-       else {
-               if ((but->flag & UI_ACTIVE) && but->type==BUTM) {
-                       BIF_draw_icon_blended(icon, BUTMACTIVE, COLORSHADE_MEDIUM);
-               } else if (but->flag & UI_ACTIVE) {
-                       BIF_draw_icon_blended(icon, but->col, COLORSHADE_HILITE);
-               } else {
-                       BIF_draw_icon_blended(icon, but->col, COLORSHADE_MEDIUM);
-               }
-       }
-
-       glBlendFunc(GL_ONE, GL_ZERO);
-       glDisable(GL_BLEND);
-
-       glPixelZoom(1.0, 1.0);
-}
-
-/* not used
-static void ui_draw_outlineX(float x1, float y1, float x2, float y2, float asp1)
-{
-       float vec[2];
-       
-       glBegin(GL_LINE_LOOP);
-       vec[0]= x1+asp1; vec[1]= y1-asp1;
-       glVertex2fv(vec);
-       vec[0]= x2-asp1; 
-       glVertex2fv(vec);
-       vec[0]= x2+asp1; vec[1]= y1+asp1;
-       glVertex2fv(vec);
-       vec[1]= y2-asp1;
-       glVertex2fv(vec);
-       vec[0]= x2-asp1; vec[1]= y2+asp1;
-       glVertex2fv(vec);
-       vec[0]= x1+asp1;
-       glVertex2fv(vec);
-       vec[0]= x1-asp1; vec[1]= y2-asp1;
-       glVertex2fv(vec);
-       vec[1]= y1+asp1;
-       glVertex2fv(vec);
-       glEnd();                
-       
-}
-
-static void ui_emboss_R(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag)
-{
-
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_DARK);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_HILITE);
-               else BIF_set_color(bc, COLORSHADE_MEDIUM);
-       }
-       
-       uiSetRoundBox(15);
-       uiRoundBox(x1, y1, x2, y2, 6);
-       cpack(0x0);
-       uiSetRoundBox(16+15);
-       uiRoundRect(x1, y1, x2, y2, 6);
-       uiSetRoundBox(15);
-}
-
-*/
-
-
-static void ui_emboss_X(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag)
-{
-
-       float asp1;
-       
-       asp1= asp;
-
-       /*x1+= asp1;*/
-       x2-= asp1;      
-       /*y1+= asp1;*/
-       y2-= asp1;
-
-       /* SHADED BUTTON */
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_QUADS);
-       
-
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_MEDIUM);
-               else BIF_set_color(bc, COLORSHADE_LGREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LIGHT);
-               else BIF_set_color(bc, COLORSHADE_HILITE);
-       }
-
-       glVertex2f(x1,y1);
-       glVertex2f(x2,y1);
-
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_WHITE);
-               BIF_set_color(bc, COLORSHADE_LIGHT);
-       }
-
-       glVertex2f(x2,(y2-(y2-y1)/3));
-       glVertex2f(x1,(y2-(y2-y1)/3));
-       glEnd();
-       
-
-       glShadeModel(GL_FLAT);
-       glBegin(GL_QUADS);
-       
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_WHITE);
-               BIF_set_color(bc, COLORSHADE_LIGHT);
-       }
-       
-       glVertex2f(x1,(y2-(y2-y1)/3));
-       glVertex2f(x2,(y2-(y2-y1)/3));
-       glVertex2f(x2,y2);
-       glVertex2f(x1,y2);
-
-       glEnd();
-
-       /* END SHADED BUTTON */
-
-       /* OUTER SUNKEN EFFECT */
-       /* left */
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       glVertex2f(x1-1,y1);
-       BIF_set_color(BUTGREY, COLORSHADE_LIGHT);
-       glVertex2f(x1-1,y2);
-       glEnd();
-       
-       /* right */
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       glVertex2f(x2+1,y1);
-       BIF_set_color(BUTGREY, COLORSHADE_LIGHT);
-       glVertex2f(x2+1,y2);
-       glEnd();
-
-       /* bottom */
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       fdrawline(x1, y1-1, x2, y1-1);
-       /* END OUTER SUNKEN EFFECT */
-       
-       /* INNER OUTLINE */
-       glShadeModel(GL_FLAT);
-       
-       /* top */
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_WHITE);
-               BIF_set_color(bc, COLORSHADE_WHITE);
-       }
-
-       fdrawline(x1, (y2-1), x2, y2-1);
-       
-       /* bottom */
-       
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY);
-               else BIF_set_color(bc, COLORSHADE_LGREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LMEDIUM);
-               BIF_set_color(bc, COLORSHADE_LMEDIUM);
-       }
-       fdrawline(x1, (y1+1), x2, y1+1);
-
-       /* left */
-       if(!(flag & UI_SELECT)) {
-                                       
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(bc, COLORSHADE_WHITE);
-       glVertex2f(x1+1,y1+2);
-       BIF_set_color(bc, COLORSHADE_LGREY);
-       glVertex2f(x1+1,y2);
-       glEnd();
-       
-       }
-       
-       /* right */
-       if(!(flag & UI_SELECT)) {
-
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(bc, COLORSHADE_LGREY);
-       glVertex2f(x2-1,y1+2);
-       BIF_set_color(bc, COLORSHADE_WHITE);
-       glVertex2f(x2-1,y2);
-       glEnd();
-       
-       }
-       /* END INNER OUTLINE */
-       
-       /* OUTER OUTLINE */
-       glShadeModel(GL_FLAT);
-       
-       /* underneath semi-fake-AA */
-       BIF_set_color(BUTGREY, COLORSHADE_GREY);
-       fdrawline(x1, y2, x2, y2);
-       BIF_set_color(BUTGREY, COLORSHADE_MEDIUM);
-       fdrawline(x1, y1, x2, y1);
-
-       /* top */
-       BIF_set_color(BUTGREY, COLORSHADE_DARK);
-       fdrawline(x1+1, y2, x2, y2);
-
-       /* left */
-       fdrawline(x1, y1+1, x1, y2);
-
-       /* right */
-       fdrawline(x2, y1+1, x2, y2);
-       
-       /* bottom */
-       BIF_set_color(BUTGREY, COLORSHADE_DARK);
-       fdrawline(x1+1, y1, x2, y1);
-       /* END OUTER OUTLINE */
-       
-}
-
-static void ui_emboss_TEX(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag)
-{
-
-       float asp1;
-       
-       asp1= asp;
-
-       /*x1+= asp1;*/
-       x2-= asp1;      
-       /*y1+= asp1;*/
-       y2-= asp1;
-
-       /* FLAT TEXT/NUM FIELD */
-       glShadeModel(GL_FLAT);
-       glBegin(GL_QUADS);
-
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_HILITE);
-               else BIF_set_color(bc, COLORSHADE_LMEDIUM);
-       }
-
-       glVertex2f(x1,y1);
-       glVertex2f(x2,y1);
-       glVertex2f(x2,y2);
-       glVertex2f(x1,y2);
-
-       glEnd();
-       /* END FLAT TEXT/NUM FIELD */
-       
-       /* OUTER SUNKEN EFFECT */
-       /* left */
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       glVertex2f(x1-1,y1);
-       BIF_set_color(BUTGREY, COLORSHADE_LIGHT);
-       glVertex2f(x1-1,y2);
-       glEnd();
-       
-       /* right */
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       glVertex2f(x2+1,y1);
-       BIF_set_color(BUTGREY, COLORSHADE_LIGHT);
-       glVertex2f(x2+1,y2);
-       glEnd();
-
-       /* bottom */
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       fdrawline(x1, y1-1, x2, y1-1);
-       /* END OUTER SUNKEN EFFECT */
-
-       /* OUTER OUTLINE */
-       glShadeModel(GL_FLAT);
-       
-       /* underneath semi-fake-AA */
-       BIF_set_color(BUTGREY, COLORSHADE_GREY);
-       fdrawline(x1, y2, x2, y2);
-       BIF_set_color(BUTGREY, COLORSHADE_MEDIUM);
-       fdrawline(x1, y1, x2, y1);
-
-       /* top */
-       BIF_set_color(BUTGREY, COLORSHADE_DARK);
-       fdrawline(x1+1, y2, x2, y2);
-
-       /* left */
-       fdrawline(x1, y1+1, x1, y2);
-
-       /* right */
-       fdrawline(x2, y1+1, x2, y2);
-       
-       /* bottom */
-       BIF_set_color(BUTGREY, COLORSHADE_DARK);
-       fdrawline(x1+1, y1, x2, y1);
-       /* END OUTER OUTLINE */
-}
-
-static void ui_emboss_NUM(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag)
-{
-
-       float asp1;
-
-       asp1= asp;
-
-       /*x1+= asp1;*/
-       x2-= asp1;      
-       /*y1+= asp1;*/
-       y2-= asp1;
-
-       /* FLAT TEXT/NUM FIELD */
-       glShadeModel(GL_FLAT);
-       glBegin(GL_QUADS);
-
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_HILITE);
-               else BIF_set_color(bc, COLORSHADE_LMEDIUM);
-       }
-
-       glVertex2f(x1,y1);
-       glVertex2f(x2,y1);
-       glVertex2f(x2,y2);
-       glVertex2f(x1,y2);
-
-       glEnd();
-       /* END FLAT TEXT/NUM FIELD */
-       
-       /* OUTER SUNKEN EFFECT */
-       /* left */
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       glVertex2f(x1-1,y1);
-       BIF_set_color(BUTGREY, COLORSHADE_LIGHT);
-       glVertex2f(x1-1,y2);
-       glEnd();
-       
-       /* right */
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       glVertex2f(x2+1,y1);
-       BIF_set_color(BUTGREY, COLORSHADE_LIGHT);
-       glVertex2f(x2+1,y2);
-       glEnd();
-
-       /* bottom */
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       fdrawline(x1, y1-1, x2, y1-1);
-       /* END OUTER SUNKEN EFFECT */
-
-       /* OUTER OUTLINE */
-       glShadeModel(GL_FLAT);
-       
-       /* underneath semi-fake-AA */
-       BIF_set_color(BUTGREY, COLORSHADE_GREY);
-       fdrawline(x1, y2, x2, y2);
-       BIF_set_color(BUTGREY, COLORSHADE_MEDIUM);
-       fdrawline(x1, y1, x2, y1);
-
-       /* top */
-       BIF_set_color(BUTGREY, COLORSHADE_DARK);
-       fdrawline(x1+1, y2, x2, y2);
-
-       /* left */
-       fdrawline(x1, y1+1, x1, y2);
-
-       /* right */
-       fdrawline(x2, y1+1, x2, y2);
-       
-       /* bottom */
-       BIF_set_color(BUTGREY, COLORSHADE_DARK);
-       fdrawline(x1+1, y1, x2, y1);
-       /* END OUTER OUTLINE */
-
-       /* SIDE ARROWS */
-       /* left */
-       
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_DARK);
-               else BIF_set_color(bc, COLORSHADE_DARK);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY);
-               else BIF_set_color(bc, COLORSHADE_LGREY);
-       }
-
-       glEnable( GL_POLYGON_SMOOTH );
-       glEnable( GL_BLEND );
-       glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
-       
-       glShadeModel(GL_FLAT);
-       glBegin(GL_TRIANGLES);
-       
-       glVertex2f((short)x1+5,(short)(y2-(y2-y1)/2));
-       glVertex2f((short)x1+10,(short)(y2-(y2-y1)/2)+4);
-       glVertex2f((short)x1+10,(short)(y2-(y2-y1)/2)-4);
-       glEnd();
-
-       /* right */
-       glShadeModel(GL_FLAT);
-       glBegin(GL_TRIANGLES);
-
-       glVertex2f((short)x2-5,(short)(y2-(y2-y1)/2));
-       glVertex2f((short)x2-10,(short)(y2-(y2-y1)/2)-4);
-       glVertex2f((short)x2-10,(short)(y2-(y2-y1)/2)+4);
-       glEnd();
-       
-       glDisable( GL_BLEND );
-       glDisable( GL_POLYGON_SMOOTH );
-       /* END SIDE ARROWS */
-
-}
-
-static void ui_emboss_MENU(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag)
-{
-
-       float asp1;
-       
-       asp1= asp;
-
-       /*x1+= asp1;*/
-       x2-= asp1;      
-       /*y1+= asp1;*/
-       y2-= asp1;
-
-       /* SHADED BUTTON */
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_QUADS);
-       
-
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LIGHT);
-               else BIF_set_color(bc, COLORSHADE_HILITE);
-       }
-
-       glVertex2f(x1,y1);
-       glVertex2f(x2,y1);
-
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY);
-               else BIF_set_color(bc, COLORSHADE_DARK);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_WHITE);
-               BIF_set_color(bc, COLORSHADE_LIGHT);
-       }
-
-       glVertex2f(x2,(y2-(y2-y1)/3));
-       glVertex2f(x1,(y2-(y2-y1)/3));
-       glEnd();
-       
-
-       glShadeModel(GL_FLAT);
-       glBegin(GL_QUADS);
-       
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY);
-               else BIF_set_color(bc, COLORSHADE_DARK);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_WHITE);
-               BIF_set_color(bc, COLORSHADE_LIGHT);
-       }
-
-       glVertex2f(x1,(y2-(y2-y1)/3));
-       glVertex2f(x2,(y2-(y2-y1)/3));
-       glVertex2f(x2,y2);
-       glVertex2f(x1,y2);
-
-       glEnd();
-       /* END SHADED BUTTON */
-
-       /* OUTER SUNKEN EFFECT */
-       /* left */
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       glVertex2f(x1-1,y1);
-       BIF_set_color(BUTGREY, COLORSHADE_LIGHT);
-       glVertex2f(x1-1,y2);
-       glEnd();
-       
-       /* right */
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       glVertex2f(x2+1,y1);
-       BIF_set_color(BUTGREY, COLORSHADE_LIGHT);
-       glVertex2f(x2+1,y2);
-       glEnd();
-
-       /* bottom */
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       fdrawline(x1, y1-1, x2, y1-1);
-       /* END OUTER SUNKEN EFFECT */
-       
-       /* INNER OUTLINE */
-       glShadeModel(GL_FLAT);
-       
-       /* top */
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_WHITE);
-               BIF_set_color(bc, COLORSHADE_WHITE);
-       }
-
-       fdrawline(x1, (y2-1), x2, y2-1);
-       
-       /* bottom */
-       
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY);
-               else BIF_set_color(bc, COLORSHADE_LGREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LMEDIUM);
-               BIF_set_color(bc, COLORSHADE_LMEDIUM);
-       }
-       fdrawline(x1, (y1+1), x2, y1+1);
-
-       /* left */
-       if(!(flag & UI_SELECT)) {
-                                       
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(bc, COLORSHADE_WHITE);
-       glVertex2f(x1+1,y1+2);
-       BIF_set_color(bc, COLORSHADE_LGREY);
-       glVertex2f(x1+1,y2);
-       glEnd();
-       
-       }
-       
-       /* right */
-       if(!(flag & UI_SELECT)) {
-
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(bc, COLORSHADE_LGREY);
-       glVertex2f(x2-1,y1+2);
-       BIF_set_color(bc, COLORSHADE_WHITE);
-       glVertex2f(x2-1,y2);
-       glEnd();
-       
-       }
-       /* END INNER OUTLINE */
-       
-       /* OUTER OUTLINE */
-       glShadeModel(GL_FLAT);
-       
-       /* underneath semi-fake-AA */
-       BIF_set_color(BUTGREY, COLORSHADE_GREY);
-       fdrawline(x1, y2, x2, y2);
-       BIF_set_color(BUTGREY, COLORSHADE_MEDIUM);
-       fdrawline(x1, y1, x2, y1);
-
-       /* top */
-       BIF_set_color(BUTGREY, COLORSHADE_DARK);
-       fdrawline(x1+1, y2, x2, y2);
-
-       /* left */
-       fdrawline(x1, y1+1, x1, y2);
-
-       /* right */
-       fdrawline(x2, y1+1, x2, y2);
-       
-       /* bottom */
-       BIF_set_color(BUTGREY, COLORSHADE_DARK);
-       fdrawline(x1+1, y1, x2, y1);
-       /* END OUTER OUTLINE */
-
-       /* DARKENED AREA */
-       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-       glEnable(GL_BLEND);
-       
-       glColor4ub(0, 0, 0, 30);
-       glRectf(x2-18, y1, x2, y2);
-
-       glDisable(GL_BLEND);
-       /* END DARKENED AREA */
-
-       /* MENU DOUBLE-ARROW  */
-       
-       /* set antialias line */
-       BIF_set_color(bc, COLORSHADE_DARK);
-       
-       glEnable( GL_POLYGON_SMOOTH );
-       glEnable( GL_BLEND );
-       glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
-       
-       glShadeModel(GL_FLAT);
-       glBegin(GL_TRIANGLES);
-       glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2)+1);
-       glVertex2f((short)x2-12,(short)(y2-(y2-y1)/2)+1);
-       glVertex2f((short)x2-8,(short)(y2-(y2-y1)/2)+4);
-       glEnd();
-               
-       glBegin(GL_TRIANGLES);
-       glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2) -1);
-       glVertex2f((short)x2-12,(short)(y2-(y2-y1)/2) -1);
-       glVertex2f((short)x2-8,(short)(y2-(y2-y1)/2) -4);
-       glEnd();
-       
-       glDisable( GL_BLEND );
-       glDisable( GL_POLYGON_SMOOTH );
-       /* MENU DOUBLE-ARROW */
-
-}
-
-static void ui_emboss_ICONROW(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag)
-{
-
-       float asp1;
-       
-       asp1= asp;
-
-       /*x1+= asp1;*/
-       x2-= asp1;      
-       /*y1+= asp1;*/
-       y2-= asp1;
-
-       /* SHADED BUTTON */
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_QUADS);
-       
-
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_MEDIUM);
-               else BIF_set_color(bc, COLORSHADE_LGREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LIGHT);
-               else BIF_set_color(bc, COLORSHADE_HILITE);
-       }
-
-       glVertex2f(x1,y1);
-       glVertex2f(x2,y1);
-
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_WHITE);
-               BIF_set_color(bc, COLORSHADE_LIGHT);
-       }
-
-       glVertex2f(x2,(y2-(y2-y1)/3));
-       glVertex2f(x1,(y2-(y2-y1)/3));
-       glEnd();
-       
-
-       glShadeModel(GL_FLAT);
-       glBegin(GL_QUADS);
-       
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_WHITE);
-               BIF_set_color(bc, COLORSHADE_LIGHT);
-       }
-
-       glVertex2f(x1,(y2-(y2-y1)/3));
-       glVertex2f(x2,(y2-(y2-y1)/3));
-       glVertex2f(x2,y2);
-       glVertex2f(x1,y2);
-
-       glEnd();
-       /* END SHADED BUTTON */
-
-       /* OUTER SUNKEN EFFECT */
-       /* left */
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       glVertex2f(x1-1,y1);
-       BIF_set_color(BUTGREY, COLORSHADE_LIGHT);
-       glVertex2f(x1-1,y2);
-       glEnd();
-       
-       /* right */
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       glVertex2f(x2+1,y1);
-       BIF_set_color(BUTGREY, COLORSHADE_LIGHT);
-       glVertex2f(x2+1,y2);
-       glEnd();
-
-       /* bottom */
-       BIF_set_color(BUTGREY, COLORSHADE_WHITE);
-       fdrawline(x1, y1-1, x2, y1-1);
-       /* END OUTER SUNKEN EFFECT */
-       
-       /* INNER OUTLINE */
-       glShadeModel(GL_FLAT);
-       
-       /* top */
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_WHITE);
-               BIF_set_color(bc, COLORSHADE_WHITE);
-       }
-
-       fdrawline(x1, (y2-1), x2, y2-1);
-       
-       /* bottom */
-       
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY);
-               else BIF_set_color(bc, COLORSHADE_LGREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LMEDIUM);
-               BIF_set_color(bc, COLORSHADE_LMEDIUM);
-       }
-       fdrawline(x1, (y1+1), x2, y1+1);
-
-       /* left */
-       if(!(flag & UI_SELECT)) {
-                                       
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(bc, COLORSHADE_WHITE);
-       glVertex2f(x1+1,y1+2);
-       BIF_set_color(bc, COLORSHADE_LGREY);
-       glVertex2f(x1+1,y2);
-       glEnd();
-       
-       }
-       
-       /* right */
-       if(!(flag & UI_SELECT)) {
-
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(bc, COLORSHADE_LGREY);
-       glVertex2f(x2-1,y1+2);
-       BIF_set_color(bc, COLORSHADE_WHITE);
-       glVertex2f(x2-1,y2);
-       glEnd();
-       
-       }
-       /* END INNER OUTLINE */
-       
-       /* OUTER OUTLINE */
-       glShadeModel(GL_FLAT);
-       
-       /* underneath semi-fake-AA */
-       BIF_set_color(BUTGREY, COLORSHADE_GREY);
-       fdrawline(x1, y2, x2, y2);
-       BIF_set_color(BUTGREY, COLORSHADE_MEDIUM);
-       fdrawline(x1, y1, x2, y1);
-
-       /* top */
-       BIF_set_color(BUTGREY, COLORSHADE_DARK);
-       fdrawline(x1+1, y2, x2, y2);
-
-       /* left */
-       fdrawline(x1, y1+1, x1, y2);
-
-       /* right */
-       fdrawline(x2, y1+1, x2, y2);
-       
-       /* bottom */
-       BIF_set_color(BUTGREY, COLORSHADE_DARK);
-       fdrawline(x1+1, y1, x2, y1);
-       /* END OUTER OUTLINE */
-
-       /* DARKENED AREA */
-       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-       glEnable(GL_BLEND);
-       
-       glColor4ub(0, 0, 0, 30);
-       glRectf(x2-9, y1, x2, y2);
-
-       glDisable(GL_BLEND);
-       /* END DARKENED AREA */
-
-       /* MENU DOUBLE-ARROW  */
-       
-       /* set antialias line */
-       BIF_set_color(bc, COLORSHADE_DARK);
-       
-       glEnable( GL_POLYGON_SMOOTH );
-       glEnable( GL_BLEND );
-       glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
-       
-       glShadeModel(GL_FLAT);
-       glBegin(GL_TRIANGLES);
-       glVertex2f((short)x2-2,(short)(y2-(y2-y1)/2)+1);
-       glVertex2f((short)x2-6,(short)(y2-(y2-y1)/2)+1);
-       glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2)+4);
-       glEnd();
-               
-       glBegin(GL_TRIANGLES);
-       glVertex2f((short)x2-2,(short)(y2-(y2-y1)/2) -1);
-       glVertex2f((short)x2-6,(short)(y2-(y2-y1)/2) -1);
-       glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2) -4);
-       glEnd();
-       
-       glDisable( GL_BLEND );
-       glDisable( GL_POLYGON_SMOOTH );
-       /* MENU DOUBLE-ARROW */
-
-}
-
-static void ui_emboss_TABL(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag)
-{
-
-       float asp1;
-       
-       asp1= asp;
-
-       /*x1+= asp1;*/
-       x2-= asp1;      
-       /*y1+= asp1;*/
-       y2-= asp1;
-
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_QUADS);
-       
-
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LMEDIUM);
-               else BIF_set_color(bc, COLORSHADE_MEDIUM);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LMEDIUM);
-               else BIF_set_color(bc, COLORSHADE_MEDIUM);
-       }
-
-       
-       //BIF_set_color(bc, COLORSHADE_MEDIUM);
-
-       glVertex2f(x1,y1);
-       glVertex2f(x2,y1);
-
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LGREY);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_WHITE);
-               BIF_set_color(bc, COLORSHADE_LIGHT);
-       }
-
-
-       //BIF_set_color(bc, COLORSHADE_LIGHT);
-
-       //glVertex2f(x2,(y1+(y2-y1)/2));
-       glVertex2f(x2,(y2-(y2-y1)/3));
-       glVertex2f(x1,(y2-(y2-y1)/3));
-       glEnd();
-       
-
-       glShadeModel(GL_FLAT);
-       glBegin(GL_QUADS);
-       
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_LIGHT);
-               BIF_set_color(bc, COLORSHADE_LIGHT);
-       }
-
-       //BIF_set_color(bc, COLORSHADE_LIGHT);
-
-       glVertex2f(x1,(y2-(y2-y1)/3));
-       glVertex2f(x2,(y2-(y2-y1)/3));
-       glVertex2f(x2,y2);
-       glVertex2f(x1,y2);
-
-       glEnd();
-
-
-       /* inner outline */
-       glShadeModel(GL_FLAT);
-       
-       /* top */
-       
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_GREY);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_WHITE);
-               BIF_set_color(bc, COLORSHADE_WHITE);
-       }
-
-       fdrawline(x1, (y2-1), x2, y2-1);
-
-
-       /* left */
-       if(!(flag & UI_SELECT)) {
-                                       
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(bc, COLORSHADE_WHITE);
-       glVertex2f(x1+1,y1-1);
-       BIF_set_color(bc, COLORSHADE_MEDIUM);
-       glVertex2f(x1+1,y2);
-       glEnd();
-       
-       }
-       
-       /* right */
-       
-       if(!(flag & UI_SELECT)) {
-
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(bc, COLORSHADE_MEDIUM);
-       glVertex2f(x2-1,y1+2);
-       BIF_set_color(bc, COLORSHADE_WHITE);
-       glVertex2f(x2-1,y2);
-       glEnd();
-       
-       }
-
-       /* outer outline */
-       glShadeModel(GL_FLAT);
-       
-       /* underneath semi-fake-AA */
-       BIF_set_color(BUTGREY, COLORSHADE_GREY);
-       fdrawline(x1, y2, x2, y2);
-       BIF_set_color(BUTGREY, COLORSHADE_MEDIUM);
-       fdrawline(x1, y1, x2, y1);
-
-       /* top */
-       BIF_set_color(BUTGREY, COLORSHADE_DARK);
-       fdrawline(x1+1, y2, x2, y2);
-
-       /* left */
-       fdrawline(x1, y1, x1, y2);
-
-       /* right */
-       fdrawline(x2, y1, x2, y2);
-
-       /* outer sunken effect */
-       /* left */
-       glShadeModel(GL_SMOOTH);
-       glBegin(GL_LINES);
-       BIF_set_color(BUTGREY, COLORSHADE_LIGHT);
-       glVertex2f(x1-1,y1);
-       BIF_set_color(BUTGREY, COLORSHADE_MEDIUM);
-       glVertex2f(x1-1,y2);
-       glEnd();
-       
-
-       glShadeModel(GL_FLAT);
-
-}
-static void ui_emboss_TABM(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag)
-{
-}
-static void ui_emboss_TABR(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag)
-{
-}
-
-
-void uiEmboss(float x1, float y1, float x2, float y2, int sel)
-{
-       
-       /* below */
-       if(sel) glColor3ub(200,200,200);
-       else glColor3ub(50,50,50);
-       fdrawline(x1, y1, x2, y1);
-
-       /* right */
-       fdrawline(x2, y1, x2, y2);
-       
-       /* top */
-       if(sel) glColor3ub(50,50,50);
-       else glColor3ub(200,200,200);
-       fdrawline(x1, y2, x2, y2);
-
-       /* left */
-       fdrawline(x1, y1, x1, y2);
-       
-}
-
-/* super minimal button as used in logic menu */
-static void ui_emboss_W(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag)
-{
-       
-       x1+= asp;
-       x2-= asp;
-       y1+= asp;
-       y2-= asp;
-
-       /* paper */
-       if(flag & UI_SELECT) {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_DARK);
-               else BIF_set_color(bc, COLORSHADE_GREY);
-       }
-       else {
-               if(flag & UI_ACTIVE) BIF_set_color(bc, COLORSHADE_HILITE);
-               else BIF_set_color(bc, COLORSHADE_MEDIUM);
-       }
-       
-       glRectf(x1, y1, x2, y2);
-
-       if(flag & UI_SELECT) {
-               BIF_set_color(bc, COLORSHADE_LIGHT);
-               
-               /* below */
-               fdrawline(x1, y1, x2, y1);
-
-               /* right */
-               fdrawline(x2, y1, x2, y2);
-       }
-       else if(flag & UI_ACTIVE) {
-               BIF_set_color(bc, COLORSHADE_WHITE);
-
-               /* top */
-               fdrawline(x1, y2, x2, y2);
-       
-               /* left */
-               fdrawline(x1, y1, x1, y2);
-       }
-}
-
-