aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
authorlecoanet2000-05-26 08:34:17 +0000
committerlecoanet2000-05-26 08:34:17 +0000
commit4c8cdf9198b34aaddb1e660d0e8adedaff950750 (patch)
tree6901409e650f434a99cfd46a2ad6c3998f1679f0 /generic
parent834273b7f7a126503598fe174bc54f1d9da7bf72 (diff)
downloadtkzinc-4c8cdf9198b34aaddb1e660d0e8adedaff950750.zip
tkzinc-4c8cdf9198b34aaddb1e660d0e8adedaff950750.tar.gz
tkzinc-4c8cdf9198b34aaddb1e660d0e8adedaff950750.tar.bz2
tkzinc-4c8cdf9198b34aaddb1e660d0e8adedaff950750.tar.xz
Ajout d'une spec de dimensionnement de field "label".
Diffstat (limited to 'generic')
-rw-r--r--generic/Attrs.c10
-rw-r--r--generic/Attrs.h1
2 files changed, 8 insertions, 3 deletions
diff --git a/generic/Attrs.c b/generic/Attrs.c
index 2e58f67..bfd155c 100644
--- a/generic/Attrs.c
+++ b/generic/Attrs.c
@@ -115,6 +115,8 @@ CharToDim(char dim)
return LF_DIM_ICON;
case 'a':
return LF_DIM_AUTO;
+ case 'l':
+ return LF_DIM_LABEL;
case 'x':
default:
return LF_DIM_PIXEL;
@@ -200,7 +202,8 @@ LabelFormatCreate(Tcl_Interp *interp,
if (!*ptr) {
goto lf_error_syn;
}
- if ((*ptr != 'x') && (*ptr != 'f') && (*ptr != 'i') && (*ptr != 'a')) {
+ if ((*ptr != 'x') && (*ptr != 'f') && (*ptr != 'i') &&
+ (*ptr != 'a') && (*ptr != 'l')) {
c_width = (ZnDim) strtod(ptr, &next_ptr);
if ((ptr == next_ptr) || (*next_ptr != 'x')) {
lf_error_syn:
@@ -243,7 +246,8 @@ LabelFormatCreate(Tcl_Interp *interp,
field_struct.x_spec = field_struct.y_spec = 0;
field_struct.x_attach = field_struct.y_attach = LF_ATTACH_PIXEL;
field_struct.x_dim = field_struct.y_dim = LF_DIM_PIXEL;
- if ((*ptr == 'x') || (*ptr == 'f') || (*ptr == 'i') || (*ptr == 'a')) {
+ if ((*ptr == 'x') || (*ptr == 'f') || (*ptr == 'i') ||
+ (*ptr == 'a') || (*ptr == 'l')) {
num_tok = sscanf(ptr, "%c%d%c%d%n", &x_char, &width,
&y_char, &height, &index);
if (num_tok != 4) {
@@ -272,7 +276,7 @@ LabelFormatCreate(Tcl_Interp *interp,
ptr += index;
}
else if (!*ptr || (field_index != 0)) {
- /* An incomplete field spec is an error if there is several fields. */
+ /* An incomplete field spec is an error if there are several fields. */
Tcl_AppendResult(interp, "incomplete field in label format: \"",
ptr-index, "\"", NULL);
goto lf_error;
diff --git a/generic/Attrs.h b/generic/Attrs.h
index 582db9d..cac2244 100644
--- a/generic/Attrs.h
+++ b/generic/Attrs.h
@@ -55,6 +55,7 @@ extern "C" {
#define LF_DIM_FONT 1
#define LF_DIM_ICON 2
#define LF_DIM_AUTO 3
+#define LF_DIM_LABEL 4
typedef struct {
int x_spec;