zoukankan      html  css  js  c++  java
  • body test

    class test {
     inherit itk::Widget
     public method aaa
     public method rollover
     public method rolloutof
     public method showStage
     private variable current_stage "hull"
     
     constructor { args } {
      itk_option add hull.width hull.height
      $itk_component(hull) configure -width 1050 -height 768 
      wm minsize [winfo toplevel $itk_component(hull)] 1050 768
      pack propagate $itk_interior 0
      
      
      itk_component add body {
          frame $itk_component(hull).body \
       -borderwidth 1 \
       -relief raised
      }
        
      itk_component add stages {
          canvas $itk_component(body).stages \
       -relief sunken \
       -bd 2 \
       -bg white \
       -width 100 \
       -highlightthickness 0
      }
      
      
      set l_stage_name(hull) "Images"
      set l_stage_name(indexing) "Indexing"
      set l_stage_name(strategy) "Strategy"
      set l_stage_name(cell_refinement) "Cell Refinement"
      set l_stage_name(integration) "Integration"
         # set l_stage_name(pointless) "Pointless"
      set l_stage_name(history) "History"
        
      set i_y 10
      foreach i_stage { hull indexing strategy cell_refinement integration  history} {
          $itk_component(stages) create rectangle \
       -5 $i_y 105 [expr $i_y + 5 + 32 + 14 + 5] \
       -fill {} \
       -outline {} \
       -tags box($i_stage)
          $itk_component(stages) create image 50 [expr $i_y + 5] \
       -image ::img::stage_${i_stage} \
       -anchor n \
       -tags icon($i_stage)
          $itk_component(stages) create text 50 [expr $i_y + 5 + 32] \
       -text $l_stage_name($i_stage) \
       -anchor n \
       -tags label($i_stage)
          $itk_component(stages) create rectangle \
       -5 $i_y 105 [expr $i_y + 5 + 32 + 14 + 5] \
       -fill {} \
       -outline {} \
       -tags overlay($i_stage)
          $itk_component(stages) bind overlay($i_stage) <Enter> \
       [code $this rollover $i_stage]
          $itk_component(stages) bind overlay($i_stage) <Leave> \
       [code $this rolloutof $i_stage]
          $itk_component(stages) bind overlay($i_stage) <1> \
       [code $this showStage $i_stage]
          set i_y [expr $i_y + 5 + 32 + 10 + 5 + 10]
      }
      

      pack $itk_component(body) -side top -fill both -expand 1
      grid $itk_component(stages) -row 0 -column 0
      
     } 
    }


    body test::rolloutof { a_stage } {
        # Undshades stage button (if not already current stage or disabled)
        if {$a_stage != $current_stage} {
     if {[$itk_component(stages) itemcget icon($a_stage) -image] != "::img::stage_${a_stage}_haze"} {
         $itk_component(stages) itemconfigure box($a_stage) \
      -fill {} \
      -outline {}
     }
        }
    }


    body test::rollover { a_stage } {
        # Shades stage button (if not already current stage or disabled)
        if {$a_stage != $current_stage} {
     if {[$itk_component(stages) itemcget icon($a_stage) -image] != "::img::stage_${a_stage}_haze"} {
         $itk_component(stages) itemconfigure box($a_stage) \
      -fill "\#eeeeee" \
      -outline "\#dcdcdc"
     }
        }
    }


    body test::showStage { a_stage } {
        # Send focus to stages menu, to force SettingEntry update
        focus $itk_component(stages)

        # Restore current stage's icon to unselected state
        $itk_component(stages) itemconfigure box($current_stage) \
     -fill {} \
     -outline {}

        # hide current stage
        $itk_component($current_stage) hide

        # Store previous stage (in case of reversion)
        set previous_state $current_stage

        # update the record of current stage
        set current_stage $a_stage

        # Update new stage's icon
        $itk_component(stages) itemconfigure box($current_stage) \
     -fill "\#dcdcdc" \
     -outline "\#bbbbbb"


        # display the panel
        $itk_component($a_stage) launch

    #added by luke on 18 October 2007
    #puts focus on the image selection box in the integration stage
     if {$a_stage == "integration"} {
    #  focus .c.body.integration.normal.isf.inf.in.entry.p.f.entry
    #  focus [[[$itk_component($a_stage) component image_numbers] component entry] component entry]  
     }


    }


    body test::aaa { } {
     
    }

    test .c
    .c aaa
    pack .c

  • 相关阅读:
    SolarWinds Orion API 远程代码执行漏洞(CVE-2020-10148)
    Lanproxy 路径遍历漏洞 (CVE-2021-3019)
    公众号文章集合-2020整理回顾
    PHPMailer远程命令执行漏洞复现
    SaltStack Shell 注入 (CVE-2020-16846)漏洞
    (CVE-2020-7961)Liferay Portal RCE 反序列化命令执行漏洞
    (CVE-2020-17530)Struts2 S2-061 远程命令执行漏洞复现
    ora-01722 无效数字
    公开课平台推荐
    PL/SQL Developer如何导出数据成sql的insert语句
  • 原文地址:https://www.cnblogs.com/greencolor/p/2123331.html
Copyright © 2011-2022 走看看