diff options
author | Felipe Heidrich | 2005-03-28 22:07:31 +0000 |
---|---|---|
committer | Felipe Heidrich | 2005-03-28 22:07:31 +0000 |
commit | bd89ec28ce4c03e69b002e4e21dcd2b0f9ced25d (patch) | |
tree | 6efa7de1b570666094942d12116788a9e81bb626 | |
parent | f4b153b8cd5fc521d6acd1694cd0ea86f7ec8ee1 (diff) | |
download | eclipse.platform.swt-bd89ec28ce4c03e69b002e4e21dcd2b0f9ced25d.tar.gz eclipse.platform.swt-bd89ec28ce4c03e69b002e4e21dcd2b0f9ced25d.tar.xz eclipse.platform.swt-bd89ec28ce4c03e69b002e4e21dcd2b0f9ced25d.zip |
*** empty log message ***
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java index 3a333eea2e..cbfe5db11d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java @@ -194,6 +194,36 @@ void createWidget () { } } +void drawWidget (GC gc, RECT rect) { + drawBackground (gc.handle, rect); + int selStart = selection.x; + int selEnd = selection.y; + if (selStart > selEnd) { + selStart = selection.y; + selEnd = selection.x; + } + // temporary code to disable text selection + selStart = selEnd = -1; + layout.draw (gc, 0, 0, selStart, selEnd, null, null); + if (hasFocus () && focusIndex != -1) { + Rectangle [] rects = getRectangles (focusIndex); + for (int i = 0; i < rects.length; i++) { + Rectangle rectangle = rects [i]; + gc.drawFocus (rectangle.x, rectangle.y, rectangle.width, rectangle.height); + } + } + if (hooks (SWT.Paint) || filters (SWT.Paint)) { + Event event = new Event (); + event.gc = gc; + event.x = rect.left; + event.y = rect.top; + event.width = rect.right - rect.left; + event.height = rect.bottom - rect.top; + sendEvent (SWT.Paint, event); + event.gc = null; + } +} + void enableWidget (boolean enabled) { super.enableWidget (enabled); if (OS.COMCTL32_MAJOR >= 6) { @@ -257,36 +287,6 @@ public String getText () { return text; } -void onPaint (GC gc, RECT rect) { - drawBackground (gc.handle, rect); - int selStart = selection.x; - int selEnd = selection.y; - if (selStart > selEnd) { - selStart = selection.y; - selEnd = selection.x; - } - // temporary code to disable text selection - selStart = selEnd = -1; - layout.draw (gc, 0, 0, selStart, selEnd, null, null); - if (hasFocus () && focusIndex != -1) { - Rectangle [] rects = getRectangles (focusIndex); - for (int i = 0; i < rects.length; i++) { - Rectangle rectangle = rects [i]; - gc.drawFocus (rectangle.x, rectangle.y, rectangle.width, rectangle.height); - } - } - if (hooks (SWT.Paint) || filters (SWT.Paint)) { - Event event = new Event (); - event.gc = gc; - event.x = rect.left; - event.y = rect.top; - event.width = rect.right - rect.left; - event.height = rect.bottom - rect.top; - sendEvent (SWT.Paint, event); - event.gc = null; - } -} - String parse (String string) { int length = string.length (); offsets = new Point [length / 4]; @@ -734,7 +734,7 @@ LRESULT WM_PAINT (int wParam, int lParam) { if (width != 0 && height != 0) { RECT rect = new RECT (); OS.SetRect (rect, ps.left, ps.top, ps.right, ps.bottom); - onPaint (gc, rect); + drawWidget (gc, rect); } gc.dispose (); } @@ -749,7 +749,7 @@ LRESULT WM_PRINTCLIENT (int wParam, int lParam) { GCData data = new GCData (); data.device = display; GC gc = GC.win32_new (wParam, data); - onPaint (gc, rect); + drawWidget (gc, rect); gc.dispose (); } return result; |