Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

PickDate update

Charles Dye

Super Moderator
May
4,947
126
Staff member
I'm posting an updated build of my PickDate plugin. In addition to some minor tweaks and bug fixes, this version adds support for selecting dates with the keyboard. Please try it out and let me know about any bugs or unexpected behaviors. I particularly want to know about incorrect calculation or display of dates, and incorrect or counterintuitive responses to keyboard control.

Thanks, everyone.

unm.edu/~cdye/dl/pickdate.zip
 
Very nice, Charles!

I did notice a little problem, at least as the calendar displays on my
screen. There is an icon at the upper-left corner that obliterates the
beginning of the title. I will try to attach a screen capture image to
this message, but I'm not sure what the mail processor will do with it.

I was using the command line: echo %@pickdate[Choose Date,,4]

-- Jay
 

Attachments

  • DatePicker.gif
    DatePicker.gif
    11.2 KB · Views: 222
Very nice, Charles!

I did notice a little problem, at least as the calendar displays on my
screen. There is an icon at the upper-left corner that obliterates the
beginning of the title. I will try to attach a screen capture image to
this message, but I'm not sure what the mail processor will do with it.

I was using the command line: echo %@pickdate[Choose Date,,4]

I can't replicate that, but I've put up a build which sets the caption before the icon....
 
... I particularly want to know about incorrect calculation or display of dates, and incorrect or counterintuitive responses to keyboard control.


It looks pretty good.

Counterintuitive observation: UpArrow and DownArrow go to the beginning of the current month and the beginning of the next month, respectively, and when using Ctrl with UpArrow and Downarrow, go to the beginning of the current year and the beginning of the next year, respectively. I didn't expect that. I expected that if I start with 3/15/09, UpArrow would go to 2/15/09 and Ctrl-DownArrow would go to 3/15/10.

It's not a serious problem -- it's just surprising and counterintuitive.

The most valuable thing I can think of to add to this would be a timeout (in seconds) parameter -- if time runs out, just return with whatever date is highlighted.

Thanks for the effort. I'm already using it.
 
More observations

1. When TAB is used to select a button, it is possible to get it into a state where ALT-O does not activate OK and ALT-C does not active cancel. Actual mouse-clicking is required. I've had a hard time narrowing down just how to get it into this state, but it does happen sometimes using TAB and SHIFT+TAB.

2. Home and End go to left-most column with a number and right-most column with a number in the current week. (In the first week of the month, Home goes to 1.)

3. Ctrl-Home and Ctrl-End go to the earliest and latest dates possible.

4. Ctrl-C in the TCC window does not cancel pickdate, but when the pickdate window is released, nothing at all is returned (and ^C shows up in the TCC window).

5. Undocumented (er, until _now_) date format 17:
Wednesday, 25 March, 2009

6. ESC on the keyboard is equivalent to Cancel. That's worth documenting.
 
And another

No selected date:

Activate %@PICKDATE[]

TAB to move focus to an arrow button.

SPACE to activate virtual depression of the selected button.
Repeat SPACE as much as you want.

NO DATE IS NOW SELECTED.

Click OK.

The last date which had been selected is returned.

This is somewhere between wrong and counterintuitive. I'm not sure which.
 
Re: And another

No selected date:

Activate %@PICKDATE[]

TAB to move focus to an arrow button.

SPACE to activate virtual depression of the selected button.
Repeat SPACE as much as you want.

NO DATE IS NOW SELECTED.

Click OK.

The last date which had been selected is returned.

This is somewhere between wrong and counterintuitive. I'm not sure which.

The arrow buttons don't affect the selection at all, they merely display different months. There is always a date selected (and it's always shown in the status line at the bottom.) By design, you can display months other than the one containing the selected date. Once the desired month is shown, you can click to select a date within it. Or not.

(Undocumented shortcut to quickly return to the selected date: click on the status line.)
 
Re: More observations

1. When TAB is used to select a button, it is possible to get it into a state where ALT-O does not activate OK and ALT-C does not active cancel. Actual mouse-clicking is required. I've had a hard time narrowing down just how to get it into this state, but it does happen sometimes using TAB and SHIFT+TAB.

I would like to know how to replicate this. (Did it happen in previous builds, or only since I started mucking with the keyboard in 0.95?)

4. Ctrl-C in the TCC window does not cancel pickdate, but when the pickdate window is released, nothing at all is returned (and ^C shows up in the TCC window).
I don't think I can do anything about that, other than putting the dialog on top of TCC's / Take Command's window.

5. Undocumented (er, until _now_) date format 17:
Wednesday, 25 March, 2009
Used internally to show the selected date on the status line. I doubt it would be useful outside of my own code.

6. ESC on the keyboard is equivalent to Cancel. That's worth documenting.
That's not me, that's Windows's dialog support. ESC has worked the Cancel button since at least Windows 3.0.
 
Counterintuitive observation: UpArrow and DownArrow go to the beginning of the current month and the beginning of the next month, respectively, and when using Ctrl with UpArrow and Downarrow, go to the beginning of the current year and the beginning of the next year, respectively. I didn't expect that. I expected that if I start with 3/15/09, UpArrow would go to 2/15/09 and Ctrl-DownArrow would go to 3/15/10.

(Up arrow and down arrow, or PageUp and PageDown?) Yes, when moving by months/years, I do jump to the start of the target month/year, or as close as possible. Trying to move by exact months seems even less intuitive to me: what is a month after January 31, or a month before March 31? What should it do if you move another month past that date? And what if the target date is masked off?

