databaseview_test.tcl

来自「一个跨平台的TCL/TK可视开发环境类似VC. TCL/TK是一个跨平台的脚本」· TCL 代码 · 共 1,016 行 · 第 1/3 页

TCL
1,016
字号
}

}

}



#############################################################################

## Procedure:  ::database_view::dataTable



namespace eval ::database_view {

proc dataTable {w} {

return $w.not81.fpage2.scr79.f.tab80

}

}



}



}



#################################

# VTCL LIBRARY PROCEDURES

#



if {![info exists vTcl(sourcing)]} {

#############################################################################

## Library Procedure:  Window



proc ::Window {args} {

    ## This procedure may be used free of restrictions.

    ##    Exception added by Christian Gavin on 08/08/02.

    ## Other packages and widget toolkits have different licensing requirements.

    ##    Please read their license agreements for details.



    global vTcl

    foreach {cmd name newname} [lrange $args 0 2] {}

    set rest    [lrange $args 3 end]

    if {$name == "" || $cmd == ""} { return }

    if {$newname == ""} { set newname $name }

    if {$name == "."} { wm withdraw $name; return }

    set exists [winfo exists $newname]

    switch $cmd {

        show {

            if {$exists} {

                wm deiconify $newname

            } elseif {[info procs vTclWindow$name] != ""} {

                eval "vTclWindow$name $newname $rest"

            }

            if {[winfo exists $newname] && [wm state $newname] == "normal"} {

                vTcl:FireEvent $newname <<Show>>

            }

        }

        hide    {

            if {$exists} {

                wm withdraw $newname

                vTcl:FireEvent $newname <<Hide>>

                return}

        }

        iconify { if $exists {wm iconify $newname; return} }

        destroy { if $exists {destroy $newname; return} }

    }

}

#############################################################################

## Library Procedure:  ::vTcl::widgets::bwidgets::scrollchildsite::widgetProc



namespace eval ::vTcl::widgets::bwidgets::scrollchildsite {

proc widgetProc {w args} {

        set command [lindex $args 0]

        set args [lrange $args 1 end]

        set children [winfo children $w]

        set child [lindex $children 0]



        ## we have renamed the default widgetProc _<widgetpath>

        if {$command == "configure" && $args == ""} {

            if {$children == ""} {

                return [concat [uplevel _$w configure]  [list {-xscrollcommand xScrollCommand ScrollCommand {} {}}]  [list {-yscrollcommand yScrollCommand ScrollCommand {} {}}]]

            } else {

                return [concat [uplevel _$w configure]  [list [$child configure -xscrollcommand]]  [list [$child configure -yscrollcommand]]]

            }

        } elseif {$command == "configure" && [llength $args] > 1} {

            return [uplevel $child configure $args]

        } elseif {[string match ?view $command]} {

            return [uplevel $child $command $args]

        }



        uplevel _$w $command $args

    }

}

#############################################################################

## Library Procedure:  vTcl::widgets::bwidgets::scrolledwindow::createCmd



namespace eval vTcl::widgets::bwidgets::scrolledwindow {

proc createCmd {target args} {

        eval ScrolledWindow $target $args

        ## create a frame where user can insert widget to scroll

        frame $target.f -class ScrollChildsite



        ## change the widget procedure

        rename ::$target.f ::_$target.f

        proc ::$target.f {command args}  "eval ::vTcl::widgets::bwidgets::scrollchildsite::widgetProc $target.f \$command \$args"

    }

}

#############################################################################

## Library Procedure:  vTcl::widgets::core::compoundcontainer::cgetProc



namespace eval vTcl::widgets::core::compoundcontainer {

proc cgetProc {w args} {

        ## This procedure may be used free of restrictions.

        ##    Exception added by Christian Gavin on 08/08/02.

        ## Other packages and widget toolkits have different licensing requirements.

        ##    Please read their license agreements for details.



        upvar ::${w}::compoundType  compoundType

        upvar ::${w}::compoundClass compoundClass



        set option [lindex $args 0]

        switch -- $option {

            -class         {return CompoundContainer}

            -compoundType  {return $compoundType}

            -compoundClass {return $compoundClass}

            default        {error "unknown option $option"}

        }

    }

}

#############################################################################

## Library Procedure:  vTcl::widgets::core::compoundcontainer::configureProc



namespace eval vTcl::widgets::core::compoundcontainer {

proc configureProc {w args} {

        ## This procedure may be used free of restrictions.

        ##    Exception added by Christian Gavin on 08/08/02.

        ## Other packages and widget toolkits have different licensing requirements.

        ##    Please read their license agreements for details.



        upvar ::${w}::compoundType  compoundType

        upvar ::${w}::compoundClass compoundClass



        if {[lempty $args]} {

            return [concat [configureProc $w -class]  [configureProc $w -compoundType]  [configureProc $w -compoundClass]]

        }

        if {[llength $args] == 1} {

            set option [lindex $args 0]

            switch -- $option {

                -class {

                    return [list "-class class Class Frame CompoundContainer"]

                }

                -compoundClass {

                    return [list "-compoundClass compoundClass CompoundClass {} [list $compoundClass]"]

                }

                -compoundType {

                    return [list "-compoundType compoundType CompoundType user $compoundType"]

                }

                default {

                    error "unknown option $option"

                }

            }

        }

        ## this widget is not modifiable afterward

        error "cannot configure this widget after it is created"

    }

}

#############################################################################

## Library Procedure:  vTcl::widgets::core::compoundcontainer::createCmd



namespace eval vTcl::widgets::core::compoundcontainer {

proc createCmd {path args} {

        ## This procedure may be used free of restrictions.

        ##    Exception added by Christian Gavin on 08/08/02.

        ## Other packages and widget toolkits have different licensing requirements.

        ##    Please read their license agreements for details.



        frame $path -class CompoundContainer

        namespace eval ::$path "set compoundType {}; set compoundClass {}"

        

        ## compound class specified ?

        if {[llength $args] == 2 && [lindex $args 0] == "-compoundClass"} {

            set type user

            set compoundName [lindex $args 1]

            insertCompound $path $type [list $compoundName]

        }



        return $path

    }

}

#############################################################################

## Library Procedure:  vTcl::widgets::core::compoundcontainer::insertCompound



namespace eval vTcl::widgets::core::compoundcontainer {

proc insertCompound {target type compoundName} {

        ## This procedure may be used free of restrictions.

        ##    Exception added by Christian Gavin on 08/08/02.

        ## Other packages and widget toolkits have different licensing requirements.

        ##    Please read their license agreements for details.



        set type user

        set spc ${type}::$compoundName

        if {[info exists ::vTcl(running)]} {

            ::vTcl::compounds::mergeCompoundCode $type [join $compoundName]

        } else {

            ::vTcl::compounds::${spc}::procsCmd

            ::vTcl::compounds::${spc}::bindtagsCmd

        }

        ::vTcl::compounds::${spc}::compoundCmd ${target}.cmpd

        ::vTcl::compounds::${spc}::infoCmd ${target}.cmpd

        pack $target.cmpd -fill both -expand 1



        ## register some info about ourself

        namespace eval ::$target "set compoundType $type; set compoundClass $compoundName"



        ## change the widget procedure

        rename ::$target ::_$target

        proc ::$target {command args}  "eval ::vTcl::widgets::core::compoundcontainer::widgetProc $target \$command \$args"

    }

}

#############################################################################

## Library Procedure:  vTcl::widgets::core::compoundcontainer::widgetProc



namespace eval vTcl::widgets::core::compoundcontainer {

proc widgetProc {w args} {

        ## This procedure may be used free of restrictions.

        ##    Exception added by Christian Gavin on 08/08/02.

        ## Other packages and widget toolkits have different licensing requirements.

        ##    Please read their license agreements for details.



        if {[llength $args] == 0} {

            ## If no arguments, returns the path the alias points to

            return $w

        }



        set command [lindex $args 0]

        set args [lrange $args 1 end]

        switch $command {

            configure {

                return [eval configureProc $w $args]

            }

            cget {

                return [eval cgetProc $w $args]

            }

            widget {

                ## call megawidget widgetProc

                return [eval $w.cmpd widget $args]

            }

            innerClass {

                return [winfo class $w.cmpd]

            }

            innerWidget {

                return $w.cmpd

            }

            default {

                ## we have renamed the default widgetProc _<widgetpath>

                uplevel _$w $command $args

            }

        }

    }

}

#############################################################################

## Library Procedure:  vTcl::widgets::core::megawidget::cgetProc



namespace eval vTcl::widgets::core::megawidget {

proc cgetProc {w args} {

        ## This procedure may be used free of restrictions.

        ##    Exception added by Christian Gavin on 08/08/02.

        ## Other packages and widget toolkits have different licensing requirements.

        ##    Please read their license agreements for details.



        upvar ::${w}::widgetProc  widgetProc



        set option [lindex $args 0]

        switch -- $option {

            -class         {return MegaWidget}

            -widgetProc    {return $widgetProc}

            default        {error "unknown option $option"}

        }

    }

}

#############################################################################

## Library Procedure:  vTcl::widgets::core::megawidget::configureProc



namespace eval vTcl::widgets::core::megawidget {

proc configureProc {w args} {

        ## This procedure may be used free of restrictions.

        ##    Exception added by Christian Gavin on 08/08/02.

        ## Other packages and widget toolkits have different licensing requirements.

        ##    Please read their license agreements for details.



        upvar ::${w}::widgetProc  widgetProc



        if {[lempty $args]} {

            return [concat [configureProc $w -class]  [configureProc $w -widgetProc]]

        }

        if {[llength $args] == 1} {

            set option [lindex $args 0]

            switch -- $option {

                -class {

                    return [list "-class class Class Frame MegaWidget"]

                }

                -widgetProc {

                    return [list "-widgetProc widgetproc WidgetProc {} [list $widgetProc]"]

                }

                default {

                    error "unknown option $option"

                }

            }

        }



        foreach {option value} $args {

            if {$option == "-widgetProc"} {

                set widgetProc $value

            }

        }

    }

}

#############################################################################

## Library Procedure:  vTcl::widgets::core::megawidget::createCmd



namespace eval vTcl::widgets::core::megawidget {

proc createCmd {path args} {

        ## This procedure may be used free of restrictions.

        ##    Exception added by Christian Gavin on 08/08/02.

        ## Other packages and widget toolkits have different licensing requirements.

        ##    Please read their license agreements for details.



        frame $path -class MegaWidget

        namespace eval ::$path "set widgetProc {}"



        ## change the widget procedure

        rename ::$path ::_$path

        proc ::$path {command args}  "eval ::vTcl::widgets::core::megawidget::widgetProc $path \$command \$args"



        ## widgetProc specified ? if so, store it

        if {[llength $args] == 2 && [lindex $args 0] == "-widgetProc"} {

            upvar ::${path}::widgetProc  widgetProc

            set widgetProc [lindex $args 1]

        }

        

        return $path

    }

}

#############################################################################

## Library Procedure:  vTcl::widgets::core::megawidget::widgetProc



namespace eval vTcl::widgets::core::megawidget {

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?