Changeset 996:8035d80d5feb for src/mlx/gui/delaycodes.py
- Timestamp:
- 07/04/19 17:57:45 (5 years ago)
- Branch:
- python3
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/delaycodes.py
r995 r996 11 11 #------------------------------------------------------------------------------ 12 12 13 class Viewport( gtk.Viewport):13 class Viewport(Gtk.Viewport): 14 14 """Viewport implementation that alleviates the problem with improper 15 15 resizing by the VBox.""" 16 16 def __init__(self): 17 17 """Construct the viewport.""" 18 gtk.Viewport.__init__(self)18 Gtk.Viewport.__init__(self) 19 19 self._recursive = False 20 20 self._vboxHeight = None … … 34 34 allocation.height = self._vboxHeight - allocation.y 35 35 self._vboxHeight = None 36 gtk.Viewport.do_size_allocate(self, allocation)37 38 class DelayCodeTableBase( gtk.VBox, gtk.Scrollable):36 Gtk.Viewport.do_size_allocate(self, allocation) 37 38 class DelayCodeTableBase(Gtk.VBox, Gtk.Scrollable): 39 39 """PyGObject-specific base class for the delay code table.""" 40 40 __gproperties__ = { 41 "vscroll-policy" : ( gtk.ScrollablePolicy,41 "vscroll-policy" : ( Gtk.ScrollablePolicy, 42 42 "vscroll-policy", 43 43 "The vertical scrolling policy", 44 gtk.ScrollablePolicy.MINIMUM,44 Gtk.ScrollablePolicy.MINIMUM, 45 45 GObject.PARAM_READWRITE ), 46 "vadjustment" : ( gtk.Adjustment,46 "vadjustment" : ( Gtk.Adjustment, 47 47 "vadjustment", 48 48 "The vertical adjustment", 49 49 GObject.PARAM_READWRITE ), 50 "hscroll-policy" : ( gtk.ScrollablePolicy,50 "hscroll-policy" : ( Gtk.ScrollablePolicy, 51 51 "hscroll-policy", 52 52 "The horizontal scrolling policy", 53 gtk.ScrollablePolicy.MINIMUM,53 Gtk.ScrollablePolicy.MINIMUM, 54 54 GObject.PARAM_READWRITE ), 55 "hadjustment" : ( gtk.Adjustment,55 "hadjustment" : ( Gtk.Adjustment, 56 56 "hadjustment", 57 57 "The horizontal adjustment", … … 74 74 do_size_allocate() function of VBox().""" 75 75 self._viewport.setVBOXHeight(allocation.height) 76 gtk.VBox.do_size_allocate(self, allocation)76 Gtk.VBox.do_size_allocate(self, allocation) 77 77 self.allocate_column_sizes(allocation) 78 78 … … 109 109 """Set the style of the event box from the treeview.""" 110 110 111 class Alignment( gtk.Alignment):111 class Alignment(Gtk.Alignment): 112 112 """An alignment that remembers the width it was given.""" 113 113 def __init__(self, xalign = 0.0, yalign=0.0, … … 121 121 """Called with the new size allocation.""" 122 122 self.allocatedWidth = allocation.width 123 gtk.Alignment.do_size_allocate(self, allocation)124 125 class TreeView( gtk.TreeView):123 Gtk.Alignment.do_size_allocate(self, allocation) 124 125 class TreeView(Gtk.TreeView): 126 126 def do_size_allocate(self, allocation): 127 127 allocation.height += 1 128 gtk.TreeView.do_size_allocate(self, allocation)129 130 #------------------------------------------------------------------------------ 131 132 class CheckButton( gtk.CheckButton):128 Gtk.TreeView.do_size_allocate(self, allocation) 129 130 #------------------------------------------------------------------------------ 131 132 class CheckButton(Gtk.CheckButton): 133 133 """A check button that contains a reference to a row in the delay code 134 134 data table.""" … … 184 184 self._delayCodeData = None 185 185 186 self._treeView = TreeView( gtk.ListStore(str, str))186 self._treeView = TreeView(Gtk.ListStore(str, str)) 187 187 self._treeView.set_rules_hint(True) 188 188 … … 192 192 self._checkButtons = [] 193 193 194 self._eventBox = gtk.EventBox()194 self._eventBox = Gtk.EventBox() 195 195 196 196 self._table = None … … 254 254 numRows = len(rows) 255 255 256 column = gtk.TreeViewColumn("", gtk.CellRendererText())256 column = Gtk.TreeViewColumn("", Gtk.CellRendererText()) 257 257 column.set_sizing(TREE_VIEW_COLUMN_FIXED) 258 258 self._treeView.append_column(column) 259 259 260 260 for header in headers: 261 column = gtk.TreeViewColumn(header, gtk.CellRendererText())261 column = Gtk.TreeViewColumn(header, Gtk.CellRendererText()) 262 262 column.set_sizing(TREE_VIEW_COLUMN_FIXED) 263 263 self._treeView.append_column(column) 264 264 265 self._table = gtk.Table(numRows, numColumns)265 self._table = Gtk.Table(numRows, numColumns) 266 266 self._table.set_homogeneous(False) 267 267 self._table.set_col_spacings(16) … … 276 276 (type, elements) = rows[i] 277 277 if type==CAPTION: 278 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,278 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5, 279 279 xscale = 1.0) 280 label = gtk.Label("<b>" + elements + "</b>")280 label = Gtk.Label("<b>" + elements + "</b>") 281 281 label.set_use_markup(True) 282 282 label.set_alignment(0.0, 0.5) … … 297 297 298 298 for j in range(0, numColumns-1): 299 label = gtk.Label(elements[j])299 label = Gtk.Label(elements[j]) 300 300 label.set_alignment(0.0, 0.5) 301 301 alignment = Alignment(xalign = 0.5, yalign = 0.5,
Note:
See TracChangeset
for help on using the changeset viewer.