Пример #1
0
        public ExamplesHolder(Base parent) :
            base(parent)
        {
            Dock = Pos.Fill;


            Base mainLeftContainer = new Base(this);

            Base leftContainer = new Base(mainLeftContainer);

            leftContainer.Dock   = Pos.Fill;
            leftContainer.Margin = new Margin(1);

            Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(leftContainer);
            label.Margin    = new Margin(7, 4, 5, 3);
            label.Text      = "AltGUI Examples";
            label.TextColor = Color.LimeGreen * 1.4;
            //label.Alignment = Pos.Center;
            label.AutoSizeToContents = true;
            label.Dock = Pos.Top;


            Base examplesContainer = new Base(leftContainer);

            examplesContainer.Dock = Pos.Fill;

            m_ExamplesList        = new CollapsibleList(examplesContainer);
            m_ExamplesList.Dock   = Pos.Fill;
            m_ExamplesList.Margin = new Margin(0, 6, 0, 3);
            m_ExamplesList.ShouldDrawBackground = false;


            m_StatusBar = new Alt.GUI.Temporary.Gwen.Control.StatusBar(this);
            m_StatusBar.ShouldDrawBackground = false;
#if !DEBUG
            m_StatusBar.Hide();
#endif
            m_StatusBar.Dock = Pos.Bottom;


            m_ExamplesList.ShouldCacheToTexture = true;


            m_Center        = new CenterControl(this);
            m_Center.Dock   = Pos.Fill;
            m_Center.Margin = new Margin(1, 1, 1, 1);


            VerticalSplitter splitter = new VerticalSplitter(this);
            splitter.Dock = Pos.Fill;
            splitter.SetPanel(0, mainLeftContainer);
            splitter.SetPanel(1, m_Center);
            splitter.SetHValue(0.21f);


            Alt.GUI.Temporary.Gwen.Control.Button startButton = null;


            bool cat_ShouldCacheToTexture = false;
            {
                Color categoryColor = Color.Cyan * 1.2;
                Color color         = Color.WhiteSmoke;
                CollapsibleCategory cat;


                cat = AddCategory("HTML", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //color = Color.Red;
                    RegisterDemo("HTML/CSS2 Renderer", cat, typeof(Example_HtmlRenderer_Multi), color);

                    //color = Color.Red;
                    RegisterDemo("HTML/CSS2 Renderer (Bitmap)", cat, typeof(Example_HtmlRenderer_RenderToBitmap), color);
                }
                //cat.IsCollapsed = true;


#if !WINDOWS_PHONE && !WINDOWS_PHONE_7 && !WINDOWS_PHONE_71 && !ANDROID && !__IOS__ || SILVERLIGHT
                cat = AddCategory("GIS", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  GMap.NET Intractive Demo
                    //color = Color.CadetBlue;
#if SILVERLIGHT || UNITY_WEBPLAYER
                    RegisterDemo("GMap.NET (Interactive)", cat, typeof(Example_GMap_NotAvailable), color);
#else
                    RegisterDemo("GMap.NET (Interactive)", cat, typeof(Example_GMap), color);
#endif

                    //  GMap.NET
                    //color = Color.CadetBlue;
#if SILVERLIGHT || UNITY_WEBPLAYER
                    RegisterDemo("GMap.NET (Big Map Maker)", cat, typeof(Example_GMap_BigMapMaker_NotAvailable), color);
#else
                    RegisterDemo("GMap.NET (Big Map Maker)", cat, typeof(Example_GMap_BigMapMaker), color);
#endif
                }
                //cat.IsCollapsed = true;
#endif


                cat = AddCategory("Plot (Interactive)", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  NPlot
                    color = Color.WhiteSmoke;// OliveDrab;
                    RegisterDemo("NPlot", cat, typeof(Example_NPlot_Multi), color);

                    //  OxyPlot
                    //color = Color.OliveDrab;
                    RegisterDemo("OxyPlot", cat, typeof(Example_OxyPlot_Multi), color);

                    //  PieChart
                    color = Color.WhiteSmoke;// OliveDrab;
                    RegisterDemo("Pie Chart", cat, typeof(Example_PieChart), color);

                    //  ZedGraph
                    //color = Color.OliveDrab;
                    RegisterDemo("ZedGraph", cat, typeof(Example_ZedGraph_Multi), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("AltNETType = FreeType.NET", categoryColor);//"Drawing"
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    color = Color.WhiteSmoke;
                    RegisterDemo("FreeType 2 Step 1", cat, typeof(Example_AltNETType_FreeType2_Step1), color);
                    RegisterDemo("FreeType 2 Step 2 Simple", cat, typeof(Example_AltNETType_FreeType2_Step2_Simple), color);
                    RegisterDemo("FreeType 2 Step 2 Advanced", cat, typeof(Example_AltNETType_FreeType2_Step2_Advanced), color);
                    RegisterDemo("Simple Font Cache Manager", cat, typeof(Example_AltNETType_SimpleFontCacheManager), color);
                    RegisterDemo("Outline Transformations", cat, typeof(Example_AltNETType_Outline_Transformations), color);
                    RegisterDemo("Font Atlas", cat, typeof(Example_AltNETType_FontAtlas), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Geometry (Interactive)", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  Vector Text
                    color       = Color.WhiteSmoke;
                    startButton = RegisterDemo("Transformed Text (Single Path)", cat, typeof(Example_VectorText_TransformedCurve1), color);
                    RegisterDemo("Transformed Text (Double Path)", cat, typeof(Example_VectorText_TransformedCurve2), color);
                    //TEMP  RegisterDemo("Vector Text Transformations", cat, typeof(Example_VectorText_Transformations), color);

                    //  Boolean
                    RegisterDemo("Boolean (CombinedGeometry)", cat, typeof(Example_CombinedGeometry), color);

                    //  Simple SVG
                    RegisterDemo("Simple SVG", cat, typeof(Example_SimpleSVG), color);

                    //  Lens Effect
                    RegisterDemo("Lens Effect SVG", cat, typeof(Example_LensEffectSVG), color);

                    //  Bilinear / Perspective Transformations
                    RegisterDemo("Bilinear / Perspective", cat, typeof(Example_Bilinear_Perspective), color);

                    //  Polar Transform
                    RegisterDemo("Polar Transform", cat, typeof(Example_PolarTransform), color);

                    //  Sin Transform
                    RegisterDemo("Sin Transform", cat, typeof(Example_SinTransform), color);

                    //  Outline
                    RegisterDemo("Outline SVG", cat, typeof(Example_Outline_SVG), color);

                    //  BSpline
                    RegisterDemo("Interactive B-Spline", cat, typeof(Example_BSpline), color);

                    //  Contour
                    RegisterDemo("Contour Tool & Poly Orientation", cat, typeof(Example_Contour), color);

                    //  Text Outline
                    RegisterDemo("Text Outline", cat, typeof(Example_TextOutline), color);

                    //  Affine Transformer
                    RegisterDemo("Affine Transformer", cat, typeof(Example_AffineTransformer), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Graphics", categoryColor);//"Drawing"
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

//#if !ANDROID //&& !SILVERLIGHT && !WINDOWS_PHONE && !WINDOWS_PHONE_7 && !WINDOWS_PHONE_71
#if !UNITY_5
                    //  ExtBrush
                    color = Color.WhiteSmoke;
                    RegisterDemo("ExtBrush", cat, typeof(Example_ExtBrush), color);
#endif
//#endif

                    //  Clipper
                    color = Color.WhiteSmoke;
                    RegisterDemo("Clipper", cat, typeof(Example_Clipper), color);

                    //  SVG
                    color = Color.WhiteSmoke;
                    RegisterDemo("SVG", cat, typeof(Example_SVG), color);

                    //  Alpha Mask
                    color = Color.WhiteSmoke;
                    //TEMP  RegisterDemo("Alpha Mask", cat, typeof(Example_AlphaMask), color);

                    //  Brushes
                    color = Color.WhiteSmoke;
                    //RegisterDemo("Brushes", cat, typeof(Example_Brushes), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Doc", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  PdfSharp
                    //color = Color.Red;
                    RegisterDemo("PdfSharp", cat, typeof(Example_PdfSharp_Multi), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Scientific Computing", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  AForge
                    color = Color.WhiteSmoke;// OliveDrab;
                    RegisterDemo("AForge.NET", cat, typeof(Example_AForge_Multi), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("GUI", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  Gwen
                    color = Color.WhiteSmoke;// CadetBlue;
                    if (Alt.Sketch.Config.Font_NoAntiAliasMaxSize < 10)
                    {
                        color = Color.White;
                    }

                    RegisterDemo("Gwen Skinned", cat, typeof(Example_Gwen_UnitTest_Skin), color);
                    RegisterDemo("Gwen Simple", cat, typeof(Example_Gwen_UnitTest_Simple), color);

                    //  QuickFont
                    //color = Color.LightBlue;
                    RegisterDemo("QuickFont", cat, typeof(Example_QuickFont), color);
                    //	start long time background initialization
                    Example_QuickFont.Initialize();

                    //  Gif
                    color = Color.WhiteSmoke;
                    RegisterDemo("Animated Gif in PictureBox", cat, typeof(Example_GifInPictureBox), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Game Physics", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  Phisics
                    color = Color.WhiteSmoke;
                    RegisterDemo("Box2D", cat, typeof(Example_Box2D), color);

                    //  Can't load type FarseerPhysics World (or some member of it) - needs researches
                                        #if !WINDOWS_PHONE && !WINDOWS_PHONE_7 && !WINDOWS_PHONE_71
                    RegisterDemo("Farseer Physics", cat, typeof(Example_FarseerPhysics), color);
                                        #endif
                }
                //cat.IsCollapsed = true;


#if !WINDOWS_PHONE && !WINDOWS_PHONE_7 && !WINDOWS_PHONE_71 && !ANDROID && !__IOS__
                cat = AddCategory("THIRD PARTY", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  SVG
                    color = Color.WhiteSmoke;
                    RegisterDemo("Awesomium Web Browser", cat, typeof(Example_Awesomium), color);
                }
                //cat.IsCollapsed = true;
#endif
            }


            PrintText("AltGUI Gwen Demo Started!");


            OnExampleSelect(startButton);
        }
Пример #2
0
        public UnitTest(Base parent, bool showStatusBar) :
            base(parent)
        {
            Dock = Alt.GUI.Temporary.Gwen.Pos.Fill;
            //NoNeed    SetSize(1024, 768);

            m_List = new CollapsibleList(this);
            m_List.ShouldCacheToTexture = true;

            LeftDock.TabControl.AddPage("Unit tests", m_List);
            LeftDock.Width = 150;

            m_TextOutput = new Alt.GUI.Temporary.Gwen.Control.ListBox(BottomDock);
            m_TextOutput.ShouldCacheToTexture = true;

            m_Button = BottomDock.TabControl.AddPage("Output", m_TextOutput);
            m_Button.ShouldCacheToTexture = true;
            BottomDock.Height             = 120;

            m_StatusBar      = new Alt.GUI.Temporary.Gwen.Control.StatusBar(this);
            m_StatusBar.Dock = Alt.GUI.Temporary.Gwen.Pos.Bottom;
            //m_StatusBar.ShouldCacheToTexture = true;
            m_StatusBar.IsHidden = !showStatusBar;

            m_DebugCheck               = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(m_StatusBar);
            m_DebugCheck.Text          = "Debug outlines";
            m_DebugCheck.CheckChanged += DebugCheckChanged;
            m_StatusBar.AddControl(m_DebugCheck, true);

            m_Center      = new Center(this);
            m_Center.Dock = Alt.GUI.Temporary.Gwen.Pos.Fill;
            GUnit test;

            bool cat_ShouldCacheToTexture = false;

            {
                CollapsibleCategory cat = m_List.Add("Non-Interactive");
                {
                    test = new GUnit_Label(m_Center);
                    RegisterUnitTest("Label", cat, test);
                    test = new GUnit_RichLabel(m_Center);
                    RegisterUnitTest("RichLabel", cat, test);
                    test = new GUnit_GroupBox(m_Center);
                    RegisterUnitTest("GroupBox", cat, test);
                    test = new GUnit_ProgressBar(m_Center);
                    RegisterUnitTest("ProgressBar", cat, test);
                    test = new GUnit_ImagePanel(m_Center);
                    RegisterUnitTest("ImagePanel", cat, test);
                    test = new GUnit_StatusBar(m_Center);
                    RegisterUnitTest("StatusBar", cat, test);
                }
                cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;
            }

            {
                CollapsibleCategory cat = m_List.Add("Standard");
                {
                    test = new GUnit_Button(m_Center);
                    RegisterUnitTest("Button", cat, test);
                    test = new GUnit_TextBox(m_Center);
                    RegisterUnitTest("TextBox", cat, test);
                    test = new GUnit_CheckBox(m_Center);
                    RegisterUnitTest("CheckBox", cat, test);
                    test = new GUnit_RadioButton(m_Center);
                    RegisterUnitTest("RadioButton", cat, test);
                    test = new GUnit_ComboBox(m_Center);
                    RegisterUnitTest("ComboBox", cat, test);
                    test = new GUnit_ListBox(m_Center);
                    RegisterUnitTest("ListBox", cat, test);
                    test = new GUnit_NumericUpDown(m_Center);
                    RegisterUnitTest("NumericUpDown", cat, test);
                    test = new GUnit_Slider(m_Center);
                    RegisterUnitTest("Slider", cat, test);
                    test = new GUnit_MenuStrip(m_Center);
                    RegisterUnitTest("MenuStrip", cat, test);
                    test = new GUnit_CrossSplitter(m_Center);
                    RegisterUnitTest("CrossSplitter", cat, test);
                }
                cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;
            }

            {
                CollapsibleCategory cat = m_List.Add("Containers");
                {
                    test = new GUnit_Window(m_Center);
                    RegisterUnitTest("Window", cat, test);
                    test = new GUnit_TreeControl(m_Center);
                    RegisterUnitTest("TreeControl", cat, test);
                    test = new GUnit_Properties(m_Center);
                    RegisterUnitTest("Properties", cat, test);
                    test = new GUnit_TabControl(m_Center);
                    RegisterUnitTest("TabControl", cat, test);
                    test = new GUnit_ScrollControl(m_Center);
                    RegisterUnitTest("ScrollControl", cat, test);
                    test = new GUnit_Docking(m_Center);
                    RegisterUnitTest("Docking", cat, test);
                }
                cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;
            }

            {
                CollapsibleCategory cat = m_List.Add("Non-standard");
                {
                    test = new GUnit_CollapsibleList(m_Center);
                    RegisterUnitTest("CollapsibleList", cat, test);
                    test = new GUnit_ColorPickers(m_Center);
                    RegisterUnitTest("Color pickers", cat, test);
                    test = new GUnit_PictureBox(m_Center);
                    RegisterUnitTest("PictureBox", cat, test);
                }
                cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;
            }

            m_StatusBar.SendToBack();
            PrintText("AltGUI.Temporary.Gwen Unit Test started!");
        }