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

📄 lconfig.tk

📁 ahb sdram interface.arm cpu series,include controller
💻 TK
📖 第 1 页 / 共 5 页
字号:
proc option_name {w mnum line text helpidx} {	button $w.x$line.l -text "$text" -relief groove -anchor w	$w.x$line.l configure -activefore [cget $w.x$line.l -fg] \				-activeback [cget $w.x$line.l -bg]	button $w.x$line.help -text "Help" -relief raised \		-command "dohelp .dohelp $helpidx .menu$mnum"	pack $w.x$line.help -side right -fill y	pack $w.x$line.l -side right -fill both -expand on}proc toggle_switch2 {w mnum line text variable} {	frame $w.x$line -relief sunken	radiobutton $w.x$line.y -text "y" -variable $variable -value 1 \		-relief groove -width 2 -command "update_active"#	radiobutton $w.x$line.m -text "-"  -variable $variable -value 2 \#		-relief groove -width 2 -command "update_active"	radiobutton $w.x$line.n -text "n"  -variable $variable -value 0 \		-relief groove -width 2 -command "update_active"	option_name $w $mnum $line $text $variable	pack $w.x$line.n $w.x$line.y -side right -fill y}proc toggle_switch3 {w mnum line text variable} {	frame $w.x$line -relief sunken	radiobutton $w.x$line.y -text "y" -variable $variable -value 1 \		-relief groove -width 2 -command "update_active"	radiobutton $w.x$line.m -text "m"  -variable $variable -value 2 \		-relief groove -width 2 -command "update_active"	radiobutton $w.x$line.n -text "n"  -variable $variable -value 0 \		-relief groove -width 2 -command "update_active"	option_name $w $mnum $line $text $variable	global CONFIG_MODULES	if {($CONFIG_MODULES == 0)} then {		$w.x$line.m configure -state disabled	}	pack $w.x$line.n $w.x$line.m $w.x$line.y -side right -fill y}proc bool {w mnum line text variable} {	toggle_switch2 $w $mnum $line $text $variable#	$w.x$line.m configure -state disabled	pack $w.x$line -anchor w -fill both -expand on}proc tristate {w mnum line text variable } {	toggle_switch3 $w $mnum $line $text $variable	pack $w.x$line -anchor w -fill both -expand on}proc dep_tristate {w mnum line text variable } {	tristate $w $mnum $line $text $variable}proc dep_bool {w mnum line text variable } {	bool $w $mnum $line $text $variable}proc int { w mnum line text variable } {	frame $w.x$line	entry $w.x$line.x -width 11 -relief sunken -borderwidth 2 \		-textvariable $variable	option_name $w $mnum $line $text $variable	pack $w.x$line.x -anchor w -side right -fill y	pack $w.x$line -anchor w -fill both -expand on}proc hex { w mnum line text variable } {	int $w $mnum $line $text $variable}proc istring { w mnum line text variable } {	frame $w.x$line	entry $w.x$line.x -width 18 -relief sunken -borderwidth 2 \		-textvariable $variable	option_name $w $mnum $line $text $variable	pack $w.x$line.x -anchor w -side right -fill y	pack $w.x$line -anchor w -fill both -expand on}proc minimenu { w mnum line text variable helpidx } {	frame $w.x$line	menubutton $w.x$line.x -textvariable $variable -menu \		$w.x$line.x.menu -relief raised \		-anchor w	option_name $w $mnum $line $text $helpidx	pack $w.x$line.x -anchor w -side right -fill y	pack $w.x$line -anchor w -fill both -expand on}proc menusplit {w m n} {	if { $n > 2 } then {		update idletasks		set menuoptsize [expr [$m yposition 2] - [$m yposition 1]]   		set maxsize [winfo screenheight $w]		set splitpoint [expr $maxsize * 4 / 5 / $menuoptsize - 1]		for {set i [expr $splitpoint + 1]} {$i <= $n} {incr i $splitpoint} {			$m entryconfigure $i -columnbreak 1		}	}}proc menutitle {text menu w} {	wm title $w "$text"}proc submenu { w mnum line text subnum } {	frame $w.x$line	button $w.x$line.l -text "" -width 9 -relief groove	$w.x$line.l configure -activefore [cget $w.x$line.l -fg] \		-activeback [cget $w.x$line.l -bg] -state disabled	button $w.x$line.m -text "$text" -relief raised -anchor w \		-command "catch {destroy .menu$subnum}; menu$subnum .menu$subnum \"$text\""	pack $w.x$line.l -side left -fill both	pack $w.x$line.m -anchor w -side right -fill both -expand on	pack $w.x$line -anchor w -fill both -expand on}proc comment {w mnum line text } {	frame $w.x$line	button $w.x$line.l -text "" -width 15 -relief groove	$w.x$line.l configure -activefore [cget $w.x$line.l -fg] \		-activeback [cget $w.x$line.l -bg] -state disabled	button $w.x$line.m -text "$text" -relief groove -anchor w	$w.x$line.m configure -activefore [cget $w.x$line.m -fg] \		-activeback [cget $w.x$line.m -bg]	pack $w.x$line.l -side left -fill both	pack $w.x$line.m -anchor w -side right -fill both -expand on	pack $w.x$line -anchor w -fill both -expand on}proc readhelp {tag fn}  {	set message ""	set b 0	if { [file readable $fn] == 1} then {		set fhandle [open $fn r]		while {[gets $fhandle inline] >= 0} {			if { $b == 0 } {				if { [regexp $tag $inline ] } {					set b 1					set message "$inline:\n"				}			} else {				if { [regexp {^[^ \t]} $inline]} {					break				}				set message "$message\n$inline"			}		}		close $fhandle	}	return $message}proc dohelp {w var parent}  {	catch {destroy $w}	toplevel $w -class Dialog	set filefound 0	set found 0	set lineno 0	if { [file readable config.help] == 1} then {		set filefound 1		# First escape sed regexp special characters in var:		set var [exec echo "$var" | sed s/\[\]\[\/.^$*\]/\\\\&/g]		# Now pick out right help text:		set message [readhelp $var config.help]		set found [expr [string length "$message"] > 0]	}	frame $w.f1	pack $w.f1 -fill both -expand on	# Do the OK button	#	set oldFocus [focus]	frame $w.f2	button $w.f2.ok -text "OK" \		-width 10 -command "destroy $w; catch {focus $oldFocus}"	pack $w.f2.ok -side bottom -pady 6 -anchor n	pack $w.f2 -side bottom -padx 10 -anchor s	scrollbar $w.f1.vscroll -command "$w.f1.canvas yview"	pack $w.f1.vscroll -side right -fill y	canvas $w.f1.canvas -relief flat -borderwidth 0 \		-yscrollcommand "$w.f1.vscroll set"	frame $w.f1.f	pack $w.f1.canvas -side right -fill y -expand on	if { $found == 0 } then {		if { $filefound == 0 } then {		message $w.f1.f.m -width 750 -aspect 300 -relief flat -text \			"No help available - unable to open file config.help."		} else {		message $w.f1.f.m -width 400 -aspect 300 -relief flat -text \			"No help available for $var"		}		label $w.f1.bm -bitmap error		wm title $w "RTFM"	} else {		text $w.f1.f.m -width 73 -relief flat -wrap word		$w.f1.f.m insert 0.0 $message		$w.f1.f.m conf -state disabled -height [$w.f1.f.m index end]		label $w.f1.bm -bitmap info		wm title $w "Configuration help" 	}	pack $w.f1.f.m -side left	pack $w.f1.bm $w.f1.f -side left -padx 10	focus $w	set winx [expr [winfo x $parent]+20]	set winy [expr [winfo y $parent]+20]	wm geometry $w +$winx+$winy	set sizok [expr [winfo reqheight $w.f2.ok] + 12]	set maxy [expr [winfo screenheight .] * 3 / 4]	set canvtotal [winfo reqheight $w.f1.f.m]	if [expr $sizok + $canvtotal < $maxy] {		set sizy $canvtotal	} else {		set sizy [expr $maxy - $sizok]	}	$w.f1.canvas configure -height $sizy -width [winfo reqwidth $w.f1.f.m] \		-scrollregion "0 0 [winfo reqwidth $w.f1.f.m] \			[winfo reqheight $w.f1.f.m]"	$w.f1.canvas create window 0 0 -anchor nw -window $w.f1.f	update idletasks	set maxy [winfo screenheight .]	if [expr $sizok + $canvtotal < $maxy] {		set sizy [expr $sizok + $canvtotal]	} else {		set sizy $maxy	}	wm maxsize $w [winfo width $w] $sizy}bind all <Alt-s> { catch {exec cp -f .config .config.old}; \		writeconfig .config config.h; wrapup .wrap }proc wrapup {w }  {	catch {destroy $w}	toplevel $w -class Dialog	global CONFIG_MODVERSIONS; vfix CONFIG_MODVERSIONS	message $w.m -width 460 -aspect 300 -relief raised -text \		"End of design configuration. "	label $w.bm -bitmap info	pack $w.bm $w.m -pady 10 -side top -padx 10	wm title $w "LEON build instructions" 	set oldFocus [focus]	frame $w.f	button $w.f.back -text "OK" \		-width 10 -command "exit 2"	pack $w.f.back -side bottom -pady 10 -anchor s	pack $w.f -pady 10 -side top -padx 10 -anchor s	focus $w        bind $w <Return> "exit 2"	global winx; global winy	set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]	wm geometry $w +$winx+$winy}proc unregister_active {num} {	global active_menus	set index [lsearch -exact $active_menus $num]	if {$index != -1} then {set active_menus [lreplace $active_menus $index $index]}}proc update_active {} {	global active_menus total_menus	set max 0	if {[llength $active_menus] > 0} then {		set max [lindex $active_menus end]		update_define [toplevel_menu [lindex $active_menus 0]] $max 0	}	foreach i $active_menus {		if {[winfo exists .menu$i] == 0} then {			unregister_active $i		} else {			update_menu$i		}	}	update_define [expr $max + 1] $total_menus 1	update_mainmenu}proc configure_entry {w option items} {	foreach i $items {		$w.$i configure -state $option	}}proc validate_int {name val default} {	if {([exec echo $val | sed s/^-//g | tr -d \[:digit:\] ] != "")} then {		global $name; set $name $default	}}proc validate_hex {name val default} {	if {([exec echo $val | tr -d \[:xdigit:\] ] != "")} then {		global $name; set $name $default	}}

⌨️ 快捷键说明

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