#205 Window widget: automatic scrollbar visibility 4.x-dev

Fri, 27 Nov 2020 20:56:41 +0200

author
cemkalyoncu
date
Fri, 27 Nov 2020 20:56:41 +0200
branch
4.x-dev
changeset 1501
5d263312e69a
parent 1500
e626149880fd
child 1502
e1bd0a8d7cf7

#205 Window widget: automatic scrollbar visibility
Template
* Component stack bug fixes
* BasicFont::GetSize fixes

Source/Gorgon/Geometry/Margin.h file | annotate | diff | comparison | revisions
Source/Gorgon/Graphics/Color.h file | annotate | diff | comparison | revisions
Source/Gorgon/Graphics/Font.cpp file | annotate | diff | comparison | revisions
Source/Gorgon/UI/ComponentStack.cpp file | annotate | diff | comparison | revisions
Source/Gorgon/UI/Template.h file | annotate | diff | comparison | revisions
Source/Gorgon/Widgets/Generator.cpp file | annotate | diff | comparison | revisions
Source/Gorgon/Widgets/Generator.h file | annotate | diff | comparison | revisions
Source/Gorgon/Widgets/Panel.cpp file | annotate | diff | comparison | revisions
Source/Gorgon/Widgets/Panel.h file | annotate | diff | comparison | revisions
Source/Gorgon/Widgets/Window.cpp file | annotate | diff | comparison | revisions
Source/Gorgon/Widgets/Window.h file | annotate | diff | comparison | revisions
Testing/Source/Manual/UI_Component.cpp file | annotate | diff | comparison | revisions
Testing/Source/Manual/UI_Generate.cpp file | annotate | diff | comparison | revisions
--- a/Source/Gorgon/Geometry/Margin.h	Thu Nov 26 07:22:31 2020 +0200
+++ b/Source/Gorgon/Geometry/Margin.h	Fri Nov 27 20:56:41 2020 +0200
@@ -32,8 +32,9 @@
 		basic_Margin(T_ all) : Left(all), Top(all), Right(all), Bottom(all) { }
 		
 		/// Sets horizontal and vertical Margin separately
-		basic_Margin(T_ horizontal, T_ vertical) : Left(horizontal), Right(horizontal), 
-		Top(vertical), Bottom(vertical) { }
+		basic_Margin(T_ horizontal, T_ vertical) : Left(horizontal), Top(vertical), 
+		Right(horizontal), Bottom(vertical) 
+		{ }
 		
 		/// Sets all Margin separately
 		basic_Margin(T_ left, T_ top, T_ right, T_ bottom) : 
--- a/Source/Gorgon/Graphics/Color.h	Thu Nov 26 07:22:31 2020 +0200
+++ b/Source/Gorgon/Graphics/Color.h	Fri Nov 27 20:56:41 2020 +0200
@@ -629,6 +629,7 @@
 		constexpr RGBA Yellow	= 0xff14ffff;
 		constexpr RGBA SkyBlue	= 0xfffdbb75;
 		constexpr RGBA Grey	= 0xff919592;
+		constexpr RGBA SemiDarkGrey	= 0xff656565;
 		constexpr RGBA LimeGreen	= 0xff05fe89;
 		constexpr RGBA LightPurple	= 0xfff677bf;
 		constexpr RGBA Violet	= 0xffea0e9a;
@@ -916,6 +917,7 @@
                 {"Yellow", Yellow},
                 {"Sky Blue", SkyBlue},
                 {"Grey", Grey},
+                {"SemiDarkGrey", SemiDarkGrey},
                 {"Lime Green", LimeGreen},
                 {"Light Purple", LightPurple},
                 {"Violet", Violet},
--- a/Source/Gorgon/Graphics/Font.cpp	Thu Nov 26 07:22:31 2020 +0200
+++ b/Source/Gorgon/Graphics/Font.cpp	Fri Nov 27 20:56:41 2020 +0200
@@ -700,6 +700,7 @@
             renderer->Prepare(text);
         
         auto y   = 0;
