From 7f5d06d638ff24444da942cf91c130d5393818cb Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 20 Oct 2003 15:40:20 +0000 Subject: Another mega commit... loadsof restructure, and a pretty good one! :) - 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' --- source/blender/ftfont/FTF_Api.h | 10 +- source/blender/ftfont/intern/FTF_Api.cpp | 11 +- source/blender/ftfont/intern/FTF_TTFont.cpp | 41 +- source/blender/ftfont/intern/FTF_TTFont.h | 6 +- source/blender/include/BIF_interface.h | 18 +- source/blender/include/BIF_language.h | 3 +- source/blender/include/BIF_resources.h | 107 +- source/blender/include/interface.h | 14 +- source/blender/makesdna/DNA_userdef_types.h | 18 +- source/blender/src/buttons_editing.c | 121 +- source/blender/src/buttons_logic.c | 166 +- source/blender/src/buttons_object.c | 93 +- source/blender/src/buttons_scene.c | 110 +- source/blender/src/buttons_script.c | 6 +- source/blender/src/buttons_shading.c | 257 ++-- source/blender/src/drawaction.c | 6 +- source/blender/src/drawimasel.c | 4 +- source/blender/src/drawipo.c | 1 - source/blender/src/drawobject.c | 6 +- source/blender/src/drawview.c | 8 +- source/blender/src/editscreen.c | 4 +- source/blender/src/filesel.c | 3 +- source/blender/src/header_action.c | 6 +- source/blender/src/header_buttonswin.c | 19 +- source/blender/src/header_filesel.c | 10 +- source/blender/src/header_image.c | 14 +- source/blender/src/header_imasel.c | 6 +- source/blender/src/header_info.c | 45 +- source/blender/src/header_ipo.c | 8 +- source/blender/src/header_nla.c | 6 +- source/blender/src/header_oops.c | 6 +- source/blender/src/header_seq.c | 6 +- source/blender/src/header_sound.c | 6 +- source/blender/src/header_text.c | 6 +- source/blender/src/header_view3d.c | 57 +- source/blender/src/headerbuttons.c | 10 +- source/blender/src/interface.c | 2222 ++------------------------- source/blender/src/interface_draw.c | 1448 +++++++++++++++++ source/blender/src/interface_panel.c | 60 +- source/blender/src/language.c | 22 +- source/blender/src/resources.c | 251 +-- source/blender/src/space.c | 113 +- source/blender/src/toolbox.c | 18 +- source/blender/src/view.c | 4 +- 44 files changed, 2219 insertions(+), 3137 deletions(-) create mode 100644 source/blender/src/interface_draw.c diff --git a/source/blender/ftfont/FTF_Api.h b/source/blender/ftfont/FTF_Api.h index 4fa97f0acba..5272697c777 100644 --- a/source/blender/ftfont/FTF_Api.h +++ b/source/blender/ftfont/FTF_Api.h @@ -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 diff --git a/source/blender/ftfont/intern/FTF_Api.cpp b/source/blender/ftfont/intern/FTF_Api.cpp index ac158ae191f..42fac0c4061 100644 --- a/source/blender/ftfont/intern/FTF_Api.cpp +++ b/source/blender/ftfont/intern/FTF_Api.cpp @@ -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); } diff --git a/source/blender/ftfont/intern/FTF_TTFont.cpp b/source/blender/ftfont/intern/FTF_TTFont.cpp index 6f50c2e0841..3233082cca7 100644 --- a/source/blender/ftfont/intern/FTF_TTFont.cpp +++ b/source/blender/ftfont/intern/FTF_TTFont.cpp @@ -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); diff --git a/source/blender/ftfont/intern/FTF_TTFont.h b/source/blender/ftfont/intern/FTF_TTFont.h index 9492e326a7e..e4cdfd75b16 100644 --- a/source/blender/ftfont/intern/FTF_TTFont.h +++ b/source/blender/ftfont/intern/FTF_TTFont.h @@ -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); diff --git a/source/blender/include/BIF_interface.h b/source/blender/include/BIF_interface.h index 579810a5903..60c5fab0e06 100644 --- a/source/blender/include/BIF_interface.h +++ b/source/blender/include/BIF_interface.h @@ -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 diff --git a/source/blender/include/BIF_language.h b/source/blender/include/BIF_language.h index 91cdc18673d..414207c2e44 100644 --- a/source/blender/include/BIF_language.h +++ b/source/blender/include/BIF_language.h @@ -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 */ diff --git a/source/blender/include/BIF_resources.h b/source/blender/include/BIF_resources.h index f329dffea17..78cef040fde 100644 --- a/source/blender/include/BIF_resources.h +++ b/source/blender/include/BIF_resources.h @@ -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); diff --git a/source/blender/include/interface.h b/source/blender/include/interface.h index b9cbbbc5332..02fdd9c2e25 100644 --- a/source/blender/include/interface.h +++ b/source/blender/include/interface.h @@ -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 diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index da4799e48a1..0fef8490b79 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -40,8 +40,24 @@ // 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; diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 83611318cb4..315325358b2 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -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, <->pntsw, 1.0, 64.0, 0, 0, ""); uiClearButLock(); - uiBlockSetCol(block, BUTGREEN); uiDefButC(block, ROW, B_LATTCHANGED, "Lin", 572, 178, 40, 19, <->typeu, 1.0, (float)KEY_LINEAR, 0, 0, ""); uiDefButC(block, ROW, B_LATTCHANGED, "Card", 612, 178, 40, 19, <->typeu, 1.0, (float)KEY_CARDINAL, 0, 0, ""); uiDefButC(block, ROW, B_LATTCHANGED, "B", 652, 178, 40, 19, <->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, <->typew, 3.0, (float)KEY_CARDINAL, 0, 0, ""); uiDefButC(block, ROW, B_LATTCHANGED, "B", 652, 138, 40, 19, <->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, <->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, °r,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"); diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index e1d0276be08..46190719af9 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -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); diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index abb21181860..637220c27e6 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -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 diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 2256def0cd7..559bf444918 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -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"); diff --git a/source/blender/src/buttons_script.c b/source/blender/src/buttons_script.c index 3a19442ad24..33040d00708 100644 --- a/source/blender/src/buttons_script.c +++ b/source/blender/src/buttons_script.c @@ -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; diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index a0766383221..34f528de0ce 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -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; astypes; 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; avars; 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, ""); diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c index 33ddedd90fa..fb07c245d28 100644 --- a/source/blender/src/drawaction.c +++ b/source/blender/src/drawaction.c @@ -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); diff --git a/source/blender/src/drawimasel.c b/source/blender/src/drawimasel.c index 77901e4d066..6c50b88585f 100644 --- a/source/blender/src/drawimasel.c +++ b/source/blender/src/drawimasel.c @@ -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 */ diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c index dc8ecb1a513..24b43bc15c9 100644 --- a/source/blender/src/drawipo.c +++ b/source/blender/src/drawipo.c @@ -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; diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 02f01debb63..15b1c311bcf 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -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); diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index 166a8d5b728..1e315acc1d8 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -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) */ diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c index 679479e8ebb..2d0d789917c 100644 --- a/source/blender/src/editscreen.c +++ b/source/blender/src/editscreen.c @@ -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); diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c index bd7584d177a..a80ff502074 100644 --- a/source/blender/src/filesel.c +++ b/source/blender/src/filesel.c @@ -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); diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c index 7a20f9a9e76..4a531123d7e 100644 --- a/source/blender/src/header_action.c +++ b/source/blender/src/header_action.c @@ -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; diff --git a/source/blender/src/header_buttonswin.c b/source/blender/src/header_buttonswin.c index ed88dd56516..68e218e33cb 100644 --- a/source/blender/src/header_buttonswin.c +++ b/source/blender/src/header_buttonswin.c @@ -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 "); diff --git a/source/blender/src/header_filesel.c b/source/blender/src/header_filesel.c index cb59284ae89..6f689ad4812 100644 --- a/source/blender/src/header_filesel.c +++ b/source/blender/src/header_filesel.c @@ -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; diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c index 9890bca5e68..1a4f3dfa37b 100644 --- a/source/blender/src/header_image.c +++ b/source/blender/src/header_image.c @@ -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; diff --git a/source/blender/src/header_imasel.c b/source/blender/src/header_imasel.c index 4f486ab5ff5..7a1d9921ff6 100644 --- a/source/blender/src/header_imasel.c +++ b/source/blender/src/header_imasel.c @@ -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; diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c index 91e3a53fbb5..40986b41575 100644 --- a/source/blender/src/header_info.c +++ b/source/blender/src/header_info.c @@ -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; diff --git a/source/blender/src/header_ipo.c b/source/blender/src/header_ipo.c index ce6c9e69582..a9811c1a8c4 100644 --- a/source/blender/src/header_ipo.c +++ b/source/blender/src/header_ipo.c @@ -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; diff --git a/source/blender/src/header_nla.c b/source/blender/src/header_nla.c index 7130b50ee44..6f39cc93531 100644 --- a/source/blender/src/header_nla.c +++ b/source/blender/src/header_nla.c @@ -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; diff --git a/source/blender/src/header_oops.c b/source/blender/src/header_oops.c index c2992171732..cd0e1f272e1 100644 --- a/source/blender/src/header_oops.c +++ b/source/blender/src/header_oops.c @@ -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; diff --git a/source/blender/src/header_seq.c b/source/blender/src/header_seq.c index e08c086b91d..cdda34bd050 100644 --- a/source/blender/src/header_seq.c +++ b/source/blender/src/header_seq.c @@ -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; diff --git a/source/blender/src/header_sound.c b/source/blender/src/header_sound.c index fafea6fbcce..d32ec760121 100644 --- a/source/blender/src/header_sound.c +++ b/source/blender/src/header_sound.c @@ -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; diff --git a/source/blender/src/header_text.c b/source/blender/src/header_text.c index c87f2d294c8..7287ffb0832 100644 --- a/source/blender/src/header_text.c +++ b/source/blender/src/header_text.c @@ -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; diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 63abef2320d..582096d1514 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -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)"); } diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c index 57b10c642cd..a2b790c1245 100644 --- a/source/blender/src/headerbuttons.c +++ b/source/blender/src/headerbuttons.c @@ -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"); diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index 1079ee4ed1a..37e76c17824 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -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); - } -} - - -/* minimal for menus */ -static void ui_emboss_M(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag) -{ - x1+= 1.0; - y1+= 1.0; - x2-= 1.0+asp; - y2-= 1.0+asp; - - - BIF_set_color(bc, COLORSHADE_WHITE); - - fdrawbox(x1, y1, x2, y2); - - /* - if(flag & UI_SELECT) { - BIF_set_color(bc, COLORSHADE_LIGHT); - - - fdrawline(x1, y1, x2, y1); - - - fdrawline(x2, y1, x2, y2); - } - else if(flag & UI_ACTIVE) { - BIF_set_color(bc, COLORSHADE_WHITE); - - - fdrawline(x1, y2, x2, y2); - - - fdrawline(x1, y1, x1, y2); - } - else { - BIF_set_color(bc, COLORSHADE_MEDIUM); - - fdrawbox(x1, y1, x2, y2); - } - */ -} - - -/* nothing! */ -static void ui_emboss_N(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int sel) -{ -} - -/* pulldown menu */ -static void ui_emboss_P(BIFColorID bc, float asp, float x1, float y1, float x2, float y2, int flag) -{ - - if(flag & UI_ACTIVE) { - BIF_set_color(bc, COLORSHADE_DARK); - glRectf(x1-1, y1, x2+2, y2); - - } else { - BIF_set_color(bc, COLORSHADE_LMEDIUM); - glRectf(x1-1, y1, x2+2, y2); - } - - glDisable(GL_BLEND); - -} - -static void ui_emboss_slider(uiBut *but, float fac) -{ - float x1, x2, y1, y2, ymid, yc; - - x1= but->x1; x2= but->x2; - y1= but->y1; y2= but->y2; - - /* the slider background line */ - ymid= (y1+y2)/2.0; - yc= 1.7*but->aspect; // height of center line - - glShadeModel(GL_SMOOTH); - glBegin(GL_QUADS); - - if(but->flag & UI_ACTIVE) - BIF_set_color(BUTGREY, COLORSHADE_LMEDIUM); - else - BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); - - - glVertex2f(x1, ymid-yc); - glVertex2f(x2, ymid-yc); - - if(but->flag & UI_ACTIVE) - BIF_set_color(BUTGREY, COLORSHADE_LIGHT); - else - BIF_set_color(BUTGREY, COLORSHADE_LMEDIUM); - - glVertex2f(x2, ymid+yc); - glVertex2f(x1, ymid+yc); - - glEnd(); - - BIF_set_color(but->col, COLORSHADE_DARK); - fdrawline(x1+1, ymid-yc, x2, ymid-yc); - - /* the movable slider */ - if(but->flag & UI_SELECT) BIF_set_color(but->col, COLORSHADE_WHITE); - else BIF_set_color(but->col, COLORSHADE_GREY); - - glShadeModel(GL_SMOOTH); - glBegin(GL_QUADS); - - BIF_set_color(BUTGREY, COLORSHADE_GREY); - - glVertex2f(x1, y1+2.5); - glVertex2f(x1+fac, y1+2.5); - - BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); - - glVertex2f(x1+fac, y2-2.5); - glVertex2f(x1, y2-2.5); - - glEnd(); - - - /* slider handle center */ - glShadeModel(GL_SMOOTH); - glBegin(GL_QUADS); - - BIF_set_color(BUTGREY, COLORSHADE_MEDIUM); - glVertex2f(x1+fac-3, y1+2); - glVertex2f(x1+fac, y1+4); - BIF_set_color(BUTGREY, COLORSHADE_WHITE); - glVertex2f(x1+fac, y2-2); - glVertex2f(x1+fac-3, y2-2); - - glEnd(); - - /* slider handle left bevel */ - BIF_set_color(BUTGREY, COLORSHADE_WHITE); - fdrawline(x1+fac-3, y2-2, x1+fac-3, y1+2); - - /* slider handle right bevel */ - BIF_set_color(BUTGREY, COLORSHADE_GREY); - fdrawline(x1+fac, y2-2, x1+fac, y1+2); - - glShadeModel(GL_FLAT); -} - -static void ui_draw_but_BUT(uiBut *but) -{ - float x=0.0; - - /* check for button text label */ - if (but->type == ICONTEXTROW) { - but->embossfunc = ui_emboss_ICONROW; - but->flag |= UI_ICON_LEFT; - ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd)); - } else if (but->type == ICONROW) { - but->flag |= UI_ICON_LEFT; - but->embossfunc = ui_emboss_ICONROW; - } - - but->embossfunc(but->col, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag); - - if(but->embossfunc==ui_emboss_TABL) { - but->flag |= UI_TEXT_LEFT; - but->flag |= UI_ICON_RIGHT; - but->flag &= ~UI_ICON_LEFT; - } - - //but->flag |= UI_TEXT_LEFT; - - /* check for button text label */ - if (but->type == ICONTEXTROW) { - ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd)); - } - else if(but->drawstr[0]!=0) { - - /* If there's an icon too (made with uiDefIconTextBut) then draw the icon - * and offset the text label to accomodate it - */ - if ( but->flag & UI_HAS_ICON) { - if (but->flag & UI_ICON_LEFT) { - ui_draw_icon(but, but->icon); - - if(but->flag & UI_TEXT_LEFT) x= but->x1+24.0; - else x= (but->x1+but->x2-but->strwidth+1)/2.0; - } else if (but->flag & UI_ICON_RIGHT) { - ui_draw_icon(but, but->icon); - - if(but->flag & UI_TEXT_LEFT) x= but->x1+4.0; - else x= (but->x1+but->x2-but->strwidth+1)/2.0; - } - } - else { - if(but->flag & UI_TEXT_LEFT) x= but->x1+4.0; - else x= (but->x1+but->x2-but->strwidth+1)/2.0; - } - - if(but->flag & UI_SELECT) { - glColor3ub(255,255,255); - } else { - glColor3ub(0,0,0); - } - - glRasterPos2f( x, (but->y1+but->y2- 9.0)/2.0); - - BIF_DrawString(but->font, but->drawstr+but->ofs, (U.transopts & TR_BUTTONS), but->flag & UI_SELECT); - } - /* if there's no text label, then check to see if there's an icon only and draw it */ - else if( but->flag & UI_HAS_ICON ) { - ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd)); - } -} - -static void ui_draw_but_MENU(uiBut *but) -{ - float x; - - but->embossfunc = ui_emboss_MENU; - - but->embossfunc(but->col, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag); - - but->flag |= UI_TEXT_LEFT; - - /* check for button text label */ - if (but->type == ICONTEXTROW) { - ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd)); - } - else if(but->drawstr[0]!=0) { - - /* If there's an icon too (made with uiDefIconTextBut) then draw the icon - and offset the text label to accomodate it */ - if ( (but->flag & UI_HAS_ICON) && (but->flag & UI_ICON_LEFT) ) { - ui_draw_icon(but, but->icon); - - if(but->flag & UI_TEXT_LEFT) x= but->x1+28.0; - else x= (but->x1+but->x2-but->strwidth+1)/2.0; - } - else { - if(but->flag & UI_TEXT_LEFT) x= but->x1+4.0; - else x= (but->x1+but->x2-but->strwidth+1)/2.0; - } - - if(but->flag & UI_SELECT) { - glColor3ub(255,255,255); - } else { - glColor3ub(0,0,0); - } - - glRasterPos2f( x, (but->y1+but->y2- 9.0)/2.0); - - BIF_DrawString(but->font, but->drawstr+but->ofs, (U.transopts & TR_BUTTONS), but->flag & UI_SELECT); - } - /* if there's no text label, then check to see if there's an icon only and draw it */ - else if( but->flag & UI_HAS_ICON ) { - ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd)); - } -} - -static void ui_draw_but_TOG3(uiBut *but) -{ - float x, r, g, b; - - but->embossfunc(but->col, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag); - - if( but->flag & UI_HAS_ICON ) { - ui_draw_icon(but, but->icon); - } - else if(but->drawstr[0]!=0) { - if(but->flag & UI_SELECT) { - int ok= 0; - - if( but->pointype==CHA ) { - if( BTST( *(but->poin+2), but->bitnr )) ok= 1; - } - else if( but->pointype ==SHO ) { - short *sp= (short *)but->poin; - if( BTST( sp[1], but->bitnr )) ok= 1; - } - - if (ok) { - glColor3ub(255, 255, 0); - r= g= 1.0; - b= 0.0; - } else { - glColor3ub(255, 255, 255); - r= g= b= 1.0; - } - } else { - glColor3ub(0, 0, 0); - r= g= b= 0.0; - } - - if(but->flag & UI_TEXT_LEFT) x= but->x1+4.0; - else x= (but->x1+but->x2-but->strwidth+1)/2.0; - - glRasterPos2f( x, (but->y1+but->y2- 9.0)/2.0); - - BIF_DrawStringRGB(but->font, but->drawstr+but->ofs, (U.transopts & TR_BUTTONS), r, g, b); - } -} - -static void ui_draw_but_TEX(uiBut *but) -{ - float x; - short pos, sel, t; - char ch; - - sel= but->flag & UI_SELECT; - - but->embossfunc = ui_emboss_TEX; - but->embossfunc(but->col, but->aspect, but->x1, but->y1, but->x2, but->y2, sel); - - /* draw cursor */ - if(but->pos != -1) { - - pos= but->pos+strlen(but->str); - if(pos >= but->ofs) { - ch= but->drawstr[pos]; - but->drawstr[pos]= 0; - - t= but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, (U.transopts & TR_BUTTONS)) + 3; - - but->drawstr[pos]= ch; - glColor3ub(255,0,0); - - glRects(but->x1+t, but->y1+2, but->x1+t+3, but->y2-2); - } - } - if(but->drawstr[0]!=0) { - /* make text white if selected (editing) */ - if (but->flag & UI_SELECT) glColor3ub(255,255,255); - else glColor3ub(0,0,0); - - if(but->flag & UI_TEXT_LEFT) x= but->x1+4.0; - else x= (but->x1+but->x2-but->strwidth+1)/2.0; - - glRasterPos2f( x, (but->y1+but->y2- 9.0)/2.0); - - /* last arg determines text black (0) or whilte (1) */ - BIF_DrawString(but->font, but->drawstr+but->ofs, (U.transopts & TR_BUTTONS), but->flag & UI_SELECT); - } -} - -static void ui_draw_but_NUM(uiBut *but) -{ - - float x; - but->embossfunc = ui_emboss_NUM; - - but->embossfunc(but->col, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag); - - /* check for button text label */ - if (but->type == ICONTEXTROW) { - ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd)); - } - else if(but->drawstr[0]!=0) { - - /* If there's an icon too (made with uiDefIconTextBut) then draw the icon - and offset the text label to accomodate it */ - if ( (but->flag & UI_HAS_ICON) && (but->flag & UI_ICON_LEFT) ) { - ui_draw_icon(but, but->icon); - - if(but->flag & UI_TEXT_LEFT) x= but->x1+24.0; - else x= (but->x1+but->x2-but->strwidth+1)/2.0; - } - else { - if(but->flag & UI_TEXT_LEFT) x= but->x1+4.0; - else x= (but->x1+but->x2-but->strwidth+1)/2.0; - } - - if(but->flag & UI_SELECT) { - glColor3ub(255,255,255); - } else { - glColor3ub(0,0,0); - } - - glRasterPos2f( x, (but->y1+but->y2- 9.0)/2.0); - - BIF_DrawString(but->font, but->drawstr+but->ofs, (U.transopts & TR_BUTTONS), but->flag & UI_SELECT); - } - /* if there's no text label, then check to see if there's an icon only and draw it */ - else if( but->flag & UI_HAS_ICON ) { - ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd)); - } - -} - -static void ui_draw_but_BUTM(uiBut *but) -{ - float x=0; - short len; - char *cpoin; - int sel; - - if (but->type == MENU) { - but->embossfunc = ui_emboss_MENU; - } - - but->embossfunc(but->col, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag); - - /* check for button text label */ - if(but->drawstr[0]!=0) { - - cpoin= strchr(but->drawstr, '|'); - if(cpoin) *cpoin= 0; - - if(but->embossfunc==ui_emboss_P) { - if(but->flag & UI_ACTIVE) { - glColor3ub(255,255,255); - sel = 1; - } else { - glColor3ub(0,0,0); - sel = 0; - } - } - else { - glColor3ub(0,0,0); - sel = 0; - } - - /* If there's an icon too (made with uiDefIconTextBut) then draw the icon - and offset the text label to accomodate it */ - if ( but->flag & UI_HAS_ICON ) { - if (but->flag & UI_ICON_LEFT ) { - ui_draw_icon(but, but->icon); - - x= but->x1+22.0; - } else if (but->flag & UI_ICON_RIGHT) { - ui_draw_icon(but, but->icon); - - x= but->x1+4.0; - } - } - else { - x= but->x1+4.0; - } - - glRasterPos2f( x, (but->y1+but->y2- 9.0)/2.0); - - BIF_DrawString(but->font, but->drawstr, (U.transopts & TR_BUTTONS), sel); - - if(cpoin) { - len= BIF_GetStringWidth(but->font, cpoin+1, (U.transopts & TR_BUTTONS)); - glRasterPos2f( but->x2 - len*but->aspect-3, (but->y1+but->y2- 9.0)/2.0); - BIF_DrawString(but->font, cpoin+1, (U.transopts & TR_BUTTONS), but->flag & UI_ACTIVE); - *cpoin= '|'; - } - } - /* if there's no text label, then check to see if there's an icon only and draw it */ - else if( but->flag & UI_HAS_ICON ) { - ui_draw_icon(but, but->icon); - } -} - -static void ui_draw_but_LABEL(uiBut *but) -{ - float x; - int sel; - - sel= but->min!=0.0; - - if(sel) glColor3ub(255,255,255); - else glColor3ub(0,0,0); - - /* check for button text label */ - if(but->drawstr[0]!=0) { - - /* If there's an icon too (made with uiDefIconTextBut) then draw the icon - and offset the text label to accomodate it */ - if ( (but->flag & UI_HAS_ICON) && (but->flag & UI_ICON_LEFT) ) { - ui_draw_icon(but, but->icon); - - if(but->flag & UI_TEXT_LEFT) x= but->x1+24.0; - else x= (but->x1+but->x2-but->strwidth+1)/2.0; - } - else { - if(but->flag & UI_TEXT_LEFT) x= but->x1+4.0; - else x= (but->x1+but->x2-but->strwidth+1)/2.0; - } - - glRasterPos2f( x, (but->y1+but->y2- 9.0)/2.0); - - BIF_DrawString(but->font, but->drawstr+but->ofs, (U.transopts & TR_BUTTONS), sel); - } - /* if there's no text label, then check to see if there's an icon only and draw it */ - else if( but->flag & UI_HAS_ICON ) { - ui_draw_icon(but, but->icon); - } -} - -static void ui_draw_but_SEPR(uiBut *but) -{ - //float y= (but->y1+but->y2)/2.0; - - BIF_set_color(but->col, COLORSHADE_MEDIUM); - glRectf(but->x1-2, but->y1-1, but->x2+2, but->y2); - -} - -static void ui_draw_but_LINK(uiBut *but) -{ - ui_draw_icon(but, but->icon); -} - - -static void ui_draw_but(uiBut *but) -{ - double value; - float fac, x1, y1, x2, y2, *fp; - char colr, colg, colb; - - if(but==0) return; - - if(but->block->frontbuf==UI_NEED_DRAW_FRONT) { - but->block->frontbuf= UI_HAS_DRAW_FRONT; - - glDrawBuffer(GL_FRONT); - if(but->win==curarea->headwin) curarea->head_swap= WIN_FRONT_OK; - else curarea->win_swap= WIN_FRONT_OK; - } - - switch (but->type) { - - case BUT: - case ROW: - case TOG: - case TOGR: - case TOGN: - case ICONTOG: - case KEYEVT: - case IDPOIN: - case ICONROW: - case ICONTEXTROW: - ui_draw_but_BUT(but); - break; - - case NUM: - ui_draw_but_NUM(but); - break; - - case TEX: - ui_draw_but_TEX(but); - break; - - case BUTM: - case BLOCK: - ui_draw_but_BUTM(but); - break; - - case MENU: - ui_draw_but_MENU(but); - break; - - case NUMSLI: - case HSVSLI: - - ui_draw_but_BUT(but); - - /* the slider */ - - x1= but->x1; x2= but->x2; - y1= but->y1; y2= but->y2; - - but->x1= (but->x1+but->x2)/2; - but->x2-= 5.0*but->aspect; - - but->y1+= 2.0*but->aspect; - but->y2-= 2.0*but->aspect; - - value= ui_get_but_val(but); - fac= (value-but->min)*(but->x2-but->x1)/(but->max - but->min); - ui_emboss_slider(but, fac); - - but->x1= x1; but->x2= x2; - but->y1= y1; but->y2= y2; - - break; - - case TOG3: - ui_draw_but_TOG3(but); - break; - - case LABEL: - ui_draw_but_LABEL(but); - break; - - case SLI: - break; - - case SCROLL: - break; - - case SEPR: - ui_draw_but_SEPR(but); - break; - - case COL: - - if( but->pointype==FLO ) { - fp= (float *)but->poin; - colr= floor(255.0*fp[0]+0.5); - colg= floor(255.0*fp[1]+0.5); - colb= floor(255.0*fp[2]+0.5); - } - else { - char *cp= (char *)but->poin; - colr= cp[0]; - colg= cp[1]; - colb= cp[2]; - } - glColor3ub(colr, colg, colb); - glRectf((but->x1), (but->y1), (but->x2), (but->y2)); - glColor3ub(0, 0, 0); - fdrawbox((but->x1), (but->y1), (but->x2), (but->y2)); - break; - - case LINK: - ui_draw_but_LINK(but); - break; - - case INLINK: - ui_draw_but_LINK(but); - break; - } -} - - - -void uiDrawMenuBox(float minx, float miny, float maxx, float maxy) -{ - BIF_set_color(MENUCOL, COLORSHADE_MEDIUM); - - glRectf(minx, miny, maxx, maxy); - - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - - glColor4ub(0, 0, 0, 100); - fdrawline(minx+4, miny, maxx+1, miny); - fdrawline(maxx+1, miny, maxx+1, maxy-4); - - glColor4ub(0, 0, 0, 80); - fdrawline(minx+4, miny-1, maxx+1, miny-1); - fdrawline(maxx+1, miny-1, maxx+1, maxy-4); - - glColor4ub(0, 0, 0, 55); - fdrawline(minx+4, miny-2, maxx+2, miny-2); - fdrawline(maxx+2, miny-2, maxx+2, maxy-4); - - glColor4ub(0, 0, 0, 35); - fdrawline(minx+4, miny-3, maxx+3, miny-3); - fdrawline(maxx+3, miny-3, maxx+3, maxy-4); - - glColor4ub(0, 0, 0, 20); - fdrawline(minx+4, miny-4, maxx+4, miny-4); - fdrawline(maxx+4, miny-4, maxx+4, maxy-4); - - glDisable(GL_BLEND); - - /* below */ - //glColor3ub(0,0,0); - //fdrawline(minx, miny, maxx, miny); - - /* right */ - //fdrawline(maxx, miny, maxx, maxy); - - /* top */ - //glColor3ub(255,255,255); - //fdrawline(minx, maxy, maxx, maxy); - - /* left */ - //fdrawline(minx, miny, minx, maxy); - -} - -static void ui_draw_linkline(uiBut *but, uiLinkLine *line) -{ - float vec1[2], vec2[2]; - - if(line->from==NULL || line->to==NULL) return; - - if(but->block->frontbuf==UI_NEED_DRAW_FRONT) { - but->block->frontbuf= UI_HAS_DRAW_FRONT; + glReadBuffer(GL_FRONT); + glDrawBuffer(GL_FRONT); - glDrawBuffer(GL_FRONT); - if(but->win==curarea->headwin) curarea->head_swap= WIN_FRONT_OK; - else curarea->win_swap= WIN_FRONT_OK; - } + /* for geforce and other cards */ + glFinish(); - vec1[0]= (line->from->x1+line->from->x2)/2.0; - vec1[1]= (line->from->y1+line->from->y2)/2.0; - vec2[0]= (line->to->x1+line->to->x2)/2.0; - vec2[1]= (line->to->y1+line->to->y2)/2.0; + su= ui_save_under(startx-1, starty-1, endx-startx+2, endy-starty+6); + if(su) su->oldwin= oldwin; - if(line->flag & UI_SELECT) BIF_set_color(but->col, COLORSHADE_LIGHT); - else glColor3ub(0,0,0); - fdrawline(vec1[0], vec1[1], vec2[0], vec2[1]); + if(su && cursor) { + su->oldcursor= get_cursor(); + set_cursor(CURSOR_STD); + } + + return su; } -static void ui_draw_links(uiBlock *block) +static void ui_endpupdraw(uiSaveUnder *su) { - uiBut *but; - uiLinkLine *line; + + /* for geforce and other cards */ + + glReadBuffer(GL_FRONT); + glDrawBuffer(GL_FRONT); - but= block->buttons.first; - while(but) { - if(but->type==LINK && but->link) { - line= but->link->lines.first; - while(line) { - ui_draw_linkline(but, line); - line= line->next; - } - } - but= but->next; - } + glFinish(); + + if(su) { + ui_paste_under(su); + } + glReadBuffer(GL_BACK); + glDrawBuffer(GL_BACK); } @@ -2346,6 +527,55 @@ void ui_autofill(uiBlock *block) block->autofill= 0; } +/* ************** LINK LINE DRAWING ************* */ + +/* link line drawing is not part of buttons or theme.. so we stick with it here */ + +static void ui_draw_linkline(uiBut *but, uiLinkLine *line) +{ + float vec1[2], vec2[2]; + + if(line->from==NULL || line->to==NULL) return; + + if(but->block->frontbuf==UI_NEED_DRAW_FRONT) { + but->block->frontbuf= UI_HAS_DRAW_FRONT; + + glDrawBuffer(GL_FRONT); + if(but->win==curarea->headwin) curarea->head_swap= WIN_FRONT_OK; + else curarea->win_swap= WIN_FRONT_OK; + } + + vec1[0]= (line->from->x1+line->from->x2)/2.0; + vec1[1]= (line->from->y1+line->from->y2)/2.0; + vec2[0]= (line->to->x1+line->to->x2)/2.0; + vec2[1]= (line->to->y1+line->to->y2)/2.0; + + if(line->flag & UI_SELECT) BIF_ThemeColorShade(but->themecol, 80); + else glColor3ub(0,0,0); + fdrawline(vec1[0], vec1[1], vec2[0], vec2[1]); +} + +static void ui_draw_links(uiBlock *block) +{ + uiBut *but; + uiLinkLine *line; + + but= block->buttons.first; + while(but) { + if(but->type==LINK && but->link) { + line= but->link->lines.first; + while(line) { + ui_draw_linkline(but, line); + line= line->next; + } + } + but= but->next; + } +} + +/* ************** BLOCK DRAWING FUNCTION ************* */ + + void uiDrawBlock(uiBlock *block) { uiBut *but; @@ -2356,7 +586,6 @@ void uiDrawBlock(uiBlock *block) uiPanelPush(block); // panel matrix if(block->flag & UI_BLOCK_LOOP) { - BIF_set_color(block->col, COLORSHADE_HILITE); uiDrawMenuBox(block->minx, block->miny, block->maxx, block->maxy); } else if(block->panel) ui_draw_panel(block); @@ -2513,148 +742,6 @@ static void ui_warp_pointer(short x, short y) #endif } -#if 0 -static int ui_do_but_MENUo(uiBut *but) -{ - uiBlock *block; - ListBase listb={NULL, NULL}; - double fvalue; - int width, height, a, xmax, ymax, starty, endx, endy; - short startx; - int columns=1, rows=0, boxh, event; - short x1, y1; - short mval[2], mousemove[2]; - MenuData *md; - - but->flag |= UI_SELECT; - ui_draw_but(but); - - block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT; - uiBlockSetCol(block, MENUCOL); - - md= decompose_menu_string(but->str); - - /* columns and row calculation */ - columns= (md->nitems+20)/20; - if (columns<1) columns= 1; - - rows= (int) md->nitems/columns; - if (rows<1) rows= 1; - - while (rows*columnsnitems) rows++; - - /* size and location */ - if(md->title) - width= 2*strlen(md->title)+BIF_GetStringWidth(block->curfont, md->title, (U.transopts & TR_MENUS)); - else - width= 0; - - for(a=0; anitems; a++) { - xmax= BIF_GetStringWidth(block->curfont, md->items[a].str, (U.transopts & TR_MENUS)); - if(xmax>width) width= xmax; - } - - width+= 10; - if (width<50) width=50; - - boxh= TBOXH; - - height= rows*boxh; - if (md->title) height+= boxh; - - xmax = G.curscreen->sizex; - ymax = G.curscreen->sizey; - - getmouseco_sc(mval); - - /* find active item */ - fvalue= ui_get_but_val(but); - for(a=0; anitems; a++) { - if( md->items[a].retval== (int)fvalue ) break; - } - /* no active item? */ - if(a==md->nitems) { - if(md->title) a= -1; - else a= 0; - } - - if(a>0) startx = mval[0]-width/2 - ((int)(a)/rows)*width; - else startx= mval[0]-width/2; - starty = mval[1]-height + boxh/2 + ((a)%rows)*boxh; - - if (md->title) starty+= boxh; - - mousemove[0]= mousemove[1]= 0; - - if(startx<10) { - mousemove[0]= 10-startx; - startx= 10; - } - if(starty<10) { - mousemove[1]= 10-starty; - starty= 10; - } - - endx= startx+width*columns; - endy= starty+height; - - if(endx>xmax) { - mousemove[0]= xmax-endx-10; - endx= xmax-10; - startx= endx-width*columns; - } - if(endy>ymax) { - mousemove[1]= ymax-endy-10; - endy= ymax-10; - starty= endy-height; - } - - ui_warp_pointer(mval[0]+mousemove[0], mval[1]+mousemove[1]); - - mousemove[0]= mval[0]; - mousemove[1]= mval[1]; - - /* here we go! */ - - if(md->title) { - uiBut *bt; - uiSetCurFont(block, block->font+1); - bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+rows*boxh), (short)width, (short)boxh, NULL, 0.0, 0.0, 0, 0, ""); - uiSetCurFont(block, block->font); - bt->flag= UI_TEXT_LEFT; - } - - for(a=0; anitems; a++) { - - x1= startx + width*((int)a/rows); - y1= starty - boxh*(a%rows) + (rows-1)*boxh; - - if (strcmp(md->items[a].str, "%l")==0) { - uiDefBut(block, SEPR, B_NOP, "", x1, y1,(short)(width-(rows>1)), (short)(boxh-1), NULL, 0.0, 0.0, 0, 0, ""); - } - else { - uiDefBut(block, BUTM|but->pointype, but->retval, md->items[a].str, x1, y1,(short)(width-(rows>1)), (short)(boxh-1), but->poin, (float) md->items[a].retval, 0.0, 0, 0, ""); - } - } - - uiBoundsBlock(block, 3); - - event= uiDoBlocks(&listb, 0); - - menudata_free(md); - - if((event & UI_RETURN_OUT)==0) ui_warp_pointer(mousemove[0], mousemove[1]); - - but->flag &= ~UI_SELECT; - ui_check_but(but); - ui_draw_but(but); - - uibut_do_func(but); - - return event; -} -#endif static int ui_do_but_MENU(uiBut *but) { @@ -2673,7 +760,6 @@ static int ui_do_but_MENU(uiBut *but) block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, but->win); block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT; - uiBlockSetCol(block, MENUCOL); md= decompose_menu_string(but->str); @@ -3328,7 +1414,6 @@ static int ui_do_but_ICONROW(uiBut *but) /* here we go! */ block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, but->win); block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT; - uiBlockSetCol(block, MENUCOL); for(a=(int)but->min; a<=(int)but->max; a++) { uiDefIconBut(block, BUTM|but->pointype, but->retval, but->icon+(a-but->min), 0, (short)(18*a), (short)(but->x2-but->x1-4), 18, but->poin, (float)a, 0.0, 0, 0, ""); @@ -3361,7 +1446,7 @@ static int ui_do_but_ICONTEXTROW(uiBut *but) block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, but->win); block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT; - uiBlockSetCol(block, MENUCOL); + md= decompose_menu_string(but->str); /* size and location */ @@ -4446,7 +2531,7 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent) if(but->flag & UI_MOUSE_OVER) { if( (but->flag & UI_ACTIVE)==0) { but->flag |= UI_ACTIVE; - if(but->type != LABEL && but->embossfunc != ui_emboss_N) ui_draw_but(but); + if(but->type != LABEL /* && but->embossfunc != ui_emboss_N */) ui_draw_but(but); } } /* hilite case 2 */ @@ -4455,7 +2540,7 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent) /* we dont clear active flag until mouse move, for Menu buttons to remain showing active item when opened */ if (uevent->event==MOUSEY) { but->flag &= ~UI_ACTIVE; - if(but->type != LABEL && but->embossfunc != ui_emboss_N) ui_draw_but(but); + if(but->type != LABEL /* && but->embossfunc != ui_emboss_N */) ui_draw_but(but); } } else if(but->type==BLOCK || but->type==MENU) { // automatic opens block button (pulldown) @@ -4666,7 +2751,7 @@ static uiSaveUnder *ui_draw_but_tip(uiBut *but) glColor3ub(0,0,0); glRasterPos2f( x1+3, y1+4); - BIF_DrawString(but->font, but->tip, (U.transopts & TR_TOOLTIPS), 0); + BIF_DrawString(but->font, but->tip, (U.transopts & TR_TOOLTIPS)); glFinish(); /* to show it in the frontbuffer */ return su; @@ -4879,7 +2964,7 @@ int uiDoBlocks(ListBase *lb, int event) /* ************** DATA *************** */ -static double ui_get_but_val(uiBut *but) +double ui_get_but_val(uiBut *but) { void *poin; double value = 0.0; @@ -5072,8 +3157,8 @@ uiBlock *uiNewBlock(ListBase *lb, char *name, short dt, short font, short win) this is because the 'mainwin' pup menu's */ block->winq= mywinget(); block->dt= dt; - block->col= BUTGREY; - + block->themecol= TH_AUTO; + /* aspect */ bwin_getsinglematrix(win, block->winmat); @@ -5264,6 +3349,36 @@ void ui_check_but(uiBut *but) } } +static int ui_auto_themecol(uiBut *but) +{ + + switch(but->type) { + case BUT: + return TH_BUT_ACTION; + case ROW: + case TOG: + case TOG3: + case TOGR: + case TOGN: + return TH_BUT_SETTING; + case SLI: + case NUM: + case NUMSLI: + case HSVSLI: + return TH_BUT_NUM; + case TEX: + return TH_BUT_TEXTFIELD; + case BLOCK: + case MENU: + case BUTM: + // (weak!) detect if it is a blockloop + if(UIbuttip) return TH_MENU_ITEM; + return TH_BUT_POPUP; + default: + return TH_BUT_NEUTRAL; + } +} + static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) { uiBut *but; @@ -5272,7 +3387,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short if(type & BUTPOIN) { /* a pointer is required */ if(poin==0) { /* if pointer is zero, button is removed and not drawn */ - BIF_set_color(block->col, COLORSHADE_MEDIUM); + BIF_ThemeColor(block->themecol); glRects(x1, y1, x1+x2, y1+y2); return NULL; } @@ -5314,8 +3429,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short but->tip= tip; but->font= block->curfont; - but->col= block->col; - + but->lock= UIlock; but->lockstr= UIlockstr; @@ -5323,6 +3437,9 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short but->win= block->win; but->block= block; // pointer back, used for frontbuffer status + if(block->themecol==TH_AUTO) but->themecol= ui_auto_themecol(but); + else but->themecol= block->themecol; + if (but->type==BUTM) { but->butm_func= block->butm_func; but->butm_func_arg= block->butm_func_arg; @@ -5332,16 +3449,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short but->func_arg2= block->func_arg2; } - if(block->dt==UI_EMBOSSX) but->embossfunc= ui_emboss_X; - else if(block->dt==UI_EMBOSSW) but->embossfunc= ui_emboss_W; - else if(block->dt==UI_EMBOSSM) but->embossfunc= ui_emboss_M; - else if(block->dt==UI_EMBOSSP) but->embossfunc= ui_emboss_P; - else if(block->dt==UI_EMBOSST) but->embossfunc= ui_emboss_TABL; - else if(block->dt==UI_EMBOSSTABL) but->embossfunc= ui_emboss_TABL; - else if(block->dt==UI_EMBOSSTABM) but->embossfunc= ui_emboss_TABM; - else if(block->dt==UI_EMBOSSTABR) but->embossfunc= ui_emboss_TABR; - else if(block->dt==UI_EMBOSSMB) but->embossfunc= ui_emboss_MENU; - else but->embossfunc= ui_emboss_N; + ui_set_embossfunc(but, block->dt); but->pos= -1; /* cursor invisible */ @@ -5355,7 +3463,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short } } - if ELEM6(but->type, HSVSLI , NUMSLI, TEX, LABEL, IDPOIN, BLOCK) { + if ELEM8(but->type, HSVSLI , NUMSLI, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM) { but->flag |= UI_TEXT_LEFT; } @@ -5489,11 +3597,11 @@ int uiBlocksGetYMin(ListBase *lb) int uiBlockGetCol(uiBlock *block) { - return block->col; + return block->themecol; } void uiBlockSetCol(uiBlock *block, int col) { - block->col= col; + block->themecol= col; } void uiBlockSetEmboss(uiBlock *block, int emboss) { @@ -5630,7 +3738,6 @@ short pupmenu(char *instr) /* block stuff first, need to know the font */ block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT); - uiBlockSetCol(block, MENUCOL); md= decompose_menu_string(instr); @@ -5742,7 +3849,6 @@ short pupmenu_col(char *instr, int maxrow) block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT); - uiBlockSetCol(block, MENUCOL); md= decompose_menu_string(instr); diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c new file mode 100644 index 00000000000..050dcc564e5 --- /dev/null +++ b/source/blender/src/interface_draw.c @@ -0,0 +1,1448 @@ +/** + * $Id$ + * + * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. The Blender + * Foundation also sells licenses for use in proprietary software under + * the Blender License. See http://www.blender.org/BL/ for information + * about this. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL/BL DUAL LICENSE BLOCK ***** + */ + +/* + a full doc with API notes can be found in bf-blender/blender/doc/interface_API.txt + + */ + + +#include +#include +#include +#include + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifndef WIN32 +#include +#else +#include +#include "BLI_winstuff.h" +#endif + +#include "MEM_guardedalloc.h" + +#include "PIL_time.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" + +#include "DNA_screen_types.h" +#include "DNA_space_types.h" +#include "DNA_userdef_types.h" +#include "DNA_vec_types.h" + +#include "BKE_blender.h" +#include "BKE_utildefines.h" +#include "BKE_global.h" + +#include "BIF_gl.h" +#include "BIF_graphics.h" +#include "BIF_keyval.h" +#include "BIF_mainqueue.h" + +#include "BIF_screen.h" +#include "BIF_toolbox.h" +#include "BIF_mywindow.h" +#include "BIF_space.h" +#include "BIF_glutil.h" +#include "BIF_interface.h" +#include "BIF_butspace.h" +#include "BIF_language.h" + +#include "BSE_view.h" + +#include "mydevice.h" +#include "interface.h" +#include "blendef.h" + +// globals +extern float UIwinmat[4][4]; + + + +/* ************** generic embossed rect, for window sliders etc ************* */ + +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); + +} + +/* ************** GENERIC ICON DRAW, NO THEME HERE ************* */ + +static void ui_draw_icon(uiBut *but, BIFIconID icon) +{ + int blend= 0; + 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); + + /* calculate blend color */ + if ELEM4(but->type, ICONTOG, TOG, ROW, TOGN) { + if(but->flag & UI_SELECT); + else if(but->flag & UI_ACTIVE); + else blend= -60; + } + BIF_draw_icon_blended(icon, but->themecol, blend); + +/* old blending method... hrums */ +/* if(but->flag & UI_SELECT) { + if(but->flag & UI_ACTIVE) { + BIF_draw_icon_blended(icon, but->themecol, -80); + } else { + BIF_draw_icon_blended(icon, but->themecol, -45); + } + } + else { + if ((but->flag & UI_ACTIVE) && but->type==BUTM) { + BIF_draw_icon_blended(icon, but->themecol, 0); + } else if (but->flag & UI_ACTIVE) { + BIF_draw_icon_blended(icon, but->themecol, 25); + } else { + BIF_draw_icon_blended(icon, but->themecol, 45); + } + } +*/ + glBlendFunc(GL_ONE, GL_ZERO); + glDisable(GL_BLEND); + + glPixelZoom(1.0, 1.0); +} + +/* ************** MATT'S THEME, SHADED DECORATED BUTTONS ************* */ + + +#define M_WHITE BIF_ThemeColorShade(bc, 80) +#define M_LIGHT BIF_ThemeColorShade(bc, 45) +#define M_HILITE BIF_ThemeColorShade(bc, 25) +#define M_LMEDIUM BIF_ThemeColorShade(bc, 10) +#define M_MEDIUM BIF_ThemeColor(bc) +#define M_LGREY BIF_ThemeColorShade(bc, -20) +#define M_GREY BIF_ThemeColorShade(bc, -45) +#define M_DARK BIF_ThemeColorShade(bc, -80) + +#define MM_WHITE BIF_ThemeColorShade(TH_BUT_NEUTRAL, 80) +#define MM_LIGHT BIF_ThemeColorShade(TH_BUT_NEUTRAL, 45) +#define MM_MEDIUM BIF_ThemeColor(TH_BUT_NEUTRAL) +#define MM_GREY BIF_ThemeColorShade(TH_BUT_NEUTRAL, -45) +#define MM_DARK BIF_ThemeColorShade(TH_BUT_NEUTRAL, -80) + + +static void ui_default_button(int 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) M_MEDIUM; + else M_LGREY; + } + else { + if(flag & UI_ACTIVE) M_LIGHT; + else M_HILITE; + } + + glVertex2f(x1,y1); + glVertex2f(x2,y1); + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) M_LGREY; + else M_GREY; + } + else { + if(flag & UI_ACTIVE) M_WHITE; + else M_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) M_LGREY; + else M_GREY; + } + else { + if(flag & UI_ACTIVE) M_WHITE; + else M_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); + MM_WHITE; + glVertex2f(x1-1,y1); + MM_LIGHT; + glVertex2f(x1-1,y2); + glEnd(); + + /* right */ + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + MM_WHITE; + glVertex2f(x2+1,y1); + MM_LIGHT; + glVertex2f(x2+1,y2); + glEnd(); + + /* bottom */ + MM_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) M_GREY; + else M_GREY; + } + else { + if(flag & UI_ACTIVE) M_WHITE; + else M_WHITE; + } + + fdrawline(x1, (y2-1), x2, y2-1); + + /* bottom */ + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) M_LGREY; + else M_LGREY; + } + else { + if(flag & UI_ACTIVE) M_LMEDIUM; + else M_LMEDIUM; + } + fdrawline(x1, (y1+1), x2, y1+1); + + /* left */ + if(!(flag & UI_SELECT)) { + + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + M_WHITE; + glVertex2f(x1+1,y1+2); + M_LGREY; + glVertex2f(x1+1,y2); + glEnd(); + + } + + /* right */ + if(!(flag & UI_SELECT)) { + + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + M_LGREY; + glVertex2f(x2-1,y1+2); + M_WHITE; + glVertex2f(x2-1,y2); + glEnd(); + + } + /* END INNER OUTLINE */ + + /* OUTER OUTLINE */ + glShadeModel(GL_FLAT); + + /* underneath semi-fake-AA */ + MM_GREY; + fdrawline(x1, y2, x2, y2); + MM_MEDIUM; + fdrawline(x1, y1, x2, y1); + + /* top */ + MM_DARK; + fdrawline(x1+1, y2, x2, y2); + + /* left */ + fdrawline(x1, y1+1, x1, y2); + + /* right */ + fdrawline(x2, y1+1, x2, y2); + + /* bottom */ + MM_DARK; + fdrawline(x1+1, y1, x2, y1); + /* END OUTER OUTLINE */ + +} + +static void ui_default_text(int 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) M_LGREY; + else M_GREY; + } + else { + if(flag & UI_ACTIVE) M_HILITE; + else M_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); + MM_WHITE; + glVertex2f(x1-1,y1); + MM_LIGHT; + glVertex2f(x1-1,y2); + glEnd(); + + /* right */ + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + MM_WHITE; + glVertex2f(x2+1,y1); + MM_LIGHT; + glVertex2f(x2+1,y2); + glEnd(); + + /* bottom */ + MM_WHITE; + fdrawline(x1, y1-1, x2, y1-1); + /* END OUTER SUNKEN EFFECT */ + + /* OUTER OUTLINE */ + glShadeModel(GL_FLAT); + + /* underneath semi-fake-AA */ + MM_GREY; + fdrawline(x1, y2, x2, y2); + MM_MEDIUM; + fdrawline(x1, y1, x2, y1); + + /* top */ + MM_DARK; + fdrawline(x1+1, y2, x2, y2); + + /* left */ + fdrawline(x1, y1+1, x1, y2); + + /* right */ + fdrawline(x2, y1+1, x2, y2); + + /* bottom */ + MM_DARK; + fdrawline(x1+1, y1, x2, y1); + /* END OUTER OUTLINE */ +} + +static void ui_default_num(int 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) M_LGREY; + else M_GREY; + } + else { + if(flag & UI_ACTIVE) M_HILITE; + else M_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); + MM_WHITE; + glVertex2f(x1-1,y1); + MM_LIGHT; + glVertex2f(x1-1,y2); + glEnd(); + + /* right */ + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + MM_WHITE; + glVertex2f(x2+1,y1); + MM_LIGHT; + glVertex2f(x2+1,y2); + glEnd(); + + /* bottom */ + MM_WHITE; + fdrawline(x1, y1-1, x2, y1-1); + /* END OUTER SUNKEN EFFECT */ + + /* OUTER OUTLINE */ + glShadeModel(GL_FLAT); + + /* underneath semi-fake-AA */ + MM_GREY; + fdrawline(x1, y2, x2, y2); + MM_MEDIUM; + fdrawline(x1, y1, x2, y1); + + /* top */ + MM_DARK; + fdrawline(x1+1, y2, x2, y2); + + /* left */ + fdrawline(x1, y1+1, x1, y2); + + /* right */ + fdrawline(x2, y1+1, x2, y2); + + /* bottom */ + MM_DARK; + fdrawline(x1+1, y1, x2, y1); + /* END OUTER OUTLINE */ + + /* SIDE ARROWS */ + /* left */ + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) M_DARK; + else M_DARK; + } + else { + if(flag & UI_ACTIVE) M_GREY; + else M_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_default_menu(int 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) M_LGREY; + else M_GREY; + } + else { + if(flag & UI_ACTIVE) M_LIGHT; + else M_HILITE; + } + + glVertex2f(x1,y1); + glVertex2f(x2,y1); + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) M_GREY; + else M_DARK; + } + else { + if(flag & UI_ACTIVE) M_WHITE; + else M_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) M_GREY; + else M_DARK; + } + else { + if(flag & UI_ACTIVE) M_WHITE; + else M_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); + MM_WHITE; + glVertex2f(x1-1,y1); + MM_LIGHT; + glVertex2f(x1-1,y2); + glEnd(); + + /* right */ + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + MM_WHITE; + glVertex2f(x2+1,y1); + MM_LIGHT; + glVertex2f(x2+1,y2); + glEnd(); + + /* bottom */ + MM_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) M_GREY; + else M_GREY; + } + else { + if(flag & UI_ACTIVE) M_WHITE; + else M_WHITE; + } + + fdrawline(x1, (y2-1), x2, y2-1); + + /* bottom */ + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) M_LGREY; + else M_LGREY; + } + else { + if(flag & UI_ACTIVE) M_LMEDIUM; + else M_LMEDIUM; + } + fdrawline(x1, (y1+1), x2, y1+1); + + /* left */ + if(!(flag & UI_SELECT)) { + + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + M_WHITE; + glVertex2f(x1+1,y1+2); + M_LGREY; + glVertex2f(x1+1,y2); + glEnd(); + + } + + /* right */ + if(!(flag & UI_SELECT)) { + + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + M_LGREY; + glVertex2f(x2-1,y1+2); + M_WHITE; + glVertex2f(x2-1,y2); + glEnd(); + + } + /* END INNER OUTLINE */ + + /* OUTER OUTLINE */ + glShadeModel(GL_FLAT); + + /* underneath semi-fake-AA */ + MM_GREY; + fdrawline(x1, y2, x2, y2); + MM_MEDIUM; + fdrawline(x1, y1, x2, y1); + + /* top */ + MM_DARK; + fdrawline(x1+1, y2, x2, y2); + + /* left */ + fdrawline(x1, y1+1, x1, y2); + + /* right */ + fdrawline(x2, y1+1, x2, y2); + + /* bottom */ + MM_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 */ + M_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_default_iconrow(int 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) M_MEDIUM; + else M_LGREY; + } + else { + if(flag & UI_ACTIVE) M_LIGHT; + else M_HILITE; + } + + glVertex2f(x1,y1); + glVertex2f(x2,y1); + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) M_LGREY; + else M_GREY; + } + else { + if(flag & UI_ACTIVE) M_WHITE; + else M_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) M_LGREY; + else M_GREY; + } + else { + if(flag & UI_ACTIVE) M_WHITE; + else M_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); + MM_WHITE; + glVertex2f(x1-1,y1); + MM_LIGHT; + glVertex2f(x1-1,y2); + glEnd(); + + /* right */ + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + MM_WHITE; + glVertex2f(x2+1,y1); + MM_LIGHT; + glVertex2f(x2+1,y2); + glEnd(); + + /* bottom */ + MM_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) M_GREY; + else M_GREY; + } + else { + if(flag & UI_ACTIVE) M_WHITE; + else M_WHITE; + } + + fdrawline(x1, (y2-1), x2, y2-1); + + /* bottom */ + + if(flag & UI_SELECT) { + if(flag & UI_ACTIVE) M_LGREY; + else M_LGREY; + } + else { + if(flag & UI_ACTIVE) M_LMEDIUM; + else M_LMEDIUM; + } + fdrawline(x1, (y1+1), x2, y1+1); + + /* left */ + if(!(flag & UI_SELECT)) { + + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + M_WHITE; + glVertex2f(x1+1,y1+2); + M_LGREY; + glVertex2f(x1+1,y2); + glEnd(); + + } + + /* right */ + if(!(flag & UI_SELECT)) { + + glShadeModel(GL_SMOOTH); + glBegin(GL_LINES); + M_LGREY; + glVertex2f(x2-1,y1+2); + M_WHITE; + glVertex2f(x2-1,y2); + glEnd(); + + } + /* END INNER OUTLINE */ + + /* OUTER OUTLINE */ + glShadeModel(GL_FLAT); + + /* underneath semi-fake-AA */ + MM_GREY; + fdrawline(x1, y2, x2, y2); + MM_MEDIUM; + fdrawline(x1, y1, x2, y1); + + /* top */ + MM_DARK; + fdrawline(x1+1, y2, x2, y2); + + /* left */ + fdrawline(x1, y1+1, x1, y2); + + /* right */ + fdrawline(x2, y1+1, x2, y2); + + /* bottom */ + MM_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 */ + M_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_default_slider(int colorid, float fac, float aspect, float x1, float y1, float x2, float y2, int flag) +{ + float ymid, yc; + + /* the slider background line */ + ymid= (y1+y2)/2.0; + yc= 1.7*aspect; // height of center line + + glShadeModel(GL_SMOOTH); + glBegin(GL_QUADS); + + if(flag & UI_ACTIVE) + BIF_ThemeColorShade(TH_BUT_NUM, +10); + else + BIF_ThemeColor(TH_BUT_NUM); + + + glVertex2f(x1, ymid-yc); + glVertex2f(x2, ymid-yc); + + if(flag & UI_ACTIVE) + BIF_ThemeColorShade(TH_BUT_NUM, +45); + else + BIF_ThemeColorShade(TH_BUT_NUM, +10); + + glVertex2f(x2, ymid+yc); + glVertex2f(x1, ymid+yc); + + glEnd(); + + BIF_ThemeColorShade(TH_BUT_NUM, -80); + fdrawline(x1+1, ymid-yc, x2, ymid-yc); + + /* the movable slider */ + if(flag & UI_SELECT) BIF_ThemeColorShade(TH_BUT_NUM, +80); + else BIF_ThemeColorShade(TH_BUT_NUM, -45); + + glShadeModel(GL_SMOOTH); + glBegin(GL_QUADS); + + BIF_ThemeColorShade(TH_BUT_NUM, -45); + + glVertex2f(x1, y1+2.5); + glVertex2f(x1+fac, y1+2.5); + + BIF_ThemeColor(TH_BUT_NUM); + + glVertex2f(x1+fac, y2-2.5); + glVertex2f(x1, y2-2.5); + + glEnd(); + + + /* slider handle center */ + glShadeModel(GL_SMOOTH); + glBegin(GL_QUADS); + + BIF_ThemeColor(TH_BUT_NUM); + glVertex2f(x1+fac-3, y1+2); + glVertex2f(x1+fac, y1+4); + BIF_ThemeColorShade(TH_BUT_NUM, +80); + glVertex2f(x1+fac, y2-2); + glVertex2f(x1+fac-3, y2-2); + + glEnd(); + + /* slider handle left bevel */ + BIF_ThemeColorShade(TH_BUT_NUM, +80); + fdrawline(x1+fac-3, y2-2, x1+fac-3, y1+2); + + /* slider handle right bevel */ + BIF_ThemeColorShade(TH_BUT_NUM, -45); + fdrawline(x1+fac, y2-2, x1+fac, y1+2); + + glShadeModel(GL_FLAT); +} + +/* default theme callback */ +static void ui_draw_default(int type, int colorid, float aspect, float x1, float y1, float x2, float y2, int flag) +{ + + switch(type) { + case NUM: + ui_default_num(colorid, aspect, x1, y1, x2, y2, flag); + break; + case TEX: + ui_default_text(colorid, aspect, x1, y1, x2, y2, flag); + break; + case ICONROW: + case ICONTEXTROW: + ui_default_iconrow(colorid, aspect, x1, y1, x2, y2, flag); + break; + case MENU: + ui_default_menu(colorid, aspect, x1, y1, x2, y2, flag); + break; + default: + ui_default_button(colorid, aspect, x1, y1, x2, y2, flag); + } + +} + +/* *************** MINIMAL THEME AND STANDARD PULLDOWN ***************** */ + +// theme can define an embosfunc and sliderfunc, text drawing is standard, no theme. + + +/* super minimal button as used in logic menu */ +static void ui_draw_minimal(int type, int colorid, 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_ThemeColorShade(colorid, -40); + else BIF_ThemeColorShade(colorid, -30); + } + else { + if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, +10); + else BIF_ThemeColor(colorid); + } + + glRectf(x1, y1, x2, y2); + + if(flag & UI_SELECT) { + BIF_ThemeColorShade(colorid, -50); + + /* top */ + fdrawline(x1, y2, x2, y2); + /* left */ + fdrawline(x1, y1, x1, y2); + BIF_ThemeColorShade(colorid, +50); + + /* below */ + fdrawline(x1, y1, x2, y1); + /* right */ + fdrawline(x2, y1, x2, y2); + } + else { + BIF_ThemeColorShade(colorid, +50); + + /* top */ + fdrawline(x1, y2, x2, y2); + /* left */ + fdrawline(x1, y1, x1, y2); + + BIF_ThemeColorShade(colorid, -50); + /* below */ + fdrawline(x1, y1, x2, y1); + /* right */ + fdrawline(x2, y1, x2, y2); + } +} + + +/* fac is the slider handle position between x1 and x2 */ +static void ui_draw_slider(int colorid, float fac, float aspect, float x1, float y1, float x2, float y2, int flag) +{ + float ymid, yc; + + /* the slider background line */ + ymid= (y1+y2)/2.0; + yc= 1.7*aspect; + + if(flag & UI_ACTIVE) + BIF_ThemeColorShade(colorid, -50); + else + BIF_ThemeColorShade(colorid, -40); + + glRectf(x1, ymid-yc, x2, ymid+yc); + + + /* the movable slider */ + if(flag & UI_ACTIVE) + BIF_ThemeColorShade(colorid, +50); + else + BIF_ThemeColorShade(colorid, +40); + + glRectf(x1+fac-aspect, ymid-yc, x1+fac+aspect, ymid+yc); + +} + +/* ************** STANDARD MENU DRAWING FUNCTION (no callback yet) ************* */ + + +// background for pulldowns, pullups, and other frontbuffer drawing temporal menus.... +// has to be made themable still (now only color) + +void uiDrawMenuBox(float minx, float miny, float maxx, float maxy) +{ + BIF_ThemeColor(TH_MENU_BACK); + + glRectf(minx, miny, maxx, maxy); + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + + glColor4ub(0, 0, 0, 100); + fdrawline(minx+4, miny, maxx+1, miny); + fdrawline(maxx+1, miny, maxx+1, maxy-4); + + glColor4ub(0, 0, 0, 80); + fdrawline(minx+4, miny-1, maxx+1, miny-1); + fdrawline(maxx+1, miny-1, maxx+1, maxy-4); + + glColor4ub(0, 0, 0, 55); + fdrawline(minx+4, miny-2, maxx+2, miny-2); + fdrawline(maxx+2, miny-2, maxx+2, maxy-4); + + glColor4ub(0, 0, 0, 35); + fdrawline(minx+4, miny-3, maxx+3, miny-3); + fdrawline(maxx+3, miny-3, maxx+3, maxy-4); + + glColor4ub(0, 0, 0, 20); + fdrawline(minx+4, miny-4, maxx+4, miny-4); + fdrawline(maxx+4, miny-4, maxx+4, maxy-4); + + glDisable(GL_BLEND); +} + + + +/* pulldown menu */ +static void ui_draw_pulldown(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag) +{ + + if(flag & UI_ACTIVE) { + BIF_ThemeColor(TH_MENU_HILITE); + glRectf(x1-1, y1, x2+2, y2); + + } else { + BIF_ThemeColor(colorid); // is set at TH_MENU_ITEM when pulldown opened. + glRectf(x1-1, y1, x2+2, y2); + } + +} + + + + +/* ************** TEXT AND ICON DRAWING FUNCTIONS ************* */ + + + +/* draws text and icons for buttons */ +static void ui_draw_text_icon(uiBut *but) +{ + float x; + int len; + char *cpoin; + + /* check for button text label */ + if (but->type == ICONTEXTROW) { + ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd)); + } + else if(but->drawstr[0]!=0) { + + // text button cursor + if(but->pos != -1) { + short t, pos, ch; + + pos= but->pos+strlen(but->str); + if(pos >= but->ofs) { + ch= but->drawstr[pos]; + but->drawstr[pos]= 0; + + t= but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, (U.transopts & TR_BUTTONS)) + 3; + + but->drawstr[pos]= ch; + glColor3ub(255,0,0); + + glRects(but->x1+t, but->y1+2, but->x1+t+3, but->y2-2); + } + } + // cut string in 2 parts + cpoin= strchr(but->drawstr, '|'); + if(cpoin) *cpoin= 0; + + /* If there's an icon too (made with uiDefIconTextBut) then draw the icon + and offset the text label to accomodate it */ + + if ( (but->flag & UI_HAS_ICON) && (but->flag & UI_ICON_LEFT) ) { + ui_draw_icon(but, but->icon); + + if(but->flag & UI_TEXT_LEFT) x= but->x1+24.0; + else x= (but->x1+but->x2-but->strwidth+1)/2.0; + } + else { + if(but->flag & UI_TEXT_LEFT) x= but->x1+4.0; + else x= (but->x1+but->x2-but->strwidth+1)/2.0; + } + + /* text color, with pulldown item exception */ + if(but->embossfunc==ui_draw_pulldown) { + if(but->flag & (UI_SELECT|UI_ACTIVE)) { + BIF_ThemeColor(TH_MENU_TEXT_HI); + } else { + BIF_ThemeColor(TH_MENU_TEXT); + } + } + else { + if(but->flag & UI_SELECT) { + BIF_ThemeColor(TH_BUT_TEXT_HI); + } else { + BIF_ThemeColor(TH_BUT_TEXT); + } + } + + /* tog3 button exception */ + if(but->type==TOG3 && (but->flag & UI_SELECT)) { + int ok= 0; + + if( but->pointype==CHA ) { + if( BTST( *(but->poin+2), but->bitnr )) ok= 1; + } + else if( but->pointype ==SHO ) { + short *sp= (short *)but->poin; + if( BTST( sp[1], but->bitnr )) ok= 1; + } + + if (ok) glColor3ub(255, 255, 0); + } + + glRasterPos2f( x, (but->y1+but->y2- 9.0)/2.0); + BIF_DrawString(but->font, but->drawstr+but->ofs, (U.transopts & TR_BUTTONS)); + + /* part text right aligned */ + if(cpoin) { + len= BIF_GetStringWidth(but->font, cpoin+1, (U.transopts & TR_BUTTONS)); + glRasterPos2f( but->x2 - len*but->aspect-3, (but->y1+but->y2- 9.0)/2.0); + BIF_DrawString(but->font, cpoin+1, (U.transopts & TR_BUTTONS)); + *cpoin= '|'; + } + } + /* if there's no text label, then check to see if there's an icon only and draw it */ + else if( but->flag & UI_HAS_ICON ) { + ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd)); + } + +} + +static void ui_draw_but_COL(uiBut *but) +{ + float *fp; + char colr, colg, colb; + + if( but->pointype==FLO ) { + fp= (float *)but->poin; + colr= floor(255.0*fp[0]+0.5); + colg= floor(255.0*fp[1]+0.5); + colb= floor(255.0*fp[2]+0.5); + } + else { + char *cp= (char *)but->poin; + colr= cp[0]; + colg= cp[1]; + colb= cp[2]; + } + glColor3ub(colr, colg, colb); + glRectf((but->x1), (but->y1), (but->x2), (but->y2)); + glColor3ub(0, 0, 0); + fdrawbox((but->x1), (but->y1), (but->x2), (but->y2)); + +} + + +/* ************** MAIN CALLBACK FUNCTION ************* */ + +/* +void ui_set_embossfunc_old(uiBut *but, int drawtype) +{ + +} +*/ + +/* nothing! */ +static void ui_draw_nothing(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag) +{ +} + + +/* ************** EXTERN, called from interface.c ************* */ + +/* ************** the main drawingtype choice: ************* */ + +void ui_set_embossfunc(uiBut *but, int drawtype) +{ + // standard builtin + if(but->type==LABEL) but->embossfunc= ui_draw_nothing; + else if(drawtype==UI_EMBOSSM) but->embossfunc= ui_draw_minimal; + else if(drawtype==UI_EMBOSSN) but->embossfunc= ui_draw_nothing; + else if(drawtype==UI_EMBOSSP) but->embossfunc= ui_draw_pulldown; + else { + int theme= BIF_GetThemeValue(TH_BUT_DRAWTYPE); + + // and the themes + if(theme==1) { + but->embossfunc= ui_draw_default; + but->sliderfunc= ui_default_slider; + } + else { + but->embossfunc= ui_draw_minimal; + but->sliderfunc= ui_draw_slider; + } + } +} + + +void ui_draw_but(uiBut *but) +{ + double value; + float x1, x2, y1, y2, fac; + + if(but==0) return; + + if(but->block->frontbuf==UI_NEED_DRAW_FRONT) { + but->block->frontbuf= UI_HAS_DRAW_FRONT; + + glDrawBuffer(GL_FRONT); + if(but->win==curarea->headwin) curarea->head_swap= WIN_FRONT_OK; + else curarea->win_swap= WIN_FRONT_OK; + } + + switch (but->type) { + + case NUMSLI: + case HSVSLI: + + but->embossfunc(but->type, but->themecol, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag); + ui_draw_text_icon(but); + + x1= (but->x1+but->x2)/2; + x2= but->x2 - 5.0*but->aspect; + y1= but->y1 + 2.0*but->aspect; + y2= but->y2 - 2.0*but->aspect; + + value= ui_get_but_val(but); + fac= (value-but->min)*(x2-x1)/(but->max - but->min); + + but->sliderfunc(but->themecol, fac, but->aspect, x1, y1, x2, y2, but->flag); + break; + + case SEPR: + // only background + break; + + case COL: + ui_draw_but_COL(but); // black box with color + break; + + case LINK: + case INLINK: + ui_draw_icon(but, but->icon); + break; + + default: + but->embossfunc(but->type, but->themecol, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag); + ui_draw_text_icon(but); + + } +} + + + + diff --git a/source/blender/src/interface_panel.c b/source/blender/src/interface_panel.c index 09f30f66944..0ae12e3ab86 100644 --- a/source/blender/src/interface_panel.c +++ b/source/blender/src/interface_panel.c @@ -97,56 +97,6 @@ static void stow_unstow(uiBlock *block); /* --------- generic helper drawng calls ---------------- */ -/* supposes you draw the actual box atop of this. */ -void uiSoftShadow(float minx, float miny, float maxx, float maxy, float rad, int alpha) -{ - - glShadeModel(GL_SMOOTH); - glEnable(GL_BLEND); - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - - /* quads start left-top, clockwise */ - - /* left */ - glBegin(GL_POLYGON); - glColor4ub(0, 0, 0, 0); - glVertex2f( minx-rad, maxy-rad); - glColor4ub(0, 0, 0, alpha); - glVertex2f( minx+rad, maxy-rad); - glColor4ub(0, 0, 0, alpha); - glVertex2f( minx+rad, miny+rad); - glColor4ub(0, 0, 0, 0); - glVertex2f( minx-rad, miny-rad); - glEnd(); - - /* bottom */ - glBegin(GL_POLYGON); - glColor4ub(0, 0, 0, alpha); - glVertex2f( minx+rad, miny+rad); - glColor4ub(0, 0, 0, alpha); - glVertex2f( maxx-rad, miny+rad); - glColor4ub(0, 0, 0, 0); - glVertex2f( maxx+rad, miny-rad); - glColor4ub(0, 0, 0, 0); - glVertex2f( minx-rad, miny-rad); - glEnd(); - - /* right */ - glBegin(GL_POLYGON); - glColor4ub(0, 0, 0, alpha); - glVertex2f( maxx-rad, maxy-rad); - glColor4ub(0, 0, 0, 0); - glVertex2f( maxx+rad, maxy-rad); - glColor4ub(0, 0, 0, 0); - glVertex2f( maxx+rad, miny-rad); - glColor4ub(0, 0, 0, alpha); - glVertex2f( maxx-rad, miny+rad); - glEnd(); - - glDisable(GL_BLEND); - glShadeModel(GL_FLAT); -} - #define UI_RB_ALPHA 16 static int roundboxtype= 15; @@ -764,7 +714,7 @@ static void ui_draw_panel_header(uiBlock *block) BIF_ThemeColor(TH_TEXT_HI); glRasterPos2f(4+block->minx+pnl_icons, block->maxy+5); - BIF_DrawString(block->curfont, block->panel->panelname, (U.transopts & TR_BUTTONS), 1); + BIF_DrawString(block->curfont, block->panel->panelname, (U.transopts & TR_BUTTONS)); return; } @@ -782,7 +732,7 @@ static void ui_draw_panel_header(uiBlock *block) BIF_ThemeColor(TH_TEXT); glRasterPos2f(16+pnl_icons+a*width, panel->sizey+4); str= ui_block_cut_str(block, pa->panelname, (short)(width-10)); - BIF_DrawString(block->curfont, str, (U.transopts & TR_BUTTONS), 0); + BIF_DrawString(block->curfont, str, (U.transopts & TR_BUTTONS)); a++; } @@ -795,7 +745,7 @@ static void ui_draw_panel_header(uiBlock *block) BIF_ThemeColor(TH_TEXT_HI); glRasterPos2f(16+pnl_icons+a*width, panel->sizey+4); str= ui_block_cut_str(block, pa->panelname, (short)(width-10)); - BIF_DrawString(block->curfont, str, (U.transopts & TR_BUTTONS), 1); + BIF_DrawString(block->curfont, str, (U.transopts & TR_BUTTONS)); a++; } @@ -833,7 +783,7 @@ void ui_draw_panel(uiBlock *block) if(panel->control & UI_PNL_CLOSE) ofsx+= PNL_ICON; BIF_ThemeColor(TH_TEXT_HI); glRasterPos2f(4+block->minx+ofsx, block->maxy+5); - BIF_DrawString(block->curfont, panel->panelname, (U.transopts & TR_BUTTONS), 1); + BIF_DrawString(block->curfont, panel->panelname, (U.transopts & TR_BUTTONS)); // border if(panel->flag & PNL_SELECT) { @@ -863,7 +813,7 @@ void ui_draw_panel(uiBlock *block) str[0]= panel->panelname[a]; if( isupper(str[0]) ) { glRasterPos2f(block->minx+5, block->maxy-ofs); - BIF_DrawString(block->curfont, str, 0, 1); + BIF_DrawString(block->curfont, str, 0); ofs+= 15; } } diff --git a/source/blender/src/language.c b/source/blender/src/language.c index cdfc9c9b218..a8918c3862f 100644 --- a/source/blender/src/language.c +++ b/source/blender/src/language.c @@ -67,32 +67,16 @@ static LANGMenuEntry *langmenu= 0; static int tot_lang = 0; #endif // INTERNATIONAL -int BIF_DrawString(BMF_Font* font, char *str, int translate, int col) -{ - -#ifdef INTERNATIONAL - if(G.ui_international == TRUE) - if(translate) - return FTF_DrawString(str, FTF_USE_GETTEXT | FTF_INPUT_UTF8, col); - else - return FTF_DrawString(str, FTF_NO_TRANSCONV | FTF_INPUT_UTF8, col); - else - return BMF_DrawString(font, str); -#else - return BMF_DrawString(font, str); -#endif - -} -int BIF_DrawStringRGB(BMF_Font* font, char *str, int translate, float r, float g, float b) +int BIF_DrawString(BMF_Font* font, char *str, int translate) { #ifdef INTERNATIONAL if(G.ui_international == TRUE) if(translate) - return FTF_DrawStringRGB(str, FTF_USE_GETTEXT | FTF_INPUT_UTF8, r, g, b); + return FTF_DrawString(str, FTF_USE_GETTEXT | FTF_INPUT_UTF8); else - return FTF_DrawStringRGB(str, FTF_NO_TRANSCONV | FTF_INPUT_UTF8, r, g, b); + return FTF_DrawString(str, FTF_NO_TRANSCONV | FTF_INPUT_UTF8); else return BMF_DrawString(font, str); #else diff --git a/source/blender/src/resources.c b/source/blender/src/resources.c index 0c9702abc34..1555dd9bc56 100644 --- a/source/blender/src/resources.c +++ b/source/blender/src/resources.c @@ -61,11 +61,16 @@ #include "blendef.h" // CLAMP #include "datatoc.h" +/* global for themes */ +static bTheme *theme_active=NULL; +static int theme_spacetype= SPACE_VIEW3D; + typedef struct { unsigned char *data; int w, h; } Icon; + static Icon *icon_from_data(unsigned char *rect, int w, int h, int rowstride) { Icon *icon= MEM_mallocN(sizeof(*icon), "internicon"); @@ -81,10 +86,14 @@ static void icon_draw(Icon *icon) { glDrawPixels(icon->w, icon->h, GL_RGBA, GL_UNSIGNED_BYTE, icon->data); } + +#if 0 + static unsigned char colclamp(int val) { return (val<0)?(0):((val>255)?255:val); } + static void icon_draw_blended(Icon *icon, unsigned char blendcol[3]) { unsigned char temprect[20*21*4]; /* XXX, not so safe */ @@ -113,67 +122,41 @@ static void icon_draw_blended(Icon *icon, unsigned char blendcol[3]) glDrawPixels(icon->w, icon->h, GL_RGBA, GL_UNSIGNED_BYTE, temprect); } -static void icon_free(Icon *icon) -{ - MEM_freeN(icon->data); - MEM_freeN(icon); -} - -/***/ - -typedef struct { - unsigned char cols[BIFNCOLORSHADES][3]; -} Color; - -static Color *common_colors_arr= NULL; +#endif -static unsigned char *get_color(BIFColorID colorid, BIFColorShade shade) +static void icon_draw_blended(Icon *icon, char *blendcol, int shade) { - int coloridx= colorid-BIFCOLORID_FIRST; - int shadeidx= shade-BIFCOLORSHADE_FIRST; + float r, g, b; - if (coloridx>=0 && coloridx=0 && shadeidx0.0?r:0.0); +// glPixelTransferf(GL_GREEN_SCALE, g>0.0?g:0.0); +// glPixelTransferf(GL_BLUE_SCALE, b>0.0?b:0.0); - return errorcol; + if(shade < 0) { + r= (128+shade)/128.0; + glPixelTransferf(GL_ALPHA_SCALE, r); } -} -void BIF_set_color(BIFColorID colorid, BIFColorShade shade) -{ - glColor3ubv(get_color(colorid, shade)); -} + glDrawPixels(icon->w, icon->h, GL_RGBA, GL_UNSIGNED_BYTE, icon->data); + +// glPixelTransferf(GL_RED_SCALE, 1.0); +// glPixelTransferf(GL_GREEN_SCALE, 1.0); +// glPixelTransferf(GL_BLUE_SCALE, 1.0); + glPixelTransferf(GL_ALPHA_SCALE, 1.0); -static void rgbaCCol_addNT(unsigned char *t, unsigned char *a, int N) -{ - t[0]= colclamp(a[0]+N); - t[1]= colclamp(a[1]+N); - t[2]= colclamp(a[2]+N); - } -static void def_col(BIFColorID colorid, unsigned char r, unsigned char g, unsigned char b) + + +static void icon_free(Icon *icon) { - int coloridx= colorid-BIFCOLORID_FIRST; - if (coloridx>=0 && coloridxdata); + MEM_freeN(icon); } -/***/ static Icon **common_icons_arr= NULL; @@ -199,14 +182,18 @@ void BIF_draw_icon(BIFIconID icon) { icon_draw(get_icon(icon)); } -void BIF_draw_icon_blended(BIFIconID icon, BIFColorID color, BIFColorShade shade) + +void BIF_draw_icon_blended(BIFIconID icon, int colorid, int shade) { - icon_draw_blended(get_icon(icon), get_color(color, shade)); + char *cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); + icon_draw_blended(get_icon(icon), cp, shade); } + int BIF_get_icon_width(BIFIconID icon) { return get_icon(icon)->w; } + int BIF_get_icon_height(BIFIconID icon) { return get_icon(icon)->h; @@ -246,7 +233,6 @@ void BIF_resources_init(void) int x, y; common_icons_arr= MEM_mallocN(sizeof(*common_icons_arr)*BIFNICONIDS, "common_icons"); - common_colors_arr= MEM_mallocN(sizeof(*common_colors_arr)*BIFNCOLORIDS, "common_colors"); for (y=0; y<10; y++) { for (x=0; x<21; x++) { @@ -274,60 +260,13 @@ void BIF_resources_init(void) } } - IMB_freeImBuf(bbuf); - - def_col(BUTGREY, 0x90,0x90,0x90); - def_col(BUTGREEN, 0x88,0xA0,0xA4); - def_col(BUTBLUE, 0xA0,0xA0,0xB0); - def_col(BUTSALMON, 0xB0,0xA0,0x90); - def_col(MIDGREY, 0xB0,0xB0,0xB0); - def_col(BUTPURPLE, 0xA2,0x98,0xA9); - def_col(BUTYELLOW, 0xB2,0xB2,0x99); - def_col(BUTRUST, 0x80,0x70,0x70); - def_col(REDALERT, 0xB0,0x40,0x40); - def_col(BUTWHITE, 0xD0,0xD0,0xD0); - def_col(BUTDBLUE, 0x80,0x80,0xA0); - def_col(BUTDPINK, 0xAA,0x88,0x55); - def_col(BUTPINK, 0xE8,0xBD,0xA7); - def_col(BUTMACTIVE, 0x30,0x30,0x30); - - def_col(ACTIONBUTCOL, 0x88,0x88,0x88); - def_col(NUMBUTCOL, 0x88,0x88,0x88); - def_col(TEXBUTCOL, 0x88,0x88,0x88); - def_col(TOGBUTCOL, 0x88,0x88,0x88); - def_col(SLIDERCOL, 0x88,0x88,0x88); - def_col(TABCOL, 0x88,0x88,0x88); - def_col(MENUCOL, 0xCF,0xCF,0xCF); - def_col(MENUACTIVECOL, 0x80,0x80,0x80); - - def_col(BUTIPO, 0xB0,0xB0,0x99); - def_col(BUTAUDIO, 0xB0,0xA0,0x90); - def_col(BUTCAMERA, 0x99,0xB2,0xA5); - def_col(BUTRANDOM, 0xA9,0x9A,0x98); - def_col(BUTEDITOBJECT, 0xA2,0x98,0xA9); - def_col(BUTPROPERTY, 0xA0,0xA0,0xB0); - def_col(BUTSCENE, 0x99,0x99,0xB2); - def_col(BUTMOTION, 0x98,0xA7,0xA9); - def_col(BUTMESSAGE, 0x88,0xA0,0x94); - def_col(BUTACTION, 0xB2,0xA9,0x99); - def_col(BUTVISIBILITY, 0xB2,0xA9,0x99); - def_col(BUTCD, 0xB0,0x95,0x90); - def_col(BUTGAME, 0x99,0xB2,0x9C); - def_col(BUTYUCK, 0xB0,0x99,0xB0); - def_col(BUTSEASICK, 0x99,0xB0,0xB0); - def_col(BUTCHOKE, 0x88,0x94,0xA0); - def_col(BUTIMPERIAL, 0x94,0x88,0xA0); - - def_col(HEADERCOL, 165, 165, 165); - def_col(HEADERCOLSEL, 185, 185, 185); - + IMB_freeImBuf(bbuf); } void BIF_resources_free(void) { free_common_icons(); - MEM_freeN(common_colors_arr); MEM_freeN(common_icons_arr); } @@ -337,17 +276,58 @@ void BIF_resources_free(void) /* THEMES */ /* ******************************************************** */ - char *BIF_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid) { ThemeSpace *ts= NULL; - char error[3]={240, 0, 240}; + static char error[3]={240, 0, 240}; + static char alert[3]={240, 60, 60}; + static char headerdesel[3]; + char *cp= error; if(btheme) { + // first check for ui buttons theme if(colorid < TH_THEMEUI) { + + switch(colorid) { + case TH_BUT_NEUTRAL: + cp= btheme->tui.neutral; break; + case TH_BUT_ACTION: + cp= btheme->tui.action; break; + case TH_BUT_SETTING: + cp= btheme->tui.setting; break; + case TH_BUT_SETTING1: + cp= btheme->tui.setting1; break; + case TH_BUT_SETTING2: + cp= btheme->tui.setting2; break; + case TH_BUT_NUM: + cp= btheme->tui.num; break; + case TH_BUT_TEXTFIELD: + cp= btheme->tui.textfield; break; + case TH_BUT_POPUP: + cp= btheme->tui.popup; break; + case TH_BUT_TEXT: + cp= btheme->tui.text; break; + case TH_BUT_TEXT_HI: + cp= btheme->tui.text_hi; break; + case TH_MENU_BACK: + cp= btheme->tui.menu_back; break; + case TH_MENU_ITEM: + cp= btheme->tui.menu_item; break; + case TH_MENU_HILITE: + cp= btheme->tui.menu_hilite; break; + case TH_MENU_TEXT: + cp= btheme->tui.menu_text; break; + case TH_MENU_TEXT_HI: + cp= btheme->tui.menu_text_hi; break; + case TH_BUT_DRAWTYPE: + cp= &btheme->tui.but_drawtype; break; + + case TH_REDALERT: + cp= alert; break; + } } else { @@ -378,6 +358,14 @@ char *BIF_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid) cp= ts->text_hi; break; case TH_HEADER: cp= ts->header; break; + case TH_HEADERDESEL: + /* we calculate a dynamic builtin header deselect color, also for pulldowns... */ + cp= ts->header; + headerdesel[0]= cp[0]>20?cp[0]-20:0; + headerdesel[1]= cp[1]>20?cp[1]-20:0; + headerdesel[2]= cp[2]>20?cp[2]-20:0; + cp= headerdesel; + break; case TH_PANEL: cp= ts->panel; break; case TH_SHADE1: @@ -439,8 +427,26 @@ void BIF_InitTheme(void) } BIF_SetTheme(NULL); // make sure the global used in this file is set - + /* UI buttons (todo) */ + SETCOL(btheme->tui.neutral, 0xA0,0xA0,0xA0, 255); + SETCOL(btheme->tui.action, 0xB0,0xA0,0x90, 255); + SETCOL(btheme->tui.setting, 0x88,0xA0,0xA4, 255); + SETCOL(btheme->tui.setting1, 0xA0,0xA0,0xB0, 255); + SETCOL(btheme->tui.setting2, 0xA2,0x98,0xA9, 255); + SETCOL(btheme->tui.num, 0x90,0x90,0x90, 255); + SETCOL(btheme->tui.textfield, 0x90,0x90,0x90, 255); + SETCOL(btheme->tui.popup, 0xB2,0xB2,0xA9, 255); + + SETCOL(btheme->tui.text, 0,0,0, 255); + SETCOL(btheme->tui.text_hi, 255, 255, 255, 255); + + SETCOL(btheme->tui.menu_back, 0xCF,0xCF,0xCF, 255); + SETCOL(btheme->tui.menu_item, 0xDA,0xDA,0xDA, 255); + SETCOL(btheme->tui.menu_hilite, 0x7F,0x7F,0x7F, 255); + SETCOL(btheme->tui.menu_text, 0, 0, 0, 255); + SETCOL(btheme->tui.menu_text_hi, 255, 255, 255, 255); + btheme->tui.but_drawtype= 1; /* space view3d */ SETCOL(btheme->tv3d.back, 115, 115, 115, 255); @@ -518,13 +524,30 @@ char *BIF_ThemeColorsPup(int spacetype) char str[32]; if(spacetype==0) { - strcpy(cp, "Not Yet"); + sprintf(str, "Neutral %%x%d|", TH_BUT_NEUTRAL); strcat(cp, str); + sprintf(str, "Action %%x%d|", TH_BUT_ACTION); strcat(cp, str); + sprintf(str, "Setting %%x%d|", TH_BUT_SETTING); strcat(cp, str); + sprintf(str, "Special Setting 1%%x%d|", TH_BUT_SETTING1); strcat(cp, str); + sprintf(str, "Special Setting 2 %%x%d|", TH_BUT_SETTING2); strcat(cp, str); + sprintf(str, "Number Input %%x%d|", TH_BUT_NUM); strcat(cp, str); + sprintf(str, "Text Input %%x%d|", TH_BUT_TEXTFIELD); strcat(cp, str); + sprintf(str, "Popup %%x%d|", TH_BUT_POPUP); strcat(cp, str); + sprintf(str, "Text %%x%d|", TH_BUT_TEXT); strcat(cp, str); + sprintf(str, "Text hilight %%x%d|", TH_BUT_TEXT_HI); strcat(cp, str); + strcat(cp,"%l|"); + sprintf(str, "Menu Background %%x%d|", TH_MENU_BACK); strcat(cp, str); + sprintf(str, "Menu Item %%x%d|", TH_MENU_ITEM); strcat(cp, str); + sprintf(str, "Menu Item hilight %%x%d|", TH_MENU_HILITE); strcat(cp, str); + sprintf(str, "Menu Text %%x%d|", TH_MENU_TEXT); strcat(cp, str); + sprintf(str, "Menu Text hilight %%x%d|", TH_MENU_TEXT_HI); strcat(cp, str); + strcat(cp,"%l|"); + sprintf(str, "Drawtype %%x%d|", TH_BUT_DRAWTYPE); strcat(cp, str); } else { // first defaults for each space sprintf(str, "Background %%x%d|", TH_BACK); strcat(cp, str); sprintf(str, "Text %%x%d|", TH_TEXT); strcat(cp, str); - sprintf(str, "Text Hilite %%x%d|", TH_TEXT_HI); strcat(cp, str); + sprintf(str, "Text hilight %%x%d|", TH_TEXT_HI); strcat(cp, str); sprintf(str, "Header %%x%d|", TH_HEADER); strcat(cp, str); if(spacetype==SPACE_VIEW3D) { @@ -562,9 +585,6 @@ char *BIF_ThemeColorsPup(int spacetype) return cp; } -static bTheme *theme_active=NULL; -static int theme_spacetype= SPACE_VIEW3D; - void BIF_SetTheme(ScrArea *sa) { if(sa==NULL) { // called for safety, when delete themes @@ -634,7 +654,7 @@ void BIF_ThemeColorBlend(int colorid1, int colorid2, float fac) // get individual values, not scaled -float BIF_GetThemeColorf(int colorid) +float BIF_GetThemeValuef(int colorid) { char *cp; @@ -643,6 +663,17 @@ float BIF_GetThemeColorf(int colorid) } +// get individual values, not scaled +int BIF_GetThemeValue(int colorid) +{ + char *cp; + + cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); + return ((int) cp[0]); + +} + + // get the color, range 0.0-1.0 void BIF_GetThemeColor3fv(int colorid, float *col) { diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 898d8fd5b29..19b52ac5b01 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -303,6 +303,7 @@ void space_set_commmandline_options(void) { } } +#if GAMEBLENDER == 1 /** * These two routines imported from the gameengine, * I suspect a lot of the resetting stuff is cruft @@ -365,6 +366,7 @@ static void restore_all_scene_cfra(LinkNode *storelist) { BLI_linklist_free(storelist, NULL); } +#endif void start_game(void) { @@ -1552,7 +1554,7 @@ void info_user_themebuts(uiBlock *block, short y1, short y2, short y3) int spacetype= 0; static short cur=1, curmain=2; short a, tot=0, isbuiltin= 0; - char string[20*32], *strp; + char string[20*32], *strp, *col; y3= y2+23; // exception! @@ -1585,12 +1587,11 @@ void info_user_themebuts(uiBlock *block, short y1, short y2, short y3) uiDefButS(block, MENU, B_UPDATE_THEME, string, 45,y3,200,20, &cur, 0, 0, 0, 0, "Current theme"); /* add / delete / name */ - uiBlockSetCol(block, BUTSALMON); + if(tot<16) uiDefBut(block, BUT, B_ADD_THEME, "Add", 45,y2,200,20, NULL, 0, 0, 0, 0, "Makes new copy of this theme"); if(tot>1 && isbuiltin==0) uiDefBut(block, BUT, B_DEL_THEME, "Delete", 45,y1,200,20, NULL, 0, 0, 0, 0, "Delete theme"); - uiBlockSetCol(block, BUTGREY); if(isbuiltin) return; @@ -1600,55 +1601,53 @@ void info_user_themebuts(uiBlock *block, short y1, short y2, short y3) /* main choices pup */ uiDefButS(block, MENU, B_CHANGE_THEME, "UI and Buttons %x1|3D View %x2|Ipo Window %x3|Buttons Window %x4|File Window %x5", 255,y2,200,20, &curmain, 0, 0, 0, 0, "Specify theme for..."); - if(curmain==2) spacetype= SPACE_VIEW3D; - if(curmain==3) spacetype= SPACE_IPO; - if(curmain==4) spacetype= SPACE_BUTS; - if(curmain==5) spacetype= SPACE_FILE; - + if(curmain==1) spacetype= 0; + else if(curmain==2) spacetype= SPACE_VIEW3D; + else if(curmain==3) spacetype= SPACE_IPO; + else if(curmain==4) spacetype= SPACE_BUTS; + else if(curmain==5) spacetype= SPACE_FILE; + else return; // only needed while coding... when adding themes for more windows + /* color choices pup */ - if(curmain==1) strp= BIF_ThemeColorsPup(0); + if(curmain==1) { + strp= BIF_ThemeColorsPup(0); + if(th_curcol==TH_BACK) th_curcol= TH_BUT_NEUTRAL; // switching main choices... + } else strp= BIF_ThemeColorsPup(spacetype); + uiDefButS(block, MENU, B_REDR, strp, 255,y1,200,20, &th_curcol, 0, 0, 0, 0, "Current color"); MEM_freeN(strp); - /* always make zero, ugly global... */ - th_curcol_ptr= NULL; + th_curcol_ptr= col= BIF_ThemeGetColorPtr(btheme, spacetype, th_curcol); + if(col==NULL) return; - /* sliders */ - if(curmain==1); + /* first handle exceptions, special single values, row selection, etc */ + if(th_curcol==TH_VERTEX_SIZE) { + uiDefButC(block, NUMSLI, B_UPDATE_THEME,"Vertex size ", 465,y3,200,20, col, 1.0, 10.0, 0, 0, ""); + } + else if(th_curcol==TH_BUT_DRAWTYPE) { + uiDefButC(block, ROW, B_UPDATE_THEME, "Minimal", 465,y3,200,20, col, 2.0, 0.0, 0, 0, ""); + uiDefButC(block, ROW, B_UPDATE_THEME, "Default", 465,y2,200,20, col, 2.0, 1.0, 0, 0, ""); + + } else { - char *col; - - th_curcol_ptr= col= BIF_ThemeGetColorPtr(btheme, spacetype, th_curcol); - - if(col && th_curcol==TH_VERTEX_SIZE) { - uiDefButC(block, NUMSLI, B_UPDATE_THEME,"Vertex size ", 465,y3,200,20, col, 1.0, 10.0, B_THEMECOL, 0, ""); + uiDefButC(block, NUMSLI, B_UPDATE_THEME,"R ", 465,y3,200,20, col, 0.0, 255.0, B_THEMECOL, 0, ""); + uiDefButC(block, NUMSLI, B_UPDATE_THEME,"G ", 465,y2,200,20, col+1, 0.0, 255.0, B_THEMECOL, 0, ""); + uiDefButC(block, NUMSLI, B_UPDATE_THEME,"B ", 465,y1,200,20, col+2, 0.0, 255.0, B_THEMECOL, 0, ""); + + uiDefButC(block, COL, B_THEMECOL, "", 675,y1,50,y3-y1+20, col, 0, 0, 0, 0, ""); + if ELEM3(th_curcol, TH_PANEL, TH_FACE, TH_FACE_SELECT) { + uiDefButC(block, NUMSLI, B_UPDATE_THEME,"A ", 465,y3+25,200,20, col+3, 0.0, 255.0, B_THEMECOL, 0, ""); } - else if(col) { - uiDefButC(block, NUMSLI, B_UPDATE_THEME,"R ", 465,y3,200,20, col, 0.0, 255.0, B_THEMECOL, 0, ""); - uiDefButC(block, NUMSLI, B_UPDATE_THEME,"G ", 465,y2,200,20, col+1, 0.0, 255.0, B_THEMECOL, 0, ""); - uiDefButC(block, NUMSLI, B_UPDATE_THEME,"B ", 465,y1,200,20, col+2, 0.0, 255.0, B_THEMECOL, 0, ""); - - uiDefButC(block, COL, B_THEMECOL, "", 675,y1,50,y3-y1+20, col, 0, 0, 0, 0, ""); - - if ELEM3(th_curcol, TH_PANEL, TH_FACE, TH_FACE_SELECT) { - uiDefButC(block, NUMSLI, B_UPDATE_THEME,"A ", 465,y3+25,200,20, col+3, 0.0, 255.0, B_THEMECOL, 0, ""); - } - - /* copy paste */ - uiBlockSetCol(block, BUTSALMON); - uiDefBut(block, BUT, B_THEME_COPY, "Copy Color", 755,y2,120,20, NULL, 0, 0, 0, 0, "Stores current color in buffer"); - uiDefBut(block, BUT, B_THEME_PASTE, "Paste Color", 755,y1,120,20, NULL, 0, 0, 0, 0, "Pastes buffer color"); + + /* copy paste */ + uiDefBut(block, BUT, B_THEME_COPY, "Copy Color", 755,y2,120,20, NULL, 0, 0, 0, 0, "Stores current color in buffer"); + uiDefBut(block, BUT, B_THEME_PASTE, "Paste Color", 755,y1,120,20, NULL, 0, 0, 0, 0, "Pastes buffer color"); - uiDefButC(block, COL, 0, "", 885,y1,50,y2-y1+20, th_curcol_arr, 0, 0, 0, 0, ""); - - } + uiDefButC(block, COL, 0, "", 885,y1,50,y2-y1+20, th_curcol_arr, 0, 0, 0, 0, ""); + } - - - - uiClearButLock(); } @@ -1670,7 +1669,7 @@ void drawinfospace(ScrArea *sa, void *spacedata) myortho2(0.0, 1280.0, 0.0, curarea->winy/fac); sprintf(naam, "infowin %d", curarea->win); - block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSSX, UI_HELV, curarea->win); + block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->win); dx= (1280-90)/7; /* spacing for use in equally dividing 'tab' row */ @@ -1704,7 +1703,7 @@ void drawinfospace(ScrArea *sa, void *spacedata) /* set the colour to blue and draw the main 'tab' controls */ - uiBlockSetCol(block, BUTBLUE); + uiBlockSetCol(block, TH_BUT_SETTING1); uiDefButI(block, ROW,B_USERPREF,"View & Controls", xpos,ypostab,(short)dx,buth, @@ -1734,8 +1733,7 @@ void drawinfospace(ScrArea *sa, void *spacedata) (short)(xpos+6*dx),ypostab,(short)dx,buth, &U.userpref,1.0,5.0, 0, 0,""); - uiBlockSetEmboss(block, UI_EMBOSSX); - uiBlockSetCol(block, BUTGREY); + uiBlockSetCol(block, TH_AUTO); /* end 'tab' controls */ @@ -1787,8 +1785,6 @@ void drawinfospace(ScrArea *sa, void *spacedata) - uiBlockSetCol(block, BUTGREEN); - uiDefBut(block, LABEL,0,"Menu Buttons:", (xpos+edgespace+medprefbut+(3*midspace)+(2*smallprefbut)),y3label,medprefbut,buth, 0, 0, 0, 0, 0, ""); @@ -1798,8 +1794,6 @@ void drawinfospace(ScrArea *sa, void *spacedata) &(U.uiflag), 0, 0, 0, 0, "Automatic opening of menu buttons"); - uiBlockSetCol(block, BUTGREY); - uiDefButS(block, NUM, 0, "ThresA:", (xpos+edgespace+medprefbut+(3*midspace)+(2*smallprefbut)),y1,smallprefbut,buth, &(U.menuthreshold1), 1, 40, 0, 0, @@ -1811,8 +1805,6 @@ void drawinfospace(ScrArea *sa, void *spacedata) "Time in 1/10 seconds for auto open sublevels"); - uiBlockSetCol(block, BUTGREEN); - uiDefButS(block, TOGN|BIT|10, B_DRAWINFO, "Rotate View", (xpos+edgespace+(4*midspace)+(4*medprefbut)),y2,(smallprefbut+2),buth, &(U.flag), 0, 0, 0, 0, "Default action for the middle mouse button"); @@ -1821,8 +1813,6 @@ void drawinfospace(ScrArea *sa, void *spacedata) (xpos+edgespace+(4*midspace)+(4*medprefbut)+smallprefbut+2),y2,(smallprefbut+2),buth, &(U.flag), 0, 0, 0, 0, "Default action for the middle mouse button"); - uiBlockSetCol(block, BUTGREY); - uiDefBut(block, LABEL,0,"Middle mouse button:", (xpos+edgespace+(3*midspace)+(4*medprefbut)),y3label,medprefbut,buth, 0, 0, 0, 0, 0, ""); @@ -1837,8 +1827,6 @@ void drawinfospace(ScrArea *sa, void *spacedata) (xpos+edgespace+(3*midspace)+(3*medprefbut)),y3label,medprefbut,buth, 0, 0, 0, 0, 0, ""); - uiBlockSetCol(block, BUTGREEN); - uiDefButS(block, TOG|BIT|5, B_DRAWINFO, "Trackball", (xpos+edgespace+(3*midspace)+(3*medprefbut)),y2,(smallprefbut+2),buth, &(U.flag), 0, 0, 0, 0, @@ -1849,8 +1837,6 @@ void drawinfospace(ScrArea *sa, void *spacedata) &(U.flag), 0, 0, 0, 0, "Use turntable style rotation with middle mouse button"); - uiBlockSetCol(block, BUTGREY); - uiDefBut(block, LABEL,0,"Mousewheel:", (xpos+edgespace+(4*midspace)+(5*medprefbut)),y3label,medprefbut,buth, 0, 0, 0, 0, 0, ""); @@ -1873,8 +1859,6 @@ void drawinfospace(ScrArea *sa, void *spacedata) xpos,y3label,medprefbut,buth, 0, 0, 0, 0, 0, ""); - uiBlockSetCol(block, BUTGREEN); - uiDefButS(block, TOGN|BIT|8, B_DRAWINFO, "ObData", (xpos+edgespace),y2,(smallprefbut+2),buth, &(U.flag), 0, 0, 0, 0, "Link new objects' material to the obData block"); @@ -1883,12 +1867,11 @@ void drawinfospace(ScrArea *sa, void *spacedata) (xpos+edgespace+smallprefbut+2),y2,(smallprefbut+2),buth, &(U.flag), 0, 0, 0, 0, "Link new objects' material to the object block"); - uiBlockSetCol(block, BUTGREY); - uiDefButS(block, NUMSLI, B_DRAWINFO, "UndoSteps:", (xpos+edgespace+2*smallprefbut+8),y2,(medprefbut+2),buth, &(U.undosteps), 1, 64, 0, 0, "Number of undo steps avail. in Editmode. Smaller conserves memory."); + uiDefBut(block, LABEL,0,"Auto keyframe on:", (xpos+edgespace+(2*medprefbut)+midspace),y3label,medprefbut,buth, 0, 0, 0, 0, 0, ""); @@ -1959,14 +1942,10 @@ void drawinfospace(ScrArea *sa, void *spacedata) (xpos+edgespace+medprefbut+midspace),y2,medprefbut,buth, 0, 0, 0, 0, 0, ""); - uiBlockSetCol(block, BUTSALMON); - uiDefBut(block, BUT, B_LOADUIFONT, "Select Font", xpos,y1,medprefbut,buth, 0, 0, 0, 0, 0, "Select a new font for the interface"); - uiBlockSetCol(block, BUTGREY); - uiDefButI(block, MENU|INT, B_SETFONTSIZE, fontsize_pup(), (xpos+edgespace+medprefbut+midspace),y1,medprefbut,buth, @@ -2019,15 +1998,11 @@ void drawinfospace(ScrArea *sa, void *spacedata) "Enables automatic saving of temporary files"); if(U.flag & AUTOSAVE) { - uiBlockSetCol(block, BUTSALMON); uiDefBut(block, BUT, B_LOADTEMP, "Open Recent", (xpos+edgespace),y1,medprefbut,buth, 0, 0, 0, 0, 0,"Opens the most recently saved temporary file"); - uiBlockSetCol(block, BUTGREY); - - uiDefButI(block, NUM, B_RESETAUTOSAVE, "Minutes:", (xpos+edgespace+medprefbut+midspace),y2,medprefbut,buth, &(U.savetime), 1.0, 60.0, 0, 0, diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c index 6b317fa2903..ef4a71d670b 100644 --- a/source/blender/src/toolbox.c +++ b/source/blender/src/toolbox.c @@ -843,7 +843,7 @@ void tbox_drawelem_text(x, y, type) } glRasterPos2i(x1+5, y1+tbfontyofs); - BIF_DrawString(G.font, tbstr, (U.transopts & TR_MENUS), (type==0 || type==2)?0:1); + BIF_DrawString(G.font, tbstr, (U.transopts & TR_MENUS)); if(keystr && keystr[0]) { if(type & 1) { @@ -852,12 +852,12 @@ void tbox_drawelem_text(x, y, type) glRecti(x2-len2-2, y1+2, x2-3, y2-2); ColorFunc(TBOXWHITE); glRasterPos2i(x2-len2, y1+tbfontyofs); - BIF_DrawString(G.font, keystr, (U.transopts & TR_MENUS), 1); + BIF_DrawString(G.font, keystr, (U.transopts & TR_MENUS)); } else { ColorFunc(TBOXBLACK); glRasterPos2i(x2-len2, y1+tbfontyofs); - BIF_DrawString(G.font, keystr, (U.transopts & TR_MENUS), 0); + BIF_DrawString(G.font, keystr, (U.transopts & TR_MENUS)); } } } @@ -1113,7 +1113,7 @@ short button(short *var, short min, short max, char *str) if(mval[0]>G.curscreen->sizex) mval[0]= G.curscreen->sizex-10; if(mval[1]>G.curscreen->sizey) mval[1]= G.curscreen->sizey-10; - block= uiNewBlock(&listb, "button", UI_EMBOSSX, UI_HELV, G.curscreen->mainwin); + block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin); uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1| UI_BLOCK_ENTER_OK); @@ -1147,7 +1147,7 @@ short sbutton(char *var, float min, float max, char *str) if(mval[0]>G.curscreen->sizex) mval[0]= G.curscreen->sizex-10; if(mval[1]>G.curscreen->sizey) mval[1]= G.curscreen->sizey-10; - block= uiNewBlock(&listb, "button", UI_EMBOSSX, UI_HELV, G.curscreen->mainwin); + block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin); uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1); x1=mval[0]-150; @@ -1180,7 +1180,7 @@ short fbutton(float *var, float min, float max, char *str) if(mval[0]>G.curscreen->sizex) mval[0]= G.curscreen->sizex-10; if(mval[1]>G.curscreen->sizey) mval[1]= G.curscreen->sizey-10; - block= uiNewBlock(&listb, "button", UI_EMBOSSX, UI_HELV, G.curscreen->mainwin); + block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin); uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1); x1=mval[0]-150; @@ -1222,7 +1222,7 @@ int movetolayer_buts(unsigned int *lay) x1= pivot[0]-sizex+10; y1= pivot[1]-sizey/2; - block= uiNewBlock(&listb, "button", UI_EMBOSSX, UI_HELV, G.curscreen->mainwin); + block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin); uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT|UI_BLOCK_RET_1); dx= (sizex-5)/12; @@ -1275,7 +1275,7 @@ void draw_numbuts_tip(char *str, int x1, int y1, int x2, int y2) temp= 0; while( BIF_GetStringWidth(G.fonts, str+temp, (U.transopts & TR_BUTTONS))>(x2 - x1-24)) temp++; glRasterPos2i(x1+16, y2-30); - BIF_DrawString(G.fonts, str+temp, (U.transopts & TR_BUTTONS), 0); + BIF_DrawString(G.fonts, str+temp, (U.transopts & TR_BUTTONS)); } int do_clever_numbuts(char *name, int tot, int winevent) @@ -1305,7 +1305,7 @@ int do_clever_numbuts(char *name, int tot, int winevent) x1= mval[0]-sizex/2; y2= mval[1]+sizey/2; - block= uiNewBlock(&listb, "numbuts", UI_EMBOSSX, UI_HELV, G.curscreen->mainwin); + block= uiNewBlock(&listb, "numbuts", UI_EMBOSS, UI_HELV, G.curscreen->mainwin); uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_ENTER_OK); /* WATCH IT: TEX BUTTON EXCEPTION */ diff --git a/source/blender/src/view.c b/source/blender/src/view.c index 0d4550d8d84..6bfd945537e 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -213,8 +213,8 @@ void project_short_noclip(float *vec, short *adr) void project_float(float *vec, float *adr) { - float fx, fy, vec4[4]; - + float vec4[4]; + adr[0]= 3200.0; VECCOPY(vec4, vec); vec4[3]= 1.0; -- cgit v1.2.3