comparison pyink/MBScene.py @ 981:9e7865906bfc

Add MadButterfly name space
author wycc
date Sat, 20 Nov 2010 23:31:02 +0800
parents 37ac93ea9aaf
children 1bda9f9e00ea
comparison
equal deleted inserted replaced
980:37ac93ea9aaf 981:9e7865906bfc
125 pass 125 pass
126 pass 126 pass
127 pass 127 pass
128 pass 128 pass
129 pass 129 pass
130 if self.scenemap==None:
131 self.desktop.doc().root().repr.setAttribute("xmlns:ns0","http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd",True)
132 scenes = self.desktop.doc().rdoc.createElement("ns0:scenes")
133 node.repr.appendChild(scenes)
130 def update(self): 134 def update(self):
131 doc = self.desktop.doc().root() 135 doc = self.desktop.doc().root()
132 rdoc = self.desktop.doc().rdoc 136 rdoc = self.desktop.doc().rdoc
133 for node in doc.childList(): 137 for node in doc.childList():
134 if node.repr.name() == 'svg:metadata': 138 if node.repr.name() == 'svg:metadata':
190 # print o.tag 194 # print o.tag
191 # oldscene.append(o) 195 # oldscene.append(o)
192 pass 196 pass
193 pass 197 pass
194 pass 198 pass
199
195 200
196 self.collectID() 201 self.collectID()
197 self.dumpID() 202 self.dumpID()
198 pass 203 pass
199 204
520 def onOK(self,event): 525 def onOK(self,event):
521 self.OK = True 526 self.OK = True
522 gtk.main_quit() 527 gtk.main_quit()
523 pass 528 pass
524 529
525 def onConfirmDelete(self):
526 if self.scenemap == None:
527 vbox = gtk.VBox(False,0)
528 vbox.pack_start(gtk.Label('Convert the SVG into a MadButterfly'
529 ' SVG file. All current element will'
530 ' be delted'))
531 hbox = gtk.HBox(False,0)
532 self.button = gtk.Button('OK')
533 hbox.pack_start(self.button,expand=False,fill=False)
534 self.button.connect('clicked', self.onOK)
535 self.button = gtk.Button('Cancel')
536 hbox.pack_start(self.button,expand=False,fill=False)
537 self.button.connect("clicked", self.onQuit)
538 vbox.pack_start(hbox,expand=False,fill=False)
539 self.window.add(vbox)
540 self.window.show_all()
541 gtk.main()
542 self.window.remove(vbox)
543 pass
544 pass
545 530
546 def show(self): 531 def show(self):
547 self.OK = True 532 self.OK = True
548 self.parseScene() 533 self.parseScene()
549 self._create_framelines() 534 self._create_framelines()
550 self._update_framelines() 535 self._update_framelines()
551 vbox = gtk.VBox(False,0) 536 vbox = gtk.VBox(False,0)
552 self.desktop.getToplevel().child.child.pack_end(vbox,expand=False) 537 self.desktop.getToplevel().child.child.pack_end(vbox,expand=False)
553 self.window = vbox 538 self.window = vbox
539 vbox = gtk.VBox(False,0)
540 self.window.pack_start(vbox,expand=False)
541 vbox.pack_start(self.scrollwin,expand=False)
542 self.vbox = vbox
543 hbox=gtk.HBox(False,0)
544 self.addButtons(hbox)
545 vbox.pack_start(hbox,expand=False)
546
554 # self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) 547 # self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
555 # self.window.connect("destroy", gtk.main_quit) 548 # self.window.connect("destroy", gtk.main_quit)
556 # self.window.set_position(gtk.WIN_POS_MOUSE) 549 # self.window.set_position(gtk.WIN_POS_MOUSE)
557 if self.scenemap == None:
558 self.onConfirmDelete()
559 pass
560 if self.OK:
561 vbox = gtk.VBox(False,0)
562 self.window.pack_start(vbox,expand=False)
563 vbox.pack_start(self.scrollwin,expand=False)
564 self.vbox = vbox
565 hbox=gtk.HBox(False,0)
566 self.addButtons(hbox)
567 vbox.pack_start(hbox,expand=False)
568 else:
569 return
570
571 # self.window.set_size_request(600,200)
572 550
573 self.window.show_all() 551 self.window.show_all()
574 pass 552 pass
575 pass 553 pass