Skip to content

Commit

Permalink
#439: Declared ListBox obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
rds1983 committed Nov 29, 2023
1 parent 2b70079 commit 60aec84
Show file tree
Hide file tree
Showing 14 changed files with 235 additions and 178 deletions.
69 changes: 35 additions & 34 deletions samples/Myra.Samples.AllWidgets/AllWidgets.Generated.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Generated by MyraPad at 11/8/2023 11:24:23 PM */
/* Generated by MyraPad at 11/29/2023 6:30:40 PM */
using Myra;
using Myra.Graphics2D;
using Myra.Graphics2D.TextureAtlases;
Expand Down Expand Up @@ -251,30 +251,31 @@ private void BuildUI()
label11.Text = "List Box:";
Grid.SetRow(label11, 10);

var listItem4 = new ListItem();
listItem4.Text = "Red";
listItem4.Color = Color.Red;

var listItem5 = new ListItem();
listItem5.Text = "Green";
listItem5.Color = Color.Lime;
var label12 = new Label();
label12.Text = "Red";
label12.TextColor = Color.Red;

var listItem6 = new ListItem();
listItem6.Text = "Blue";
listItem6.Color = Color.Blue;
var label13 = new Label();
label13.Text = "Green";
label13.TextColor = Color.Lime;

var listBox1 = new ListBox();
listBox1.Width = 200;
Grid.SetColumn(listBox1, 1);
Grid.SetRow(listBox1, 10);
Grid.SetColumnSpan(listBox1, 2);
listBox1.Items.Add(listItem4);
listBox1.Items.Add(listItem5);
listBox1.Items.Add(listItem6);
var label14 = new Label();
label14.Text = "Blue";
label14.TextColor = Color.Blue;

var listView1 = new ListView();
listView1.SelectedIndex = null;
listView1.Width = 200;
Grid.SetColumn(listView1, 1);
Grid.SetRow(listView1, 10);
Grid.SetColumnSpan(listView1, 2);
listView1.Widgets.Add(label12);
listView1.Widgets.Add(label13);
listView1.Widgets.Add(label14);

var label12 = new Label();
label12.Text = "Vertical Menu:";
Grid.SetRow(label12, 11);
var label15 = new Label();
label15.Text = "Vertical Menu:";
Grid.SetRow(label15, 11);

var menuItem1 = new MenuItem();
menuItem1.Text = "Start New Game";
Expand All @@ -292,9 +293,9 @@ private void BuildUI()
verticalMenu1.Items.Add(menuItem2);
verticalMenu1.Items.Add(menuItem3);

var label13 = new Label();
label13.Text = "Tree";
Grid.SetRow(label13, 12);
var label16 = new Label();
label16.Text = "Tree";
Grid.SetRow(label16, 12);

_gridRight = new Grid();
_gridRight.ColumnSpacing = 8;
Expand Down Expand Up @@ -339,17 +340,17 @@ private void BuildUI()
_gridRight.Widgets.Add(label10);
_gridRight.Widgets.Add(spinButton1);
_gridRight.Widgets.Add(label11);
_gridRight.Widgets.Add(listBox1);
_gridRight.Widgets.Add(label12);
_gridRight.Widgets.Add(listView1);
_gridRight.Widgets.Add(label15);
_gridRight.Widgets.Add(verticalMenu1);
_gridRight.Widgets.Add(label13);
_gridRight.Widgets.Add(label16);

var scrollViewer1 = new ScrollViewer();
scrollViewer1.ShowHorizontalScrollBar = false;
scrollViewer1.Content = _gridRight;

var label14 = new Label();
label14.Text = "Vertical Slider:";
var label17 = new Label();
label17.Text = "Vertical Slider:";

var verticalSlider1 = new VerticalSlider();
verticalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
Expand All @@ -369,11 +370,11 @@ private void BuildUI()
{
Type = Myra.Graphics2D.UI.ProportionType.Fill,
});
grid1.Widgets.Add(label14);
grid1.Widgets.Add(label17);
grid1.Widgets.Add(verticalSlider1);

var label15 = new Label();
label15.Text = "Progress Bars:";
var label18 = new Label();
label18.Text = "Progress Bars:";

_horizontalProgressBar = new HorizontalProgressBar();
_horizontalProgressBar.Id = "_horizontalProgressBar";
Expand Down Expand Up @@ -402,7 +403,7 @@ private void BuildUI()
{
Type = Myra.Graphics2D.UI.ProportionType.Fill,
});
grid2.Widgets.Add(label15);
grid2.Widgets.Add(label18);
grid2.Widgets.Add(_horizontalProgressBar);
grid2.Widgets.Add(_verticalProgressBar);

