File: sidebar.tcl

package info (click to toggle)
tkgate 2.1%2Brepack-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 28,384 kB
  • sloc: ansic: 62,300; tcl: 20,345; xml: 2,731; yacc: 1,177; lex: 839; sh: 664; makefile: 180; perl: 39
file content (107 lines) | stat: -rw-r--r-- 3,066 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#   Copyright (C) 1987-2015 by Jeffery P. Hansen
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License along
#   with this program; if not, write to the Free Software Foundation, Inc.,
#   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Last edit by hansen on Tue Jan 13 09:30:38 2009
#

namespace eval SideBar {
  #############################################################################
  #
  # Make a tab for the Net/Ports box
  #
  proc netTabs {w tab} {
    switch $tab {
      Nets {
	NetList::create $w
      }
      Ports {
	PortList::create $w
      }
    }
    $w configure -padx 2 -pady 2
  }


  #############################################################################
  #
  # Make a tab for the module tree/list view
  #
  proc moduleTabs {w tab} {
    switch $tab {
      Tree {
	BlockTree::create $w
      }
      List {
	BlockList::create $w
      }
    }
    $w configure -padx 2 -pady 2
  }

  #############################################################################
  #
  # This creates the combined nets/ports list on the lower left side of the GUI
  #
  proc makeNetPortBox {w} {
    TabBox::new $w -tabs { Nets Ports} -command SideBar::netTabs -tablabels [list [m sidetab.nets]  [m sidetab.ports]] -expand 1

    helpon $w.bNets [m ho.netlist]
    helpon $w.bPorts [m ho.ports]
  }

  #############################################################################
  #
  # This creates the combined module tree/list viewer
  #
  proc makeBlockList {w} {
    frame $w

    set labels [list [m module.tree] [m module.list]]
    set images [list [gifI modtree.gif] [gifI modlist.gif]]

    TabBox::new $w.mtab -tabs {Tree List} -command SideBar::moduleTabs -tablabels $labels -tabimages $images -compound left -expand 1
    pack $w.mtab -fill both -expand 1


    helpon $w.mtab.bTree [m ho.modtree]
    helpon $w.mtab.bList [m ho.modlist]
  }

  #
  # The user requested a property edit, but there are no gates seleted.  Look in the side
  # bar windows to see if we can find something selected.
  #
  proc editModuleOrNet {} {
    set net [NetList::getselection]
    if {$net != "" } {
      gat_editNet $net
      return
    }
    #  if { [BlockList::getselection] != "" || [BlockTree::getselection] != "" } {
    #    EditModuleDB::post
    #  }
  }

  #
  # Set up the side-bar windows here.
  #
  proc new {w} {
    makeBlockList $w.blklst
    makeNetPortBox $w.nptab

    pane $w.blklst $w.nptab -orient vertical -handlelook {-relief flat -height 10} -decoration paneDecoration
  }
}