@Override void draw(Theme theme, GC gc, Rectangle bounds) { long /*int*/ progressHandle = theme.progressHandle; long /*int*/ gtkStyle = gtk_widget_get_style (progressHandle); long /*int*/ drawable = gc.getGCData().drawable; theme.transferClipping(gc, gtkStyle); byte[] detail = Converter.wcsToMbcs(null, "trough", true); int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; gtk_render_box (gtkStyle, drawable, getStateType(DrawData.WIDGET_WHOLE), OS.GTK_SHADOW_IN, null, progressHandle, detail, x, y, width, height); int xthichness = OS.gtk_style_get_xthickness(gtkStyle); int ythichness = OS.gtk_style_get_ythickness(gtkStyle); if ((style & SWT.VERTICAL) != 0) { gtk_orientable_set_orientation (progressHandle, OS.GTK_PROGRESS_BOTTOM_TO_TOP); x += xthichness; width -= xthichness * 2; height -= ythichness * 2; height *= selection / (float)Math.max(1, (maximum - minimum)); y += bounds.height - ythichness - height; } else { gtk_orientable_set_orientation (progressHandle, OS.GTK_PROGRESS_LEFT_TO_RIGHT); x += xthichness; y += ythichness; width -= xthichness * 2; height -= ythichness * 2; width *= selection / (float)Math.max(1, maximum - minimum); } detail = Converter.wcsToMbcs(null, "bar", true); gtk_render_box (gtkStyle, drawable, OS.GTK_STATE_PRELIGHT, OS.GTK_SHADOW_OUT, null, progressHandle, detail, x, y, width, height); }
@Override void draw(Theme theme, GC gc, Rectangle bounds) { if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) { int /*long*/ hTheme = OS.OpenThemeData(0, getClassId()); RECT rect = new RECT (); rect.left = bounds.x; int spaceSize = buffer[0]; RECT content = new RECT(); int[] part = getPartId(DrawData.WIDGET_WHOLE); if ((style & SWT.VERTICAL) != 0) { OS.GetThemeBackgroundContentRect(hTheme, gc.handle, part[0], part[1], rect, content);
@Override void draw(Theme theme, GC gc, Rectangle bounds) { int /*long*/ progressHandle = theme.progressHandle; int /*long*/ gtkStyle = gtk_widget_get_style (progressHandle); int /*long*/ drawable = gc.getGCData().drawable; theme.transferClipping(gc, gtkStyle); byte[] detail = Converter.wcsToMbcs(null, "trough", true); int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; gtk_render_box (gtkStyle, drawable, getStateType(DrawData.WIDGET_WHOLE), OS.GTK_SHADOW_IN, null, progressHandle, detail, x, y, width, height); int xthichness = OS.gtk_style_get_xthickness(gtkStyle); int ythichness = OS.gtk_style_get_ythickness(gtkStyle); if ((style & SWT.VERTICAL) != 0) { gtk_orientable_set_orientation (progressHandle, OS.GTK_PROGRESS_BOTTOM_TO_TOP); x += xthichness; width -= xthichness * 2; height -= ythichness * 2; height *= selection / (float)Math.max(1, (maximum - minimum)); y += bounds.height - ythichness - height; } else { gtk_orientable_set_orientation (progressHandle, OS.GTK_PROGRESS_LEFT_TO_RIGHT); x += xthichness; y += ythichness; width -= xthichness * 2; height -= ythichness * 2; width *= selection / (float)Math.max(1, maximum - minimum); } detail = Converter.wcsToMbcs(null, "bar", true); gtk_render_box (gtkStyle, drawable, OS.GTK_STATE_PRELIGHT, OS.GTK_SHADOW_OUT, null, progressHandle, detail, x, y, width, height); }
@Override void draw(Theme theme, GC gc, Rectangle bounds) { int /*long*/ progressHandle = theme.progressHandle; int /*long*/ gtkStyle = gtk_widget_get_style (progressHandle); int /*long*/ drawable = gc.getGCData().drawable; theme.transferClipping(gc, gtkStyle); byte[] detail = Converter.wcsToMbcs(null, "trough", true); int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; gtk_render_box (gtkStyle, drawable, getStateType(DrawData.WIDGET_WHOLE), OS.GTK_SHADOW_IN, null, progressHandle, detail, x, y, width, height); int xthichness = OS.gtk_style_get_xthickness(gtkStyle); int ythichness = OS.gtk_style_get_ythickness(gtkStyle); if ((style & SWT.VERTICAL) != 0) { gtk_orientable_set_orientation (progressHandle, OS.GTK_PROGRESS_BOTTOM_TO_TOP); x += xthichness; width -= xthichness * 2; height -= ythichness * 2; height *= selection / (float)Math.max(1, (maximum - minimum)); y += bounds.height - ythichness - height; } else { gtk_orientable_set_orientation (progressHandle, OS.GTK_PROGRESS_LEFT_TO_RIGHT); x += xthichness; y += ythichness; width -= xthichness * 2; height -= ythichness * 2; width *= selection / (float)Math.max(1, maximum - minimum); } detail = Converter.wcsToMbcs(null, "bar", true); gtk_render_box (gtkStyle, drawable, OS.GTK_STATE_PRELIGHT, OS.GTK_SHADOW_OUT, null, progressHandle, detail, x, y, width, height); }