Expand Down
10 changes: 5 additions & 5 deletions samples/Myra.Samples.AllWidgets/allControls.xmmp
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
<Label Text="Spin Button:" Grid.Row="9" />
<SpinButton Value="1" Width="100" Grid.Column="1" Grid.Row="9" />
<Label Text="List Box:" Grid.Row="10" />
<ListBox Width="200" Grid.Column="1" Grid.Row="10" Grid.ColumnSpan="2">
<ListItem Text="Red" Color="#FF0000FF" />
<ListItem Text="Green" Color="#00FF00FF" />
<ListItem Text="Blue" Color="#0000FFFF" />
</ListBox>
<ListView Width="200" Grid.Column="1" Grid.Row="10" Grid.ColumnSpan="2">
<Label Text="Red" TextColor="#FF0000FF" />
<Label Text="Green" TextColor="#00FF00FF" />
<Label Text="Blue" TextColor="#0000FFFF" />
</ListView>
<Label Text="Vertical Menu:" Grid.Row="11" />
<VerticalMenu Grid.Column="1" Grid.Row="11">
<MenuItem Text="Start New Game" />
Expand Down
61 changes: 31 additions & 30 deletions samples/Myra.Samples.CustomUIStylesheet/AllWidgets.Generated.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Generated by MyraPad at 10/31/2023 1:24:24 PM */
/* Generated by MyraPad at 11/29/2023 6:32:56 PM */
using Myra;
using Myra.Graphics2D;
using Myra.Graphics2D.TextureAtlases;
Expand Down Expand Up @@ -112,29 +112,30 @@ private void BuildUI()
label8.Text = "List Box:";
Grid.SetRow(label8, 7);

var listItem4 = new ListItem();
listItem4.Text = "Red";
listItem4.Color = Color.Red;

var listItem5 = new ListItem();
listItem5.Text = "Green";
listItem5.Color = Color.Lime;

var listItem6 = new ListItem();
listItem6.Text = "Blue";
listItem6.Color = Color.Blue;
var label9 = new Label();
label9.Text = "Red";
label9.TextColor = Color.Red;

var listBox1 = new ListBox();
listBox1.Width = 200;
Grid.SetColumn(listBox1, 1);
Grid.SetRow(listBox1, 7);
listBox1.Items.Add(listItem4);
listBox1.Items.Add(listItem5);
listBox1.Items.Add(listItem6);
var label10 = new Label();
label10.Text = "Green";
label10.TextColor = Color.Lime;

var label9 = new Label();
label9.Text = "Tree";
Grid.SetRow(label9, 8);
var label11 = new Label();
label11.Text = "Blue";
label11.TextColor = Color.Blue;

var listView1 = new ListView();
listView1.SelectedIndex = 0;
listView1.Width = 200;
Grid.SetColumn(listView1, 1);
Grid.SetRow(listView1, 7);
listView1.Widgets.Add(label9);
listView1.Widgets.Add(label10);
listView1.Widgets.Add(label11);

var label12 = new Label();
label12.Text = "Tree";
Grid.SetRow(label12, 8);

_gridRight = new Grid();
_gridRight.ColumnSpacing = 8;
Expand Down Expand Up @@ -166,15 +167,15 @@ private void BuildUI()
_gridRight.Widgets.Add(label7);
_gridRight.Widgets.Add(textBox1);
_gridRight.Widgets.Add(label8);
_gridRight.Widgets.Add(listBox1);
_gridRight.Widgets.Add(label9);
_gridRight.Widgets.Add(listView1);
_gridRight.Widgets.Add(label12);

var scrollViewer1 = new ScrollViewer();
scrollViewer1.ShowHorizontalScrollBar = false;
scrollViewer1.Content = _gridRight;

var label10 = new Label();
label10.Text = "Vertical Slider:";
var label13 = new Label();
label13.Text = "Vertical Slider:";

var verticalSlider1 = new VerticalSlider();
verticalSlider1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
Expand All @@ -194,11 +195,11 @@ private void BuildUI()
{
Type = Myra.Graphics2D.UI.ProportionType.Fill,
});
grid1.Widgets.Add(label10);
grid1.Widgets.Add(label13);
grid1.Widgets.Add(verticalSlider1);

var label11 = new Label();
label11.Text = "Progress Bars:";
var label14 = new Label();
label14.Text = "Progress Bars:";

_horizontalProgressBar = new HorizontalProgressBar();
_horizontalProgressBar.Id = "_horizontalProgressBar";
Expand Down Expand Up @@ -227,7 +228,7 @@ private void BuildUI()
{
Type = Myra.Graphics2D.UI.ProportionType.Fill,
});
grid2.Widgets.Add(label11);
grid2.Widgets.Add(label14);
grid2.Widgets.Add(_horizontalProgressBar);
grid2.Widgets.Add(_verticalProgressBar);

Expand Down
10 changes: 5 additions & 5 deletions samples/Myra.Samples.CustomUIStylesheet/allControls.xmmp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
<Label Text="Text Field:" Grid.Row="6" />
<TextBox Grid.Column="1" Grid.Row="6" />
<Label Text="List Box:" Grid.Row="7" />
<ListBox Width="200" Grid.Column="1" Grid.Row="7">
<ListItem Text="Red" Color="#FF0000FF" />
<ListItem Text="Green" Color="#00FF00FF" />
<ListItem Text="Blue" Color="#0000FFFF" />
</ListBox>
<ListView SelectedIndex="0" Width="200" Grid.Column="1" Grid.Row="7">
<Label Text="Red" TextColor="#FF0000FF" />
<Label Text="Green" TextColor="#00FF00FF" />
<Label Text="Blue" TextColor="#0000FFFF" />
</ListView>
<Label Text="Tree" Grid.Row="8" />
</Grid>
</ScrollViewer>
Expand Down
8 changes: 4 additions & 4 deletions samples/Myra.Samples.GridContainer/GridGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,13 @@ protected override void LoadContent()
grid.Widgets.Add(_verticalProgressBar);

