Menu

#16 Make scroll wheel work right

Version_0.9_Beta
open
7
2005-07-28
2005-07-18
No

Make the scroll wheel work right in all of the forms
and scrolling windows.

Discussion

  • Benjamin Sprague

    • assigned_to: nobody --> realmadsci
     
  • Benjamin Sprague

    Logged In: YES
    user_id=1312775

    ListBox has working scroll wheel. It first allows itself to
    get the focus when clicked on:
    bind ListBoxFocus <1> [list focus %W]

    Then, it uses BWidget's built in wheel bindings:
    ## Let any click within the canvas focus on the canvas
    so that
    ## MouseWheel scroll events will be properly handled by the
    ## canvas.
    if {[Widget::cget $path -autofocus]} {
    bindtags $path.c [concat [bindtags $path.c] ListBoxFocus]
    BWidget::bindMouseWheel $path.c
    }

    Which is listed below:
    # BWidget::bindMouseWheel --
    #
    # Bind mouse wheel actions to a given widget.
    #
    # Arguments:
    # widget - The widget to bind.
    #
    # Results:
    # None.
    proc BWidget::bindMouseWheel { widget } {
    bind $widget <MouseWheel> {%W yview scroll [expr
    {-%D/24}] units}
    bind $widget <Shift-MouseWheel> {%W yview scroll [expr
    {-%D/120}] pages}
    bind $widget <Control-MouseWheel> {%W yview scroll [expr
    {-%D/120}] units}

    bind $widget <Button-4> {event generate %W <MouseWheel>
    -delta 120}
    bind $widget <Button-5> {event generate %W <MouseWheel>
    -delta -120}
    }

     
  • Benjamin Sprague

    • milestone: 510045 --> 513368
     
  • Benjamin Sprague

    • milestone: 513368 --> 513365
     
  • Benjamin Sprague

    • milestone: 513365 --> Version_0.9_Beta
     

Log in to post a comment.

MongoDB Logo MongoDB