Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import c4d
- class Sub(c4d.gui.SubDialog):
- def CreateLayout(self):
- self.AddStaticText(1001, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, 0, "SubDialog", c4d.BORDER_THIN_IN)
- return True
- class AutreSub(c4d.gui.SubDialog):
- def CreateLayout(self):
- self.AddStaticText(1001, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, 0, "Autre Sub", c4d.BORDER_THIN_IN)
- return True
- class test(c4d.gui.GeDialog):
- sub = Sub()
- def CreateLayout(self):
- self.AddButton(1002, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT)
- self.AddSubDialog(1001, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 100, 100)
- self.AttachSubDialog(self.sub, 1001)
- return True
- def Command(self, id, msg):
- if id == 1002:
- self.sub = AutreSub()
- self.AttachSubDialog(self.sub, 1001)
- self.LayoutChanged(1001)
- return True
- def main():
- dlg = test()
- dlg.Open(c4d.DLG_TYPE_MODAL_RESIZEABLE, defaultw=400, defaulth=400)
- if __name__=='__main__':
- main()
- import c4d
- class Sub(c4d.gui.SubDialog):
- def CreateLayout(self):
- self.AddStaticText(1001, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, 0, "SubDialog", c4d.BORDER_THIN_IN)
- self.AddButton(1002, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT)
- return True
- def Message(self, msg, result):
- if msg.GetId() == 1002:
- print 'Sub'
- return c4d.gui.SubDialog.Message(self, msg, result)
- def Command(self, id, msg):
- if id == 1002:
- bc = c4d.BaseContainer()
- bc.SetId(2000)
- self.SendParentMessage(bc)
- return True
- class test(c4d.gui.GeDialog):
- sub = Sub()
- def CreateLayout(self):
- self.AddSubDialog(1001, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 100, 100)
- self.AttachSubDialog(self.sub, 1001)
- return True
- def Command(self, id, msg):
- print id, msg
- return True
- def Message(self, msg, result):
- if msg.GetId() == 2000:
- print 'MainDLG'
- bc = c4d.BaseContainer()
- bc.SetId(1002)
- self.SendMessage(self.sub.GetId(), bc)
- return c4d.gui.GeDialog.Message(self, msg, result)
- def main():
- dlg = test()
- dlg.Open(c4d.DLG_TYPE_MODAL_RESIZEABLE, defaultw=400, defaulth=400)
- if __name__=='__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement