def CreateLayout(self):
...
scrollflags = c4d.SCROLLGROUP_VERT | c4d.SCROLLGROUP_HORIZ | c4d.SCROLLGROUP_AUTOHORIZ|c4d.SCROLLGROUP_AUTOVERT
if self.ScrollGroupBegin(self.ID_Scroll_Group, c4d.BFH_SCALEFIT| c4d.BFV_SCALEFIT, scrollflags, initw=0, inith=0):
if self.GroupBegin(self.ID_ProjectSubDlg_Group, c4d.BFH_SCALEFIT| c4d.BFV_SCALEFIT, 1, 0,""):
#
#
#
pass # sub_item_dlgs
#
#
#
self.GroupEnd()
self.GroupEnd()
...
return True
def init_sub_items(self):
self.sub_item_dlgs = []
self.LayoutFlushGroup(self.ID_ProjectSubDlg_Group)
if self.GroupBegin(self.ID_ProjectSubDlg_Group, c4d.BFH_SCALEFIT| c4d.BFV_SCALEFIT, 1, 0,""):
item_list = sorted(self.structure["items"], key=lambda x: self.structure["items"][x]["order"])
index = 1
for item_name in item_list:
item_data = self.structure["items"][item_name]
if item_data["type"] != self.get_type():
continue
sub_item_dlg = ProjectSubDlg(self.structure, item_data, index) ## Add custom subdialog
self.sub_item_dlgs.append(sub_item_dlg)
self.AddSeparatorH(2,c4d.BFH_SCALEFIT)
self.AddSubDialog(self.ID_Item_dlg_START+index, flags=c4d.BFH_SCALEFIT)
self.AttachSubDialog(sub_item_dlg, self.ID_Item_dlg_START+index)
index +=1
self.GroupEnd()
self.LayoutChanged(self.ID_ProjectSubDlg_Group)
I have creat a list of subdialogs inside scroll group, and subdialog have a function will open doc.when i do this command, the scroll group will also be randomly changed?
and i also can recive the message use:
def Message(self, msg, result):
if msg.GetId() == c4d.BFM_SCROLLGROUP_SCROLLED :
print("scroll group change when document refresh")
return c4d.gui.GeDialog.Message(self, msg, result)
i think this is a bug because it not happen in r24, is there any solution in r26?