nGuiTabbedLayout

View: New views
2 Messages — Rating Filter:   Alert me  

nGuiTabbedLayout

by Ghoust :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

Has anybody tried the nGuiTabbedLayout ? I have the problem that the tab
buttons are not showing up, the code is as follows:

//snip

this->tabframe =
(nGuiTabbedLayout*)kernelServer->New("nguitabbedlayout", "tabframe");

this->tabframe->SetNumTabs(4);
rectangle re(off, vector2(0.2f,off.y+0.35f));

for(int i =0; i<4;i++)
{
//    this->tabframe->GetChildLayoutAt(i)->SetRect(re);
//    this->tabframe->OnShow();
    nGuiCheckButton* cb = this->tabframe->GetTabButtonAt(i);
    nString name;
    if(i==0)
        name = "tab1";
    if(i==1)
        name = "tab2";
    if(i==2)
        name = "tab3";
    if(i==3)
        name = "tab4";

    tabs.Append((nGuiSlider2*)kernelServer->New("nguislider2", name.Get()));
    cb->SetText(name.Get());
    cb->SetFont("GuiSmall");

    tabs.At(i)->SetDefaultBrush("sidebar");
    tabs.At(i)->OnShow();
    tabs.At(i)->SetRect(re);
    this->tabframe->GetChildLayoutAt(i)->SetDefaultBrush("sidebar");
   
this->tabframe->GetChildLayoutAt(i)->AttachForm(tabs.At(i),nGuiFormLayout::Top,off.y);
   
this->tabframe->GetChildLayoutAt(i)->AttachForm(tabs.At(i),nGuiFormLayout::Left,off.x);
}
this->tabframe->SetRect(re);
this->tabframe->SetDefaultBrush("firstborder");
layout->AttachForm(this->tabframe, nGuiFormLayout::Top, off.y);
layout->AttachForm(this->tabframe, nGuiFormLayout::Left, off.x);
layout->AttachForm(this->tabframe, nGuiFormLayout::Right, 0.0f);
this->tabframe->OnShow();
off.y += 0.35f;

//snip

thnx for any help

Tom

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

*** NOTE: To reply to the list use "reply to all",  ***
***       to reply direct to the sender use "reply" ***
_______________________________________________
Nebuladevice-discuss mailing list
Nebuladevice-discuss@...
https://lists.sourceforge.net/lists/listinfo/nebuladevice-discuss

Re: nGuiTabbedLayout

by Ghoust :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

OK, it's really that easy so I'm answering my own question:

place before

tabs.Append((nGuiSlider2*)kernelServer->N...

the line

kernelServer->PushCwd(this->tabframe->GetChildLayoutAt(i));

and after that line

kernelServer->PopCwd();

The tab layouts and anything you attach to it should be placed as childs of the original layouts in the nebula named hierarchy.

Tom

Ghoust schrieb:

> Hi all,
>
> Has anybody tried the nGuiTabbedLayout ? I have the problem that the tab
> buttons are not showing up, the code is as follows:
>
> //snip
>
> this->tabframe =
> (nGuiTabbedLayout*)kernelServer->New("nguitabbedlayout", "tabframe");
>
> this->tabframe->SetNumTabs(4);
> rectangle re(off, vector2(0.2f,off.y+0.35f));
>
> for(int i =0; i<4;i++)
> {
> //    this->tabframe->GetChildLayoutAt(i)->SetRect(re);
> //    this->tabframe->OnShow();
>     nGuiCheckButton* cb = this->tabframe->GetTabButtonAt(i);
>     nString name;
>     if(i==0)
>         name = "tab1";
>     if(i==1)
>         name = "tab2";
>     if(i==2)
>         name = "tab3";
>     if(i==3)
>         name = "tab4";
>
>     tabs.Append((nGuiSlider2*)kernelServer->New("nguislider2", name.Get()));
>     cb->SetText(name.Get());
>     cb->SetFont("GuiSmall");
>
>     tabs.At(i)->SetDefaultBrush("sidebar");
>     tabs.At(i)->OnShow();
>     tabs.At(i)->SetRect(re);
>     this->tabframe->GetChildLayoutAt(i)->SetDefaultBrush("sidebar");
>    
> this->tabframe->GetChildLayoutAt(i)->AttachForm(tabs.At(i),nGuiFormLayout::Top,off.y);
>    
> this->tabframe->GetChildLayoutAt(i)->AttachForm(tabs.At(i),nGuiFormLayout::Left,off.x);
> }
> this->tabframe->SetRect(re);
> this->tabframe->SetDefaultBrush("firstborder");
> layout->AttachForm(this->tabframe, nGuiFormLayout::Top, off.y);
> layout->AttachForm(this->tabframe, nGuiFormLayout::Left, off.x);
> layout->AttachForm(this->tabframe, nGuiFormLayout::Right, 0.0f);
> this->tabframe->OnShow();
> off.y += 0.35f;
>
> //snip
>
> thnx for any help
>
> Tom
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
> *** NOTE: To reply to the list use "reply to all",  ***
> ***       to reply direct to the sender use "reply" ***
> _______________________________________________
> Nebuladevice-discuss mailing list
> Nebuladevice-discuss@...
> https://lists.sourceforge.net/lists/listinfo/nebuladevice-discuss
>
>  


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

*** NOTE: To reply to the list use "reply to all",  ***
***       to reply direct to the sender use "reply" ***
_______________________________________________
Nebuladevice-discuss mailing list
Nebuladevice-discuss@...
https://lists.sourceforge.net/lists/listinfo/nebuladevice-discuss