Changeset e933fd6 in tol for tolbase/lib/toltk/tolbase.tcl


Ignore:
Timestamp:
Nov 10, 2016, 12:56:04 PM (10 years ago)
Author:
Pedro Gea <pgea@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
a762e01
Parents:
0731938
Message:

Refs #1933
Se sustituyen los ::blt::tabset por NoteBook de BWidget. En total se sustituyeron 19 tabsets.
Se suspenden un par de widgets que parece que no se usan, y por tanto tampoco se les ha sustituido ::blt::tabset: bsersel, btab. bchilddetail tampoco parece usarse.
Se corrige un problem en InsertItem de tolinspe.

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

File:
1 edited

Legend:

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

    r0731938 re933fd6  
    172172
    173173  # tabset for eval, output & description
    174   set widgets(tabset) $pane2.ts
    175   set w_tabset [::blt::tabset $widgets(tabset) -side top -relief flat \
    176                     -bd 0 -outerpad 0 -tearoff 0  -slant right -textside right \
    177                     -highlightthickness 0 ]
    178   set sw2 [ScrolledWindow $w_tabset.sw2 -auto both]
    179   set sw3 [ScrolledWindow $w_tabset.sw3 -auto both]
    180   set widgets(tabset,info) $sw3
    181    
    182   $w_tabset insert end \
    183      Eval   -text "[mc Eval]   <Ctrl+A>" -selectbackground \#d9d9d9 -bg gray75 -pady 0\
    184      Output -text "[mc Output] <Ctrl+O>" -selectbackground \#d9d9d9 -bg gray75 -pady 0\
    185      Info   -text "[mc Info]   <Ctrl+I>" -selectbackground \#d9d9d9 -bg gray75 -pady 0
    186 
    187   # OUTPUT CONSOLE COMPONENT 
     174  set widgets(tabset) $pane2.nb
     175  set w_tabset [NoteBook $widgets(tabset) -tabbevelsize 8 -tabpady {2 6} -font {Arial 8}]
     176
     177  $w_tabset insert 0 Eval -text "  [mc Eval] <Ctrl+A>  " -background \#d9d9d9
     178  $w_tabset insert 1 Output -text "  [mc Output] <Ctrl+O>  " -background \#d9d9d9
     179  $w_tabset insert 2 Info -text "  [mc Info] <Ctrl+I>  " -background \#d9d9d9   
     180  $w_tabset raise Eval     
     181  set tab1 [$w_tabset getframe Eval]     
     182  set tab2 [$w_tabset getframe Output]
     183  set tab3 [$w_tabset getframe Info]
     184  set widgets(tabset,tabInfo) $tab3 
     185  $tab1 configure -borderwidth 2 -background \#d9d9d9
     186  $tab2 configure -borderwidth 2 -background \#d9d9d9 
     187  $tab3 configure -borderwidth 2 -background \#d9d9d9   
     188  set sw2 [ScrolledWindow $tab2.sw -scrollbar none]
     189  set sw3 [ScrolledWindow $tab3.sw -scrollbar none]
     190  set widgets(tabset,info) $sw3
     191
     192  # OUTPUT CONSOLE COMPONENT
    188193  set widgets(output) $sw2.out
    189194  set w_output [text $widgets(output) -wrap none -cursor ""\
    … …  
    191196  $sw2 setwidget $w_output
    192197
    193   # EVAL CONSOLE COMPONENT     
    194   set feval $w_tabset.f 
     198  # EVAL CONSOLE COMPONENT
     199  set feval $tab1.f 
    195200  CreateEvalWindow $feval
    196201
    … …  
    225230  set widgets(info) $widgets(info,text)
    226231
    227   set widgets(info,markupviewer) [ markupviewer $w_tabset.mv \
    228                                        -db $data(notebookdb) -showtitle 0 ]
     232  set widgets(info,markupviewer) [markupviewer $tab3.mv -db $data(notebookdb) -showtitle 0]
    229233
    230234  MarkupMenu $widgets(info,markupviewer)
    … …  
    256260  $path bind <Control-F4> +[list $path kill]
    257261 
    258   bind $path <Control-KeyRelease> \
    259       +[list ::TolConsole::OnControlKey %K %k]
    260   $w_tabset tab configure Eval   -window $feval -fill both -padx 0
    261   $w_tabset tab configure Output -window $sw2   -fill both -padx 0
    262   $w_tabset tab configure Info   -window $sw3   -fill both -padx 0
     262  bind $path <Control-KeyRelease> +[list ::TolConsole::OnControlKey %K %k]
     263  pack $tab1.f -fill both -expand yes 
     264  pack $tab2.sw -fill both -expand yes
     265
     266  #@ Se añade al grid el .sw y se quita (sin olvidar su configuración)
     267  #@ Luego se añade al grid el .mv.
     268  #@ La función :TolConsole::ActivateInfoWidget alterna entre uno u otro
     269  grid columnconfigure $tab3 0 -weight 1
     270  grid rowconfigure $tab3 0 -weight 1   
     271  grid $tab3.sw -column 0 -row 0 -sticky nwes
     272  grid remove $tab3.sw
     273  grid $tab3.mv -column 0 -row 0 -sticky nwes 
     274 
    263275  pack $w_tabset -fill both -expand yes
    264276   
    … …  
    407419  switch -exact $win  {
    408420    "eval"   {
    409       $widgets(tabset) select 0
     421      $widgets(tabset) raise Eval
    410422      $widgets(eval) mark set anchor insert
    411423    }
    412     "output" {
    413       $widgets(tabset) select 1
     424    "output" { 
     425      $widgets(tabset) raise Output
    414426    }
    415427    "info"   {
    416       $widgets(tabset) select 2
     428      $widgets(tabset) raise Info
    417429    }
    418430  }
    … …  
    509521}
    510522
     523#/////////////////////////////////////////////////////////////////////////////
    511524proc ::TolConsole::ActivateInfoWidget { id } {
     525#/////////////////////////////////////////////////////////////////////////////
    512526  variable widgets
    513527
    514528  if { $id eq "text" } {
    515     set w $widgets(tabset,info)
     529    set w $widgets(tabset,info)   
    516530  } elseif { $id eq "markup" } {
    517     set w $widgets(info,markupviewer)
     531    set w $widgets(info,markupviewer) 
    518532  } else {
    519533    error "unknown id '$id' in ::TolConsole::ActivateInfoWidget"
    520534  }
    521   if { [ $widgets(tabset) tab cget Info -window ] ne $w } {
    522     $widgets(tabset) tab configure Info  -window $w -fill both -padx 0
    523   }
    524   $widgets(tabset) select 2
     535
     536  set slave [lindex [grid slaves $widgets(tabset,tabInfo)] 0]
     537  #@ se admite que solo hay un 'slave' 
     538  if { $slave ne $w } {
     539    grid remove $slave
     540    grid $w
     541  }
     542  $widgets(tabset) raise Info
    525543}
    526544
    … …  
    700718    if { $state } {
    701719        $widgets(eval) configure -cursor watch
    702         $widgets(tabset) configure -cursor watch
     720        #@TS2NB $widgets(tabset) configure -cursor watch
     721        $widgets(panes,bottom) configure -cursor watch
    703722       #  ::blt::busy hold .       
    704723    } else {
    705724        $widgets(eval) configure -cursor xterm
    706         $widgets(tabset) configure -cursor ""
     725        #@TS2NB $widgets(tabset) configure -cursor ""
     726        $widgets(panes,bottom) configure -cursor ""
    707727      #  ::blt::busy release .     
    708728    }
    … …  
    723743
    724744  $w_eval insert end "$message\n"
    725   $w_tabset select 0
     745  $w_tabset raise Eval
    726746  $w_eval see end
    727747}
    … …  
    759779    always {
    760780      if $data(chWrite) {
    761         $w_tabset select 1
     781        $w_tabset raise Output
    762782        $w_output see end     
    763783      }
    … …  
    770790        set time $time_now
    771791        if $data(chWrite) {
    772           $w_tabset select 1
     792          $w_tabset raise Output         
    773793          $w_output see end
    774794        }
    … …  
    14971517    [list ::TolConsole::OptionsDestroy $dialog]
    14981518  set w [$dialog getframe]
    1499  
    15001519  wm resizable $dialog 0 0
    1501   # TabSet TolBase
    1502   set w_ts [::blt::tabset $w.ts -relief flat -highlightthickness 0 -bd 0 \
    1503     -outerpad 0 -tier 2 -slant both -textside right -side left -rotate 90 ]
    1504   #insertar tabset
    1505   $w_ts insert end TolBase
    1506   set f0 [frame $w_ts.f0] 
    1507   $w_ts tab configure "TolBase" -text "TolBase" \
    1508     -window $f0 -fill both -padx 0 -selectbackground \#d9d9d9 -bg gray75 
    1509  
     1520 
     1521  #@ Se prescinde de la pestaña lateral TolBase
     1522
    15101523  # TabSet Options
    1511   set w_tabset [::blt::tabset $f0.ts -relief flat -highlightthickness 0\
    1512     -bd 0 -outerpad 0 -tier 2 -slant right -textside right ]
    1513  
    1514   $w_tabset insert end TOL Output Precision Paths Others
    1515   set f1 [frame $w_tabset.f1]
    1516   set f2 [frame $w_tabset.f2]
    1517   set f3 [frame $w_tabset.f3]
    1518   set f4 [frame $w_tabset.f4]
    1519   set f5 [frame $w_tabset.f5]
    1520 
    1521   $w_tabset tab configure "TOL" -text [mc "TOL"] -window $f1\
    1522        -fill both -padx 0 -selectbackground \#d9d9d9 -bg gray75
    1523   $w_tabset tab configure "Output" -text [mc "Output"] -window $f2\
    1524        -fill both -padx 0 -selectbackground \#d9d9d9 -bg gray75
    1525   $w_tabset tab configure "Precision" -text [mc "Precision"] -window $f3\
    1526        -fill both -padx 0 -selectbackground \#d9d9d9 -bg gray75
    1527   $w_tabset tab configure "Paths" -text [mc "Paths"] -window $f5\
    1528        -fill both -padx 0 -selectbackground \#d9d9d9 -bg gray75
    1529   $w_tabset tab configure "Others" -text [mc "Others"] -window $f4\
    1530        -fill both -padx 0 -selectbackground \#d9d9d9 -bg gray75
     1524  set w_tabset [NoteBook $w.nb -tabbevelsize 8 -tabpady {2 6} -font {Arial 8}]
     1525 
     1526  set num_i 0
     1527  foreach lab_i [list TOL Output Precision Paths Others] {
     1528    $w_tabset insert $num_i $lab_i -text "  $lab_i  " -background \#d9d9d9
     1529    set tab_i [$w_tabset getframe $lab_i]
     1530    $tab_i configure -borderwidth 2 -background \#d9d9d9
     1531    incr num_i   
     1532    set f$num_i [frame $tab_i.f]
     1533    pack $tab_i.f -fill both -expand yes 
     1534  }
     1535  $w_tabset raise [$w_tabset pages 0]
    15311536
    15321537  OptionsGet
    … …  
    15341539  OptionsCreateOutput     $f2
    15351540  OptionsCreatePrecision  $f3
    1536   OptionsCreatePaths      $f5
    1537   OptionsCreateOthers     $f4
     1541  OptionsCreatePaths      $f4
     1542  OptionsCreateOthers     $f5
    15381543 
    15391544  # Options project
    … …  
    15411546      [string length $data(proc,OnOptionCreate)]} {
    15421547    foreach f $data(proc,OnOptionCreate) {
    1543       $f $w_ts
     1548      $f $w_tabset
    15441549    }
    15451550  }
    … …  
    15641569
    15651570  pack $w_bbox   -side bottom -expand no  -fill x
     1571  $w_tabset compute_size
    15661572  pack $w_tabset -side top    -expand yes -fill both
    1567   pack $w_ts -expand yes -fill both ;#-sticky news
    15681573 
    15691574  if {!($tabinit eq "")} {
    1570     switch -exact $tabinit  {
    1571       "TOL" {
    1572         $w_tabset select 0
    1573       }
    1574       "Output" {
    1575         $w_tabset select 1
    1576       }
    1577       "Precision" {
    1578         $w_tabset select 2
    1579       }
    1580       "Paths" {
    1581         $w_tabset select 3
    1582       }
    1583       "Others" {
    1584         $w_tabset select 4
    1585       }     
    1586     }
     1575    $w_tabset raise $tabinit
    15871576  }
    15881577  bind $dialog <F1> "ShowHelp Tb4Opc"
Note: See TracChangeset for help on using the changeset viewer.