1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PickDate update

Discussion in 'Plugins' started by Charles Dye, Mar 25, 2009.

  1. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    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.

    http://www.unm.edu/~cdye/dl/pickdate.zip
     
  2. Jay Sage

    Joined:
    Jun 2, 2008
    Messages:
    284
    Likes Received:
    1
    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
     

    Attached Files:

  3. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    I can't replicate that, but I've put up a build which sets the caption before the icon....
     
  4. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3

    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.
     
  5. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    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.
     
  6. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    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.
     
  7. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    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.)
     
  8. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    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 don't think I can do anything about that, other than putting the dialog on top of TCC's / Take Command's window.

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

    That's not me, that's Windows's dialog support. ESC has worked the Cancel button since at least Windows 3.0.
     
  9. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    (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?

    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.
     
  10. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    Re: More observations

    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?)
     
  11. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    Re: And another

    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.
     
  12. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    Re: More observations

    I didn't try this earlier than 0.95. I'll try to find a definitive way to cause it.

    (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?)
     
  13. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    Re: More observations

    Or parse LOCALE_SLONGDATE.... Not gonna happen in v1.0, though!
     
  14. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
  15. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    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.
     
  16. Arjan Feddema

    Joined:
    Jun 20, 2008
    Messages:
    39
    Likes Received:
    0
    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:


     
  17. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    I don't see any reason why not...?
     
  18. Arjan Feddema

    Joined:
    Jun 20, 2008
    Messages:
    39
    Likes Received:
    0
    Show me.

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

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



    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
     
  19. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,287
    Likes Received:
    39
    http://www.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....)
     
  20. Arjan Feddema

    Joined:
    Jun 20, 2008
    Messages:
    39
    Likes Received:
    0
    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:



    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
     

Share This Page