From 97451a5bdc54c814b99f592baaa448d854a12eae Mon Sep 17 00:00:00 2001 From: irox Date: Mon, 7 Jan 2002 08:58:46 +0000 Subject: [PATCH] * library/srcbar.itcl (SrcBar::create_buttons): Line number and address fields have been removed and added to the status bar. * library/srcwin.itb (SrcWin::_build_win): Add address and line number fields to status bar. Moved download progress bar to status bar. (SrcWin::download_progress): Use canvas on status bar. Remember to adjust width of 64-bit address. (SrcWin::location): Set line number and address on status bar. * library/srcwin.ith (SrcWin): Added new private variable. --- gdb/gdbtk/ChangeLog | 13 +++++++++++ gdb/gdbtk/library/srcbar.itcl | 23 ------------------ gdb/gdbtk/library/srcwin.itb | 54 ++++++++++++++++++++++++++++++++----------- gdb/gdbtk/library/srcwin.ith | 1 + 4 files changed, 55 insertions(+), 36 deletions(-) diff --git a/gdb/gdbtk/ChangeLog b/gdb/gdbtk/ChangeLog index 25ee3af941..d9e5b85ea1 100644 --- a/gdb/gdbtk/ChangeLog +++ b/gdb/gdbtk/ChangeLog @@ -1,3 +1,16 @@ +2002-01-07 Ian Roxborough + + * library/srcbar.itcl (SrcBar::create_buttons): Line number + and address fields have been removed and added to the + status bar. + * library/srcwin.itb (SrcWin::_build_win): Add address and + line number fields to status bar. Moved download progress + bar to status bar. + (SrcWin::download_progress): Use canvas on status bar. + Remember to adjust width of 64-bit address. + (SrcWin::location): Set line number and address on status bar. + * library/srcwin.ith (SrcWin): Added new private variable. + 2002-01-04 Andrew Cagney * generic/gdbtk-cmds.c (gdb_disassemble_driver): Replace diff --git a/gdb/gdbtk/library/srcbar.itcl b/gdb/gdbtk/library/srcbar.itcl index 778b530a51..16b001427a 100644 --- a/gdb/gdbtk/library/srcbar.itcl +++ b/gdb/gdbtk/library/srcbar.itcl @@ -534,12 +534,6 @@ class SrcBar { $Tool add separator } - $Tool add label addr $address "Address" -relief sunken \ - -bd 1 -anchor e -font src-font - - $Tool add label line $line "Line Number" -width 6 -relief sunken \ - -bd 1 -anchor e -font src-font - $Tool toolbar_button_right_justify create_stack_buttons @@ -1167,23 +1161,6 @@ Do you want to continue?" \ ::set GDBSrcBar_state($this) $updatevalue } - # This holds the text that is shown in the address label. - public variable address {} { - if {[string length $address] > 10} { - # 64-bit address plus "0x" - set width 18 - } else { - # 32-bit address plus "0x" - set width 10 - } - $Tool itemconfigure addr -text $address -font src-font -width $width - } - - # This holds the text that is shown in the line label. - public variable line {} { - $Tool itemconfigure line -text $line - } - # This holds the source window's display mode. Valid values are # SOURCE, ASSEMBLY, SRC+ASM, and MIXED. public variable displaymode SOURCE { diff --git a/gdb/gdbtk/library/srcwin.itb b/gdb/gdbtk/library/srcwin.itb index f5ba7b19a2..08bcfb8263 100644 --- a/gdb/gdbtk/library/srcwin.itb +++ b/gdb/gdbtk/library/srcwin.itb @@ -111,18 +111,13 @@ body SrcWin::_build_win {} { $_statbar.mode list insert end MIXED $_statbar.mode list insert end SRC+ASM - - # Search/download progress frame + # Search frame $_statbar.frame entry $_statbar.frame.search -bd 3 -font src-font -width 10 bind_plain_key $_statbar.frame.search \ Return [code $this _search forwards] bind_plain_key $_statbar.frame.search \ Shift-Return [code $this _search backwards] - canvas $_statbar.frame.progress -relief sunken -borderwidth 2 \ - -highlightthickness 0 -takefocus 0 -width 100 -height 0 -confine 1 - $_statbar.frame.progress create rectangle 0 0 0 \ - [winfo height $_statbar.frame.progress] -outline blue -fill blue -tags rect pack $_statbar.frame -side right -pady 4 -padx 10 -fill y -expand 1 -anchor e pack $_statbar.mode -side right -padx 10 -pady 4 @@ -140,8 +135,32 @@ body SrcWin::_build_win {} { # add status line set _status [conAdd status -resizable 0] + set _statusframe [frame $_status] + set _status $_statusframe.con label $_status -relief sunken -bd 3 -font global/status -height 1 - pack $_status -expand 1 -fill both + + # add download progress meter + canvas $_statusframe.progress -relief sunken -borderwidth 2 \ + -highlightthickness 0 -takefocus 0 -width 100 -height 0 -confine 1 + $_statusframe.progress create rectangle 0 0 0 \ + [winfo height $_statusframe.progress] -outline blue -fill blue -tags rect + + # add address and line number indicators + label $_statusframe.addr -text "" -width 10 -relief sunken \ + -bd 1 -anchor e -font src-font + label $_statusframe.line -text "" -width 6 -relief sunken \ + -bd 1 -anchor e -font src-font + + balloon register $_statusframe.addr "Address" + balloon register $_statusframe.line "Line number" + + pack $_statusframe -expand 1 -fill both + grid $_status -row 0 -column 1 -sticky news -pady 2 -padx 2 + grid $_statusframe.addr -row 0 -column 3 -sticky nes -pady 4 + grid $_statusframe.line -row 0 -column 4 -sticky nws -pady 4 + grid columnconfigure $_statusframe 1 -weight 10 + grid columnconfigure $_statusframe 2 -minsize 5 + grid columnconfigure $_statusframe 5 -minsize 5 } set_execution_status @@ -206,8 +225,8 @@ body SrcWin::download_progress { section num tot {msg ""} } { #debug "$section $num $tot $msg" if {$last_section_start == 0} { - pack forget $_statbar.frame.search - pack $_statbar.frame.progress -fill both -expand yes + grid forget $_statusframe.addr $_statusframe.line + grid $_statusframe.progress -row 0 -column 4 -padx 4 -sticky news ::update idletasks } @@ -232,7 +251,7 @@ body SrcWin::download_progress { section num tot {msg ""} } { set_status "Downloading section $section - $num bytes" } - set canvas $_statbar.frame.progress + set canvas $_statusframe.progress set height [winfo height $canvas] if {$last_done} { set width [winfo width $canvas] @@ -259,8 +278,9 @@ body SrcWin::download_progress { section num tot {msg ""} } { set last_done 0 set last_section_start 0 - pack forget $_statbar.frame.progress - pack $_statbar.frame.search -fill x -expand yes + grid forget $_statusframe.progress + grid $_statusframe.addr -row 0 -column 3 -sticky new -pady 4 + grid $_statusframe.line -row 0 -column 4 -sticky nws -pady 4 ::update idletasks } } @@ -457,7 +477,15 @@ body SrcWin::location {tag linespec} { } # set address and line widgets - $_toolbar configure -address $addr -line $line + if {[string length $address] > 10} { + # 64-bit address plus "0x" + set width 18 + } else { + # 32-bit address plus "0x" + set width 10 + } + $_statusframe.addr configure -text $addr -font src-font -width $width + $_statusframe.line configure -text $line # set function combobox $_statbar.func entryset $funcname diff --git a/gdb/gdbtk/library/srcwin.ith b/gdb/gdbtk/library/srcwin.ith index 5cf256c8d1..9d5447c45e 100644 --- a/gdb/gdbtk/library/srcwin.ith +++ b/gdb/gdbtk/library/srcwin.ith @@ -79,6 +79,7 @@ class SrcWin { variable _statbar variable _status variable _toolbar + variable _statusframe variable top variable twin variable current -- 2.11.0