+2002-03-05 Martin M. Hunt <hunt@redhat.com>
+
+ * library/prefs.tcl (pref_read): If a preference specifies
+ "src-font", substitute "global/fixed".
+ (pref_set_defaults): Change defaults from "src-font" to
+ "global/fixed". Do not create font object "src-font". Do
+ not add hook to trace its changes.
+ (pref_src-font_trace): Remove.
+
+ * library/console.itb (Console::_update_option): Remove
+ font update because this happens automatically.
+
+ * library/globalpref.itb: No need to set
+ changed flag for fonts; updates happen automatically
+ when prefs are updated.
+
+ * library/bpwin.itb: Replaced src-font with global/fixed.
+ * library/browserwin.itb: Ditto.
+ * library/mempref.itb: Ditto.
+ * library/memwin.itb: Ditto.
+ * library/process.itb: Ditto.
+ * library/regwin.itb: Ditto.
+ * library/srcbar.itcl: Ditto.
+ * library/srcpref.itb: Ditto.
+ * library/srctextwin.itb: Ditto.
+ * library/srcwin.itb: Ditto.
+ * library/stackwin.itb: Ditto.
+ * library/tdump.tcl: Ditto.
+ * library/tracedlg.tcl: Ditto.
+ * library/variables.tcl: Ditto.
+ * library/watch.tcl: Ditto.
+
2002-03-01 Keith Seitz <keiths@redhat.com>
* generic/gdbtk-register.c (register_changed_p): Don't use REGISTER_BYTES.
-# Breakpoint window for GDBtk.
-# Copyright 1997, 1998, 1999, 2001 Red Hat, Inc.
+# Breakpoint window for Insight.
+# Copyright 1997, 1998, 1999, 2001, 2002 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# write header
if {$tracepoints} {
label $twin.num0 -text "Num" -relief raised -bd 2 -anchor center \
- -font src-font
+ -font global/fixed
}
label $twin.thread0 -text "Thread" -relief raised -bd 2 -anchor center \
- -font src-font
+ -font global/fixed
label $twin.addr0 -text "Address" -relief raised -bd 2 -anchor center \
- -font src-font
+ -font global/fixed
label $twin.file0 -text "File" -relief raised -bd 2 -anchor center \
- -font src-font
+ -font global/fixed
label $twin.line0 -text "Line" -relief raised -bd 2 -anchor center \
- -font src-font
+ -font global/fixed
label $twin.func0 -text "Function" -relief raised -bd 2 -anchor center \
- -font src-font
+ -font global/fixed
if {$tracepoints} {
label $twin.pass0 -text "PassCount" -relief raised -borderwidth 2 \
- -anchor center -font src-font
+ -anchor center -font global/fixed
grid x $twin.num0 $twin.addr0 $twin.file0 $twin.line0 $twin.func0 $twin.pass0 \
-sticky new
} else {
}
if {$tracepoints} {
- label $twin.num$i -text "$number " -relief flat -anchor e -font src-font -bg $bg1
+ label $twin.num$i -text "$number " -relief flat -anchor e -font global/fixed -bg $bg1
}
- label $twin.addr$i -text "[$bp_event get address] " -relief flat -anchor e -font src-font -bg $bg1
+ label $twin.addr$i -text "[$bp_event get address] " -relief flat -anchor e -font global/fixed -bg $bg1
if {[info exists _files(short,$file)]} {
set file $_files(short,$file)
} else {
}
if {$show_threads} {
if {$thread == "-1"} {set thread "ALL"}
- label $twin.thread$i -text "$thread " -relief flat -anchor e -font src-font -bg $bg1
+ label $twin.thread$i -text "$thread " -relief flat -anchor e -font global/fixed -bg $bg1
}
- label $twin.file$i -text "$file " -relief flat -anchor e -font src-font -bg $bg1
- label $twin.line$i -text "[$bp_event get line] " -relief flat -anchor e -font src-font -bg $bg1
- label $twin.func$i -text "[$bp_event get function] " -relief flat -anchor e -font src-font -bg $bg1
+ label $twin.file$i -text "$file " -relief flat -anchor e -font global/fixed -bg $bg1
+ label $twin.line$i -text "[$bp_event get line] " -relief flat -anchor e -font global/fixed -bg $bg1
+ label $twin.func$i -text "[$bp_event get function] " -relief flat -anchor e -font global/fixed -bg $bg1
if {$tracepoints} {
- label $twin.pass$i -text "[$bp_event get pass_count] " -relief flat -anchor e -font src-font -bg $bg1
+ label $twin.pass$i -text "[$bp_event get pass_count] " -relief flat -anchor e -font global/fixed -bg $bg1
}
if {$mbar} {
# Browswer window for Insight.
-# Copyright 1998, 1999, 2001 Red Hat
+# Copyright 1998, 1999, 2001, 2002 Red Hat
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
itk_component add filt_label {
label [$itk_component(filter) childsite].lbl -text {Show if function } \
- -font src-font
+ -font global/fixed
}
itk_component add filt_type {
combobox::combobox [$itk_component(filter) childsite].type -height 4 \
-width 15 -editable 0 \
-command [code $this _set_filter_mode] \
- -font src-font
+ -font global/fixed
} { }
# Fill the filter mode combo-box
$itk_component(filt_type) entryset $cur_filter_mode
itk_component add filt_entry {
- entry [$itk_component(filter) childsite].ent -font src-font \
+ entry [$itk_component(filter) childsite].ent -font global/fixed \
-textvariable [pref varname gdb/search/last_symbol] -background white
} {
usual Entry
}
itk_component add view_name {
- label $itk_component(view_hidden).name -font src-font
+ label $itk_component(view_hidden).name -font global/fixed
}
itk_component add view_func {
combobox::combobox $itk_component(view_bottom).combo -maxheight 15 \
- -font src-font \
- -command [code $this _goto_func]
+ -font global/fixed -command [code $this _goto_func]
} {
# Should be able to do this, but can't cause the combobox doesn't
# fake up a MegaWidget well enough
itk_component add view_mode {
combobox::combobox $itk_component(view_bottom).mode -width 9 \
- -font src-font \
- -command [code $this mode]
+ -font global/fixed -command [code $this mode]
} {
#rename -background -textbackground textBackground Background
}
itk_component add view_search {
entry $itk_component(view_bottom).search -borderwidth 2 \
- -font src-font -width 10 \
- -background white
+ -font global/fixed -width 10 -background white
} {
rename -background -textbackground textBackground Background
}
_build_win
eval itk_initialize $args
add_hook gdb_no_inferior_hook [list $this idle dummy]
-
- # Right now the preferences window directly uses preference
- # variables. This means that if we track the preference changes
- # here, things will appear weird to the user -- the console window
- # will change before the user chooses Accpet in the prefs window.
- # Until the preference window is fixed we can't enable this
- # dynamic tracking. FIXME.
- # foreach option {gdb/console/wrap gdb/console/prompt_fg \
- # gdb/console/error_fg gdb/console/font} {
- # pref add_hook $option [code $this _update_option]
- # }
+
+ # There are a bunch of console prefs that have no UI
+ # for the user to modify them. In the event that the user
+ # really wants to change them, they will have to be modified
+ # in prefs.tcl or by editing .gdbtkinit. When these prefs
+ # gain a prefs UI, the user may change them dynamically
+ # and the console window will need notification that they
+ # have changed. Add them to the following list and
+ # Console::_update_option.
+ foreach option {gdb/console/wrap} {
+ pref add_hook $option [code $this _update_option]
+ }
set gdbtk_state(console) $this
}
global gdbtk_state
set gdbtk_state(console) ""
remove_hook gdb_no_inferior_hook [list $this idle dummy]
-
- # foreach option {gdb/console/wrap gdb/console/prompt_fg \
- # gdb/console/error_fg gdb/console/font} {
- # pref remove_hook $option [code $this _update_option]
- # }
}
body Console::_build_win {} {
gdb/console/error_fg {
$_twin tag configure err_tag -foreground $value
}
-
- gdb/console/font {
- $_twin configure -font $value
- }
}
}
-# Global preference class implementation for GDBtk.
-# Copyright 1997, 1998, 1999 Cygnus Solutions
+# Global preference class implementation for Insight.
+# Copyright 1997, 1998, 1999, 2002 Red Hat
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
set font [font configure test-$thunk-font]
if {[pref get global/font/$thunk] != $font} {
pref set global/font/$thunk $font
- set changed_something 1
}
}
-# Memory display preferences window for GDBtk.
-# Copyright 1998, 1999 Cygnus Solutions
+# Memory display preferences window for Insight.
+# Copyright 1998, 1999, 2002 Red Hat
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
label $fr.2.l -text "Bytes Per Row "
set Widgets(b-bytes_per_row) [::combobox::combobox $fr.2.c \
-command [code $this set_bytes_per_row] \
- -width 4 -editable 0 -font src-font]
+ -width 4 -editable 0 -font global/fixed]
$fr.2.c list insert end 4
$fr.2.c list insert end 8
$fr.2.c list insert end 16
table $itk_interior.t -titlerows 1 -titlecols 1 -variable ${this}_memval \
-roworigin -1 -colorigin -1 -bg $bg \
- -browsecmd "$this changed_cell %s %S" -font src-font\
+ -browsecmd "$this changed_cell %s %S" -font global/fixed\
-colstretch unset -rowstretch unset -selectmode single \
-xscrollcommand "$itk_interior.sx set" -resizeborders none \
-cols $numcols -rows $numrows -autoclear 1
-# Local preferences functions for GDBtk.
-# Copyright 1997, 1998, 1999 Cygnus Solutions
+# Local preferences functions for Insight.
+# Copyright 1997, 1998, 1999, 2002 Red Hat
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
} elseif {$section == "global"} {
pref setd $section/$name $val
} else {
+ # backwards compatibility. recognize old src-font name
+ if {$val == "src-font"} {set val "global/fixed"}
pref setd gdb/$section/$name $val
}
}
pref define gdb/console/error_fg red
pref define gdb/console/log_fg green
pref define gdb/console/target_fg blue
- pref define gdb/console/font src-font
+ pref define gdb/console/font global/fixed
# Source window defaults
pref define gdb/src/PC_TAG green
pref define gdb/src/bp_fg red
pref define gdb/src/temp_bp_fg orange
pref define gdb/src/disabled_fg black
- pref define gdb/src/font src-font
+ pref define gdb/src/font global/fixed
pref define gdb/src/break_fg black
pref define gdb/src/source2_fg navy
pref define gdb/src/variableBalloons 1
pref define gdb/src/disassembly-flavor ""
- # set up src-font
- set val [pref get global/font/fixed]
- eval font create src-font $val
-
- # Trace the global/font/fixed preference
- pref add_hook global/font/fixed pref_src-font_trace
-
# Variable Window defaults
- pref define gdb/variable/font src-font
+ pref define gdb/variable/font global/fixed
pref define gdb/variable/disabled_fg gray
# Stack Window
- pref define gdb/stack/font src-font
+ pref define gdb/stack/font global/fixed
# Register Window
pref define gdb/reg/rows 16
pref define gdb/editor ""
}
-# This traces the global/fixed font and forces src-font to
-# to be the same.
-proc pref_src-font_trace {varname val} {
- eval font configure src-font $val
-}
# Process window for Insight.
-# Copyright 1998, 1999, 2001 Red Hat, Inc.
+# Copyright 1998, 1999, 2001, 2002 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
-background [pref get gdb/font/normal_bg] \
-selectbackground green \
-selectforeground black \
- -textfont src-font \
+ -textfont global/fixed \
-exportselection false \
-selectioncommand [code $this change_context]
} {}
# Register display window for Insight.
-# Copyright 1998, 1999, 2001 Red Hat, Inc.
+# Copyright 1998, 1999, 2001, 2002 Red Hat, Inc.
#
# Written by Keith Seitz (keiths@redhat.com)
# based on work by Martin Hunt (hunt@redhat.com)
itk_component add table {
::table $itk_interior.tbl -variable [scope _data] \
-bg [pref get gdb/font/normal_bg] -fg [pref get gdb/font/normal_fg] \
- -browsecmd [code $this _select_cell %S] -font src-font \
+ -browsecmd [code $this _select_cell %S] -font global/fixed \
-colstretch unset -rowstretch unset -selectmode single \
-resizeborders none -multiline false -colwidth 18 \
-autoclear 0 -bg [pref get gdb/font/normal_bg] \
}
# Add find in file entry box.
- $Tool add label findlabel "Find:" "" -anchor e -font src-font
+ $Tool add label findlabel "Find:" "" -anchor e -font global/fixed
$Tool add custom searchbox entry "Search in editor" \
- -bd 3 -font src-font -width 10
+ -bd 3 -font global/fixed -width 10
set callback [code $source search]
$Tool itembind searchbox <Return> \
-# Source preferences dialog for GDBtk.
-# Copyright 1998, 1999 Cygnus Solutions
+# Source preferences dialog for Insight.
+# Copyright 1998, 1999, 2002 Red Hat
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
set have_disassembly_flavor 1
frame $f.dis
label $f.dis.l -text "Disassembly Flavor: "
- combobox::combobox $f.dis.combo -maxheight 15 -width 15 -font src-font -editable 0 \
- -command [code $this _set_flavor]
+ combobox::combobox $f.dis.combo -maxheight 15 -width 15 \
+ -font global/fixed -editable 0 -command [code $this _set_flavor]
foreach elem $vals {
$f.dis.combo list insert end $elem
# METHOD: setTabs - set the tabs for the assembly/src windows
# ------------------------------------------------------------------
body SrcTextWin::setTabs {win {asm S}} {
- set fsize [font measure src-font "W"]
+ set fsize [font measure [pref get gdb/src/font] "W"]
set tsize [pref get gdb/src/tab_size]
set rest ""
# debug
# Make sure we redo the break images when we reconfigure
- set size [font measure src-font "W"]
+ set size [font measure [pref get gdb/src/font] "W"]
makeBreakDot $size [pref get gdb/src/bp_fg] $break_images(bp)
makeBreakDot $size [pref get gdb/src/temp_bp_fg] $break_images(temp_bp)
makeBreakDot $size [pref get gdb/src/disabled_fg] $break_images(disabled_bp)
frame $_statbar
pack $_statbar -expand 1 -fill both
- combobox::combobox $_statbar.name -maxheight 15 -font src-font\
+ combobox::combobox $_statbar.name -maxheight 15 -font global/fixed\
-command [code $this _name]
set need_files 1
- combobox::combobox $_statbar.func -maxheight 15 -font src-font\
+ combobox::combobox $_statbar.func -maxheight 15 -font global/fixed\
-command [code $this goto_func]
combobox::combobox $_statbar.mode -width 9 -editable false \
- -font src-font -command [code $this mode]
+ -font global/fixed -command [code $this mode]
$_statbar.mode list insert end SOURCE
$_statbar.mode list insert end ASSEMBLY
# add address and line number indicators
label $_statusframe.addr -text "" -width 10 -relief sunken \
- -bd 1 -anchor e -font src-font
+ -bd 1 -anchor e -font global/fixed
label $_statusframe.line -text "" -width 6 -relief sunken \
- -bd 1 -anchor e -font src-font
+ -bd 1 -anchor e -font global/fixed
balloon register $_statusframe.addr "Address"
balloon register $_statusframe.line "Line number"
# 32-bit address plus "0x"
set width 10
}
- $_statusframe.addr configure -text $addr -font src-font -width $width
+ $_statusframe.addr configure -text $addr -font global/fixed -width $width
$_statusframe.line configure -text $line
# set function combobox
-# Stack window for GDBtk.
-# Copyright 1997, 1998, 1999 Cygnus Solutions
+# Stack window for Insight.
+# Copyright 1997, 1998, 1999, 2002 Red Hat
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
-textbackground [pref get gdb/font/normal_bg] \
-foreground [pref get gdb/font/normal_fg] \
-visibleitems 30x15 \
- -textfont src-font -selectioncommand [code $this change_frame]
+ -textfont global/fixed -selectioncommand [code $this change_frame]
} {}
# Add sizebox for windows
# Trace dump window for Insight
-# Copyright 1998, 1999, 2001 Red Hat, Inc.
+# Copyright 1998, 1999, 2001, 2002 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
itk_component add stext {
iwidgets::scrolledtext $itk_interior.stext -hscrollmode $mode \
- -vscrollmode $mode -textfont src-font \
+ -vscrollmode $mode -textfont global/fixed \
-background [pref get gdb/font/normal_bg]
} {}
[$itk_component(stext) component text] configure \
# Trace configuration dialog for Insight
-# Copyright 1997, 1998, 1999, 2001 Red Hat, Inc.
+# Copyright 1997, 1998, 1999, 2001, 2002 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
pack $act_frame.lb -side bottom -fill both -expand 1 -padx 5 -pady 5
# New actions
- combobox::combobox $new_frame.combo -maxheight 15 -editable 0 -font src-font \
- -command [code $this set_action_type]
+ combobox::combobox $new_frame.combo -maxheight 15 -editable 0 \
+ -font global/fixed -command [code $this set_action_type]
$new_frame.combo list insert end collect while-stepping
$new_frame.combo entryset collect
# Variable display window for Insight.
-# Copyright 1997, 1998, 1999, 2001 Red Hat
+# Copyright 1997, 1998, 1999, 2001, 2002 Red Hat
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
method build_win {f} {
global tixOption tcl_platform Display
# debug
- set width [font measure src-font "W"]
+ set width [font measure global/fixed "W"]
# Choose the default width to be...
set width [expr {40 * $width}]
if {$tcl_platform(platform) == "windows"} {
set sbg [$Hlist cget -bg]
set fg [$Hlist cget -fg]
set bg $tixOption(input1_bg)
- set width [font measure src-font $LengthString]
+ set width [font measure global/fixed $LengthString]
$Hlist configure -indent $width -bg $bg \
-selectforeground $fg -selectbackground $sbg \
- -selectborderwidth 0 -separator . -font src-font
+ -selectborderwidth 0 -separator . -font global/fixed
# Get display styles
set normal_fg [$Hlist cget -fg]
set highlight_fg [pref get gdb/font/highlight_fg]
set disabled_fg [pref get gdb/variable/disabled_fg]
set NormalTextStyle [tixDisplayStyle text -refwindow $Hlist \
- -bg $bg -fg $normal_fg -font src-font]
+ -bg $bg -fg $normal_fg -font global/fixed]
set HighlightTextStyle [tixDisplayStyle text -refwindow $Hlist \
- -bg $bg -fg $highlight_fg -font src-font]
+ -bg $bg -fg $highlight_fg -font global/fixed]
set DisabledTextStyle [tixDisplayStyle text -refwindow $Hlist \
- -bg $bg -fg $disabled_fg -font src-font]
+ -bg $bg -fg $disabled_fg -font global/fixed]
if {[catch {gdb_cmd "show output-radix"} msg]} {
set Radix 10
if {$Editing == ""} {
# Must create the frame
set Editing [frame $Hlist.frame -bg $bg -bd 0 -relief flat]
- set lbl [::label $Editing.lbl -fg $fg -bg $bg -font src-font]
- set ent [entry $Editing.ent -bg $tixOption(bg) -font src-font]
+ set lbl [::label $Editing.lbl -fg $fg -bg $bg -font global/fixed]
+ set ent [entry $Editing.ent -bg $tixOption(bg) -font global/fixed]
pack $lbl $ent -side left
}
# Watch window for Insight.
-# Copyright 1997, 1998, 1999, 2001 Red Hat
+# Copyright 1997, 1998, 1999, 2001, 2002 Red Hat
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
set treeFrame [frame $f.top]
set entryFrame [frame $f.expr]
VariableWin::build_win $treeFrame
- set Entry [entry $entryFrame.ent -font src-font]
+ set Entry [entry $entryFrame.ent -font global/fixed]
button $entryFrame.but -text "Add Watch" -command [code $this validateEntry]
pack $f -fill both -expand yes
grid $entryFrame.ent -row 0 -column 0 -sticky news -padx 2