/[ascend]/branches/adrian/pygtk/properties.py
ViewVC logotype

Diff of /branches/adrian/pygtk/properties.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3017 by adrian, Wed Apr 1 10:57:31 2015 UTC revision 3018 by adrian, Mon Jul 20 12:22:06 2015 UTC
# Line 7  from infodialog import * Line 7  from infodialog import *
7    
8  class RelPropsWin:  class RelPropsWin:
9      def __init__(self,browser,instance):      def __init__(self,browser,instance):
10          self.instance = instance;          self.instance = instance
11          self.browser = browser;          self.browser = browser
12    
13          # GUI config          # GUI config
14          self.browser.builder.add_objects_from_file(self.browser.glade_file, ["relpropswin"])          self.browser.builder.add_objects_from_file(self.browser.glade_file, ["relpropswin"])
# Line 20  class RelPropsWin: Line 20  class RelPropsWin:
20          self.expr = self.browser.builder.get_object("expr")          self.expr = self.browser.builder.get_object("expr")
21          self.included = self.browser.builder.get_object("included")          self.included = self.browser.builder.get_object("included")
22          self.active = self.browser.builder.get_object("active")          self.active = self.browser.builder.get_object("active")
23          self.exprbuff = Gtk.TextBuffer();          self.exprbuff = Gtk.TextBuffer()
24          self.expr.set_buffer(self.exprbuff)          self.expr.set_buffer(self.exprbuff)
25          self.morepropsbutton = self.browser.builder.get_object("morepropsbutton");          self.morepropsbutton = self.browser.builder.get_object("morepropsbutton1")
26    
27          self.statusimg = self.browser.builder.get_object("rel_statusimg");          self.statusimg = self.browser.builder.get_object("rel_statusimg")
28          self.statusmessage = self.browser.builder.get_object("rel_statusmessage");          self.statusmessage = self.browser.builder.get_object("rel_statusmessage")
29    
30          self.fill_values()          self.fill_values()
31          self.browser.builder.connect_signals(self)          self.browser.builder.connect_signals(self)
32    
33      def fill_values(self):      def fill_values(self):
34          self.relname.set_text( self.browser.sim.getInstanceName(self.instance) )          self.window.set_title(self.instance.getKindStr())
35          self.residual.set_text( str( self.instance.getResidual() ) )          self.relname.set_text(self.browser.sim.getInstanceName(self.instance))
36          self.exprbuff.set_text( self.instance.getRelationAsString(self.browser.sim.getModel() ) )          _status = self.instance.getStatus()
37          self.included.set_active( self.instance.isIncluded() )          self.statusimg.set_from_pixbuf(self.browser.statusicons[_status])
38            self.statusmessage.set_text(self.browser.statusmessages[_status])
39          _status = self.instance.getStatus()              if self.instance.isRelation():
40          self.statusimg.set_from_pixbuf(self.browser.statusicons[_status]);              self.exprbuff.set_text(self.instance.getRelationAsString(self.browser.sim.getModel()))
41          self.statusmessage.set_text(self.browser.statusmessages[_status]);          elif self.instance.isLogicalRelation():
42                self.exprbuff.set_text(self.instance.getLogrelAsString(self.browser.sim.getModel()))
43            elif self.instance.isWhen():
44                self.exprbuff.set_text(self.instance.getWhenAsString(self.browser.sim.getModel()))
45    
46            if str(self.instance.getType()) == "relation":
47                self.residual.set_text(str(self.instance.getResidual()))
48                self.included.set_active(self.instance.isIncluded())
49            else:
50                self.morepropsbutton.set_sensitive(False)
51                self.residual.set_sensitive(False)
52                self.included.set_sensitive(False)
53    
54      def on_relpropswin_close(self,*args):      def on_relpropswin_close(self,*args):
55          self.window.response(Gtk.ResponseType.CANCEL)          self.window.response(Gtk.ResponseType.CANCEL)

Legend:
Removed from v.3017  
changed lines
  Added in v.3018

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22