Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorRobert Wenzlaff <rwenzlaff@soylent-green.com>2003-11-06 02:54:22 +0300
committerRobert Wenzlaff <rwenzlaff@soylent-green.com>2003-11-06 02:54:22 +0300
commitaeb8a0f1ae51336f5794458604016de20764f500 (patch)
tree06d0344dcc67cc591f7dc4b7bc5d02462e6231c4 /source
parente1c8f26537b74aa69eed4220244ef941c8b82613 (diff)
Modified pupmenu_col() to allow separators.
Diffstat (limited to 'source')
-rw-r--r--source/blender/src/interface.c17
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);