- fixed drawing errors in constraint panel
- join 3d window could crash... unchecked pointer in interface.c - setting align in buttonswin caused stripes to draw in view3d-panels - fixed events for new 'background and view settings menu'
This commit is contained in:
@@ -309,9 +309,11 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
|
||||
{
|
||||
uiBut *but;
|
||||
char typestr[64];
|
||||
short height, width = 268;
|
||||
short height, width = 238;
|
||||
BIFColorID curCol;
|
||||
|
||||
/* there is something weird in this function... opengl draw (glrects) doesnt match the buttons... */
|
||||
|
||||
uiBlockSetEmboss(block, UI_EMBOSSW);
|
||||
|
||||
get_constraint_typestring (typestr, con);
|
||||
@@ -352,7 +354,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
|
||||
else
|
||||
BIF_set_color(curCol, COLORSHADE_MEDIUM);
|
||||
|
||||
glRects(*xco+20, *yco, *xco+248, *yco+20);
|
||||
glRects(*xco+34, *yco-12, *xco+266, *yco+5);
|
||||
|
||||
but = uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, *xco+20, *yco, 100, 20, NULL, 0.0, 0.0, 0.0, 0.0, "");
|
||||
uiButSetFunc(but, move_constraint_func, con, NULL);
|
||||
@@ -389,9 +391,9 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
|
||||
bArmature *arm;
|
||||
|
||||
height = 86;
|
||||
BIF_set_color(curCol, COLORSHADE_GREY);
|
||||
glRects(*xco, *yco-height, *xco+width, *yco);
|
||||
uiEmboss((float)*xco, (float)*yco-height, (float)*xco+width, (float)*yco, 1);
|
||||
BIF_set_color(curCol, COLORSHADE_MEDIUM);
|
||||
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);
|
||||
|
||||
/* Draw target parameters */
|
||||
uiDefIDPoinBut(block, test_obpoin_but, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+((width/2)-48), *yco-20, 96, 18, &data->tar, "Target Object");
|
||||
@@ -421,9 +423,9 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
|
||||
bLocateLikeConstraint *data = con->data;
|
||||
bArmature *arm;
|
||||
height = 66;
|
||||
BIF_set_color(curCol, COLORSHADE_GREY);
|
||||
glRects(*xco, *yco-height, *xco+width, *yco);
|
||||
uiEmboss((float)*xco, (float)*yco-height, (float)*xco+width, (float)*yco, 1);
|
||||
BIF_set_color(curCol, COLORSHADE_MEDIUM);
|
||||
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);
|
||||
|
||||
/* Draw target parameters */
|
||||
uiDefIDPoinBut(block, test_obpoin_but, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+((width/2)-48), *yco-20, 96, 18, &data->tar, "Target Object");
|
||||
@@ -446,9 +448,9 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
|
||||
bRotateLikeConstraint *data = con->data;
|
||||
bArmature *arm;
|
||||
height = 46;
|
||||
BIF_set_color(curCol, COLORSHADE_GREY);
|
||||
glRects(*xco, *yco-height, *xco+width, *yco);
|
||||
uiEmboss((float)*xco, (float)*yco-height, (float)*xco+width, (float)*yco, 1);
|
||||
BIF_set_color(curCol, COLORSHADE_MEDIUM);
|
||||
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);
|
||||
|
||||
uiDefIDPoinBut(block, test_obpoin_but, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+((width/2)-48), *yco-20, 96, 18, &data->tar, "Target Object");
|
||||
|
||||
@@ -467,9 +469,9 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
|
||||
bArmature *arm;
|
||||
|
||||
height = 66;
|
||||
BIF_set_color(curCol, COLORSHADE_GREY);
|
||||
glRects(*xco, *yco-height, *xco+width, *yco);
|
||||
uiEmboss((float)*xco, (float)*yco-height, (float)*xco+width, (float)*yco, 1);
|
||||
BIF_set_color(curCol, COLORSHADE_MEDIUM);
|
||||
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);
|
||||
|
||||
uiDefButF(block, NUM, B_CONSTRAINT_REDRAW, "Tolerance:", *xco+((width/2)-96), *yco-20, 96, 18, &data->tolerance, 0.0001, 1.0, 0.0, 0.0, "Maximum distance to target after solving");
|
||||
uiDefButI(block, NUM, B_CONSTRAINT_REDRAW, "Iterations:", *xco+((width/2)), *yco-20, 96, 18, &data->iterations, 1, 10000, 0.0, 0.0, "Maximum number of solving iterations");
|
||||
@@ -488,9 +490,9 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
|
||||
case CONSTRAINT_TYPE_NULL:
|
||||
{
|
||||
height = 20;
|
||||
BIF_set_color(curCol, COLORSHADE_GREY);
|
||||
glRects(*xco, *yco-height, *xco+width, *yco);
|
||||
uiEmboss((float)*xco, (float)*yco-height, (float)*xco+width, (float)*yco, 1);
|
||||
BIF_set_color(curCol, COLORSHADE_MEDIUM);
|
||||
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);
|
||||
}
|
||||
break;
|
||||
case CONSTRAINT_TYPE_TRACKTO:
|
||||
@@ -499,9 +501,9 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
|
||||
bArmature *arm;
|
||||
|
||||
height = 46;
|
||||
BIF_set_color(curCol, COLORSHADE_GREY);
|
||||
glRects(*xco, *yco-height, *xco+width, *yco);
|
||||
uiEmboss((float)*xco, (float)*yco-height, (float)*xco+width, (float)*yco, 1);
|
||||
BIF_set_color(curCol, COLORSHADE_MEDIUM);
|
||||
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);
|
||||
|
||||
uiDefIDPoinBut(block, test_obpoin_but, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+((width/2)-48), *yco-20, 96, 18, &data->tar, "Target Object");
|
||||
|
||||
@@ -593,7 +595,7 @@ static void object_panel_constraint(void)
|
||||
|
||||
block= uiNewBlock(&curarea->uiblocks, "object_panel_constraint", UI_EMBOSSX, UI_HELV, curarea->win);
|
||||
uiNewPanelTabbed("Effects", "Object");
|
||||
if(uiNewPanel(curarea, block, "Constraints", "Object", 10, 640, 318, 204)==0) return;
|
||||
if(uiNewPanel(curarea, block, "Constraints", "Object", 640, 0, 318, 204)==0) return;
|
||||
|
||||
/* this is a variable height panel, newpanel doesnt force new size on existing panels */
|
||||
/* so first we make it default height */
|
||||
|
||||
@@ -885,6 +885,7 @@ void do_viewbuts(unsigned short event)
|
||||
|
||||
case B_BLENDBGPIC:
|
||||
if(vd->bgpic && vd->bgpic->rect) setalpha_bgpic(vd->bgpic);
|
||||
addqueue(curarea->win, REDRAW, 1);
|
||||
break;
|
||||
|
||||
case B_BGPICBROWSE:
|
||||
@@ -997,7 +998,7 @@ static void view3d_panel_settings(short action) // VIEW3D_HANDLER_SETTINGS
|
||||
|
||||
if(vd->bgpic) {
|
||||
|
||||
uiDefButF(block, NUM, B_DIFF, "Size:", 160,160,150,20, &vd->bgpic->size, 0.1, 250.0, 100, 0, "Set the size for the width of the BackGroundPic");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "Size:", 160,160,150,20, &vd->bgpic->size, 0.1, 250.0, 100, 0, "Set the size for the width of the BackGroundPic");
|
||||
|
||||
id= (ID *)vd->bgpic->ima;
|
||||
IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->image), id, &(G.buts->menunr));
|
||||
@@ -1031,12 +1032,12 @@ static void view3d_panel_settings(short action) // VIEW3D_HANDLER_SETTINGS
|
||||
}
|
||||
}
|
||||
|
||||
uiDefButF(block, NUM, B_DIFF, "Grid:", 10, 50, 150, 19, &vd->grid, 0.001, 1000.0, 10, 0, "Set the distance between gridlines");
|
||||
uiDefButS(block, NUM, B_DIFF, "GridLines:", 160, 50, 150, 19, &vd->gridlines, 0.0, 100.0, 100, 0, "Set the number of gridlines");
|
||||
uiDefButF(block, NUM, B_DIFF, "Lens:", 10, 30, 150, 19, &vd->lens, 10.0, 120.0, 100, 0, "Set the lens for the perspective view");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "Grid:", 10, 50, 150, 19, &vd->grid, 0.001, 100.0, 10, 0, "Set the distance between gridlines");
|
||||
uiDefButS(block, NUM, REDRAWVIEW3D, "GridLines:", 160, 50, 150, 19, &vd->gridlines, 0.0, 100.0, 100, 0, "Set the number of gridlines");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "Lens:", 10, 30, 150, 19, &vd->lens, 10.0, 120.0, 100, 0, "Set the lens for the perspective view");
|
||||
|
||||
uiDefButF(block, NUM, B_DIFF, "ClipStart:", 10, 10, 150, 19, &vd->near, 0.1*vd->grid, 100.0, 100, 0, "Set startvalue in perspective view mode");
|
||||
uiDefButF(block, NUM, B_DIFF, "ClipEnd:", 160, 10, 150, 19, &vd->far, 1.0, 1000.0*vd->grid, 100, 0, "Set endvalue in perspective view mode");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "ClipStart:", 10, 10, 150, 19, &vd->near, vd->grid, 100.0, 100, 0, "Set startvalue in perspective view mode");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "ClipEnd:", 160, 10, 150, 19, &vd->far, 1.0, 1000.0*vd->grid, 100, 0, "Set endvalue in perspective view mode");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1435,7 +1435,6 @@ static void closeheadwin(ScrArea *sa)
|
||||
static void closeareawin(ScrArea *sa)
|
||||
{
|
||||
uiFreeBlocksWin(&sa->uiblocks, sa->win);
|
||||
uiFreePanels(&sa->panels);
|
||||
|
||||
if(sa->win) mywinclose(sa->win);
|
||||
sa->win= 0;
|
||||
@@ -1449,6 +1448,7 @@ static void del_area(ScrArea *sa)
|
||||
freespacelist(&sa->spacedata);
|
||||
|
||||
uiFreeBlocks(&sa->uiblocks);
|
||||
uiFreePanels(&sa->panels);
|
||||
|
||||
if(sa==curarea) curarea= 0;
|
||||
if(sa==g_activearea) g_activearea= 0;
|
||||
|
||||
@@ -6677,7 +6677,14 @@ static void ui_draw_panel_header(uiBlock *block)
|
||||
|
||||
static void ui_draw_panel(uiBlock *block)
|
||||
{
|
||||
int align=0;
|
||||
|
||||
if(block->panel->paneltab) return;
|
||||
|
||||
if(curarea->spacetype==SPACE_BUTS) {
|
||||
SpaceButs *sbuts= curarea->spacedata.first;
|
||||
align= sbuts->align;
|
||||
}
|
||||
|
||||
if(block->panel->flag & PNL_CLOSEDY) {
|
||||
uiSetRoundBox(15);
|
||||
@@ -6745,9 +6752,9 @@ static void ui_draw_panel(uiBlock *block)
|
||||
glColor4ub(198, 198, 198, 100);
|
||||
glRectf(block->minx, block->miny, block->maxx, block->maxy);
|
||||
|
||||
if(G.buts->align) {
|
||||
if(align) {
|
||||
glColor4ub(206, 206, 206, 100);
|
||||
if(G.buts->align==BUT_HORIZONTAL) ui_set_panel_pattern('h');
|
||||
if(align==BUT_HORIZONTAL) ui_set_panel_pattern('h');
|
||||
else ui_set_panel_pattern('v');
|
||||
|
||||
glRectf(block->minx, block->miny, block->maxx, block->maxy);
|
||||
|
||||
Reference in New Issue
Block a user