+        int maxx = 0;
         auto tot = w;
 
         internal::boundedprint(
@@ -707,6 +708,8 @@
 
             [&](Glyph, internal::markvecit begin, internal::markvecit end, int w) {
                 y += (int)renderer->GetLineGap();
+                if(maxx < w)
+                    maxx = w;
             },
 
             [&](Glyph prev, Glyph next) { return (int)renderer->KerningDistance(prev, next).X; },
@@ -714,7 +717,7 @@
             std::bind(&internal::dodefaulttab<int>, 0, std::placeholders::_1, renderer->GetMaxWidth() * 8)
         );
 
-        return {w, y};
+        return {maxx, y};
     }
     
     int BasicFont::GetCharacterIndex(const std::string &text, Geometry::Point location) const{ 
@@ -1072,8 +1075,8 @@
                     maxx = width;
 
                 if(justify && eol == 0) {
-                    if(maxx < width)
-                        maxx = width;
+                    if(maxx < tot)
+                        maxx = tot;
                 }
             },
             [&](Glyph prev, Glyph next) { return int(hspace + renderer->KerningDistance(prev, next).X); },
--- a/Source/Gorgon/UI/ComponentStack.cpp	Thu Nov 26 07:22:31 2020 +0200
+++ b/Source/Gorgon/UI/ComponentStack.cpp	Fri Nov 27 20:56:41 2020 +0200
@@ -2660,6 +2660,7 @@
                                 else
                                     comp.size = th.GetRenderer().GetSize(text, width);
                             }
+                            //else comp.size is already 0x0
                         }
                     }
                 }
@@ -3178,6 +3179,10 @@
                     //add indent
                     lastspacing = calculatemargin(s, e) + endmost->GetTemplate().GetIndent().Left(parent.innersize.Width, getemsize(*endmost));
                 }
+                
+                //calculate remaining space for percent based components
+                spaceleft     = parent.innersize.Width - startused - endused - lastspacing;
+                textspaceleft = textwidth - startused - endused - lastspacing;
             }
             else { //vertical
                 if(startmost) {
@@ -3215,12 +3220,13 @@
                     //add indent
                     lastspacing = calculatemargin(s, e) + endmost->GetTemplate().GetIndent().Top(0, getemsize(*endmost));
                 }
+                
+                //calculate remaining space for percent based components
+                spaceleft     = parent.innersize.Height - startused - endused - lastspacing;
+                textspaceleft = textwidth;
+
             }
             
-            //calculate remaining space for percent based components
-            spaceleft     = parent.innersize.Width - startused - endused - lastspacing;
-            textspaceleft = textwidth - startused - endused - lastspacing;
-
             if(middlepass && stage != middle)
                 stage = middle;
             else
--- a/Source/Gorgon/UI/Template.h	Thu Nov 26 07:22:31 2020 +0200
+++ b/Source/Gorgon/UI/Template.h	Fri Nov 27 20:56:41 2020 +0200
@@ -1709,11 +1709,11 @@
 
         /// Changes the border size of the component. Border size stays within the object area, but excluded
         /// from the interior area.
-        void SetBorderSize(int value) { bordersize ={value}; ChangedEvent(); }
+        void SetBorderSize(int value) { bordersize = {value}; ChangedEvent(); }
 
         /// Changes the border size of the component. Border size stays within the object area, but excluded
         /// from the interior area.
-        void SetBorderSize(int hor, int ver) { bordersize ={hor, ver}; ChangedEvent(); }
+        void SetBorderSize(int hor, int ver) { bordersize = {hor, ver}; ChangedEvent(); }
 
         /// Changes the border size of the component. Border size stays within the object area, but excluded
         /// from the interior area.
