AutoHotkey Community

It is currently May 27th, 2012, 12:23 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: DateTime improvement
PostPosted: June 4th, 2005, 5:15 pm 
Offline

Joined: September 7th, 2004, 9:20 pm
Posts: 275
Location: France
I tried the DateTime GUI control, and I have some suggestions to do :
I used to test it :
Code:
Gui, Add, DateTime, vMyDateTime, yyyyMMdd
Gui,show

and I seen in the help file :
Quote:
Keyboard navigation: Use the Up/Down arrow keys, NumpadPlus/Minus, and Home/End to increase or decrease the control's values. Use LeftArrow and RightArrow to move from field to field inside the control. Within the drop-down calendar, use the arrow keys to move from day to day; use PageUp/Down to move backward/forward by one month; use Ctrl-PageUp/Down to move backward/forward by one year; and use Home/End to select the first/last day of the month.

But for my point of vue, I'd like to enter (for example for today's date) : 20050604 rather than 2005{Left}06{Left}04, witch is longer and (at least in my mind) less practical. I think it is very usefull to be able to enter the date in this way for the speed of typing.

And I'd like to be able to enter the date in this way, even if I use :
Code:
Gui, Add, DateTime, vMyDateTime, yyyy/MM/dd
Gui,show

So without typing the "/" characters
Is it possible to have an option to do that ? I prefer this possibility to the following one :

I read too in the help file :
Quote:
If the control has a g-label, the label is launched whenever the user changes the date or time. For each launch, the control's associated output variable (if any) is automatically updated with the currently selected date/time.

So I can have a procedure called after each character typed to Send myself the {Left} keys required (in my example after the "5" of 2005 and the "6" of 06.
But to do so, I need to know the actual length of the entry (after each call to the label) to be able to Send the {Left} keys at the appropriate moment.
Perhaps there can be an option to return the length of the entry after every call to the g-label.
Perhaps I didn't understood well and the g-label is called after a valid year, then month, ... are entered, in witch case sending the {Left} keys may be more easy. But I don't like this option as there can be collision (???) between the text typed by the user and the {Left} keys sended by the procedure in the label.
Or may be the procedure must use the BlockInput (on then off) command at the appropriate moment ? But how to determine that appropriate moment ?
Is it possible that this way to do the job may be slowly than the first one ?

I hope to have been enough definite and ... persuasive.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: DateTime improvement
PostPosted: June 4th, 2005, 8:22 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Nemroth wrote:
I'd like to enter (for example for today's date) : 20050604 rather than 2005{Left}06{Left}04
That's not easy to implement because the control's internal behavior is difficult to change (partly due to a lack of documenation about how it works internally).

Quote:
And I'd like to be able to enter the date in this way, even if I use :
Gui, Add, DateTime, vMyDateTime, yyyy/MM/dd
Gui,show
So without typing the "/" characters
It's a good idea but for now it's too much complexity. You might consider using three edit controls instead: Each would have a g-label to monitor and validate it. Each would automatially move the caret/focus to the next field when the first field is complete.

As for your second idea, it doesn't seem practical due to the limitations of the control (which is a built-in feature of the OS). But hopefully the edit-control approach described above will work for you.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 4th, 2005, 8:43 pm 
Offline

Joined: September 7th, 2004, 9:20 pm
Posts: 275
Location: France
Thanks Chris for your answer.

Never mind. As I retrieved the beardboy's SetTimer solution for edit controls, I will try it on the DateTime control too.

DateTime and MonthCal are very good improvements of the GUI capabilities.

Thanks again for all the beautifull work that you make.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group