Hello,
I'm trying to lay out my GUI and I'm having some difficulty. Here's what I have so far:
Here's what I'd like to make:
ISSUES:
- I'd like to center text #1 "TITLE" in its parent group. Thought I am using the flags
c4d.BFH_CENTER | c4d.BFV_CENTER
, it's still appearing at the top left of its parent group. - I'd like "Thumbnail 1"'s parent to be a square. My initial width and height are set using
initw=160, inith=160
but it's still rectangular. - I'd like the text "Thumbnail 1" to be at the horizontal center and vertical bottom of its parent. I am using the flags:
c4d.BFH_CENTER | c4d.BFV_BOTTOM
Can anyone help me with these issues, please? My code is below. Thank you.
import c4d
from c4d import utils
from c4d.gui import GeUserArea, GeDialog
UIID01 = 10001
UIID02 = 10002
UIID03 = 10003
UIID04 = 10004
UIID05 = 10005
UIID06 = 10006
class Dialog(GeDialog):
def __init__(self):
super(Dialog, self).__init__()
def CreateLayout(self):
self.SetTitle("My GUI")
#column 1
self.GroupBegin(id=UIID01,flags=c4d.BFH_SCALEFIT, cols=1, rows=2, title="") #2
self.GroupBorderNoTitle(c4d.BORDER_SCHEME_EDIT)
#column 1 row 1, Title
self.GroupBegin(id=UIID02,flags=c4d.BFH_SCALEFIT, cols=1, rows=1, title="", inith=50) #4
self.GroupBorderNoTitle(c4d.BORDER_BLACK)
self.AddStaticText(UIID03, c4d.BFH_CENTER | c4d.BFV_CENTER , name="TITLE", borderstyle=1)
self.GroupEnd() #4
#column 1 row 2, Scroll List
self.ScrollGroupBegin(id=UIID04, flags=c4d.BFH_SCALEFIT, scrollflags=c4d.SCROLLGROUP_VERT, inith=260) #4
self.GroupBorderNoTitle(c4d.BORDER_BLACK)
#thumbnail
self.GroupBegin(id=UIID05, flags=c4d.BFH_LEFT | c4d.BFV_TOP, cols=1, rows=1, title="", initw=160, inith=160) #5
self.GroupBorderNoTitle(c4d.BORDER_BLACK)
self.AddStaticText(UIID06, c4d.BFH_CENTER | c4d.BFV_BOTTOM , name="Thumbnail 1")
self.GroupEnd() #5
self.GroupEnd() #4, end Scroll List
self.GroupEnd() #2, end column 1
return True
def main(doc):
dlg = Dialog()
dlg.Open(c4d.DLG_TYPE_MODAL_RESIZEABLE, defaultw=640, defaulth=640)
if __name__=='__main__':
main(doc)