Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine2001-06-27 16:47:43 -0400
committerVeronika Irvine2001-06-27 16:47:43 -0400
commit99e0564cbc10611a8f78322f6f18a21f6e115cdf (patch)
tree9dc4a0e827025157451ec373786ff475bf60bda4
parente52ae8cabcab6e0362eee8f614964c07f1378c64 (diff)
downloadeclipse.platform.swt-99e0564cbc10611a8f78322f6f18a21f6e115cdf.tar.gz
eclipse.platform.swt-99e0564cbc10611a8f78322f6f18a21f6e115cdf.tar.xz
eclipse.platform.swt-99e0564cbc10611a8f78322f6f18a21f6e115cdf.zip
VI Clipboard hacking
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c4
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Device.java18
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GC.java37
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java1
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Composite.java124
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Display.java9
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Label.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Scale.java1
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Shell.java6
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ToolItem.java11
11 files changed, 180 insertions, 35 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
index 2d10a97655..896c2e5fb7 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
@@ -955,7 +955,7 @@ private void redrawTabArea(int index) {
y = item.y;
Rectangle area = super.getClientArea();
width = area.x + area.width - x;
- height = area.y + area.height - y;
+ height = item.height;
}
redraw(x, y, width, height, false);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c b/bundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c
index 99d97120cf..2eee321d95 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c
@@ -8015,7 +8015,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_read
if (buf)
buf1 = (*env)->GetByteArrayElements(env, buf, NULL);
- rc = (jint) read(filedes, (char *)buf, nbyte);
+ rc = (jint) read(filedes, (char *)buf1, nbyte);
if (buf)
(*env)->ReleaseByteArrayElements(env, buf, buf1, 0);
@@ -8038,7 +8038,7 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_write
if (buf)
buf1 = (*env)->GetByteArrayElements(env, buf, NULL);
- rc = (jint) write(filedes, (char *)buf, nbyte);
+ rc = (jint) write(filedes, (char *)buf1, nbyte);
if (buf)
(*env)->ReleaseByteArrayElements(env, buf, buf1, 0);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Device.java
index ff740b3b53..78f73d66a2 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Device.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/Device.java
@@ -94,6 +94,13 @@ void dispose_Object (Object object) {
public Rectangle getBounds () {
checkDevice ();
+ PgDisplaySettings_t settings = new PgDisplaySettings_t ();
+ OS.PgGetVideoMode (settings);
+ return new Rectangle (0, 0, settings.xres, settings.yres);
+}
+
+public Rectangle getClientArea () {
+ checkDevice ();
PhRect_t rect = new PhRect_t ();
OS.PhWindowQueryVisible (OS.Ph_QUERY_GRAPHICS, 0, 1, rect);
int width = rect.lr_x - rect.ul_x + 1;
@@ -101,14 +108,13 @@ public Rectangle getBounds () {
return new Rectangle (rect.ul_x, rect.ul_y, width, height);
}
-public Rectangle getClientArea () {
- return getBounds ();
-}
-
public int getDepth () {
checkDevice ();
- //NOT DONE
- return 32;
+ PgDisplaySettings_t settings = new PgDisplaySettings_t ();
+ OS.PgGetVideoMode (settings);
+ PgVideoModeInfo_t mode_info = new PgVideoModeInfo_t ();
+ OS.PgGetVideoModeInfo ((short) settings.mode, mode_info);
+ return mode_info.bits_per_pixel;
}
public DeviceData getDeviceData () {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GC.java
index 27bfe18b80..be8a0d3aeb 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/graphics/GC.java
@@ -1371,23 +1371,19 @@ int setGC() {
void setGCClipping() {
int rid = data.rid;
int widget = data.widget;
- int topWidget = data.topWidget;
if (rid == OS.Ph_DEV_RID) OS.PgSetRegion(rid);
else if (widget != 0) OS.PgSetRegion(OS.PtWidgetRid(widget));
else if (data.image != null) return;
- // NOTE: PgSetRegion resets the clipping rectangle to the full size of
- // the region.
+ /* NOTE: PgSetRegion resets the clipping rectangle */
OS.PgSetMultiClip(data.clipRectsCount, data.clipRects);
if (widget == 0) return;
- int clip_tile = getClipping(widget, topWidget, true, true);
+ int clip_tile = getClipping(widget, data.topWidget, true, true);
int[] clip_rects_count = new int[1];
int clip_rects = OS.PhTilesToRects(clip_tile, clip_rects_count);
- OS.PhFreeTiles(clip_tile);
-
- /* PgSetClipping sets the clipping to the full region when the count is zero */
+ OS.PhFreeTiles(clip_tile);
if (clip_rects_count[0] == 0) {
clip_rects_count[0] = 1;
OS.free(clip_rects);
@@ -1400,7 +1396,10 @@ void setGCClipping() {
int getClipping(int widget, int topWidget, boolean clipChildren, boolean clipSiblings) {
int child_tile = 0;
int widget_tile = OS.PhGetTile(); // NOTE: PhGetTile native initializes the tile
-
+
+ PhRect_t rect = new PhRect_t ();
+ int args [] = {OS.Pt_ARG_FLAGS, 0, 0, OS.Pt_ARG_BASIC_FLAGS, 0, 0};
+
/* Get the rectangle of all siblings in front of the widget */
if (clipSiblings) {
int temp_widget = topWidget;
@@ -1410,6 +1409,17 @@ int getClipping(int widget, int topWidget, boolean clipChildren, boolean clipSib
if (child_tile == 0) child_tile = tile;
else child_tile = OS.PhAddMergeTiles(tile, child_tile, null);
OS.PtWidgetExtent(temp_widget, tile); // NOTE: tile->rect
+ args [1] = args [4] = 0;
+ OS.PtGetResources(temp_widget, args.length / 3, args);
+ if ((args [1] & OS.Pt_HIGHLIGHTED) != 0) {
+ int basic_flags = args [4];
+ OS.memmove(rect, tile, PhRect_t.sizeof);
+ if ((basic_flags & OS.Pt_TOP_ETCH) != 0) rect.ul_y++;
+ if ((basic_flags & OS.Pt_BOTTOM_ETCH) != 0) rect.lr_y--;
+ if ((basic_flags & OS.Pt_RIGHT_ETCH) != 0) rect.ul_x++;
+ if ((basic_flags & OS.Pt_LEFT_ETCH) != 0) rect.lr_x--;
+ OS.memmove(tile, rect, PhRect_t.sizeof);
+ }
}
}
/* Translate the siblings rectangles to the widget's coordinates */
@@ -1426,6 +1436,17 @@ int getClipping(int widget, int topWidget, boolean clipChildren, boolean clipSib
if (child_tile == 0) child_tile = tile;
else child_tile = OS.PhAddMergeTiles(tile, child_tile, null);
OS.PtWidgetExtent(temp_widget, tile); // NOTE: tile->rect
+ args [1] = args [4] = 0;
+ OS.PtGetResources(temp_widget, args.length / 3, args);
+ if ((args [1] & OS.Pt_HIGHLIGHTED) != 0) {
+ int basic_flags = args [4];
+ OS.memmove(rect, tile, PhRect_t.sizeof);
+ if ((basic_flags & OS.Pt_TOP_ETCH) != 0) rect.ul_y++;
+ if ((basic_flags & OS.Pt_BOTTOM_ETCH) != 0) rect.lr_y--;
+ if ((basic_flags & OS.Pt_RIGHT_ETCH) != 0) rect.ul_x++;
+ if ((basic_flags & OS.Pt_LEFT_ETCH) != 0) rect.lr_x--;
+ OS.memmove(tile, rect, PhRect_t.sizeof);
+ }
}
temp_widget = OS.PtWidgetBrotherInFront(temp_widget);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java
index 43c4aeddc7..174460a8d0 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java
@@ -139,6 +139,7 @@ void createHandle (int index) {
int [] args = {
OS.Pt_ARG_HORIZONTAL_ALIGNMENT, alignment, 0,
OS.Pt_ARG_INDICATOR_TYPE, (style & SWT.CHECK) != 0 ? OS.Pt_N_OF_MANY : OS.Pt_ONE_OF_MANY, 0,
+ OS.Pt_ARG_FILL_COLOR, display.WIDGET_BACKGROUND, 0,
OS.Pt_ARG_RESIZE_FLAGS, 0, OS.Pt_RESIZE_XY_BITS,
};
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 b120e52b4e..e5908ee800 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
@@ -93,15 +93,21 @@ void createScrolledHandle (int parentHandle) {
OS.Pt_ARG_FLAGS, hasBorder () ? OS.Pt_HIGHLIGHTED : 0, OS.Pt_HIGHLIGHTED,
OS.Pt_ARG_BASIC_FLAGS, hasBorder () ? etches : 0, etches,
OS.Pt_ARG_CONTAINER_FLAGS, 0, OS.Pt_ENABLE_CUA | OS.Pt_ENABLE_CUA_ARROWS,
+ OS.Pt_ARG_FILL_COLOR, OS.Pg_TRANSPARENT, 0,
OS.Pt_ARG_RESIZE_FLAGS, 0, OS.Pt_RESIZE_XY_BITS,
};
scrolledHandle = OS.PtCreateWidget (OS.PtContainer (), parentHandle, args.length / 3, args);
- if ((style & SWT.NO_BACKGROUND) != 0) {
- args = new int [] {OS.Pt_ARG_FILL_COLOR, OS.Pg_TRANSPARENT, 0};
- OS.PtSetResources(scrolledHandle, args.length / 3, args);
- }
if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES);
Display display = getDisplay ();
+ etches = OS.Pt_TOP_OUTLINE | OS.Pt_LEFT_OUTLINE;
+ args = new int [] {
+ OS.Pt_ARG_FLAGS, OS.Pt_HIGHLIGHTED, OS.Pt_HIGHLIGHTED,
+ OS.Pt_ARG_BASIC_FLAGS, etches, etches,
+ OS.Pt_ARG_WIDTH, display.SCROLLBAR_WIDTH, 0,
+ OS.Pt_ARG_HEIGHT, display.SCROLLBAR_HEIGHT, 0,
+ OS.Pt_ARG_RESIZE_FLAGS, 0, OS.Pt_RESIZE_XY_BITS,
+ };
+ OS.PtCreateWidget (OS.PtContainer (), scrolledHandle, args.length / 3, args);
int clazz = display.PtContainer;
args = new int [] {
OS.Pt_ARG_CONTAINER_FLAGS, 0, OS.Pt_ENABLE_CUA | OS.Pt_ENABLE_CUA_ARROWS,
@@ -120,7 +126,79 @@ public Rectangle getClientArea () {
OS.PtWidgetArea (handle, area);
return new Rectangle (area.pos_x, area.pos_y, area.size_w, area.size_h);
}
+
+int getClipping(int widget, int topWidget, boolean clipChildren, boolean clipSiblings) {
+ int child_tile = 0;
+ int widget_tile = OS.PhGetTile(); // NOTE: PhGetTile native initializes the tile
+
+ PhRect_t rect = new PhRect_t ();
+ int args [] = {OS.Pt_ARG_FLAGS, 0, 0, OS.Pt_ARG_BASIC_FLAGS, 0, 0};
+ /* Get the rectangle of all siblings in front of the widget */
+ if (clipSiblings) {
+ int temp_widget = topWidget;
+ while ((temp_widget = OS.PtWidgetBrotherInFront(temp_widget)) != 0) {
+ if (OS.PtWidgetIsRealized(temp_widget)) {
+ int tile = OS.PhGetTile();
+ if (child_tile == 0) child_tile = tile;
+ else child_tile = OS.PhAddMergeTiles(tile, child_tile, null);
+ OS.PtWidgetExtent(temp_widget, tile); // NOTE: tile->rect
+ args [1] = args [4] = 0;
+ OS.PtGetResources(temp_widget, args.length / 3, args);
+ if ((args [1] & OS.Pt_HIGHLIGHTED) != 0) {
+ int basic_flags = args [4];
+ OS.memmove(rect, tile, PhRect_t.sizeof);
+ if ((basic_flags & OS.Pt_TOP_ETCH) != 0) rect.ul_y++;
+ if ((basic_flags & OS.Pt_BOTTOM_ETCH) != 0) rect.lr_y--;
+ if ((basic_flags & OS.Pt_RIGHT_ETCH) != 0) rect.ul_x++;
+ if ((basic_flags & OS.Pt_LEFT_ETCH) != 0) rect.lr_x--;
+ OS.memmove(tile, rect, PhRect_t.sizeof);
+ }
+ }
+ }
+ /* Translate the siblings rectangles to the widget's coordinates */
+ OS.PtWidgetCanvas(topWidget, widget_tile); // NOTE: widget_tile->rect
+ OS.PhDeTranslateTiles(child_tile, widget_tile); // NOTE: widget_tile->rect.ul
+ }
+
+ /* Get the rectangle of the widget's children */
+ if (clipChildren) {
+ int temp_widget = OS.PtWidgetChildBack(widget);
+ while (temp_widget != 0) {
+ if (OS.PtWidgetIsRealized(temp_widget)) {
+ int tile = OS.PhGetTile();
+ if (child_tile == 0) child_tile = tile;
+ else child_tile = OS.PhAddMergeTiles(tile, child_tile, null);
+ OS.PtWidgetExtent(temp_widget, tile); // NOTE: tile->rect
+ args [1] = args [4] = 0;
+ OS.PtGetResources(temp_widget, args.length / 3, args);
+ if ((args [1] & OS.Pt_HIGHLIGHTED) != 0) {
+ int basic_flags = args [4];
+ OS.memmove(rect, tile, PhRect_t.sizeof);
+ if ((basic_flags & OS.Pt_TOP_ETCH) != 0) rect.ul_y++;
+ if ((basic_flags & OS.Pt_BOTTOM_ETCH) != 0) rect.lr_y--;
+ if ((basic_flags & OS.Pt_RIGHT_ETCH) != 0) rect.ul_x++;
+ if ((basic_flags & OS.Pt_LEFT_ETCH) != 0) rect.lr_x--;
+ OS.memmove(tile, rect, PhRect_t.sizeof);
+ }
+ }
+ temp_widget = OS.PtWidgetBrotherInFront(temp_widget);
+ }
+ }
+
+ /* Get the widget's rectangle */
+ OS.PtWidgetCanvas(widget, widget_tile); // NOTE: widget_tile->rect
+ OS.PhDeTranslateTiles(widget_tile, widget_tile); // NOTE: widget_tile->rect.ul
+
+ /* Clip the widget's rectangle from the child/siblings rectangle's */
+ if (child_tile != 0) {
+ int clip_tile = OS.PhClipTilings(widget_tile, child_tile, null);
+ OS.PhFreeTiles(child_tile);
+ return clip_tile;
+ }
+ return widget_tile;
+}
+
public Control [] getChildren () {
if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED);
@@ -213,7 +291,37 @@ int processMouse (int info) {
int processPaint (int damage) {
if ((state & CANVAS) != 0) {
if ((style & SWT.NO_BACKGROUND) == 0) {
+
+ /* Get the clipping tiles for children and siblings */
+ int clip_tile = getClipping (handle, topHandle (), true, true);
+
+ /* Translate the clipping to the current GC coordinates */
+ short [] abs_x = new short [1], abs_y = new short [1];
+ OS.PtGetAbsPosition (handle, abs_x, abs_y);
+ short [] dis_abs_x = new short [1], dis_abs_y = new short [1];
+ OS.PtGetAbsPosition (OS.PtFindDisjoint (handle), dis_abs_x, dis_abs_y);
+ PhPoint_t delta = new PhPoint_t ();
+ delta.x = (short) (abs_x [0] - dis_abs_x [0]);
+ delta.y = (short) (abs_y [0] - dis_abs_y [0]);
+ OS.PhTranslateTiles(clip_tile, delta);
+
+ /* Set the clipping */
+ int[] clip_rects_count = new int [1];
+ int clip_rects = OS.PhTilesToRects (clip_tile, clip_rects_count);
+ OS.PhFreeTiles (clip_tile);
+ if (clip_rects_count [0] == 0) {
+ clip_rects_count [0] = 1;
+ OS.free (clip_rects);
+ clip_rects = OS.malloc (PhRect_t.sizeof);
+ }
+ OS.PgSetMultiClip (clip_rects_count[0], clip_rects);
+ OS.free (clip_rects);
+
+ /* Draw the widget */
OS.PtSuperClassDraw (OS.PtContainer (), handle, damage);
+
+ /* Reset the clipping */
+ OS.PgSetMultiClip (0, 0);
}
}
return super.processPaint (damage);
@@ -316,6 +424,14 @@ void resizeClientArea (int width, int height) {
OS.Pt_ARG_HEIGHT, Math.max (clientHeight, 0), 0,
};
OS.PtSetResources (handle, args.length / 3, args);
+ PhPoint_t pt = new PhPoint_t ();
+ pt.x = (short) clientWidth;
+ pt.y = (short) clientHeight;
+ int ptr = OS.malloc (PhPoint_t.sizeof);
+ OS.memmove (ptr, pt, PhPoint_t.sizeof);
+ args = new int [] {OS.Pt_ARG_POS, ptr, 0};
+ OS.PtSetResources (OS.PtWidgetChildBack (scrolledHandle), args.length / 3, args);
+ OS.free (ptr);
}
void setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Display.java
index 4bd481006c..48390bb046 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Display.java
@@ -327,15 +327,6 @@ public Shell getActiveShell () {
return null;
}
-public Rectangle getBounds () {
- checkDevice ();
- PhRect_t rect = new PhRect_t ();
- OS.PhWindowQueryVisible (OS.Ph_QUERY_GRAPHICS, 0, 1, rect);
- int width = rect.lr_x - rect.ul_x + 1;
- int height = rect.lr_y - rect.ul_y + 1;
- return new Rectangle (rect.ul_x, rect.ul_y, width, height);
-}
-
public Control getCursorControl () {
checkDevice ();
int ig = OS.PhInputGroup (0);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Label.java
index 0bd2a8b36b..b97c3fc575 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Label.java
@@ -121,6 +121,7 @@ void createHandle (int index) {
int [] args = {
OS.Pt_ARG_SEP_FLAGS, orientation, OS.Pt_SEP_VERTICAL | OS.Pt_SEP_HORIZONTAL,
OS.Pt_ARG_SEP_TYPE, type, 0,
+ OS.Pt_ARG_FILL_COLOR, display.WIDGET_BACKGROUND, 0,
OS.Pt_ARG_RESIZE_FLAGS, 0, OS.Pt_RESIZE_XY_BITS,
};
handle = OS.PtCreateWidget (clazz, parentHandle, args.length / 3, args);
@@ -138,6 +139,7 @@ void createHandle (int index) {
OS.Pt_ARG_FLAGS, hasBorder ? OS.Pt_HIGHLIGHTED : 0, OS.Pt_HIGHLIGHTED,
OS.Pt_ARG_HORIZONTAL_ALIGNMENT, alignment, 0,
OS.Pt_ARG_VERTICAL_ALIGNMENT, verticalAlign, 0,
+ OS.Pt_ARG_FILL_COLOR, display.WIDGET_BACKGROUND, 0,
OS.Pt_ARG_RESIZE_FLAGS, 0, OS.Pt_RESIZE_XY_BITS,
};
handle = OS.PtCreateWidget (clazz, parentHandle, args.length / 3, args);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Scale.java
index 400c24766f..619e836f48 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Scale.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Scale.java
@@ -59,6 +59,7 @@ void createHandle (int index) {
OS.Pt_ARG_PAGE_INCREMENT, 10, 0,
OS.Pt_ARG_SLIDER_SIZE, 10, 0,
OS.Pt_ARG_ORIENTATION, (style & SWT.HORIZONTAL) != 0 ? OS.Pt_HORIZONTAL : OS.Pt_VERTICAL, 0,
+ OS.Pt_ARG_FILL_COLOR, display.WIDGET_BACKGROUND, 0,
OS.Pt_ARG_RESIZE_FLAGS, 0, OS.Pt_RESIZE_XY_BITS,
};
handle = OS.PtCreateWidget (clazz, parentHandle, args.length / 3, args);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Shell.java
index 6e66d3a8ca..631c0d5785 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Shell.java
@@ -119,6 +119,7 @@ void createHandle (int index) {
if (handle != 0) {
int clazz = display.PtContainer;
int [] args = {
+ OS.Pt_ARG_FILL_COLOR, OS.Pg_TRANSPARENT, 0,
OS.Pt_ARG_RESIZE_FLAGS, 0, OS.Pt_RESIZE_XY_BITS,
};
shellHandle = OS.PtCreateWidget (clazz, handle, args.length / 3, args);
@@ -160,6 +161,7 @@ void createHandle (int index) {
OS.Pt_ARG_WINDOW_NOTIFY_FLAGS, notifyFlags, notifyFlags,
OS.Pt_ARG_WINDOW_STATE, windowState, ~0,
OS.Pt_ARG_FLAGS, OS.Pt_DELAY_REALIZE, OS.Pt_DELAY_REALIZE,
+ OS.Pt_ARG_FILL_COLOR, OS.Pg_TRANSPARENT, 0,
OS.Pt_ARG_RESIZE_FLAGS, 0, OS.Pt_RESIZE_XY_BITS,
};
OS.PtSetParentWidget (parentHandle);
@@ -167,10 +169,6 @@ void createHandle (int index) {
OS.free (titlePtr);
if (shellHandle == 0) error (SWT.ERROR_NO_HANDLES);
}
- if ((style & SWT.NO_BACKGROUND) != 0) {
- int [] args = new int [] {OS.Pt_ARG_FILL_COLOR, OS.Pg_TRANSPARENT, 0};
- OS.PtSetResources(shellHandle, args.length / 3, args);
- }
createScrolledHandle (shellHandle);
if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.RESIZE)) == 0) {
int [] args = {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ToolItem.java
index 305bfc6873..fba9ac682a 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/ToolItem.java
@@ -362,13 +362,22 @@ public void setHotImage (Image image) {
if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED);
if ((style & SWT.SEPARATOR) != 0) return;
+
+ /* TEMPORARY CODE: remove when when FLAT tool bars are implemented */
+ if ((parent.style & SWT.FLAT) != 0) setImage (image);
+
hotImage = image;
}
public void setImage (Image image) {
if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
if (!isValidWidget ()) error (SWT.ERROR_WIDGET_DISPOSED);
- if ((style & SWT.SEPARATOR) != 0) return;
+ if ((style & SWT.SEPARATOR) != 0) return;
+ super.setImage (image);
+
+ /* TEMPORARY CODE: remove when when FLAT tool bars are implemented */
+ if ((parent.style & SWT.FLAT) != 0 && hotImage != null) return;
+
int imageHandle = 0;
int type = OS.Pt_Z_STRING;
if (image != null) {

Back to the top