--- a/Source/Gorgon/Widgets/Generator.cpp	Thu Nov 26 07:22:31 2020 +0200
+++ b/Source/Gorgon/Widgets/Generator.cpp	Fri Nov 27 20:56:41 2020 +0200
@@ -109,6 +109,8 @@
         delete hoverborder;
         delete downborder;
         delete disabledborder;
+        delete passivewindowborder;
+        delete activewindowborder;
         delete grooveborder;
         delete normaleditborder;
         delete hovereditborder;
@@ -214,6 +216,21 @@
         return *disabledborder;
     }
     
+    Graphics::BitmapRectangleProvider &SimpleGenerator::ActiveWindowBorder() {
+        if(!activewindowborder)
+            activewindowborder = makeborder(0x0, Border.ActiveWindow, 0, 0, Border.Radius ? Border.Radius+Border.Width*2 : 0);
+        
+        return *activewindowborder;
+    }
+    
+    Graphics::BitmapRectangleProvider &SimpleGenerator::PassiveWindowBorder() {
+        if(!passivewindowborder)
+            passivewindowborder = makeborder(0x0, Border.PassiveWindow, 0, 0, Border.Radius ? Border.Radius+Border.Width*2 : 0);
+        
+        return *passivewindowborder;
+    }
+    
+    
     Graphics::BitmapRectangleProvider &SimpleGenerator::PanelBorder(int missingedge) {
         if(!panelborders[missingedge])
             panelborders[missingedge] = makeborder(Border.Color, Background.Panel, missingedge);
@@ -1136,86 +1153,17 @@
         return temp;
     }
     
