Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search

Add element to GeDialog Group

Author
Message
  Topic Search Topic Search
Shawni View Drop Down
Member
Member


Joined: 2008 Mar 24
Location: Germany
Online Status: Offline
Posts: 350
Direct Link To This Post Topic: Add element to GeDialog Group
    Posted: 2008 Sep 19 at 12:19pm

User Information:

Cinema 4D Version:   11 
Platform:      
Language(s):     C++  ;  

---------

Hi!

is it possible to add an element to a dialog group, even if the dialog is created?

thanks :)
____________________
www.xpresso24.com

Python in CINEMA 4D. Check out: http://py4d.com
Back to Top
kuroyume0161 View Drop Down
Member
Member
Avatar

Joined: 2002 Oct 29
Location: United States
Online Status: Offline
Posts: 3665
Direct Link To This Post Posted: 2008 Sep 19 at 4:39pm
Yes. Use LayoutFlushGroup() and LayoutChanged() as bookends to a group you want to change. Don't call CreateLayout() though. Have CreateLayout() call a method that does the group element setup between the GroupBegin()/GroupEnd() of the group that will be changed. Have another method called to do later flushes and resetting (LayoutMyGroup() in this case):

//*---------------------------------------------------------------------------*
Bool CreateLayout()
//*---------------------------------------------------------------------------*
{
     ...
     GroupBegin(GROUP_MYGROUP,BFH_SCALEFIT|BFV_SCALEFIT,0L,2L,String(""),0L);
     {
          CreateMyGroupElements();
     }
     GroupEnd();
     ...
}
// Relayout MyGroup
//*---------------------------------------------------------------------------*
void LayoutMyGroup()
//*---------------------------------------------------------------------------*
{
     LayoutFlushGroup(GROUP_MYGROUP);
     CreateMyGroupElements();
     LayoutChanged(GROUP_MYGROUP);
}
// Create MyGroup Elements
//*---------------------------------------------------------------------------*
void CreateMyGroupElements()
//*---------------------------------------------------------------------------*
{
     AddButton(blah, blah);
     ...
}
Back to Top
Shawni View Drop Down
Member
Member


Joined: 2008 Mar 24
Location: Germany
Online Status: Offline
Posts: 350
Direct Link To This Post Posted: 2008 Sep 19 at 5:07pm
Hi kuroyume0161,

thanks for your reply. Yes, I tried it and it works, do you have an idea how to add a element without deleting the content of the group?

I would like to have an insertion point at the end of the group without deleting the elements before.


Bye :)
____________________
www.xpresso24.com

Python in CINEMA 4D. Check out: http://py4d.com
Back to Top
kuroyume0161 View Drop Down
Member
Member
Avatar

Joined: 2002 Oct 29
Location: United States
Online Status: Offline
Posts: 3665
Direct Link To This Post Posted: 2008 Sep 19 at 5:23pm
Use a group around just that element. You can do this with any group and there really isn't much penalty for things like lots of groups with one or few elements in each. :) Even an empty group at first can be filled or emptied as needed. As you can see, the only thing required is a group ID for reference.
Back to Top
Shawni View Drop Down
Member
Member


Joined: 2008 Mar 24
Location: Germany
Online Status: Offline
Posts: 350
Direct Link To This Post Posted: 2008 Sep 20 at 2:22am
Hi!

Thanks, thats a goood idea. thanks ..
____________________
www.xpresso24.com

Python in CINEMA 4D. Check out: http://py4d.com
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.125 seconds.