Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarolyn MacLeod2012-03-07 16:17:05 -0500
committerCarolyn MacLeod2012-03-07 16:17:05 -0500
commit4cf183f94d4d4d275955b891045c44c32b075e0a (patch)
treec838e3ad4e10341221c5dbd6882a73e439f6d3a0 /examples
parent0baf41d40f3dd8716522c72f50e1eb2c9697bedd (diff)
downloadeclipse.platform.swt-4cf183f94d4d4d275955b891045c44c32b075e0a.tar.gz
eclipse.platform.swt-4cf183f94d4d4d275955b891045c44c32b075e0a.tar.xz
eclipse.platform.swt-4cf183f94d4d4d275955b891045c44c32b075e0a.zip
Bug 212023 - limitation of SWT ColorDialog
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java
index f3a33e39e7..033bb2a72f 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java
@@ -37,6 +37,7 @@ class DialogTab extends Tab {
Button effectsVisibleButton, usePreviousResultButton;
Button saveButton, openButton, multiButton;
RGB colorDialogResult, fontDialogColorResult;
+ RGB[] colorDialogCustomColors;
String directoryDialogResult;
String fileDialogResult;
int fileDialogIndexResult;
@@ -131,13 +132,23 @@ class DialogTab extends Tab {
ColorDialog dialog = new ColorDialog (shell ,style);
if (usePreviousResultButton.getSelection()) {
dialog.setRGB (colorDialogResult);
+ dialog.setRGBs(colorDialogCustomColors);
}
dialog.setText (ControlExample.getResourceString("Title"));
RGB result = dialog.open ();
textWidget.append (ControlExample.getResourceString("ColorDialog") + Text.DELIMITER);
textWidget.append (ControlExample.getResourceString("Result", new String [] {"" + result}) + Text.DELIMITER);
- textWidget.append ("getRGB() = " + dialog.getRGB() + Text.DELIMITER + Text.DELIMITER);
+ textWidget.append ("getRGB() = " + dialog.getRGB() + Text.DELIMITER);
+ textWidget.append ("getRGBs() =" + Text.DELIMITER);
+ RGB[] rgbs = dialog.getRGBs();
+ if (rgbs != null) {
+ for (int i=0; i<rgbs.length; i++) {
+ textWidget.append ("\t" + rgbs [i] + Text.DELIMITER);
+ }
+ }
+ textWidget.append (Text.DELIMITER);
colorDialogResult = result;
+ colorDialogCustomColors = rgbs;
return;
}

Back to the top