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

How does GroupBeginInMenuLine() work?

 Post Reply Post Reply
Author
Message
mnu View Drop Down
Member
Member


Joined: 2002 Nov 11
Location: Germany
Online Status: Offline
Posts: 41
Post Options Post Options   Quote mnu Quote  Post ReplyReply Direct Link To This Post Topic: How does GroupBeginInMenuLine() work?
    Posted: 2010 Feb 13 at 10:37am

User Information:

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

---------

Hi,

can somebody tell me how to use "GroupBeginInMenuLine()" correctly? I try to recreate the default "Coordinate Manager" layout. This has three descriptive text elements in its menu line.

Here's the "Coordinate Manager" dialog:



And here's my dialog:



This is the code to generate the menu line entries:


GroupBeginInMenuLine();
          GroupBegin(0,BFH_LEFT,3,0,"",0);
          AddStaticText(0, BFH_LEFT | BFH_SCALEFIT, 0, 0, "Position", 0);
          AddStaticText(0, BFH_LEFT | BFH_SCALEFIT, 0, 0, "Scale", 0);
          AddStaticText(0, BFH_LEFT | BFH_SCALEFIT, 0, 0, "Rotation", 0);
          GroupEnd();
          GroupEnd();


How can I orient them left and spread them out to match the coloumns of the editfields?

Thanx alot in advane, best manuel
Back to Top
Matthias Bober View Drop Down
Forum Moderator
Forum Moderator


Joined: 2006 Oct 16
Location: Germany
Online Status: Offline
Posts: 1644
Post Options Post Options   Quote Matthias Bober Quote  Post ReplyReply Direct Link To This Post Posted: 2010 Feb 15 at 12:31am
The menu of the coordinate manager is actually no menu but just a normal dialog group. What makes it appear as menu is the WINDOWPIN dialog element.

This is the resource code of this line:

GROUP
{
COLUMNS 1;
  SCALE_H;
SPACE 4,0;
    GROUP
    {
        ROWS 1;
        SCALE_H;
       
        WINDOWPIN { ALIGN_LEFT; ALIGN_TOP; };
        STATICTEXT IDC_HEADLINE1 { SIZE 100,0; SCALE_H; }
        STATICTEXT IDC_HEADLINE2 { SIZE 100,0; SCALE_H; }
        STATICTEXT IDC_HEADLINE3 { SIZE 100,0; SCALE_H; }
    }
    SEPARATOR { SCALE_H; }
}


cheers,
Matthias

MAXON
developer support
Back to Top
mnu View Drop Down
Member
Member


Joined: 2002 Nov 11
Location: Germany
Online Status: Offline
Posts: 41
Post Options Post Options   Quote mnu Quote  Post ReplyReply Direct Link To This Post Posted: 2010 Feb 15 at 3:24am
Thanx Matthias, I'll try this.

Is there a possibility to make this work if the dialog is hard coded as in my case or do I have to use descriptions? I know, using external resources is best practise, but for prototyping in house tools doing it by code is often faster.

Best Manuel
Back to Top
Matthias Bober View Drop Down
Forum Moderator
Forum Moderator


Joined: 2006 Oct 16
Location: Germany
Online Status: Offline
Posts: 1644
Post Options Post Options   Quote Matthias Bober Quote  Post ReplyReply Direct Link To This Post Posted: 2010 Feb 15 at 5:58am
It is possible to hard code it. Have a look at the code below. Make sure to remove the menu bar in the dialog's constructor.


class ListViewDialog : public GeDialog
{
    public:
        ListViewDialog(void);

        virtual Bool CreateLayout(void);
};

ListViewDialog::ListViewDialog(void)
{
    C4DOS.Cd->AddGadget(Get(),DIALOG_NOMENUBAR,0,NULL,0,0,0,0,NULL,NULL); //removes the menu bar
}

Bool ListViewDialog::CreateLayout(void)
{
    // first call the parent instance
    Bool res = GeDialog::CreateLayout();

    GroupBegin(0,BFH_SCALE|BFH_LEFT,0,1,String(),0);
        C4DOS.Cd->AddGadget(Get(),DIALOG_PIN,0,NULL,BFH_LEFT|BFV_TOP,0,0,0,NULL,NULL); //add the window pin
        AddStaticText(0,BFH_SCALE,100,0,String("Position"),0);
        AddStaticText(0,BFH_SCALE,100,0,String("Scale"),0);
        AddStaticText(0,BFH_SCALE,100,0,String("Rotation"),0);
    GroupEnd();

    return res;
}


cheers,
Matthias

MAXON
developer support
Back to Top
mnu View Drop Down
Member
Member


Joined: 2002 Nov 11
Location: Germany
Online Status: Offline
Posts: 41
Post Options Post Options   Quote mnu Quote  Post ReplyReply Direct Link To This Post Posted: 2010 Feb 15 at 6:04am
That's very helpful. Thank you very much for your fast answer.

Best Manuel
Back to Top
 Post Reply Post Reply

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.109 seconds.