Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 285259 - Spin works incorrect in CDateTime control
Summary: Spin works incorrect in CDateTime control
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Wim Jongman CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-31 06:24 EDT by Stanislav CLA
Modified: 2021-07-05 11:38 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stanislav CLA 2009-07-31 06:24:56 EDT
Build ID: M20080221-1800

Steps To Reproduce:
1.Create CDateTime contol in text mode with spinner and date pattern = "dd.MM.yyyy"
2.Select month field
3.Press spinner UP button

Expected result is month must be incremented according to the control description (If the style DROP_DOWN is not set and SPINNER is, then a Spinner widget can be used to increment and decrement the field).

Actual result: field selection is changed to 'dd' field. Day is incremented
Comment 1 Hartmut Bauer CLA 2009-10-03 21:05:06 EDT
Not sure if this breaks other things, but by making the following change in CDateTime.java I got the spinner to work correct.

At about line 250 the listener sets for SWT.FocusOut the activeField to FIELD_NONE, this is the cause of the problem. If this doesn't happen the spinner works.  

	Listener textListener = new Listener() {
		public void handleEvent(Event event) {
			switch (event.type) {
...
			case SWT.FocusOut:
				if(!rightClick && !internalFocusShift) {
//					setActiveField(FIELD_NONE);
					updateText();
				}
				break;
			case SWT.KeyDown:
Comment 2 Ashwin CLA 2009-12-29 04:49:44 EST
Is this fixed ?
Comment 3 Henno Vermeulen CLA 2013-01-17 04:46:27 EST
Same happens for me when I use CDT.TIME_SHORT: when spinning while yhe minutes are selected the hours change.
Comment 4 Henno Vermeulen CLA 2013-01-17 05:02:49 EST
What I noted in my previous comment was already reported as bug 320656.
Comment 5 Wim Jongman CLA 2013-11-02 11:53:11 EDT
Pushed to master.

http://git.eclipse.org/c/nebula/org.eclipse.nebula.git/commit/?id=85b9d3049aa848ba786a5882f9f2c6a13bf93eff

thanks for reporting