syntax errors.
* library/tracedlg.tcl: Update to work with Itcl3.0
and ManagedWin.
* library/actiondlg.tcl: Update to work with Itcl3.0
and ManagedWin.
(build_win): Use iwidgets scrolled listbox instead
of the tix one.
+2001-07-12 Keith Seitz <keiths@redhat.com>
+
+ * library/srcbar.itcl (create_trace_buttons): Fix
+ syntax errors.
+
+ * library/tracedlg.tcl: Update to work with Itcl3.0
+ and ManagedWin.
+
+ * library/actiondlg.tcl: Update to work with Itcl3.0
+ and ManagedWin.
+ (build_win): Use iwidgets scrolled listbox instead
+ of the tix one.
+
2001-07-05 Keith Seitz <keiths@redhat.com>
* library/managedwin.itb (_create): Don't pass "-over"
# GNU General Public License for more details.
-itcl_class ActionDlg {
+class ActionDlg {
+ inherit ManagedWin
+
# ------------------------------------------------------------------
# CONSTRUCTOR
# ------------------------------------------------------------------
- constructor {config} {
+ constructor {args} {
global _TStepCount _TOtherVariable
- set class [$this info class]
- set hull [namespace tail $this]
- set old_name $this
- ::rename $this $this-tmp-
- ::frame $hull -class $class
- ::rename $hull $old_name-win-
- ::rename $this $old_name
-
- set top [winfo toplevel [namespace tail $this]]
- wm withdraw $top
+ eval itk_initialize $args
set Registers [gdb_regnames]
if {$Line != ""} {
lappend Variables "All Registers"
lappend Variables "Collect Stack"
- build_win $this
+ build_win
# Set a default return status, in case we are destroyed
set _TOtherVariable {}
if {"$Data" != {}} {
change 1 $Data
}
-
- after idle [list wm deiconify $top]
- # after idle grab $this
}
# ------------------------------------------------------------------
# Note that this is okay: the callback (TraceDlg::done, usually) will
# ignore stray "cancel" callbacks
eval $Callback cancel
-
- set top [winfo toplevel [namespace tail $this]]
- destroy $this
- destroy $top
}
# ------------------------------------------------------------------
# METHOD: build_win - build the Trace dialog box (cache this?)
# ------------------------------------------------------------------
- method build_win {f} {
+ method build_win {} {
global _TStepCount _TOtherVariable
+ set f $itk_interior
+
# The two frames of this dialog
set bbox [frame $f.bbox]; # for holding OK,CANCEL buttons
set data [frame $f.data]; # for everything else
# The Collect listbox
label $cFrame.lbl -text {Collect:}
- tixScrolledListBox $cFrame.lb -scrollbar auto \
- -browsecmd "$this toggle_button_state 0" \
- -command "$this change 0"
- set CollectLB [$cFrame.lb subwidget listbox]
- $CollectLB configure -selectmode extended
+ set CollectLB [iwidgets::scrolledlistbox $cFrame.lb -hscrollmode dynamic \
+ -vscrollmode dynamic \
+ -selectioncommand [code $this toggle_button_state 0] \
+ -dblclickcommand [code $this change 0] \
+ -selectmode extended \
+ -exportselection false]
+ [$CollectLB component listbox] configure -background gray92
pack $cFrame.lbl $cFrame.lb -side top -expand yes -pady 2
# The Variables listbox
label $vFrame.lbl -text {Variables:}
- tixScrolledListBox $vFrame.lb -scrollbar auto \
- -browsecmd "$this toggle_button_state 1" \
- -command "$this change 1"
- set VariablesLB [$vFrame.lb subwidget listbox]
- $VariablesLB configure -selectmode extended
+ set VariablesLB [iwidgets::scrolledlistbox $vFrame.lb -hscrollmode dynamic \
+ -vscrollmode dynamic \
+ -selectioncommand [code $this toggle_button_state 1] \
+ -dblclickcommand [code $this change 1] \
+ -selectmode extended \
+ -exportselection false]
+ [$VariablesLB component listbox] configure -background gray92
pack $vFrame.lbl $vFrame.lb -side top -expand yes -pady 2
# The button frame
method toggle_button_state {add} {
- # BUG in Tix.. This is invoked whenever a <1> event is generated in
+ # This is invoked whenever a <1> event is generated in
# the listbox...
if {$add} {
- set a [$VariablesLB curselection]
+ set a [$VariablesLB getcurselection]
if {"$a" != ""} {
$AddButton configure -state normal
$RemoveButton configure -state disabled
}
} else {
- set a [$CollectLB curselection]
+ set a [$CollectLB getcurselection]
if {"$a" != ""} {
$AddButton configure -state disabled
$RemoveButton configure -state normal
# METHOD: cancel - cancel the dialog and do not set the trace
# ------------------------------------------------------------------
method cancel {} {
- delete
+ ::delete object $this
}
method remove_special {list items} {
debug "DATA = $data"
eval $Callback $command $steps [list $data]
- delete
+ ::delete object $this
}
}
# PUBLIC DATA
- public File
- public Line {}
- public WhileStepping 0
- public Number
- public Callback
- public Data {}
- public Steps {}
- public Address {}
+ public variable File
+ public variable Line {}
+ public variable WhileStepping 0
+ public variable Number
+ public variable Callback
+ public variable Data {}
+ public variable Steps {}
+ public variable Address {}
# PROTECTED DATA
- protected WhileSteppingEntry
- protected CollectLB
- protected VariablesLB
- protected Variables {}
- protected Collect {}
- protected Locals
- protected Args
- protected Registers
- protected Others {}
- protected AddButton
- protected RemoveButton
- protected OtherEntry
- protected StackCollect {*(char*)$sp@64}
+ protected variable WhileSteppingEntry
+ protected variable CollectLB
+ protected variable VariablesLB
+ protected variable Variables {}
+ protected variable Collect {}
+ protected variable Locals
+ protected variable Args
+ protected variable Registers
+ protected variable Others {}
+ protected variable AddButton
+ protected variable RemoveButton
+ protected variable OtherEntry
+ protected variable StackCollect {*(char*)$sp@64}
}
private method create_trace_buttons {{show 0}} {
if {$show} {
- set command $Tool add button
+ set command "add button"
} else {
- set command $Tool create
+ set command "create"
}
- $command tfindstart Trace {tfind_cmd "tfind start"} "First Hit <F>" \
+ $Tool $command tfindstart Trace {tfind_cmd "tfind start"} "First Hit <F>" \
-image rewind_img
- $command tfind Trace {tfind_cmd tfind} "Next Hit <N>" -image next_hit_img
+ $Tool $command tfind Trace {tfind_cmd tfind} "Next Hit <N>" -image next_hit_img
- $command tfindprev Trace {tfind_cmd "tfind -"} "Previous Hit <P>" \
+ $Tool $command tfindprev Trace {tfind_cmd "tfind -"} "Previous Hit <P>" \
-image prev_hit_img
- $command tfindline Trace {tfind_cmd "tfind line"} "Next Line Hit <L>" \
+ $Tool $command tfindline Trace {tfind_cmd "tfind line"} "Next Line Hit <L>" \
-image next_line_img
- $command tfindtp Trace { tfind_cmd "tfind tracepoint"} \
+ $Tool $command tfindtp Trace { tfind_cmd "tfind tracepoint"} \
"Next Hit Here <H>" -image next_check_img
set Trace_control_buttons {tfindstart tfind tfindprev tfindline tfindtp}
-# Trace configuration dialog for GDBtk.
-# Copyright 1997, 1998, 1999 Cygnus Solutions
+# Trace configuration dialog for Insight
+# Copyright 1997, 1998, 1999, 2001 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
# either one if a tracepoint was set/edited successfully or zero if
# the user bails out (cancel or destroy buttons).
-itcl_class TraceDlg {
+class TraceDlg {
+ inherit ManagedWin
+
# ------------------------------------------------------------------
# CONSTRUCTOR: create new trace dialog
# ------------------------------------------------------------------
- constructor {config} {
- #
- # Create a window with the same name as this object
- #
- set class [$this info class]
- set hull [namespace tail $this]
- set old_name $this
- ::rename $this $this-tmp-
- ::frame $hull -class $class
- ::rename $hull $old_name-win-
- ::rename $this $old_name
-
- set top [winfo toplevel [namespace tail $this]]
- wm withdraw $top
- build_win $this
- after idle [list wm deiconify $top]
- after idle [list $this title]
-# after idle grab $this
+ constructor {args} {
+
+ eval itk_initialize $args
+ build_win
+ title
}
# ------------------------------------------------------------------
destructor {
# Remove this window and all hooks
-# grab release $this
if {$ActionsDlg != ""} {
- catch {manage delete $ActionsDlg}
+ catch {delete object $ActionsDlg}
}
- set top [winfo toplevel [namespace tail $this]]
- destroy $top
- destroy $this
}
# ------------------------------------------------------------------
# METHOD: build_win - build the Trace dialog box (cache this?)
# ------------------------------------------------------------------
- method build_win {f} {
- global _TPassCount
+ method build_win {} {
+ set f $itk_interior
# Need to set the title to either "Add Tracepoint" or "Edit Tracepoint",
# depending on the location of the given tracepoint.
# Do not allow this until we clean up the action dialog...
tk_messageBox -type ok -icon error \
-message "Cannot set tracepoint ranges across functions!"
- after idle manage delete $this
+ after idle [code delete object $this]
}
#set functions [join $functions ,]
label $exp.funlbl -text {Function:}
#debug "ADDING ACTION FOR $File:[lindex $Lines 0]"
if {$Lines != {}} {
- set ActionsDlg [eval manage create actiondlg -File $File \
+ set ActionsDlg [eval ManagedWin::open ActionDlg -File $File \
-Line [lindex $Lines 0] \
-WhileStepping $whilestepping -Number [lindex $Number 0]\
- -Callback \"$this done\" $step_args]
+ -Callback "\\\{$this done\\\}" $step_args]
} else {
- set ActionsDlg [eval manage create actiondlg -File $File \
+ set ActionsDlg [eval ManagedWin::open ActionDlg -File $File \
-Address [lindex $Addresses 0] \
-WhileStepping $whilestepping -Number [lindex $Number 0]\
- -Callback \"$this done\" $step_args]
+ -Callback "\\\{$this done\\\}" $step_args]
}
}
# METHOD: cancel - cancel the dialog and do not set the trace
# ------------------------------------------------------------------
method cancel {} {
- manage delete $this
+ ::delete object $this
}
# ------------------------------------------------------------------
set tpnum [gdb_tracepoint_exists "$File:$line"]
if {$tpnum == -1} {
tk_messageBox -type ok -icon error -message "Tracepoint was deleted"
- manage delete $this
+ ::delete object $this
return
}
}
continue
}
}
- if {$New == 0 && $Exists == 1} {
- set num [gdb_tracepoint_exists "$File:$Line"]
- if {$num == -1} {
- tk_messageBox -type ok -icon error -message "Tracepoint was deleted"
- manage delete $this
- return
- }
- }
+ if {$New == 0 && $Exists == 1} {
+ set num [gdb_tracepoint_exists "$File:$Line"]
+ if {$num == -1} {
+ tk_messageBox -type ok -icon error -message "Tracepoint was deleted"
+ ::delete object $this
+ return
+ }
+ }
+
#debug "Editing tracepoint \#$Number: $_TPassCount $actions"
set err [catch {gdb_edit_tracepoint $number $_TPassCount $actions} errTxt]
}
}
}
- manage delete $this
+ ::delete object $this
}
method cmd {line} {
debug "deleting tracepoint $Number"
set err [catch {gdb_cmd "delete tracepoints $Number"} errTxt]
debug "done deleting tracepoint $Number"
- manage delete $this
+ ::delete object $this
}
method get_data {action} {
# !! lindex $Lines 0 -- better way?
if {$Lines != {}} {
- manage create actiondlg -File $File -Line [lindex $Lines 0] \
+ ManagedWin::open ActionDlg -File $File -Line [lindex $Lines 0] \
-WhileStepping $whilestepping -Number [lindex $Number 0] \
-Callback "$this done" -Data $real_data -Steps $steps
} else {
- manage create actiondlg -File $File -Address [lindex $Addresses 0] \
+ ManagedWin::open ActionDlg -File $File -Address [lindex $Addresses 0] \
-WhileStepping $whilestepping -Number [lindex $Number 0] \
-Callback "$this done" -Data $real_data -Steps $steps
}
}
# PUBLIC DATA
- public File {}
- public Lines {}
- public Addresses {}
- public Number {}
+ public variable File {}
+ public variable Lines {}
+ public variable Addresses {}
+ public variable Number {}
# PROTECTED DATA
- protected Delete
- protected _TPassCount
- protected ActionType {}
- protected ActionLB
- protected Actions
- protected WhileStepping 0
- protected Selection {}
- protected New 0; # set whenever there is a new tp to add
- protected Exists 0; # set whenever a tracepoint in the range exists
- protected Dismissed 0; # has this dialog been dismissed already?
- protected ActionsDlg {}
+ protected variable Delete
+ protected variable _TPassCount
+ protected variable ActionType {}
+ protected variable ActionLB
+ protected variable Actions
+ protected variable WhileStepping 0
+ protected variable Selection {}
+ protected variable New 0; # set whenever there is a new tp to add
+ protected variable Exists 0; # set whenever a tracepoint in the range exists
+ protected variable Dismissed 0; # has this dialog been dismissed already?
+ protected variable ActionsDlg {}
}
proc gdb_add_tracepoint {where passes actions {addr {}}} {