Adding some more hooks for wxxdot.
This commit is contained in:
parent
04e4ebb7d9
commit
b5a713e31d
|
@ -167,6 +167,7 @@ class WxDotWindow(wx.Panel):
|
||||||
self.select_cbs = []
|
self.select_cbs = []
|
||||||
self.dc = None
|
self.dc = None
|
||||||
self.ctx = None
|
self.ctx = None
|
||||||
|
self.items_by_url = {}
|
||||||
|
|
||||||
### User callbacks
|
### User callbacks
|
||||||
def register_select_callback(self, cb):
|
def register_select_callback(self, cb):
|
||||||
|
@ -183,6 +184,7 @@ class WxDotWindow(wx.Panel):
|
||||||
#print dc
|
#print dc
|
||||||
ctx = wxcairo.ContextFromDC(dc)
|
ctx = wxcairo.ContextFromDC(dc)
|
||||||
ctx = pangocairo.CairoContext(ctx)
|
ctx = pangocairo.CairoContext(ctx)
|
||||||
|
#print "DRAW"
|
||||||
|
|
||||||
# Get widget size
|
# Get widget size
|
||||||
width, height = self.GetSize()
|
width, height = self.GetSize()
|
||||||
|
@ -245,8 +247,6 @@ class WxDotWindow(wx.Panel):
|
||||||
self.reload()
|
self.reload()
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
event.Skip()
|
|
||||||
|
|
||||||
### Helper functions
|
### Helper functions
|
||||||
def get_current_pos(self):
|
def get_current_pos(self):
|
||||||
"""Get the current graph position."""
|
"""Get the current graph position."""
|
||||||
|
@ -453,6 +453,16 @@ class WxDotWindow(wx.Panel):
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
self.set_xdotcode(xdotcode)
|
self.set_xdotcode(xdotcode)
|
||||||
|
|
||||||
|
# Store references to all the items
|
||||||
|
self.items_by_url = {}
|
||||||
|
for item in self.graph.nodes + self.graph.edges:
|
||||||
|
if item.url is not None:
|
||||||
|
self.items_by_url[item.url] = item
|
||||||
|
|
||||||
|
# Store references to subgraph states
|
||||||
|
self.subgraph_shapes = self.graph.subgraph_shapes
|
||||||
|
|
||||||
except ParseError, ex:
|
except ParseError, ex:
|
||||||
print "ERROR PARSING XDOT CODE"
|
print "ERROR PARSING XDOT CODE"
|
||||||
dialog = gtk.MessageDialog(type=gtk.MESSAGE_ERROR,
|
dialog = gtk.MessageDialog(type=gtk.MESSAGE_ERROR,
|
||||||
|
|
Loading…
Reference in New Issue