The most valuable thing I can think of to add to this would be a timeout (in seconds) parameter -- if time runs out, just return with whatever date is highlighted.
I think I'm going to have to install a timer anyway, in my ongoing struggle to make it consistently pop up above Take Command's window and not underneath.... I'll start messing with timers once the keyboard stuff seems reliable.
 
Re: More observations

I don't think I can do anything about that, other than putting the dialog on top of TCC's / Take Command's window.

Turns out there is. Calling HoldSignals() prevents Ctrl-C or Ctrl-Break from interrupting the command, but only if I do not re-enable them with EnableSignals() before my function exits. Is there any downside to doing this? (Calling HoldSignals() without a later EnableSignals() -- it looks like TCC re-enables it automatically?)
 
Re: And another

The arrow buttons don't affect the selection at all, they merely display different months. There is always a date selected (and it's always shown in the status line at the bottom.) By design, you can display months other than the one containing the selected date. Once the desired month is shown, you can click to select a date within it. Or not.

(Undocumented shortcut to quickly return to the selected date: click on the status line.)

Ahh, that makes sense. It isn't that there is no date selected, it's that the selected date is no longer visible (but is shown in plain text, rather than as a highlighted number).

I hope you document that heretofore undocumented shortcut. It's a Good Thing.
 
Re: More observations

I would like to know how to replicate this. (Did it happen in previous builds, or only since I started mucking with the keyboard in 0.95?)
I didn't try this earlier than 0.95. I'll try to find a definitive way to cause it.

Used internally to show the selected date on the status line. I doubt it would be useful outside of my own code.

(Format 17). Wanna make it useful? Allow an environment variable to specify the format, like SET PICKDATE_FMT17="dddd, dd mmmm, yyyy", and display that as the status line, and return it as format 17. (Or generalize it to allow other format numbers, too, between 8 and 15.)


(I never seem to run out of suggestions, do I?)
 
Re: More observations

(Format 17). Wanna make it useful? Allow an environment variable to specify the format, like SET PICKDATE_FMT17="dddd, dd mmmm, yyyy", and display that as the status line, and return it as format 17.

Or parse LOCALE_SLONGDATE.... Not gonna happen in v1.0, though!
 
I've put up a new build, which removes the control menu (and therefore the little icon and the close button) and disables ^C and ^Break.

unm.edu/~cdye/dl/pickdate.zip
 
I've put up a new build, which removes the control menu (and therefore the little icon and the close button) and disables ^C and ^Break.

unm.edu/~cdye/dl/pickdate.zip

Works well. Fn-Break (on a laptop) works very well -- it aborts with a *cancel*, as if ESC or the Cancel button was used. Personally, I think that's appropriate. Ctrl-C does nothing, and that's good.
 
Great tool!

Can you do the same for a radiobutton menu and/or a checkbox menu?
msgbox only gives me 4 buttons.

Regards

*********** REPLY SEPARATOR ***********

On 26-3-2009 at 21:14 dcantor wrote:


>---Quote (Originally by Charles Dye)---
>I've put up a new build, which removes the control menu (and therefore the
>little icon and the close button) and disables ^C and ^Break.
>
>unm.edu/~cdye/dl/pickdate.zip
>---End Quote---
>Works well. Fn-Break (on a laptop) works very well -- it aborts with a
>*cancel*, as if ESC or the Cancel button was used. Personally, I think
>that's appropriate. Ctrl-C does nothing, and that's good.
>
>
>
>
 
Show me.

*********** REPLY SEPARATOR ***********

On 28-3-2009 at 15:23 Charles Dye wrote:


>---Quote (Originally by Arjan Feddema)---
>Can you do the same for a radiobutton menu and/or a checkbox menu? msgbox
>only gives me 4 buttons.
>---End Quote---
>I don't see any reason why not...?
>
>
>
>


TCC 10,00,49 Windows XP [Version 5,1,2600]
TCC Build 49 Windows XP Build 2600 Service Pack 3
Registered to Arjan Feddema - 1 System License
 

unm.edu/~cdye/dl/menu.zip

Note that this silly demo doesn't return any actual info; it just puts up a dialog. (Microsoft Visual C++ doesn't seem to provide the powerful string handling capabilities of, say, BASIC on the Vic-20....)
 
Thanks,

However, the main reason I asked was because I can't program any plugins.
The reason that I use Take Command, is that I'm a 4dos user since 1987 and never saw the point in learning another language.

Since Take Command doesn't provide any "windows like" menu's, only @select and msgbox (4 buttons 4 options) , I'm stuck with writing complicated scripts that asks everytime for a diffferent setting.

It would be nice to have a checkbox menu that reads a textfile displays the lines with a checkbox in front of it.
That way I can check the options and write it back to i.e. an inifile or another textfile.
And afterwards process that new textfile.

Or something like that. A radiobutton menu would be nice two.

So if you could spare the time, I would be much obliged.

Kind regards.

Arjan

p.s.

Rex if your reading this, maybe something for the next version?

*********** REPLY SEPARATOR ***********

On 30-3-2009 at 13:55 Charles Dye wrote:


>---Quote (Originally by Arjan Feddema)---
>Show me.
>---End Quote---
>unm.edu/~cdye/dl/menu.zip
>
>Note that this silly demo doesn't return any actual info; it just puts up
>a dialog. (Microsoft Visual C++ doesn't seem to provide the powerful
>string handling capabilities of, say, BASIC on the Vic-20....)
>
>
>
>


TCC 10,00,49 Windows XP [Version 5,1,2600]
TCC Build 49 Windows XP Build 2600 Service Pack 3
Registered to Arjan Feddema - 1 System License
 
Back
Top