⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scrolledtext.itk

📁 windows下的GDB insight前端
💻 ITK
📖 第 1 页 / 共 2 页
字号:
# visibleitems option engaged, geometry constraints are maintained# only on the text.  The size of the other components such as # labels, margins, and scroll bars, are additive and independent, # effecting the overall size of the scrolled text.  In contrast,# should the width and height options have non zero values, they# are applied to the scrolled text as a whole.  The text is # compressed or expanded to maintain the geometry constraints.# ------------------------------------------------------------------itcl::configbody iwidgets::Scrolledtext::visibleitems {    if {[regexp {^[0-9]+x[0-9]+$} $itk_option(-visibleitems)]} {	if {($itk_option(-width) == 0) && \		($itk_option(-height) == 0)} {	    set chars [lindex [split $itk_option(-visibleitems) x] 0]	    set lines [lindex [split $itk_option(-visibleitems) x] 1]	    	    set shell [lindex [grid info $itk_component(clipper)] 1]	    #	    # Due to a bug in the tk4.2 grid, we have to check the 	    # propagation before setting it.  Setting it to the same	    # value it already is will cause it to toggle.	    #	    if {! [grid propagate $shell]} {		grid propagate $shell yes	    }	    	    $itk_component(text) configure -width $chars -height $lines	}	    } else {	error "bad visibleitems option\		\"$itk_option(-visibleitems)\": should be\		widthxheight"    }}# ------------------------------------------------------------------#                            METHODS# ------------------------------------------------------------------# ------------------------------------------------------------------# METHOD: childsite## Returns the path name of the child site widget.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::childsite {} {    return $itk_component(text)}# ------------------------------------------------------------------# METHOD: bbox index## Returns four element list describing the bounding box for the list# item at index# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::bbox {index} {    return [$itk_component(text) bbox $index]}# ------------------------------------------------------------------# METHOD clear ## Clear the text area.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::clear {} {    $itk_component(text) delete 1.0 end}# ------------------------------------------------------------------# METHOD import filename## Load text from an existing file (import filename)# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::import {filename {index end}} {    set f [open $filename r]    insert $index [read $f]    close $f}# ------------------------------------------------------------------# METHOD export filename## write text to a file (export filename)# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::export {filename} {    set f [open $filename w]        set txt [$itk_component(text) get 1.0 end]    puts $f $txt        flush $f    close $f}# ------------------------------------------------------------------# METHOD compare index1 op index2## Compare indices according to relational operator.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::compare {index1 op index2} {    return [$itk_component(text) compare $index1 $op $index2]}# ------------------------------------------------------------------# METHOD debug ?boolean?## Activates consistency checks in B-tree code associated with text# widgets.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::debug {args} {    eval $itk_component(text) debug $args}# ------------------------------------------------------------------# METHOD delete first ?last?## Delete a range of characters from the text.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::delete {first {last {}}} {    $itk_component(text) delete $first $last}# ------------------------------------------------------------------# METHOD dlineinfo index## Returns a five element list describing the area occupied by the# display line containing index.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::dlineinfo {index} {    return [$itk_component(text) dlineinfo $index]}# ------------------------------------------------------------------# METHOD get index1 ?index2?## Return text from start index to end index.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::get {index1 {index2 {}}} {    return [$itk_component(text) get $index1 $index2]}# ------------------------------------------------------------------# METHOD image option ?arg arg ...?## Manipulate images dependent on options.## ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::image {option args} {  return [eval $itk_component(text) image $option $args]}# ------------------------------------------------------------------# METHOD index index## Return position corresponding to index.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::index {index} {    return [$itk_component(text) index $index]}# ------------------------------------------------------------------# METHOD insert index chars ?tagList?## Insert text at index.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::insert {args} {    eval $itk_component(text) insert $args}# ------------------------------------------------------------------# METHOD mark option ?arg arg ...?## Manipulate marks dependent on options.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::mark {option args} {    return [eval $itk_component(text) mark $option $args]}# ------------------------------------------------------------------# METHOD scan option args## Implements scanning on texts.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::scan {option args} {    eval $itk_component(text) scan $option $args}# ------------------------------------------------------------------# METHOD search ?switches? pattern index ?varName?## Searches the text for characters matching a pattern.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::search {args} {    #-----------------------------------------------------------    # BUG FIX: csmith (Chad Smith: csmith@adc.com), 11/18/99    #-----------------------------------------------------------    # Need to run this command up one level on the stack since    # the text widget may modify one of the arguments, which is    # the case when -count is specified.    #-----------------------------------------------------------    return [uplevel eval $itk_component(text) search $args]}# ------------------------------------------------------------------# METHOD see index## Adjusts the view in the window so the character at index is # visible.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::see {index} {    $itk_component(text) see $index}# ------------------------------------------------------------------# METHOD tag option ?arg arg ...?## Manipulate tags dependent on options.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::tag {option args} {    return [eval $itk_component(text) tag $option $args]}# ------------------------------------------------------------------# METHOD window option ?arg arg ...?## Manipulate embedded windows.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::window {option args} {    return [eval $itk_component(text) window $option $args]}# ------------------------------------------------------------------# METHOD xview## Changes x view in widget's window.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::xview {args} {    return [eval $itk_component(text) xview $args]}# ------------------------------------------------------------------# METHOD yview## Changes y view in widget's window.# ------------------------------------------------------------------itcl::body iwidgets::Scrolledtext::yview {args} {    return [eval $itk_component(text) yview $args]}

⌨️ 快捷键说明

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