protected override void OnLoad(EventArgs e) { base.OnLoad(e); Alt.GUI.Temporary.Gwen.Control.StatusBar sb = new Alt.GUI.Temporary.Gwen.Control.StatusBar(this); Alt.GUI.Temporary.Gwen.Control.Label left = new Alt.GUI.Temporary.Gwen.Control.Label(sb); left.Text = "Label added to left"; sb.AddControl(left, false); Alt.GUI.Temporary.Gwen.Control.Label right = new Alt.GUI.Temporary.Gwen.Control.Label(sb); right.Text = "Label added to right"; sb.AddControl(right, true); Alt.GUI.Temporary.Gwen.Control.Button bl = new Alt.GUI.Temporary.Gwen.Control.Button(sb); bl.Text = "Left button"; sb.AddControl(bl, false); Alt.GUI.Temporary.Gwen.Control.Button br = new Alt.GUI.Temporary.Gwen.Control.Button(sb); br.Text = "Right button"; sb.AddControl(br, true); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); Alt.GUI.Temporary.Gwen.Control.MenuStrip menu = new Alt.GUI.Temporary.Gwen.Control.MenuStrip(this); Alt.GUI.Temporary.Gwen.Control.MenuItem root = menu.AddItem("Original Size"); { root.Menu.AddItem("800%").SetAction(miZoom_Click); root.Menu.AddItem("600%").SetAction(miZoom_Click); root.Menu.AddItem("400%").SetAction(miZoom_Click); root.Menu.AddItem("200%").SetAction(miZoom_Click); root.Menu.AddItem("150%").SetAction(miZoom_Click); root.Menu.AddItem("100%").SetAction(miZoom_Click); root.Menu.AddItem("75%").SetAction(miZoom_Click); root.Menu.AddItem("50%").SetAction(miZoom_Click); root.Menu.AddItem("25%").SetAction(miZoom_Click); root.Menu.AddItem("10%").SetAction(miZoom_Click); root.Menu.AddDivider(); root.Menu.AddItem("Best Fit").SetAction(miBestFit_Click); root.Menu.AddItem("Full Page").SetAction(miFullPage_Click); } menu.AddItem("Full Page" //, "AltData/Gwen/test16.png" ).Clicked += miFullPage_Click; menu.AddItem("Best Fit" //, "AltData/Gwen/test16.png" ).Clicked += miBestFit_Click; menu.AddItem("Smaller" //, "AltData/Gwen/test16.png" ).Clicked += miSmaller_Click; menu.AddItem("Larger" //, "AltData/Gwen/test16.png" ).Clicked += miLarger_Click; #if !SILVERLIGHT menu.AddItem("Create PDF"//, "AltData/Gwen/test16.png" ).Clicked += miCreatePDF_Click; #endif Alt.GUI.Temporary.Gwen.Control.StatusBar sb = new Alt.GUI.Temporary.Gwen.Control.StatusBar(this); m_StatisBarLabel = new Alt.GUI.Temporary.Gwen.Control.Label(sb); m_StatisBarLabel.AutoSizeToContents = true; m_StatisBarLabel.Text = ""; sb.AddControl(m_StatisBarLabel, false); m_PagePreview.SetRenderEvent(new Alt.GUI.PdfSharp.Temporary.Gwen.PagePreview.RenderEvent(Render)); m_PagePreview.PageSize = PageSizeConverter.ToSize(PageSize.A4); UpdateStatusBar(); }
public Example_AForge_BlobsExplorer(Base parent) : base(parent) { #if SILVERLIGHT || UNITY_WEBPLAYER Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(this); label.AutoSizeToContents = true; label.Text = //Description + "\n" + "(This example is not available in this Demo, please download SDK)"; "THIS EXAMPLE IS NOT AVAILABLE IN THIS DEMO,\nPLEASE DOWNLOAD AltGUI SDK"; label.TextColor = Color.Orange * 1.2; label.Dock = Pos.Top; label.Margin = new Margin(0, 0, 0, 5); label.Font = Example_NotAvailable_ScreenShot.Font; #endif // GUI { Alt.GUI.Temporary.Gwen.Control.StatusBar status = new Alt.GUI.Temporary.Gwen.Control.StatusBar(this); { status.ShouldDrawBackground = false; blobsCountLabel = new Alt.GUI.Temporary.Gwen.Control.Label(status); blobsCountLabel.AutoSizeToContents = true; status.AddControl(blobsCountLabel, false); } m_BottomPanel = new Alt.GUI.Temporary.Gwen.Control.Base(this); { m_BottomPanel.Dock = Pos.Bottom; m_BottomPanel.Height = 210; } m_TopPanel = new Alt.GUI.Temporary.Gwen.Control.Base(this); { m_TopPanel.Dock = Pos.Top; m_TopPanel.Height = 30; highlightTypeCombo = new Alt.GUI.Temporary.Gwen.Control.ComboBox(m_TopPanel); highlightTypeCombo.AddItem("Convex Hull").UserData = 0; highlightTypeCombo.AddItem("Left/Right Edges").UserData = 1; highlightTypeCombo.AddItem("Top/Bottom Edges").UserData = 2; highlightTypeCombo.AddItem("Quadrilateral").UserData = 3; highlightTypeCombo.Location = new PointI(0, 0); highlightTypeCombo.Width = 133; highlightTypeCombo.ItemSelected += new GwenEventHandler(highlightTypeCombo_SelectedIndexChanged); showRectangleAroundSelectionCheck = new LabeledCheckBox(m_TopPanel); showRectangleAroundSelectionCheck.Location = new PointI(143, 1); showRectangleAroundSelectionCheck.Text = "Show rectangle around selection"; showRectangleAroundSelectionCheck.Width += 10; showRectangleAroundSelectionCheck.CheckedChanged += new System.EventHandler(showRectangleAroundSelectionCheck_CheckedChanged); } blobsBrowser = new BlobsBrowser(this); blobsBrowser.Dock = Pos.Fill; blobsBrowser.Highlighting = BlobsExplorer.BlobsBrowser.HightlightType.ConvexHull; #if !SILVERLIGHT && !UNITY_WEBPLAYER blobsBrowser.BlobSelected += new BlobsExplorer.BlobSelectionHandler(blobsBrowser_BlobSelected); #endif } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); m_CurZoom = 0; m_Splitter = new Alt.GUI.Temporary.Gwen.Control.CrossSplitter(this); m_Splitter.SetPosition(0, 0); m_Splitter.Dock = Alt.GUI.Temporary.Gwen.Pos.Fill; { Alt.GUI.Temporary.Gwen.Control.VerticalSplitter splitter = new Alt.GUI.Temporary.Gwen.Control.VerticalSplitter(m_Splitter); Alt.GUI.Temporary.Gwen.Control.Button button1 = new Alt.GUI.Temporary.Gwen.Control.Button(splitter); button1.SetText("Vertical left"); Alt.GUI.Temporary.Gwen.Control.Button button2 = new Alt.GUI.Temporary.Gwen.Control.Button(splitter); button2.SetText("Vertical right"); splitter.SetPanel(0, button1); splitter.SetPanel(1, button2); m_Splitter.SetPanel(0, splitter); } { Alt.GUI.Temporary.Gwen.Control.HorizontalSplitter splitter = new Alt.GUI.Temporary.Gwen.Control.HorizontalSplitter(m_Splitter); Alt.GUI.Temporary.Gwen.Control.Button button1 = new Alt.GUI.Temporary.Gwen.Control.Button(splitter); button1.SetText("Horizontal up"); Alt.GUI.Temporary.Gwen.Control.Button button2 = new Alt.GUI.Temporary.Gwen.Control.Button(splitter); button2.SetText("Horizontal down"); splitter.SetPanel(0, button1); splitter.SetPanel(1, button2); m_Splitter.SetPanel(1, splitter); } { Alt.GUI.Temporary.Gwen.Control.HorizontalSplitter splitter = new Alt.GUI.Temporary.Gwen.Control.HorizontalSplitter(m_Splitter); Alt.GUI.Temporary.Gwen.Control.Button button1 = new Alt.GUI.Temporary.Gwen.Control.Button(splitter); button1.SetText("Horizontal up"); Alt.GUI.Temporary.Gwen.Control.Button button2 = new Alt.GUI.Temporary.Gwen.Control.Button(splitter); button2.SetText("Horizontal down"); splitter.SetPanel(0, button1); splitter.SetPanel(1, button2); m_Splitter.SetPanel(2, splitter); } { Alt.GUI.Temporary.Gwen.Control.VerticalSplitter splitter = new Alt.GUI.Temporary.Gwen.Control.VerticalSplitter(m_Splitter); Alt.GUI.Temporary.Gwen.Control.Button button1 = new Alt.GUI.Temporary.Gwen.Control.Button(splitter); button1.SetText("Vertical left"); Alt.GUI.Temporary.Gwen.Control.Button button2 = new Alt.GUI.Temporary.Gwen.Control.Button(splitter); button2.SetText("Vertical right"); splitter.SetPanel(0, button1); splitter.SetPanel(1, button2); m_Splitter.SetPanel(3, splitter); } //Status bar to hold unit testing buttons Alt.GUI.Temporary.Gwen.Control.StatusBar pStatus = new Alt.GUI.Temporary.Gwen.Control.StatusBar(this); pStatus.Dock = Alt.GUI.Temporary.Gwen.Pos.Bottom; { Alt.GUI.Temporary.Gwen.Control.Button pButton = new Alt.GUI.Temporary.Gwen.Control.Button(pStatus); pButton.SetText("Zoom"); pButton.Clicked += ZoomTest; pStatus.AddControl(pButton, false); } { Alt.GUI.Temporary.Gwen.Control.Button pButton = new Alt.GUI.Temporary.Gwen.Control.Button(pStatus); pButton.SetText("UnZoom"); pButton.Clicked += UnZoomTest; pStatus.AddControl(pButton, false); } { Alt.GUI.Temporary.Gwen.Control.Button pButton = new Alt.GUI.Temporary.Gwen.Control.Button(pStatus); pButton.SetText("CenterPanels"); pButton.Clicked += CenterPanels; pStatus.AddControl(pButton, true); } { Alt.GUI.Temporary.Gwen.Control.Button pButton = new Alt.GUI.Temporary.Gwen.Control.Button(pStatus); pButton.SetText("Splitters"); pButton.Clicked += ToggleSplitters; pStatus.AddControl(pButton, true); } }
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!"); }