protected override void OnLoad(EventArgs e) { base.OnLoad(e); { m_DockControl = new Alt.GUI.Temporary.Gwen.Control.TabControl(this); m_DockControl.SetBounds(10, 10, 200, 200); { Alt.GUI.Temporary.Gwen.Control.TabButton button = m_DockControl.AddPage("Controls"); Alt.GUI.Temporary.Gwen.Control.Base page = button.Page; { Color rbColor = Color.Gray * 0.5; Alt.GUI.Temporary.Gwen.Control.RadioButtonGroup radio = new Alt.GUI.Temporary.Gwen.Control.RadioButtonGroup(page, "Tab position"); radio.TextColor = rbColor; radio.UseCurrentColorAsNormal = true; radio.SetPosition(10, 10); Alt.GUI.Temporary.Gwen.Control.LabeledRadioButton rb; rb = radio.AddOption("Top"); rb.Select(); rb.NormalTextColor = rbColor; rb = radio.AddOption("Bottom"); rb.NormalTextColor = rbColor; rb = radio.AddOption("Left"); rb.NormalTextColor = rbColor; rb = radio.AddOption("Right"); rb.NormalTextColor = rbColor; radio.SelectionChanged += OnDockChange; } } m_DockControl.AddPage("Red"); m_DockControl.AddPage("Green"); m_DockControl.AddPage("Blue"); } { Alt.GUI.Temporary.Gwen.Control.TabControl dragMe = new Alt.GUI.Temporary.Gwen.Control.TabControl(this); dragMe.SetBounds(220, 10, 200, 200); dragMe.AddPage("You"); dragMe.AddPage("Can"); dragMe.AddPage("Reorder").SetImage("AltData/Gwen/test16.png"); dragMe.AddPage("These"); dragMe.AddPage("Tabs"); dragMe.AllowReorder = true; } }
void CreateUI2() { Base rightPanel = new Base(m_MainSplitter); rightPanel.Dock = Pos.Fill; //rightPanel.Margin = new Margin(0); m_MainSplitter.SetPanel(0, rightPanel); Alt.GUI.Temporary.Gwen.Control.Label label_TOP = new Alt.GUI.Temporary.Gwen.Control.Label(rightPanel); label_TOP.TextColor = LabelColor; label_TOP.AutoSizeToContents = true; label_TOP.Text = "GMap.NET Interactive Example (use right mouse button to pan map)"; label_TOP.TextColor = Color.Yellow; label_TOP.Dock = Pos.Top; label_TOP.Margin = new Margin(0, 3, 0, 7); // cache Tab Alt.GUI.Temporary.Gwen.Control.TabButton button = m_TabControl.AddPage("cache"); Alt.GUI.Temporary.Gwen.Control.Base page = button.Page; { int btn_offset = 7; button2 = new Alt.GUI.Temporary.Gwen.Control.Button(page); button2.Text = "Clear tiles in disk cache"; button2.Dock = Pos.Top; // set top offset button2.Margin = new Margin(0, btn_offset, 0, 0); button2.Click += new EventHandler(button2_Click); // memory cache usage Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(page); label.TextColor = LabelColor; label.AutoSizeToContents = true; label.Text = "memory cache usage:"; label.Dock = Pos.Top; // set top offset label.Margin = new Margin(0, 12, 0, 2); textBoxMemory = new Alt.GUI.Temporary.Gwen.Control.TextBox(page); textBoxMemory.ReadOnly = true; textBoxMemory.Dock = Pos.Top; // disk cache size label = new Alt.GUI.Temporary.Gwen.Control.Label(page); label.TextColor = LabelColor; label.AutoSizeToContents = true; label.Text = "disk cache size:"; label.Dock = Pos.Top; // set top offset label.Margin = new Margin(0, 12, 0, 2); textBoxCacheSize = new Alt.GUI.Temporary.Gwen.Control.TextBox(page); textBoxCacheSize.ReadOnly = true; textBoxCacheSize.Dock = Pos.Top; // disk cache status label = new Alt.GUI.Temporary.Gwen.Control.Label(page); label.TextColor = LabelColor; label.AutoSizeToContents = true; label.Text = "disk cache status:"; label.Dock = Pos.Top; // set top offset label.Margin = new Margin(0, 12, 0, 2); textBoxCacheStatus = new Alt.GUI.Temporary.Gwen.Control.TextBox(page); textBoxCacheStatus.ReadOnly = true; textBoxCacheStatus.Dock = Pos.Top; // cache routing/geocodig/etc checkBoxUseRouteCache = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(page); checkBoxUseRouteCache.TextColor = LabelColor; checkBoxUseRouteCache.UseCurrentColorAsNormal = true; checkBoxUseRouteCache.Text = "cache routing/geocodig/etc"; checkBoxUseRouteCache.Dock = Pos.Top; // set top offset checkBoxUseRouteCache.Margin = new Margin(0, 14, 0, 0); checkBoxUseRouteCache.IsChecked = true; } #if UNITY_WEBPLAYER button.Hide(); #endif // info Tab button = m_TabControl.AddPage("info"); page = button.Page; { // lat Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(page); label.TextColor = LabelColor; label.AutoSizeToContents = true; label.Text = "lat:"; label.Dock = Pos.Top; // set top offset label.Margin = new Margin(0, 4, 0, 0); textBoxLatCurrent = new Alt.GUI.Temporary.Gwen.Control.TextBox(page); textBoxLatCurrent.ReadOnly = true; textBoxLatCurrent.Dock = Pos.Top; // lng label = new Alt.GUI.Temporary.Gwen.Control.Label(page); label.TextColor = LabelColor; label.AutoSizeToContents = true; label.Text = "lng:"; label.Dock = Pos.Top; textBoxLngCurrent = new Alt.GUI.Temporary.Gwen.Control.TextBox(page); textBoxLngCurrent.ReadOnly = true; textBoxLngCurrent.Dock = Pos.Top; // zoom label = new Alt.GUI.Temporary.Gwen.Control.Label(page); label.TextColor = LabelColor; label.AutoSizeToContents = true; label.Text = "zoom:"; label.Dock = Pos.Top; // set top offset label.Margin = new Margin(0, 12, 0, 0); textBoxZoomCurrent = new Alt.GUI.Temporary.Gwen.Control.TextBox(page); textBoxZoomCurrent.ReadOnly = true; textBoxZoomCurrent.Dock = Pos.Top; // markers label = new Alt.GUI.Temporary.Gwen.Control.Label(page); label.TextColor = LabelColor; label.AutoSizeToContents = true; label.Text = "markers:"; label.Dock = Pos.Top; textBoxMarkerCount = new Alt.GUI.Temporary.Gwen.Control.TextBox(page); textBoxMarkerCount.ReadOnly = true; textBoxMarkerCount.Dock = Pos.Top; // routes label = new Alt.GUI.Temporary.Gwen.Control.Label(page); label.TextColor = LabelColor; label.AutoSizeToContents = true; label.Text = "routes:"; label.Dock = Pos.Top; textBoxrouteCount = new Alt.GUI.Temporary.Gwen.Control.TextBox(page); textBoxrouteCount.ReadOnly = true; textBoxrouteCount.Dock = Pos.Top; } // MAP MainMap = new Map(rightPanel); MainMap.Dock = Pos.Fill; //MainMap.Margin = new Margin(1, 0, 1, 0); //MainMap.DrawClientBorder = true; MainMap.DrawBorder = true; // Scale Base m_ScaleControl = new Base(MainMap); m_ScaleControl.SetBounds(10, 10, 20, 200); Alt.GUI.Temporary.Gwen.Control.Button plus = new Alt.GUI.Temporary.Gwen.Control.Button(m_ScaleControl); plus.Text = "+"; plus.Dock = Pos.Top; plus.Click += new EventHandler(buttonZoomUp_Click); Alt.GUI.Temporary.Gwen.Control.Button minus = new Alt.GUI.Temporary.Gwen.Control.Button(m_ScaleControl); minus.Text = "-"; minus.Dock = Pos.Bottom; minus.Click += new EventHandler(buttonZoomDown_Click); m_ScaleTrackBar = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_ScaleControl); m_ScaleTrackBar.Dock = Pos.Fill; m_ScaleTrackBar.ValueChanged += new GwenEventHandler(trackBar1_ValueChanged); }
void CreateUI1() { m_MainSplitter = new Alt.GUI.Temporary.Gwen.Control.VerticalSplitter(this); m_MainSplitter.Dock = Pos.Fill; m_TabControl = new Alt.GUI.Temporary.Gwen.Control.TabControl(m_MainSplitter); m_TabControl.SetBounds(0, 0, 220, 200); m_TabControl.Dock = Pos.Right; m_MainSplitter.SetPanel(1, m_TabControl); m_MainSplitter.SetHValue(0.73f); // map Tab Alt.GUI.Temporary.Gwen.Control.TabButton button = m_TabControl.AddPage("map"); Base page = button.Page; { m_Page_map_ScrollControl = new ScrollControl(page); m_Page_map_ScrollControl.Dock = Pos.Fill; m_Page_map_ScrollControl.EnableScroll(false, true); m_Page_map_ScrollControl.AutoHideBars = true; m_Page_map_MainPanel = new Base(m_Page_map_ScrollControl); m_Page_map_MainPanel.SetBounds(0, 0, 100, 500); m_Page_map_MainPanel.Dock = Pos.Top; int btn_offset = 7; // coordinates m_Page_map_GroupBox_coordinates = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_Page_map_MainPanel); m_Page_map_GroupBox_coordinates.TextColor = LabelColor; m_Page_map_GroupBox_coordinates.Text = "coordinates"; m_Page_map_GroupBox_coordinates.Dock = Pos.Top; m_Page_map_GroupBox_coordinates.AutoSizeToContents = true; { // lat Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(m_Page_map_GroupBox_coordinates); label.TextColor = LabelColor; label.AutoSizeToContents = true; label.Text = "lat:"; label.Dock = Pos.Top; // set top offset label.Margin = new Margin(0, 5, 0, 2); textBoxLat = new Alt.GUI.Temporary.Gwen.Control.TextBox(m_Page_map_GroupBox_coordinates); textBoxLat.ReadOnly = true; textBoxLat.Dock = Pos.Top; textBoxLat.Text = "54.6961334816182"; // lng label = new Alt.GUI.Temporary.Gwen.Control.Label(m_Page_map_GroupBox_coordinates); label.TextColor = LabelColor; label.AutoSizeToContents = true; label.Text = "lng:"; label.Dock = Pos.Top; label.Margin = new Margin(0, 0, 0, 2); textBoxLng = new Alt.GUI.Temporary.Gwen.Control.TextBox(m_Page_map_GroupBox_coordinates); textBoxLng.ReadOnly = true; textBoxLng.Dock = Pos.Top; textBoxLng.Text = "25.2985095977783"; // goto label = new Alt.GUI.Temporary.Gwen.Control.Label(m_Page_map_GroupBox_coordinates); label.TextColor = LabelColor; label.AutoSizeToContents = true; label.Text = "goto:"; label.Dock = Pos.Top; label.Margin = new Margin(0, 0, 0, 2); textBoxGeo = new Alt.GUI.Temporary.Gwen.Control.TextBox(m_Page_map_GroupBox_coordinates); textBoxGeo.ReadOnly = true; textBoxGeo.Dock = Pos.Top; textBoxGeo.Text = "lietuva vilnius"; // GoTo button8 = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_coordinates); button8.Text = "GoTo !"; button8.Dock = Pos.Top; // set top offset button8.Margin = new Margin(0, btn_offset, 0, 0); button8.Click += new EventHandler(button8_Click); // Reload button1 = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_coordinates); button1.Text = "Reload"; button1.Dock = Pos.Top; // set top offset button1.Margin = new Margin(0, btn_offset, 0, 0); button1.Click += new EventHandler(button1_Click); } // gmap m_Page_map_GroupBox_gmap = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_Page_map_MainPanel); m_Page_map_GroupBox_gmap.TextColor = LabelColor; m_Page_map_GroupBox_gmap.Text = "gmap"; m_Page_map_GroupBox_gmap.Dock = Pos.Top; m_Page_map_GroupBox_gmap.AutoSizeToContents = true; // set top offset m_Page_map_GroupBox_gmap.Margin = new Margin(0, 10, 0, 0); { // type Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(m_Page_map_GroupBox_gmap); label.TextColor = LabelColor; label.AutoSizeToContents = true; label.Text = "type:"; label.Dock = Pos.Top; // set top offset label.Margin = new Margin(0, 5, 0, 0); comboBoxMapType = new Alt.GUI.Temporary.Gwen.Control.ComboBox(m_Page_map_GroupBox_gmap); comboBoxMapType.Dock = Pos.Top; // mode label = new Alt.GUI.Temporary.Gwen.Control.Label(m_Page_map_GroupBox_gmap); label.TextColor = LabelColor; label.AutoSizeToContents = true; label.Text = "mode:"; label.Dock = Pos.Top; comboBoxMode = new Alt.GUI.Temporary.Gwen.Control.ComboBox(m_Page_map_GroupBox_gmap); comboBoxMode.Dock = Pos.Top; #if UNITY_WEBPLAYER || UNITY_5 comboBoxMode.Disable(); #endif // Current Marker checkBoxCurrentMarker = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(m_Page_map_GroupBox_gmap); checkBoxCurrentMarker.TextColor = LabelColor; checkBoxCurrentMarker.UseCurrentColorAsNormal = true; checkBoxCurrentMarker.Text = "Current Marker"; checkBoxCurrentMarker.Dock = Pos.Top; // set top offset checkBoxCurrentMarker.Margin = new Margin(0, btn_offset, 0, 0); checkBoxCurrentMarker.CheckedChanged += new EventHandler(checkBoxCurrentMarker_CheckedChanged); // Grid checkBoxDebug = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(m_Page_map_GroupBox_gmap); checkBoxDebug.TextColor = LabelColor; checkBoxDebug.UseCurrentColorAsNormal = true; checkBoxDebug.Text = "Grid"; checkBoxDebug.Dock = Pos.Top; // set top offset checkBoxDebug.Margin = new Margin(0, btn_offset, 0, 0); checkBoxDebug.CheckedChanged += new EventHandler(checkBoxDebug_CheckedChanged); // Drag Map checkBoxCanDrag = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(m_Page_map_GroupBox_gmap); checkBoxCanDrag.TextColor = LabelColor; checkBoxCanDrag.UseCurrentColorAsNormal = true; checkBoxCanDrag.Text = "Drag Map (right mouse button)"; checkBoxCanDrag.Dock = Pos.Top; // set top offset checkBoxCanDrag.Margin = new Margin(0, btn_offset, 0, 0); checkBoxCanDrag.CheckedChanged += new EventHandler(checkBoxCanDrag_CheckedChanged); } // routing m_Page_map_GroupBox_routing = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_Page_map_MainPanel); m_Page_map_GroupBox_routing.TextColor = LabelColor; m_Page_map_GroupBox_routing.Text = "routing"; m_Page_map_GroupBox_routing.Dock = Pos.Top; m_Page_map_GroupBox_routing.AutoSizeToContents = true; // set top offset m_Page_map_GroupBox_routing.Margin = new Margin(0, 10, 0, 0); { // set Start buttonSetStart = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_routing); buttonSetStart.Text = "set Start"; buttonSetStart.Dock = Pos.Top; // set top offset buttonSetStart.Margin = new Margin(0, 7, 0, 0); buttonSetStart.Click += new EventHandler(buttonSetStart_Click); // set End buttonSetEnd = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_routing); buttonSetEnd.Text = "set End"; buttonSetEnd.Dock = Pos.Top; // set top offset buttonSetEnd.Margin = new Margin(0, btn_offset, 0, 0); buttonSetEnd.Click += new EventHandler(buttonSetEnd_Click); // Add Route button3 = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_routing); button3.Text = "Add Route"; button3.Dock = Pos.Top; // set top offset button3.Margin = new Margin(0, btn_offset, 0, 10); button3.Click += new EventHandler(button3_Click); // Clear Routes button6 = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_routing); button6.Text = "Clear Routes"; button6.Dock = Pos.Top; // set top offset button6.Margin = new Margin(0, btn_offset, 0, 0); button6.Click += new EventHandler(button6_Click); // Clear Polygons button15 = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_routing); button15.Text = "Clear Polygons"; button15.Dock = Pos.Top; // set top offset button15.Margin = new Margin(0, btn_offset, 0, 0); button15.Click += new EventHandler(button15_Click); } // markers m_Page_map_GroupBox_markers = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_Page_map_MainPanel); m_Page_map_GroupBox_markers.TextColor = LabelColor; m_Page_map_GroupBox_markers.Text = "markers"; m_Page_map_GroupBox_markers.Dock = Pos.Top; m_Page_map_GroupBox_markers.AutoSizeToContents = true; // set top offset m_Page_map_GroupBox_markers.Margin = new Margin(0, 10, 0, 0); { // Add Marker button4 = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_markers); button4.Text = "Add Marker"; button4.Dock = Pos.Top; // set top offset button4.Margin = new Margin(0, 7, 0, 0); button4.Click += new EventHandler(button4_Click); // place info checkBoxPlacemarkInfo = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(m_Page_map_GroupBox_markers); checkBoxPlacemarkInfo.TextColor = LabelColor; checkBoxPlacemarkInfo.UseCurrentColorAsNormal = true; checkBoxPlacemarkInfo.Text = "place info"; checkBoxPlacemarkInfo.Dock = Pos.Top; // set top offset checkBoxPlacemarkInfo.Margin = new Margin(0, btn_offset, 0, 0); checkBoxPlacemarkInfo.IsChecked = true; // Zoom Center button7 = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_markers); button7.Text = "Zoom Center"; button7.Dock = Pos.Top; // set top offset button7.Margin = new Margin(0, btn_offset, 0, 0); button7.Click += new EventHandler(button7_Click); // Clear All button5 = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_markers); button5.Text = "Clear All"; button5.Dock = Pos.Top; // set top offset button5.Margin = new Margin(0, btn_offset, 0, 0); button5.Click += new EventHandler(button5_Click); } } }
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!"); }