Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
widget::dateentry
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Julian H J Loaring  
View profile  
 More options Jan 19 2012, 10:28 am
Newsgroups: comp.lang.tcl
From: Julian H J Loaring <j...@hippospace.com>
Date: Thu, 19 Jan 2012 07:28:14 -0800 (PST)
Local: Thurs, Jan 19 2012 10:28 am
Subject: widget::dateentry
I recently did a teacup update and this pulled in a new version of
widget::dateentry, version 0.95. Unfortunately this has changed the
behavior of the drop down calendar. It is no longer possible to
quickly skip through months & years by using the embeded calendar's
arrow buttons because the drop down is removed after each button
press.

The cause of this is the following binding

        bind $dropbox <ButtonPress> [subst -nocommands {
            if {[string first "$dropbox" [winfo containing %X %Y]] != 0} {
                      $win unpost
            } else {

                      $win DateAccepted
              }
           }]

This is trying to see if the user clicks outside of dropdown calendar.
If so it closes the window otherwise it assumes the user has selected
a new date. The latter case ain't necessarily so if it was an arrow
button pressed... (IMHO)

The underlying problem is that the embeded widget::calendar doesn't
let the wrapper know what item is under the mouse.

A glorious hack which knows way too much about the calendar ;)
===============================================

1) Change the binding
 bind $dropbox <ButtonPress> [mymethod dropboxClick $dropbox %X %Y %x
%y]

2) Add the new callback

    method dropboxClick {w X Y x y} {
        if {[string first "$dropbox" [winfo containing $X $Y]] != 0} {
                      $win unpost
        } else {
            set c $w.calendar
            if {[$c find closest $x $y] > 4} {
               $win DateAccepted
            }
        }
    }

3) And whilst my sleeves are rolled up, use the mouse wheel to scroll
by month

bind $dropbox <MouseWheel> [mymethod dropboxWheel $dropbox %D]

    method dropboxWheel {w d} {

                set c $w.calendar
                if {$d < 0} {
                        $c adjust 0 -1 0
                } else {
                        $c adjust 0 1 0
                }

   }

kind regards
Julian H J Loaring


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »