Ignore:
Timestamp:
Jan 26, 2009, 10:15:38 AM (18 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
a64730a
Parents:
1286a3a
Message:

holdon in TclChartMatrix, TclChartSet

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@487 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tolbase/lib/toltk/tolmethods.tcl

    r1286a3a rc61d3f9  
    249249
    250250#/////////////////////////////////////////////////////////////////////////////
    251 proc Tol_SetChartMethod { title source gcfFile geometry filetosave lstNames type lstPairs } {
     251proc Tol_SetChartMethod { title source gcfFile geometry filetosave lstNames
     252                          type lstPairs {holdon ""}} {
    252253#
    253254# PURPOSE: Hook of Chart method
    … …  
    266267#   lstPairs -> when type is 0 pairs is the list of correspondence beetwen index
    267268#               columns to data columns (x-y pairs)
     269#   holdon   -> tell if the new graph goes into a new context or an existing one
    268270#
    269271#/////////////////////////////////////////////////////////////////////////////
    … …  
    281283  }
    282284  # MDI
    283   set tl [::project::CreateForm \
    284     -title $wTitle -type Graphs -iniconfig SetGraph -geometry $geometry]
    285   $tl setgeometry $geometry 
     285  if {$holdon ne "" && (![winfo exists $holdon] || [winfo class $holdon] ne "Mdidoc")} {
     286    Tol_HciWriter "<W>[mc {Graphic requested to be drawn on %s but that graphic context does not exist or is not a valid grafic windows} $holdon]</W>"
     287    set holdon ""
     288  }
     289  if {[winfo exists $holdon]} {
     290    set tl $holdon
     291  } else {
     292    puts "no existe '$holdon' por eso ... ::project::CreateForm"
     293
     294    set tl [::project::CreateForm \
     295                -title $wTitle -type Graphs -iniconfig SetGraph -geometry $geometry]
     296    $tl setgeometry $geometry
     297  }
    286298  set top [$tl getframe]
    287299  # if source is a list is interpreted as a set name and indexes accesing a element
    … …  
    303315  set Instance [::SetGraphDialog::DrawSet $top.g $cmd $source $type $lstPairs \
    304316    $lstNames $gcfFile [list $title]]
    305   bind $top.g <Destroy> +[list ::tol::tableset destroy $cmd]
    306   if { [llength $source] > 1} {
    307     bind $top.g <Destroy> +[list ::tol::stack release $source]
    308   }
    309   pack $top.g -fill both -expand yes
    310   update
    311   ::bayesGraph::GrapOptApplyAxisTicks $Instance ${Instance}::options gr,0
    312   if { [string length $filetosave] } {
    313     ::bayesGraph::TakePhoto $Instance $filetosave
    314     after idle "destroy $tl"
     317  if {$holdon ne ""} {
     318    ::tol::tableset destroy $cmd
     319    if { [llength $source] > 1} {
     320      ::tol::stack release $source
     321    }
     322  } else {
     323    bind $top.g <Destroy> +[list ::tol::tableset destroy $cmd]
     324    if { [llength $source] > 1} {
     325      bind $top.g <Destroy> +[list ::tol::stack release $source]
     326    }
     327    pack $top.g -fill both -expand yes
     328    update
     329    ::bayesGraph::GrapOptApplyAxisTicks $Instance ${Instance}::options gr,0
     330    if { [string length $filetosave] } {
     331      ::bayesGraph::TakePhoto $Instance $filetosave
     332      after idle "destroy $tl"
     333    }
    315334  }
    316335  return $tl
Note: See TracChangeset for help on using the changeset viewer.