diff options
author | Grant Gayed <ggayed> | 2006-03-16 16:21:45 +0000 |
---|---|---|
committer | Grant Gayed <ggayed> | 2006-03-16 16:21:45 +0000 |
commit | fa405fd1fda974bc21f6737451c9906f36c5ae2a (patch) | |
tree | 430068cd3770d0b4a3ba9cf37e60572218868714 | |
parent | 0c70daa458ad57e4cae80889c9f578fd4ff166bb (diff) | |
download | eclipse.platform.swt-fa405fd1fda974bc21f6737451c9906f36c5ae2a.tar.gz eclipse.platform.swt-fa405fd1fda974bc21f6737451c9906f36c5ae2a.tar.xz eclipse.platform.swt-fa405fd1fda974bc21f6737451c9906f36c5ae2a.zip |
drawBackground
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Canvas.java | 5 | ||||
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Composite.java | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Canvas.java index 78d842914f..ef56bc7872 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Canvas.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Canvas.java @@ -110,10 +110,7 @@ public void drawBackground (GC gc, int x, int y, int width, int height) { checkWidget (); if (gc == null) error (SWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); - Color oldColor = gc.getBackground(); - gc.setBackground(getBackground()); - gc.fillRectangle(x, y, width, height); - gc.setBackground(oldColor); + super.drawBackground (gc, x, y, width, height); } int drawProc (int widget, int damage) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Composite.java index 1ad3c172bf..334ab7c3b7 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Composite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Composite.java @@ -270,6 +270,13 @@ void createScrolledHandle (int parentHandle) { createScrollBars (); } +void drawBackground (GC gc, int x, int y, int width, int height) { + Color oldColor = gc.getBackground(); + gc.setBackground(getBackground()); + gc.fillRectangle(x, y, width, height); + gc.setBackground(oldColor); +} + void drawWidget (int widget, int damage) { if ((state & CANVAS) != 0) { if ((style & SWT.NO_BACKGROUND) == 0) { |