-    UI::Template SimpleGenerator::BlankPanel() {
-        Geometry::Size defsize = {
-            WidgetWidth * 2 + Spacing, 
-            BorderedWidgetHeight * 10 + Spacing * 9};
-        
-        UI::Template temp = maketemplate();
-        temp.SetSpacing(Spacing);
-        temp.SetSize(defsize);
-        
-        auto &bg = temp.AddContainer(0, UI::ComponentCondition::Always)
-            .AddIndex(1)
-        ;
-        bg.SetClip(true);
-        
-        auto &vp = temp.AddContainer(1, UI::ComponentCondition::Always)
-            .AddIndex(2)
-        ;
-        vp.SetTag(UI::ComponentTemplate::ViewPortTag);
-        vp.SetSize(100, 100, UI::Dimension::Percent);
-        vp.SetAnchor(UI::Anchor::TopLeft, UI::Anchor::TopLeft, UI::Anchor::TopLeft);
-        vp.SetClip(true);
-        
-        auto &cont = temp.AddContainer(2, UI::ComponentCondition::Always);
-        cont.SetTag(UI::ComponentTemplate::ContentsTag);
-        cont.SetSize(0, 0, UI::Dimension::Percent);
-        cont.SetSizing(UI::ComponentTemplate::Fixed);
-        cont.SetPositioning(cont.Absolute);
-        cont.SetAnchor(UI::Anchor::TopLeft, UI::Anchor::TopLeft, UI::Anchor::TopLeft);
-        
-        auto &vst = operator[](Scrollbar_Vertical);
-        auto &hst = operator[](Scrollbar_Horizontal);
-        
-        temp.SetSize(temp.GetWidth()+vst.GetWidth()+Spacing, temp.GetHeight());
-        
-        bg
-            .AddIndex(3) //VScroll
-            .AddIndex(4) //HScroll
-        ;
-        
-        auto &vs = temp.AddPlaceholder(3, UI::ComponentCondition::VScroll);
-        vs.SetTemplate(vst);
-        vs.SetTag(UI::ComponentTemplate::VScrollTag);
-        vs.SetSize(vst.GetWidth(), {100, UI::Dimension::Percent});
-        vs.SetSizing(UI::ComponentTemplate::Fixed);
-        vs.SetAnchor(UI::Anchor::TopRight, UI::Anchor::TopRight, UI::Anchor::TopLeft);
-        vs.SetMargin(Spacing, 0, 0, 0);
-        
-        auto &hs = temp.AddPlaceholder(4, UI::ComponentCondition::HScroll);
-        hs.SetPositioning(UI::ComponentTemplate::Absolute);
-        hs.SetTemplate(hst);
-        hs.SetTag(UI::ComponentTemplate::HScrollTag);
-        hs.SetSize({100, UI::Dimension::Percent}, hst.GetHeight());
-        hs.SetSizing(UI::ComponentTemplate::Fixed);
-        hs.SetAnchor(UI::Anchor::None, UI::Anchor::BottomCenter, UI::Anchor::BottomCenter);
-        hs.SetMargin(0, Spacing, vst.GetWidth()+Spacing, 0);
-        
-        {
-            auto &vp = temp.AddContainer(1, UI::ComponentCondition::HScroll)
-                .AddIndex(2)
-            ;
-            vp.SetTag(UI::ComponentTemplate::ViewPortTag);
-            vp.SetSize(100, 100, UI::Dimension::Percent);
-            vp.SetAnchor(UI::Anchor::TopLeft, UI::Anchor::TopLeft, UI::Anchor::TopLeft);
-            vp.SetClip(true);
-            vp.SetIndent(0, 0, 0, hst.GetHeight()+Spacing);
-        }
-        return temp;
-    }
-    
     UI::Template SimpleGenerator::makepanel(int missingedge, bool scrollers) {
         Geometry::Size defsize = {
             WidgetWidth * 2 + Spacing + Border.Width * 2 + Spacing * 2, 
             BorderedWidgetHeight * 10 + Spacing * 9 + Border.Width * 2 + Spacing * 2
         };
         
-        if(missingedge == 1 || missingedge == 3) {
+        if(missingedge == 1 || missingedge == 3 || missingedge == -1) {
             defsize.Height = BorderedWidgetHeight + Border.Width + Spacing * 2;
         }
         
-        if(missingedge == 2 || missingedge == 4) {
+        if(missingedge == 2 || missingedge == 4 || missingedge == -1) {
             defsize.Width = WidgetWidth * 2 + Spacing + Border.Width + Spacing * 2;
         }
         
@@ -1226,7 +1174,9 @@
         auto &bg = temp.AddContainer(0, UI::ComponentCondition::Always)
             .AddIndex(1)
         ;
-        bg.Background.SetAnimation(PanelBorder(missingedge));
+        
+        if(missingedge != -1)
+            bg.Background.SetAnimation(PanelBorder(missingedge));
         
         
         Geometry::Margin padding(Border.Width + Spacing);
@@ -1243,6 +1193,9 @@
         case 4:
             padding.Right = Spacing;
             break;
+        case -1:
+            padding = Spacing;
+            break;
         }
         
         bg.SetPadding(padding);
@@ -1303,6 +1256,12 @@
         return temp;
     }
     
+    UI::Template SimpleGenerator::BlankPanel() {
+        auto tmp = makepanel(-1, true);
+        
+        return tmp;
+    }
+    
     UI::Template SimpleGenerator::Panel() {
         auto tmp = makepanel(0, true);
         
@@ -1907,10 +1866,37 @@
         
     }
     
-    
     UI::Template SimpleGenerator::Window() {
-        auto tmp = makepanel(0, true);
+        auto tmp = makepanel(-1, true);
         tmp.SetSize({300, 200});
+        
+        auto &cbg = dynamic_cast<UI::ContainerTemplate&>(tmp[0]);
+        cbg.Background.SetAnimation(NormalBG());
+        cbg.SetIndex(6);
+        cbg.SetSize(100, 100, UI::Dimension::Percent);
+        cbg.SetPositioning(UI::ComponentTemplate::Relative);
+        cbg.SetAnchor(UI::Anchor::BottomCenter, UI::Anchor::TopCenter, UI::Anchor::TopCenter);
+            
+        auto addborder = [&](auto condition, auto &image) {
+            auto &bg = tmp.AddContainer(0, condition)
+                .AddIndex(5) //title
+                .AddIndex(6) //panel
+            ;
+            bg.Background.SetAnimation(image);
+            bg.SetPadding(Border.Width*2, Border.Width*2, Border.Width*2, Border.Width*2);
+            bg.SetOrientation(Graphics::Orientation::Vertical);
+        };
+        
+        addborder(UI::ComponentCondition::Always, PassiveWindowBorder());
+        addborder(UI::ComponentCondition::Focused, ActiveWindowBorder());
+        
+        auto &text = tmp.AddTextholder(5, UI::ComponentCondition::Always);
+        text.SetRenderer(CenteredFont);
+        text.SetSize({100, UI::Dimension::Percent}, WidgetHeight);
+        text.SetMargin(0, 0, 0, Border.Width);
+        text.SetDataEffect(UI::ComponentTemplate::Title);
+        text.SetSizing(UI::ComponentTemplate::Fixed);
+        
         return tmp;
     }
 }}
