diff options
author | Robert Wenzlaff <rwenzlaff@soylent-green.com> | 2003-11-06 02:54:22 +0300 |
---|---|---|
committer | Robert Wenzlaff <rwenzlaff@soylent-green.com> | 2003-11-06 02:54:22 +0300 |
commit | aeb8a0f1ae51336f5794458604016de20764f500 (patch) | |
tree | 06d0344dcc67cc591f7dc4b7bc5d02462e6231c4 /source | |
parent | e1c8f26537b74aa69eed4220244ef941c8b82613 (diff) |
Modified pupmenu_col() to allow separators.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/interface.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index 95a891a4c21..864cc597099 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -3937,7 +3937,7 @@ short pupmenu_col(char *instr, int maxrow) rows= (int) md->nitems/columns; if (rows<1) rows= 1; - while (rows*columns<md->nitems) rows++; + while (rows*columns<(md->nitems+columns) ) rows++; /* size and location */ if(md->title) width= 2*strlen(md->title)+BIF_GetStringWidth(uiBlockGetCurFont(block), md->title, (U.transopts & TR_BUTTONS)); @@ -4022,11 +4022,20 @@ short pupmenu_col(char *instr, int maxrow) } for(a=0; a<md->nitems; a++) { - + char *name= md->items[a].str; + x1= startx + width*((int)a/rows); y1= starty - boxh*(a%rows) + (rows-1)*boxh; - - uiDefButI(block, BUTM, B_NOP, md->items[a].str, x1, y1, (short)(width-(rows>1)), (short)(boxh-1), &val, (float)md->items[a].retval, 0.0, 0, 0, ""); + + if( strcmp(name, "%l")==0){ + uiDefBut(block, SEPR, B_NOP, "", x1, y1, width, 6, NULL, 0, 0.0, 0, 0, ""); + y1 -= 6; + } + else { + uiDefButS(block, BUTM, B_NOP, name, x1, y1, width, boxh-1, &val, (float) md->items[a].retval, 0.0, 0, 0, ""); + y1 -= boxh; + } + //uiDefButI(block, BUTM, B_NOP, md->items[a].str, x1, y1, (short)(width-(rows>1)), (short)(boxh-1), &val, (float)md->items[a].retval, 0.0, 0, 0, ""); } uiBoundsBlock(block, 3); |