#*******************************************************************************
# E.S.O. - VLT project
#
# "@(#) $Id: rtdq4Trans.tcl,v 1.14+ 1999/03/25 10:45:51 vltsccm Exp $"
#
# who       when      what
# --------  --------  ----------------------------------------------
# pbiereic  22/03/99  created

itk::usual rtdq4Trans {}

class rtdq4Trans {
    inherit rtd::RtdImageTrans

    constructor {args} {
        eval RtdImageTrans::constructor $args
    } {
        eval itk_initialize $args
    }
    
    # fill the given menu with radiobuttons for changing the magnification
    # of the image and keep them updated with the other controls
    # redefines: rtd::RtdImageTrans::fill_mag_menu

    method fill_mag_menu {m} {
        global ::$w_.mag ::imageq4

        for {set i $itk_option(-min_scale)} {$i<=-2} {incr i 1} {
	    set cmd "$imageq4(0) scale $i $i; $imageq4(1) scale $i $i; $imageq4(2) scale $i $i; $imageq4(3) scale $i $i"
            $m add radiobutton \
                -label "1/[expr -$i]x" \
                -command $cmd \
                -variable $w_.mag
        }
        for {set i 1} {$i<=$itk_option(-max_scale)} {incr i} {
	    set cmd "$imageq4(0) scale $i $i; $imageq4(1) scale $i $i; $imageq4(2) scale $i $i; $imageq4(3) scale $i $i"
            $m add radiobutton \
                -label "  ${i}x" \
                -command $cmd \
                -variable $w_.mag
        }
        set $w_.mag {  1x}
    }
        
    # -- public vars --
}