--- a/Source/Gorgon/Widgets/Generator.h	Thu Nov 26 07:22:31 2020 +0200
+++ b/Source/Gorgon/Widgets/Generator.h	Fri Nov 27 20:56:41 2020 +0200
@@ -217,6 +217,9 @@
         Graphics::BitmapRectangleProvider &HoverBorder();
         Graphics::BitmapRectangleProvider &DownBorder();
         Graphics::BitmapRectangleProvider &DisabledBorder();
+
+        Graphics::BitmapRectangleProvider &ActiveWindowBorder();
+        Graphics::BitmapRectangleProvider &PassiveWindowBorder();
         
         Graphics::BitmapRectangleProvider &PanelBorder(int missingedge = 0);
         
@@ -271,11 +274,13 @@
         } Focus;
         
         struct BorderInfo {
-            int Width               = 2;
-            int Radius              = 0;
-            int Divisions           = 1;
-            Graphics::RGBA Color    = Graphics::Color::Charcoal;
-            Graphics::RGBA Disabled = {Graphics::Color::Charcoal, 0.5};
+            int Width                    = 2;
+            int Radius                   = 0;
+            int Divisions                = 1;
+            Graphics::RGBA Color         = Graphics::Color::Charcoal;
+            Graphics::RGBA Disabled      = {Graphics::Color::Charcoal, 0.5};
+            Graphics::RGBA PassiveWindow = {Graphics::Color::SemiDarkGrey, 0.85};
+            Graphics::RGBA ActiveWindow  = {Graphics::Color::Charcoal, 0.85};
         } Border;
         
         struct BackgroundInfo {
@@ -334,6 +339,8 @@
         Graphics::BitmapRectangleProvider *hoverborder = nullptr;
         Graphics::BitmapRectangleProvider *downborder = nullptr;
         Graphics::BitmapRectangleProvider *disabledborder = nullptr;
+        Graphics::BitmapRectangleProvider *passivewindowborder = nullptr;
+        Graphics::BitmapRectangleProvider *activewindowborder = nullptr;
         
         Graphics::BitmapRectangleProvider *panelborders[5] = {};
         
--- a/Source/Gorgon/Widgets/Panel.cpp	Thu Nov 26 07:22:31 2020 +0200
+++ b/Source/Gorgon/Widgets/Panel.cpp	Fri Nov 27 20:56:41 2020 +0200
@@ -182,12 +182,12 @@
     void Panel::focused() {
         if(!HasFocusedWidget())
             FocusFirst();
-        Widget::focused();
+        ComponentStackWidget::focused();
     }
     
     void Panel::focuslost() {
         RemoveFocus();
-        Widget::focuslost();
+        ComponentStackWidget::focuslost();
     }
     
     Gorgon::Layer &Panel::getlayer() {
--- a/Source/Gorgon/Widgets/Panel.h	Thu Nov 26 07:22:31 2020 +0200
+++ b/Source/Gorgon/Widgets/Panel.h	Fri Nov 27 20:56:41 2020 +0200
@@ -54,7 +54,7 @@
         /// will also display a scrollbar. Depending on the theme it might not be
         /// visible until there is something to scroll. Disabling scrolling will
         /// not take the scroll position to top. 
-        void EnableScroll(bool vertical, bool horizontal);
+        virtual void EnableScroll(bool vertical, bool horizontal);
         
         /// Whether vertical scrolling is enabled
         bool IsVerticalScrollEnabled() const {
@@ -219,11 +219,11 @@
         
         virtual void childboundschanged(Widget *source) override;
         
-        void updatecontent();
+        virtual void updatecontent();
         
-        void updatescroll();
+        virtual void updatescroll();
         
-        void updatebars();
+        virtual void updatebars();
         
         bool updaterequired = false;
         
--- a/Source/Gorgon/Widgets/Window.cpp	Thu Nov 26 07:22:31 2020 +0200
+++ b/Source/Gorgon/Widgets/Window.cpp	Fri Nov 27 20:56:41 2020 +0200
@@ -8,14 +8,46 @@
         Title(this),
         title(title)
     {
-        EnableScroll(false, false);
         stack.SetData(UI::ComponentTemplate::Title, title);
+        updatescrollvisibility();
     }
     
     void Window::SetTitle(const std::string &value) {
         title = value;
         stack.SetData(UI::ComponentTemplate::Title, title);
     }
-
+    
+    void Window::EnableScroll(bool vertical, bool horizontal) {
+        Panel::EnableScroll(vertical, horizontal);
+        
+        updatescrollvisibility();
+    }
+    
+    void Window::updatescroll() {
+        Panel::updatescroll();
+        updatescrollvisibility();
+    }
+    
+    void Window::updatecontent() {
+        Panel::updatecontent();
+        updatescrollvisibility();
+    }
+    
+    void Window::updatescrollvisibility() {
+        auto val = stack.GetTargetValue();
+        
+        if(val[3] == 1 || val[3] == 0 || !hscroll) {
+            stack.RemoveCondition(UI::ComponentCondition::HScroll);
+        }
+        else {
+            stack.AddCondition(UI::ComponentCondition::HScroll);
+        }
+        if(val[4] == 1 || val[4] == 0 || !vscroll) {
+            stack.RemoveCondition(UI::ComponentCondition::VScroll);
+        }
+        else {
+            stack.AddCondition(UI::ComponentCondition::VScroll);
+        }
+    }
     
 } }
--- a/Source/Gorgon/Widgets/Window.h	Thu Nov 26 07:22:31 2020 +0200
+++ b/Source/Gorgon/Widgets/Window.h	Fri Nov 27 20:56:41 2020 +0200
@@ -9,6 +9,8 @@
      * including panels. Once created, window will automatically place itself
      * into the active OS window. It supports title, if enabled, self movement 
      * and resizing.
+     * 
+     * When enabled, windows autohide their scrollbar as necessary.
      */
     class Window : public Panel {
     public:
@@ -32,8 +34,15 @@
             return title;
         }
         
+        virtual void EnableScroll(bool vertical, bool horizontal) override;
+        
         TextualProperty<Window, std::string, &Window::GetTitle, &Window::SetTitle> Title;
 
+    protected:
+        virtual void updatescroll() override;
+        virtual void updatecontent() override;
+        void updatescrollvisibility();
+        
     private:
         std::string title;
     };
