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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-01-04 14:43:13 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-01-04 14:43:13 +0300
commit7cacb35845a2c1c677186315471900add911095f (patch)
tree74a705004cc386448cae27dc107ec0a713f6d884
parentb91d5bf951a7cb9f3389f31ee438f2a3fcdf287d (diff)
toolbox.c - for the label in VarStruct use the tooltip for the text to get around the 15 char limit that only allowed you to fill about half of the available area on the clever numbuts panel,
the tip isnt used for a label anyway. added comments explaining whats going on. only effects clever numbuts internaly. type fixes for weightpaint_envelope_assign.py
-rw-r--r--release/scripts/weightpaint_envelope_assign.py8
-rw-r--r--source/blender/src/toolbox.c34
2 files changed, 23 insertions, 19 deletions
diff --git a/release/scripts/weightpaint_envelope_assign.py b/release/scripts/weightpaint_envelope_assign.py
index f383633995a..cafa44fef38 100644
--- a/release/scripts/weightpaint_envelope_assign.py
+++ b/release/scripts/weightpaint_envelope_assign.py
@@ -211,12 +211,12 @@ def main():
PREF_ENV_GROUPNAME= Draw.Create('')
PREF_UPDATE_ACT= Draw.Create(True)
pup_block= [\
- ('Update Active', PREF_UPDATE_ACT, 'Only apply envalope weights to the active group.'),\
- 'or initialize from group',\
- ('GR:', PREF_ENV_GROUPNAME, 0, 21, 'The name of an existing groups to '),\
+ ('Update Active', PREF_UPDATE_ACT, 'Only apply envelope weights to the active group.'),\
+ '...or initialize from group',\
+ ('GR:', PREF_ENV_GROUPNAME, 0, 21, 'The name of an existing groups, each member will be used as a weight envelope'),\
]
- if not Draw.PupBlock('Envalope From Group...', pup_block):
+ if not Draw.PupBlock('Envelope From Group...', pup_block):
return
PREF_UPDATE_ACT= PREF_UPDATE_ACT.val
diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c
index 7d77ad755d5..55d76e2190c 100644
--- a/source/blender/src/toolbox.c
+++ b/source/blender/src/toolbox.c
@@ -563,10 +563,15 @@ int do_clever_numbuts(char *name, int tot, int winevent)
uiDefBut(block, TEX, 0, varstr->name,(short)((x1+15) + (sizex*xi)),(short)(y2-55- 20*yi),(short)(sizex), 19, numbpoin[a], varstr->min, varstr->max, 0, 0, varstr->tip);
}
else {
- if(varstr->type==LABEL) /* dont include the label when rounding the buttons */
+ if(varstr->type==LABEL) {/* dont include the label when rounding the buttons */
uiBlockEndAlign(block);
- uiDefBut(block, varstr->type, 0, varstr->name,(short)((x1+15) + (sizex*xi)),(short)(y2-55-20*yi), (short)(sizex), 19, &(numbdata[a]), varstr->min, varstr->max, 100, 0, varstr->tip);
+ /* using the tip for the name, this is incorrect lets us get around the 16 char limit of name */
+ /* Changed from the line below to use the tip since the tip isnt used for a label */
+ uiDefBut(block, varstr->type, 0, varstr->tip,(short)((x1+15) + (sizex*xi)),(short)(y2-55-20*yi), (short)(sizex), 19, &(numbdata[a]), varstr->min, varstr->max, 100, 0, "");
+ } else {
+ uiDefBut(block, varstr->type, 0, varstr->name,(short)((x1+15) + (sizex*xi)),(short)(y2-55-20*yi), (short)(sizex), 19, &(numbdata[a]), varstr->min, varstr->max, 100, 0, varstr->tip);
+ }
if(varstr->type==LABEL)
uiBlockBeginAlign(block);
@@ -598,14 +603,6 @@ int do_clever_numbuts(char *name, int tot, int winevent)
if(varstr->type==TEX);
else if ELEM( (varstr->type & BUTPOIN), FLO, INT ) memcpy(numbpoin[a], numbdata+a, 4);
else if((varstr->type & BUTPOIN)==SHO ) *((short *)(numbpoin[a]))= *( (short *)(numbdata+a));
-
- /*
- if( strncmp(varstr->name, "Rot", 3)==0 ) {
- float *fp;
-
- fp= numbpoin[a];
- fp[0]= M_PI*fp[0]/180.0;
- }*/
}
if(winevent) {
@@ -628,14 +625,21 @@ void add_numbut(int nr, int type, char *str, float min, float max, void *poin, c
if(nr>=MAXNUMBUTS) return;
numbuts[nr].type= type;
- strcpy(numbuts[nr].name, str);
+
numbuts[nr].min= min;
numbuts[nr].max= max;
- if(tip)
- strcpy(numbuts[nr].tip, tip);
- else
- strcpy(numbuts[nr].tip, "");
+ if (type==LABEL) {
+ /* evil use it tooltip for the label string to get around the 16 char limit of "name" */
+ strcpy(numbuts[nr].tip, str);
+ } else {
+ /* for all other types */
+ strcpy(numbuts[nr].name, str);
+ if(tip)
+ strcpy(numbuts[nr].tip, tip);
+ else
+ strcpy(numbuts[nr].tip, "");
+ }
/*WATCH: TEX BUTTON EXCEPTION */