Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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