--- a/Testing/Source/Manual/UI_Component.cpp	Thu Nov 26 07:22:31 2020 +0200
+++ b/Testing/Source/Manual/UI_Component.cpp	Fri Nov 27 20:56:41 2020 +0200
@@ -903,6 +903,33 @@
     return {"Relative anchoring vertical", "Size 20x20 and 20x20 objects on a 60x60 white background, first one should be aligned to top left, second should be under the first one. Objects are green and red and should be touching.", stack};
 }
 
+TestData test_relanchvertrelsize(Layer &layer) {
+    auto &temp = *new Template;
+    temp.SetSize(60, 80);
+
+    auto &cont1 = temp.AddContainer(0, Gorgon::UI::ComponentCondition::Always);
+    cont1.AddIndex(1);
+    cont1.AddIndex(2);
+    cont1.SetOrientation(Gorgon::Graphics::Orientation::Vertical);
+    cont1.Background.SetAnimation(whiteimg());
+
+    auto &cont2 = temp.AddContainer(1, Gorgon::UI::ComponentCondition::Always);
+    cont2.Background.SetAnimation(greenimg());
+    cont2.SetSize(20, 20, Gorgon::UI::Dimension::Pixel);
+    cont2.SetMargin(0,0,0,10);
+
+    auto &cont3 = temp.AddContainer(2, Gorgon::UI::ComponentCondition::Always);
+    cont3.Background.SetAnimation(redimg());
+    cont3.SetSize(20, {100, Gorgon::UI::Dimension::Percent});
+    cont3.SetAnchor(Gorgon::UI::Anchor::BottomLeft, Gorgon::UI::Anchor::TopLeft, Gorgon::UI::Anchor::TopLeft);
+
+    auto &stack = *new ComponentStack(temp);
+
+    layer.Add(stack);
+
+    return {"Relative anchoring vertical relative sizing", "Size 20x20 and 20x50 objects on a 60x80 white background, first one should be aligned to top left, second should be under the first one after 10px of space. Objects are green and red.", stack};
+}
+
 TestData test_relanch2(Layer &layer) {
     auto &temp = *new Template;
     temp.SetSize(60, 60);
@@ -1792,11 +1819,14 @@
     cont2.SetDataEffect(Gorgon::UI::ComponentTemplate::Title);
     cont2.SetColor(Color::Brown);
     cont2.SetRenderer(app.fntlarge);
+    cont2.SetSize(100,100,Gorgon::UI::Dimension::Percent);
+    cont2.SetSizing(Gorgon::UI::ComponentTemplate::Automatic);
     
     auto &cont3 = temp.AddTextholder(2, Gorgon::UI::ComponentCondition::Always);
     cont3.SetDataEffect(Gorgon::UI::ComponentTemplate::Text);
     cont3.SetColor(Color::DarkGreen);
     cont3.SetRenderer(app.fnt);
+    cont3.SetSizing(Gorgon::UI::ComponentTemplate::Automatic);
     
     auto &stack = *new ComponentStack(temp);
     
@@ -2855,6 +2885,7 @@
     &test_relanch,
     &test_relanch2,
     &test_relanchvert,
+    &test_relanchvertrelsize,
     
     &test_anchbaseline,
     &test_anchsetbaseline,
@@ -2944,7 +2975,8 @@
     //END
     
     &test_anchacc,
-    &test_ignored
+    &test_ignored,
+    
 };
 
 //END tests
--- a/Testing/Source/Manual/UI_Generate.cpp	Thu Nov 26 07:22:31 2020 +0200
+++ b/Testing/Source/Manual/UI_Generate.cpp	Fri Nov 27 20:56:41 2020 +0200
@@ -296,7 +296,10 @@
     ;
     
     Widgets::Window wind;
+    wind.SetTitle("My window");
     app.wind.Add(wind);
+    wind.Add(btn);
+    btn.Move(0,0);
 
     /*Widgets::Progressor<std::string, StringDiv, StringVal, Gorgon::TextualProperty> bar2;
     bar2.Maximum = "Hello world";

mercurial