- fixed pixel offset error for listview (outliner)
- removed a lot of old drawing code
- put back special widgets Normal, Curve, Colorband
This commit is contained in:
2009-04-06 15:44:30 +00:00
parent 6e91947cda
commit 88ab62c031
5 changed files with 75 additions and 1915 deletions

View File

@@ -944,65 +944,6 @@ void uiBlockClearButLock(uiBlock *block)
/* *************************************************************** */ /* *************************************************************** */
/* XXX 2.50 no button editing */
#if 0
static void setup_file(uiBlock *block)
{
uiBut *but;
FILE *fp;
fp= fopen("butsetup","w");
if(fp==NULL);
else {
but= block->buttons.first;
while(but) {
ui_check_but(but);
fprintf(fp,"%d,%d,%d,%d %s %s\n", (int)but->x1, (int)but->y1, (int)( but->x2-but->x1), (int)(but->y2-but->y1), but->str, but->tip);
but= but->next;
}
fclose(fp);
}
}
static void edit_but(uiBlock *block, uiBut *but, uiEvent *uevent)
{
short dx, dy, mval[2], mvalo[2], didit=0;
getmouseco_sc(mvalo);
while(TRUE) {
if( !(get_mbut() & L_MOUSE) ) break;
getmouseco_sc(mval);
dx= (mval[0]-mvalo[0]);
dy= (mval[1]-mvalo[1]);
if(dx!=0 || dy!=0) {
mvalo[0]= mval[0];
mvalo[1]= mval[1];
cpack(0xc0c0c0);
glRectf(but->x1-2, but->y1-2, but->x2+2, but->y2+2);
if((uevent->qual & LR_SHIFTKEY)==0) {
but->x1 += dx;
but->y1 += dy;
}
but->x2 += dx;
but->y2 += dy;
ui_draw_but(ar, but);
ui_block_flush_back(but->block);
didit= 1;
}
/* idle for this poor code */
else PIL_sleep_ms(30);
}
if(didit) setup_file(block);
}
#endif
/* XXX 2.50 no links supported yet */ /* XXX 2.50 no links supported yet */
#if 0 #if 0
@@ -2430,8 +2371,6 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short
but->func_arg1= block->func_arg1; but->func_arg1= block->func_arg1;
but->func_arg2= block->func_arg2; but->func_arg2= block->func_arg2;
ui_set_embossfunc(but, block->dt);
but->pos= -1; /* cursor invisible */ but->pos= -1; /* cursor invisible */
if(ELEM(but->type, NUM, NUMABS)) { /* add a space to name */ if(ELEM(but->type, NUM, NUMABS)) { /* add a space to name */

File diff suppressed because it is too large Load Diff

View File

@@ -329,8 +329,6 @@ extern int ui_handler_panel_region(struct bContext *C, struct wmEvent *event);
extern void ui_draw_panel(struct ARegion *ar, uiBlock *block); extern void ui_draw_panel(struct ARegion *ar, uiBlock *block);
/* interface_draw.c */ /* interface_draw.c */
extern void ui_set_embossfunc(uiBut *but, int drawtype);
extern void ui_draw_but(ARegion *ar, uiBut *but);
extern void ui_rasterpos_safe(float x, float y, float aspect); extern void ui_rasterpos_safe(float x, float y, float aspect);
extern void ui_draw_tria_icon(float x, float y, float aspect, char dir); extern void ui_draw_tria_icon(float x, float y, float aspect, char dir);
extern void ui_draw_anti_x(float x1, float y1, float x2, float y2); extern void ui_draw_anti_x(float x1, float y1, float x2, float y2);
@@ -343,12 +341,18 @@ extern void gl_round_box_vertical_shade(int mode, float minx, float miny, float
void ui_draw_icon(uiBut *but, BIFIconID icon, int blend); void ui_draw_icon(uiBut *but, BIFIconID icon, int blend);
void ui_draw_text(uiBut *but, float x, float y, int sunken); void ui_draw_text(uiBut *but, float x, float y, int sunken);
void ui_draw_but_COLORBAND(uiBut *but);
void ui_draw_but_NORMAL(uiBut *but);
void ui_draw_but_CURVE(ARegion *ar, uiBut *but);
/* interface_handlers.c */ /* interface_handlers.c */
extern void ui_button_active_cancel(const struct bContext *C, uiBut *but); extern void ui_button_active_cancel(const struct bContext *C, uiBut *but);
/* interface_widgets.c */ /* interface_widgets.c */
void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3); void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3);
void ui_draw_menu_back(uiBlock *block); void ui_draw_menu_back(uiBlock *block);
extern void ui_draw_but(ARegion *ar, uiBut *but);
/* interface_anim.c */ /* interface_anim.c */
void ui_but_anim_flag(uiBut *but, float cfra); void ui_but_anim_flag(uiBut *but, float cfra);

View File

@@ -1628,7 +1628,7 @@ static int widget_roundbox_set(uiBut *but, rcti *rect)
} }
/* conversion from old to new buttons, so still messy */ /* conversion from old to new buttons, so still messy */
void ui_draw_but_new(ARegion *ar, uiBut *but) void ui_draw_but(ARegion *ar, uiBut *but)
{ {
uiWidgetType *wt= NULL; uiWidgetType *wt= NULL;
rcti rect; rcti rect;
@@ -1716,8 +1716,18 @@ void ui_draw_but_new(ARegion *ar, uiBut *but)
wt= widget_type(UI_WTYPE_SWATCH); wt= widget_type(UI_WTYPE_SWATCH);
break; break;
// XXX four old button types
case HSVCUBE: case HSVCUBE:
ui_draw_but_HSVCUBE(but); // XXX old ui_draw_but_HSVCUBE(but);
break;
case BUT_COLORBAND:
ui_draw_but_COLORBAND(but);
break;
case BUT_NORMAL:
ui_draw_but_NORMAL(but);
break;
case BUT_CURVE:
ui_draw_but_CURVE(ar, but);
break; break;
default: default:

View File

@@ -879,8 +879,9 @@ void UI_view2d_view_orthoSpecial(const bContext *C, View2D *v2d, short xaxis)
/* pixel offsets (-0.375f) are needed to get 1:1 correspondance with pixels for smooth UI drawing, /* pixel offsets (-0.375f) are needed to get 1:1 correspondance with pixels for smooth UI drawing,
* but only applied where requsted * but only applied where requsted
*/ */
xofs= (v2d->flag & V2D_PIXELOFS_X) ? 0.375f : 0.0f; /* XXX temp (ton) */
yofs= (v2d->flag & V2D_PIXELOFS_Y) ? 0.375f : 0.0f; xofs= 0.0f; // (v2d->flag & V2D_PIXELOFS_X) ? 0.375f : 0.0f;
yofs= 0.0f; // (v2d->flag & V2D_PIXELOFS_Y) ? 0.375f : 0.0f;
/* apply mask-based adjustments to cur rect (due to scrollers), to eliminate scaling artifacts */ /* apply mask-based adjustments to cur rect (due to scrollers), to eliminate scaling artifacts */
view2d_map_cur_using_mask(v2d, &curmasked); view2d_map_cur_using_mask(v2d, &curmasked);