Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
index cba725b3bb..9d1f20fb40 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -118,6 +118,9 @@ public DateTime (Composite parent, int style) {
if ((this.style & SWT.CALENDAR) == 0) {
/* SWT.DATE and SWT.TIME */
createText((this.style & SWT.DROP_DOWN) != 0);
+ } else {
+ /* Highlight the current(today) date */
+ OS.gtk_calendar_mark_day(handle, Calendar.getInstance().get(Calendar.DAY_OF_MONTH));
}
initAccessible ();
}
@@ -885,7 +888,6 @@ void popupCalendarEvent (Event event) {
*/
if (popupCalendar.monthChanged) {
popupCalendar.monthChanged = false;
- OS.gtk_calendar_clear_marks(popupCalendar.handle);
} else {
dropDownCalendar (false);
}
@@ -1082,6 +1084,12 @@ void sendSelectionEvent () {
year = y[0];
month = m[0];
day = d[0];
+ /* Highlight the current(today) date */
+ if (year == Calendar.getInstance().get(Calendar.YEAR) && month == Calendar.getInstance().get(Calendar.MONTH)) {
+ OS.gtk_calendar_mark_day(handle, Calendar.getInstance().get(Calendar.DAY_OF_MONTH));
+ } else {
+ OS.gtk_calendar_clear_marks(handle);
+ }
sendSelectionEvent (SWT.Selection);
}
}

Back to the top