On 31/03/2017 at 16:56, xxxxxxxx wrote:
I have a Gedialog Master class. And Another Gedialog class.
When I press a button into the GeDialogMaster class I open my another Gedialog class.
Then after something into the subDialog I want to update the ui of the SubDialog. But that didn't work. Flush seem to work but not the redraw part.
I also got another little issue which is not related to SubDialog.
I have a text with a color but if I select this text with right click, after the hoover the color recome by default.
Here you get an exemple of what I'm speaking. Actually into my plugin I call dialog inAsync mode but for the exemple I guess it's more easy to run it into the Script Manager so I switched to Modal.
import c4d
class mainDialog(c4d.gui.GeDialog) :
def __init__(self) :
self.subDlg = MyOtherDialog()
def CreateLayout(self) :
self.AddButton(1001, c4d.BFH_CENTER, 60, 15, "Open")
return True
def Command(self, id, msg) :
if id == 1001:
self.subDlg.Open(dlgtype=c4d.DLG_TYPE_MODAL, defaultw=300, defaulth=150, xpos=-1, ypos=-1)
return True
class MyOtherDialog(c4d.gui.GeDialog) :
data = "aaaaa"
def CreateLayout(self) :
self.__create_ui()
return True
def __create_ui(self, refresh=False) :
if refresh:
self.LayoutFlushGroup(1002)
else:
self.GroupBegin(1002, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 1, 1, "My Group")
self.AddStaticText(1003, c4d.BFH_CENTER | c4d.BFV_SCALEFIT, name="test")
if refresh:
self.SetString(1003, self.data)
self.SetDefaultColor(1003, c4d.COLOR_TEXT, c4d.Vector(0.631, 1, 0.33))
else:
self.SetDefaultColor(1003, c4d.COLOR_TEXT, c4d.Vector(0.78, 0.257, 0.257))
self.AddButton(1004, c4d.BFH_CENTER, 60, 15, "Refresh")
self.GroupEnd()
if refresh:
self.LayoutChanged(1002)
def Command(self, id, msg) :
if id == 1004:
self.__create_ui(True)
return True
def main() :
main_dlg = mainDialog()
main_dlg.Open(dlgtype=c4d.DLG_TYPE_MODAL, defaultw=300, defaulth=150, xpos=-1, ypos=-1)
if __name__=='__main__':
main()
Thanks in advance :)