How to create grid layout dialog like content browser in Cinema 4D



  • I want to create grid layout, and show my pictures in the layout,like content browser layout.
    Snipaste_2020-02-17_22-27-02.png
    I try to use GeUserArea() ,but it's little hard for me.
    Can you guys give some idea or example for me?
    (I'm chinese guy , so... sorry about my bad english😕 )



  • Hi, @gheyret I restored this topic since I have the answers ready and it may interest other people.

    There is nothing builtin like that in Cinema 4D the only way is to recreate everything yourself in a GeUserArea.

    With that's said there is this topic that may interest you Drag & Drop to Reorder in GUI.
    There is also this example PoseMasterUi_Exemple.py I did some time ago.

    Hope its helpful,
    Cheers,
    Maxime.



  • Wow! Big thanks for you man !
    Cheers!



  • Hi @m_adam thank you again ,I have another problem is ; if i try to create ScrollArea in UserArea ,the cinema 4d is crashed,i don't know what's wrong



  • ScrollArea doesn't create a scroll bar but scrolls the user area.

    So please open a new topic with your code included so I can take a look :).
    Cheers,
    Maxime.



  • @m_adam
    This is my code:

        def DrawMsg(self, x1, y1, x2, y2, msg):
            """
            This method is called to render the content of the view.
            """
    
            # Enables double buffering to avoid flickering.
            self.OffScreenOn()
    
            # Draw the background.
            self.DrawSetPen(c4d.COLOR_BG)
            self.DrawRectangle(x1, y1, x2, y2)
            self.ScrollArea(1, 1, x1, y1, self.GetWidth(), self.GetHeight())
    


  • I really encourage you to open a new topic, the issue here is unrelated and due to ScrollArea actually invalidate the whole drawing, and since you are in the DrwMsg, this creates an infinite loop where C4D try to redraw (calling DrawMsg) but you scroll so it invoke a redraw and etc.

    Cheers,
    Maxime


Log in to reply