summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
diff options
context:
space:
mode:
authorSteve Northover <steve>2002-10-16 17:46:09 +0000
committerSteve Northover <steve>2002-10-16 17:46:09 +0000
commit58e5a59fb368ef9f3f43f8eea0b984cb90c4159e (patch)
treec83ca7b1ae1ce4ad53334c34339e71980d0c17c6 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
parent9ee2a7fe3d31efd1bbaa8109583dbc7f3b9cbc47 (diff)
downloadeclipse.platform.swt-58e5a59fb368ef9f3f43f8eea0b984cb90c4159e.tar.gz
eclipse.platform.swt-58e5a59fb368ef9f3f43f8eea0b984cb90c4159e.tar.xz
eclipse.platform.swt-58e5a59fb368ef9f3f43f8eea0b984cb90c4159e.zip
*** empty log message ***
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java36
1 files changed, 17 insertions, 19 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
index 331bec5579..df141d17d2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
@@ -71,21 +71,6 @@ static int checkStyle (int style) {
return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
}
-void configureBar (int selection, int minimum, int maximum) {
- double fraction = minimum == maximum ? 1 : (double)(selection - minimum) / (maximum - minimum);
- OS.gtk_progress_bar_set_fraction (handle, fraction);
- /*
- * Feature in GTK. The progress bar does
- * not redraw right away when a value is
- * changed. This is not strictly incorrect
- * but unexpected. The fix is to force all
- * outstanding redraws to be delivered.
- */
- OS.gdk_flush ();
- int window = paintWindow ();
- OS.gdk_window_process_updates (window, false);
-}
-
void createHandle (int index) {
state |= HANDLE;
handle = OS.gtk_progress_bar_new ();
@@ -182,7 +167,7 @@ public void setMaximum (int maximum) {
if (maximum < min) maximum = min;
max = maximum;
if (value > maximum) value = maximum;
- configureBar (value, min, max);
+ updateBar (value, min, max);
}
/**
@@ -203,7 +188,7 @@ public void setMinimum (int minimum) {
if (minimum > max) minimum = max;
if (value < minimum) value = minimum;
min = minimum;
- configureBar (value, min, max);
+ updateBar (value, min, max);
}
/**
@@ -224,8 +209,21 @@ public void setSelection (int x) {
if (x < min) x = min;
if (x > max) x = max;
value = x;
- configureBar (value, min, max);
+ updateBar (value, min, max);
}
-
+void updateBar (int selection, int minimum, int maximum) {
+ double fraction = minimum == maximum ? 1 : (double)(selection - minimum) / (maximum - minimum);
+ OS.gtk_progress_bar_set_fraction (handle, fraction);
+ /*
+ * Feature in GTK. The progress bar does
+ * not redraw right away when a value is
+ * changed. This is not strictly incorrect
+ * but unexpected. The fix is to force all
+ * outstanding redraws to be delivered.
+ */
+ OS.gdk_flush ();
+ int window = paintWindow ();
+ OS.gdk_window_process_updates (window, false);
+}
}