// List box
var list = new ListBox();
var list = new ListView();
Grid.SetColumn(list, 5);
Grid.SetRow(list, 4);

list.Items.Add(new ListItem("Red", Color.Red));
list.Items.Add(new ListItem("Green", Color.Green));
list.Items.Add(new ListItem("Blue", Color.Blue));
list.Widgets.Add(new Label { Text = "Red", TextColor = Color.Red });
list.Widgets.Add(new Label { Text = "Green", TextColor = Color.Green });
list.Widgets.Add(new Label { Text = "Blue", TextColor = Color.Blue });
grid.Widgets.Add(list);

// Vertical slider
Expand Down
83 changes: 47 additions & 36 deletions samples/Myra.Samples.NonModalWindows/UI/Window3.Generated.cs
Original file line number Diff line number Diff line change
@@ -1,70 +1,81 @@
/* Generated by MyraPad at 9/8/2022 6:36:55 AM */
/* Generated by MyraPad at 11/29/2023 6:40:28 PM */
using Myra;
using Myra.Graphics2D;
using Myra.Graphics2D.TextureAtlases;
using Myra.Graphics2D.UI;
using Myra.Graphics2D.Brushes;
using Myra.Graphics2D.UI.Properties;
using FontStashSharp.RichText;
using AssetManagementBase;

#if STRIDE
using Stride.Core.Mathematics;
#elif PLATFORM_AGNOSTIC
using System.Drawing;
using System.Numerics;
using Color = FontStashSharp.FSColor;
#else
// MonoGame/FNA
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
#endif

namespace Myra.Samples.NonModalWindows.UI
{
partial class Window3: Window
{
private void BuildUI()
{
var listItem1 = new ListItem();
listItem1.Text = "ItemItemItem0";
var label1 = new Label();
label1.Text = "ItemItemItem0";

var listItem2 = new ListItem();
listItem2.Text = "ItemItemItem1";
var label2 = new Label();
label2.Text = "ItemItemItem1";

var listItem3 = new ListItem();
listItem3.Text = "ItemItemItem2";
var label3 = new Label();
label3.Text = "ItemItemItem2";

var listItem4 = new ListItem();
listItem4.Text = "ItemItemItem3";
var label4 = new Label();
label4.Text = "ItemItemItem3";

var listItem5 = new ListItem();
listItem5.Text = "ItemItemItem4";
var label5 = new Label();
label5.Text = "ItemItemItem4";

var listItem6 = new ListItem();
listItem6.Text = "ItemItemItem5";
var label6 = new Label();
label6.Text = "ItemItemItem5";

var listItem7 = new ListItem();
listItem7.Text = "ItemItemItem6";
var label7 = new Label();
label7.Text = "ItemItemItem6";

var listItem8 = new ListItem();
listItem8.Text = "ItemItemItem7";
var label8 = new Label();
label8.Text = "ItemItemItem7";

var listItem9 = new ListItem();
listItem9.Text = "ItemItemItem8";
var label9 = new Label();
label9.Text = "ItemItemItem8";

var listItem10 = new ListItem();
listItem10.Text = "ItemItemItem9";
var label10 = new Label();
label10.Text = "ItemItemItem9";

var listBox1 = new ListBox();
listBox1.MaxHeight = 150;
listBox1.Items.Add(listItem1);
listBox1.Items.Add(listItem2);
listBox1.Items.Add(listItem3);
listBox1.Items.Add(listItem4);
listBox1.Items.Add(listItem5);
listBox1.Items.Add(listItem6);
listBox1.Items.Add(listItem7);
listBox1.Items.Add(listItem8);
listBox1.Items.Add(listItem9);
listBox1.Items.Add(listItem10);
var listView1 = new ListView();
listView1.MaxHeight = 150;
listView1.Widgets.Add(label1);
listView1.Widgets.Add(label2);
listView1.Widgets.Add(label3);
listView1.Widgets.Add(label4);
listView1.Widgets.Add(label5);
listView1.Widgets.Add(label6);
listView1.Widgets.Add(label7);
listView1.Widgets.Add(label8);
listView1.Widgets.Add(label9);
listView1.Widgets.Add(label10);

var panel1 = new Panel();
panel1.Widgets.Add(listBox1);
panel1.Widgets.Add(listView1);


Title = "Window 3";
Left = 466;
Top = 241;
Left = 805;
Top = 288;
Content = panel1;
}

Expand Down
Loading

0 comments on commit 60aec84

Please sign in to comment.