From 58c80ff0565eaf7cdcac1e8ac1379b16f9b58992 Mon Sep 17 00:00:00 2001 From: Grant Gayed Date: Tue, 15 Apr 2003 20:53:37 +0000 Subject: 33316 --- .../gtk1x/org/eclipse/swt/widgets/FontDialog.java | 32 +++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/FontDialog.java') diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/FontDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/FontDialog.java index 174ed80d92..8c9f027bc8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/FontDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk1x/org/eclipse/swt/widgets/FontDialog.java @@ -99,10 +99,24 @@ int destroyFunc (int widget, int colorInfo) { * selected in the dialog, or null if none is available. * * @return the FontData for the selected font, or null + * @deprecated use #getFontDataSet () */ -public FontData getFontData() { +public FontData getFontData () { return fontData; } +/** + * Returns a FontData set describing the font that was + * selected in the dialog, or null if none is available. + * + * @return the FontData for the selected font, or null + * @since 2.2 + */ +public FontData [] getFontDataSet () { + if (fontData == null) return null; + FontData [] result = new FontData [1]; + result [0] = fontData; + return result; +} int okFunc (int widget, int callData) { int hFontName = OS.gtk_font_selection_dialog_get_font_name (callData); int fontSize = OS.strlen (hFontName); @@ -165,8 +179,24 @@ public FontData open () { * the platform choose one. * * @param fontData the FontData to use initially, or null + * @deprecated use #setFontData (FontData []) */ public void setFontData (FontData fontData) { this.fontData = fontData; } +/** + * Sets a set of FontData objects describing the font to + * be selected by default in the dialog, or null to let + * the platform choose one. + * + * @param fontData the set of FontData objects to use initially, or null + * @since 2.2 + */ +public void setFontData (FontData [] fontData) { + if (fontData != null && fontData.length > 0) { + this.fontData = fontData [0]; + } else { + this.fontData = null; + } +} } -- cgit