Пример #1
0
 TabSet::TabbedSubSet* TabSet::CreateTabbedSubSet(const String& Name, const UInt16 ChildZOrder)
 {
     TabbedSubSet* NewSet = this->ParentScreen->CreateWidget(Name,UnifiedRect(0,0,1,1,0,0,0,0));
     this->AddChild(NewSet,ChildZOrder);
     NewSet->Hide();
     return NewSet;
 }
Пример #2
0
void HorizontalScrollbar::ConstructHorizontalScrollbar(const UI::ScrollbarStyle& ScrollStyle)
{
    // Create the rects we'll use
    UnifiedVec2 ChildPosition(0,0,0,0);
    UnifiedVec2 ChildSize(1,1,0,0);
    UnifiedRect ChildRect(ChildPosition,ChildSize);
    if( UI::SB_NoButtons == ScrollStyle )
    {
        // Create our objects
        this->ScrollBack = ParentScreen->CreateButton(this->Name+".ScrollBack",ChildRect);
        this->ScrollBack->SetHorizontalSizingRules(UI::SR_Fill_Available);
        this->ScrollBack->SetVerticalSizingRules(UI::SR_Unified_Dims);
        this->AddChild(this->ScrollBack,0);

        this->Scroller = ParentScreen->CreateButton(this->Name+".Scroller",ChildRect);
        this->Scroller->SetManualTransformUpdates(true);
        this->AddChild(this->Scroller,1);
    } else {
        //Get the position for all items involved and configure their offsets
        if(UI::SB_Separate == ScrollStyle)
        {
            // Create our objects
            this->UpLeftButton = ParentScreen->CreateButton(this->Name+".LeftButton",ChildRect);
            this->UpLeftButton->SetHorizontalPositioningRules(UI::PF_Anchor_Left);
            this->UpLeftButton->SetHorizontalSizingRules(UI::SR_Match_Other_Axis);
            this->UpLeftButton->SetVerticalSizingRules(UI::SR_Unified_Dims);
            this->AddChild(this->UpLeftButton,0);

            this->ScrollBack = ParentScreen->CreateButton(this->Name+".ScrollBack",ChildRect);
            this->ScrollBack->SetHorizontalSizingRules(UI::SR_Fill_Available);
            this->ScrollBack->SetVerticalSizingRules(UI::SR_Unified_Dims);
            this->AddChild(this->ScrollBack,1);

            this->DownRightButton = ParentScreen->CreateButton(this->Name+".RightButton",ChildRect);
            this->DownRightButton->SetHorizontalPositioningRules(UI::PF_Anchor_Right);
            this->DownRightButton->SetHorizontalSizingRules(UI::SR_Match_Other_Axis);
            this->DownRightButton->SetVerticalSizingRules(UI::SR_Unified_Dims);
            this->AddChild(this->DownRightButton,2);

            this->Scroller = ParentScreen->CreateButton(this->Name+".Scroller",ChildRect);
            this->Scroller->SetManualTransformUpdates(true);
            this->AddChild(this->Scroller,3);
        }
        else if(UI::SB_TogetherDownRight == ScrollStyle)
        {
            // Create our objects
            this->ScrollBack = ParentScreen->CreateButton(this->Name+".ScrollBack",ChildRect);
            this->ScrollBack->SetHorizontalSizingRules(UI::SR_Fill_Available);
            this->ScrollBack->SetVerticalSizingRules(UI::SR_Unified_Dims);
            this->AddChild(this->ScrollBack,0);

            this->UpLeftButton = ParentScreen->CreateButton(this->Name+".LeftButton",UnifiedRect(UnifiedVec2(-1,-1,0,0),ChildSize));
            this->UpLeftButton->SetHorizontalPositioningRules(UI::PF_Anchor_Right | UI::PF_Anchor_SelfSize);
            this->UpLeftButton->SetHorizontalSizingRules(UI::SR_Match_Other_Axis);
            this->UpLeftButton->SetVerticalSizingRules(UI::SR_Unified_Dims);
            this->AddChild(this->UpLeftButton,1);

            this->DownRightButton = ParentScreen->CreateButton(this->Name+".RightButton",ChildRect);
            this->DownRightButton->SetHorizontalPositioningRules(UI::PF_Anchor_Right);
            this->DownRightButton->SetHorizontalSizingRules(UI::SR_Match_Other_Axis);
            this->DownRightButton->SetVerticalSizingRules(UI::SR_Unified_Dims);
            this->AddChild(this->DownRightButton,2);

            this->Scroller = ParentScreen->CreateButton(this->Name+".Scroller",ChildRect);
            this->Scroller->SetManualTransformUpdates(true);
            this->AddChild(this->Scroller,3);
        }
        else if(UI::SB_TogetherUpLeft == ScrollStyle)
        {
            // Create our objects
            this->UpLeftButton = ParentScreen->CreateButton(this->Name+".LeftButton",ChildRect);
            this->UpLeftButton->SetHorizontalPositioningRules(UI::PF_Anchor_Left);
            this->UpLeftButton->SetHorizontalSizingRules(UI::SR_Match_Other_Axis);
            this->UpLeftButton->SetVerticalSizingRules(UI::SR_Unified_Dims);
            this->AddChild(this->UpLeftButton,0);

            this->DownRightButton = ParentScreen->CreateButton(this->Name+".RightButton",UnifiedRect(UnifiedVec2(1,1,0,0),ChildSize));
            this->DownRightButton->SetHorizontalPositioningRules(UI::PF_Anchor_Left | UI::PF_Anchor_SelfSize);
            this->DownRightButton->SetHorizontalSizingRules(UI::SR_Match_Other_Axis);
            this->DownRightButton->SetVerticalSizingRules(UI::SR_Unified_Dims);
            this->AddChild(this->DownRightButton,1);

            this->ScrollBack = ParentScreen->CreateButton(this->Name+".ScrollBack",ChildRect);
            this->ScrollBack->SetHorizontalSizingRules(UI::SR_Fill_Available);
            this->ScrollBack->SetVerticalSizingRules(UI::SR_Unified_Dims);
            this->AddChild(this->ScrollBack,2);

            this->Scroller = ParentScreen->CreateButton(this->Name+".Scroller",ChildRect);
            this->Scroller->SetManualTransformUpdates(true);
            this->AddChild(this->Scroller,3);
        }
    }

    Rect TempDims;
    if( this->ActDims != TempDims ) {
        TempDims = this->ActDims;
        this->UpdateDimensions(TempDims,TempDims);
    }

    this->SubscribeToChildEvents();
}