Mercurial > projects > dwt2
comparison org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/CTabItem.d @ 120:536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
===D2===
* added [Try]Immutable/Const/Shared templates to work with differenses in D1/D2 instead of version statements
used these templates to work with strict type storage rules of dmd-2.053
* com.ibm.icu now also compilable with D2, but not tested yet
* small fixes
Snippet288 - shared data is in TLS
===Phobos===
* fixed critical bugs in Phobos implemention
completely incorrect segfault prone fromStringz (Linux's port ruthless killer)
terrible, incorrect StringBuffer realization (StyledText killer)
* fixed small bugs as well
Snippet72 - misprint in the snippet
* implemented missed functionality for Phobos
ByteArrayOutputStream implemented (image loading available)
formatting correctly works for all DWT's cases
As a result, folowing snippets now works with Phobos (Snippet### - what is fixed):
Snippet24, 42, 111, 115, 130, 235, 276 - bad string formatting
Snippet48, 282 - crash on image loading
Snippet163, 189, 211, 213, 217, 218, 222 - crash on copy/cut in StyledText
Snippet244 - hang-up
===Tango===
* few changes for the latest Tango trunc-r5661
* few small performance improvments
===General===
* implMissing-s for only one version changed to implMissingInTango/InPhobos
* incorrect calls to Format in toString-s fixed
* fixed loading \uXXXX characters in ResourceBundle
* added good UTF-8 support for StyledText, TextLayout (Win32) and friends
UTF functions revised and tested. It is now in java.nonstandard.*Utf modules
StyledText and TextLayout (Win32) modules revised for UTF-8 support
* removed small diferences in most identical files in *.swt.* folders
*.swt.internal.image, *.swt.events and *.swt.custom are identical in Win32/Linux32
now 179 of 576 (~31%) files in *.swt.* folders are fully identical
* Win32: snippets now have right subsystem, pretty icons and native system style controls
* small fixes in snippets
Snippet44 - it's not Snippet44
Snippet212 - functions work with different images and offsets arrays
Win32: Snippet282 - crash on close if the button has an image
Snippet293 - setGrayed is commented
and others
Win32: As a result, folowing snippets now works
Snippet68 - color doesn't change
Snippet163, 189, 211, 213, 217, 218, 222 - UTF-8 issues (see above)
Snippet193 - no tabel headers
author | Denis Shelomovskij <verylonglogin.reg@gmail.com> |
---|---|
date | Sat, 09 Jul 2011 15:50:20 +0300 |
parents | 9f4c18c268b2 |
children |
comparison
equal
deleted
inserted
replaced
119:d00e8db0a568 | 120:536e43f63c81 |
---|---|
293 } | 293 } |
294 | 294 |
295 // draw selected tab background and outline | 295 // draw selected tab background and outline |
296 shape = null; | 296 shape = null; |
297 if (this.parent.onBottom) { | 297 if (this.parent.onBottom) { |
298 int[] left = parent.simple ? cast(int[])CTabFolder.SIMPLE_BOTTOM_LEFT_CORNER : cast(int[])CTabFolder.BOTTOM_LEFT_CORNER; | 298 TryConst!(int)[] left = parent.simple ? CTabFolder.SIMPLE_BOTTOM_LEFT_CORNER : CTabFolder.BOTTOM_LEFT_CORNER; |
299 int[] right = parent.simple ? cast(int[])CTabFolder.SIMPLE_BOTTOM_RIGHT_CORNER : parent.curve; | 299 TryConst!(int[]) right = parent.simple ? CTabFolder.SIMPLE_BOTTOM_RIGHT_CORNER : parent.curve; |
300 if (parent.borderLeft is 0 && parent.indexOf(this) is parent.firstIndex) { | 300 if (parent.borderLeft is 0 && parent.indexOf(this) is parent.firstIndex) { |
301 left = [x, y+height]; | 301 left = [x, y+height]; |
302 } | 302 } |
303 shape = new int[left.length+right.length+8]; | 303 shape = new int[left.length+right.length+8]; |
304 int index = 0; | 304 int index = 0; |
317 shape[index++] = parent.simple ? rightEdge - 1 : rightEdge + parent.curveWidth - parent.curveIndent; | 317 shape[index++] = parent.simple ? rightEdge - 1 : rightEdge + parent.curveWidth - parent.curveIndent; |
318 shape[index++] = y - 1; | 318 shape[index++] = y - 1; |
319 shape[index++] = parent.simple ? rightEdge - 1 : rightEdge + parent.curveWidth - parent.curveIndent; | 319 shape[index++] = parent.simple ? rightEdge - 1 : rightEdge + parent.curveWidth - parent.curveIndent; |
320 shape[index++] = y - 1; | 320 shape[index++] = y - 1; |
321 } else { | 321 } else { |
322 int[] left = parent.simple ? cast(int[])CTabFolder.SIMPLE_TOP_LEFT_CORNER : cast(int[])CTabFolder.TOP_LEFT_CORNER; | 322 TryConst!(int)[] left = parent.simple ? CTabFolder.SIMPLE_TOP_LEFT_CORNER : CTabFolder.TOP_LEFT_CORNER; |
323 int[] right = parent.simple ? cast(int[])CTabFolder.SIMPLE_TOP_RIGHT_CORNER : parent.curve; | 323 TryConst!(int[]) right = parent.simple ? CTabFolder.SIMPLE_TOP_RIGHT_CORNER : parent.curve; |
324 if (parent.borderLeft is 0 && parent.indexOf(this) is parent.firstIndex) { | 324 if (parent.borderLeft is 0 && parent.indexOf(this) is parent.firstIndex) { |
325 left = [x, y]; | 325 left = [x, y]; |
326 } | 326 } |
327 shape = new int[left.length+right.length+8]; | 327 shape = new int[left.length+right.length+8]; |
328 int index = 0; | 328 int index = 0; |
480 CTabFolder.TOP_LEFT_CORNER_HILITE[0] + x + 1, //rely on fact that first pair is top/right of curve | 480 CTabFolder.TOP_LEFT_CORNER_HILITE[0] + x + 1, //rely on fact that first pair is top/right of curve |
481 1 + y, | 481 1 + y, |
482 rightEdge - parent.curveIndent, | 482 rightEdge - parent.curveIndent, |
483 1 + y); | 483 1 + y); |
484 | 484 |
485 int[] leftHighlightCurve = CTabFolder.TOP_LEFT_CORNER_HILITE; | 485 const int[] leftHighlightCurve = CTabFolder.TOP_LEFT_CORNER_HILITE; |
486 | 486 |
487 int d = parent.tabHeight - parent.topCurveHighlightEnd.length /2; | 487 int d = parent.tabHeight - parent.topCurveHighlightEnd.length /2; |
488 | 488 |
489 int lastX = 0; | 489 int lastX = 0; |
490 int lastY = 0; | 490 int lastY = 0; |
551 | 551 |
552 int[] shape = null; | 552 int[] shape = null; |
553 int startX = x + width - 1; | 553 int startX = x + width - 1; |
554 | 554 |
555 if (this.parent.onBottom) { | 555 if (this.parent.onBottom) { |
556 int[] right = parent.simple | 556 TryConst!(int[]) right = parent.simple |
557 ? CTabFolder.SIMPLE_UNSELECTED_INNER_CORNER | 557 ? CTabFolder.SIMPLE_UNSELECTED_INNER_CORNER |
558 : CTabFolder.BOTTOM_RIGHT_CORNER; | 558 : CTabFolder.BOTTOM_RIGHT_CORNER; |
559 | 559 |
560 shape = new int[right.length + 2]; | 560 shape = new int[right.length + 2]; |
561 int index = 0; | 561 int index = 0; |
565 shape[index++] = y + height + right[2 * i + 1] - 1; | 565 shape[index++] = y + height + right[2 * i + 1] - 1; |
566 } | 566 } |
567 shape[index++] = startX; | 567 shape[index++] = startX; |
568 shape[index++] = y - 1; | 568 shape[index++] = y - 1; |
569 } else { | 569 } else { |
570 int[] right = parent.simple | 570 TryConst!(int[]) right = parent.simple |
571 ? CTabFolder.SIMPLE_UNSELECTED_INNER_CORNER | 571 ? CTabFolder.SIMPLE_UNSELECTED_INNER_CORNER |
572 : CTabFolder.TOP_RIGHT_CORNER; | 572 : CTabFolder.TOP_RIGHT_CORNER; |
573 | 573 |
574 shape = new int[right.length + 2]; | 574 shape = new int[right.length + 2]; |
575 int index = 0; | 575 int index = 0; |
607 */ | 607 */ |
608 void drawLeftUnselectedBorder(GC gc) { | 608 void drawLeftUnselectedBorder(GC gc) { |
609 | 609 |
610 int[] shape = null; | 610 int[] shape = null; |
611 if (this.parent.onBottom) { | 611 if (this.parent.onBottom) { |
612 int[] left = parent.simple | 612 TryConst!(int[]) left = parent.simple |
613 ? CTabFolder.SIMPLE_UNSELECTED_INNER_CORNER | 613 ? CTabFolder.SIMPLE_UNSELECTED_INNER_CORNER |
614 : CTabFolder.BOTTOM_LEFT_CORNER; | 614 : CTabFolder.BOTTOM_LEFT_CORNER; |
615 | 615 |
616 shape = new int[left.length + 2]; | 616 shape = new int[left.length + 2]; |
617 int index = 0; | 617 int index = 0; |
620 for (int i = 0; i < left.length / 2; i++) { | 620 for (int i = 0; i < left.length / 2; i++) { |
621 shape[index++] = x + left[2 * i]; | 621 shape[index++] = x + left[2 * i]; |
622 shape[index++] = y + height + left[2 * i + 1] - 1; | 622 shape[index++] = y + height + left[2 * i + 1] - 1; |
623 } | 623 } |
624 } else { | 624 } else { |
625 int[] left = parent.simple | 625 TryConst!(int[]) left = parent.simple |
626 ? CTabFolder.SIMPLE_UNSELECTED_INNER_CORNER | 626 ? CTabFolder.SIMPLE_UNSELECTED_INNER_CORNER |
627 : CTabFolder.TOP_LEFT_CORNER; | 627 : CTabFolder.TOP_LEFT_CORNER; |
628 | 628 |
629 shape = new int[left.length + 2]; | 629 shape = new int[left.length + 2]; |
630 int index = 0; | 630 int index = 0; |