aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2014-01-17 07:09:36 (EST)
committerSravan Kumar Lakkimsetti2014-01-17 07:50:57 (EST)
commit6c621148e4f8d62b288aaf2751c64105309afd20 (patch)
tree23f538a9054213d577a6e9a52ef4f3e507d5737d
parent05fe7587ce9a1ea0c00969251eeaadbf4e7f7753 (diff)
downloadeclipse.platform.swt-6c621148e4f8d62b288aaf2751c64105309afd20.zip
eclipse.platform.swt-6c621148e4f8d62b288aaf2751c64105309afd20.tar.gz
eclipse.platform.swt-6c621148e4f8d62b288aaf2751c64105309afd20.tar.bz2
Bug 339754 - DateTime doesn't mark current date with SWT.CALENDAR style.refs/changes/46/20746/3
Change-Id: If130402e88038d68a5a1c4b6226d4a38b5e9004c Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
-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 cba725b..9d1f20f 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);
}
}