Lines 260-272
Link Here
|
260 |
- thmargin - thmargin; |
260 |
- thmargin - thmargin; |
261 |
if (tsize.x > 0) |
261 |
if (tsize.x > 0) |
262 |
twidth -= tsize.x + IGAP; |
262 |
twidth -= tsize.x + IGAP; |
263 |
if (textClient != null) |
263 |
if (textClient != null) { |
264 |
tcsize = textClientCache.computeSize(SWT.DEFAULT, SWT.DEFAULT); |
264 |
tcsize = textClientCache.computeSize(SWT.DEFAULT, SWT.DEFAULT); |
265 |
if (tcsize.x > 0) |
265 |
} |
266 |
twidth -= tcsize.x + IGAP; |
|
|
267 |
Point size = NULL_SIZE; |
266 |
Point size = NULL_SIZE; |
268 |
if (textLabel != null) |
267 |
if (textLabel != null) { |
269 |
size = textLabelCache.computeSize(twidth, SWT.DEFAULT); |
268 |
if (tcsize.x > 0 && FormUtil.isWrapControl(textClient)) { |
|
|
269 |
size = textLabelCache.computeSize(SWT.DEFAULT, SWT.DEFAULT); |
270 |
if (twidth < size.x + IGAP + tcsize.x) { |
271 |
twidth -= IGAP; |
272 |
if (textLabel instanceof Label) |
273 |
size = FormUtil.computeWrapSize(new GC(textLabel), ((Label)textLabel).getText(), Math.round(twidth*(size.x/(float)(size.x+tcsize.x)))); |
274 |
else |
275 |
size = textLabelCache.computeSize(Math.round(twidth*(size.x/(float)(size.x+tcsize.x))), SWT.DEFAULT); |
276 |
tcsize = textClientCache.computeSize(twidth-size.x, SWT.DEFAULT); |
277 |
} |
278 |
} |
279 |
else { |
280 |
twidth -= tcsize.x + IGAP; |
281 |
size = textLabelCache.computeSize(twidth, SWT.DEFAULT); |
282 |
} |
283 |
} |
270 |
if (textLabel instanceof Label) { |
284 |
if (textLabel instanceof Label) { |
271 |
Point defSize = textLabelCache.computeSize(SWT.DEFAULT, |
285 |
Point defSize = textLabelCache.computeSize(SWT.DEFAULT, |
272 |
SWT.DEFAULT); |
286 |
SWT.DEFAULT); |
Lines 386-398
Link Here
|
386 |
Point tcsize = NULL_SIZE; |
400 |
Point tcsize = NULL_SIZE; |
387 |
if (textClient != null) { |
401 |
if (textClient != null) { |
388 |
tcsize = textClientCache.computeSize(SWT.DEFAULT, SWT.DEFAULT); |
402 |
tcsize = textClientCache.computeSize(SWT.DEFAULT, SWT.DEFAULT); |
389 |
if (innertHint != SWT.DEFAULT) |
|
|
390 |
innertHint -= IGAP + tcsize.x; |
391 |
} |
403 |
} |
392 |
Point size = NULL_SIZE; |
404 |
Point size = NULL_SIZE; |
393 |
|
405 |
|
394 |
if (textLabel != null) |
406 |
if (textLabel != null) { |
395 |
size = textLabelCache.computeSize(innertHint, SWT.DEFAULT); |
407 |
if (tcsize.x > 0 && FormUtil.isWrapControl(textClient)) { |
|
|
408 |
size = textLabelCache.computeSize(SWT.DEFAULT, SWT.DEFAULT); |
409 |
if (innertHint != SWT.DEFAULT && innertHint < size.x + IGAP + tcsize.x) { |
410 |
innertHint -= IGAP; |
411 |
if (textLabel instanceof Label) |
412 |
size = FormUtil.computeWrapSize(new GC(textLabel), ((Label)textLabel).getText(), Math.round(innertHint*(size.x/(float)(size.x+tcsize.x)))); |
413 |
else |
414 |
size = textLabelCache.computeSize(Math.round(innertHint*(size.x/(float)(size.x+tcsize.x))), SWT.DEFAULT); |
415 |
tcsize = textClientCache.computeSize(innertHint-size.x, SWT.DEFAULT); |
416 |
} |
417 |
} else { |
418 |
if (innertHint != SWT.DEFAULT) |
419 |
innertHint -= IGAP + tcsize.x; |
420 |
size = textLabelCache.computeSize(innertHint, SWT.DEFAULT); |
421 |
} |
422 |
} |
396 |
if (textLabel instanceof Label) { |
423 |
if (textLabel instanceof Label) { |
397 |
Point defSize = textLabelCache.computeSize(SWT.DEFAULT, |
424 |
Point defSize = textLabelCache.computeSize(SWT.DEFAULT, |
398 |
SWT.DEFAULT); |
425 |
SWT.DEFAULT); |
Lines 450-456
Link Here
|
450 |
} |
477 |
} |
451 |
if (toggle != null) { |
478 |
if (toggle != null) { |
452 |
height = height - size.y + Math.max(size.y, tsize.y); |
479 |
height = height - size.y + Math.max(size.y, tsize.y); |
453 |
width += twidth; |
480 |
width += twidth +IGAP; |
454 |
} |
481 |
} |
455 |
|
482 |
|
456 |
Point result = new Point(width + marginWidth + marginWidth |
483 |
Point result = new Point(width + marginWidth + marginWidth |