Begin Custom Controls and Editable Cue Info

This commit is contained in:
2019-07-15 07:01:35 -05:00
parent 2f29172f2d
commit e4aadf835a
7 changed files with 253 additions and 87 deletions
+7 -71
View File
@@ -11,7 +11,7 @@ namespace qController
QSelectedCueCell qCell;
QSelectedCueOptionsCell qSelectedCueOptions;
Grid mainG;
QControlsBlock qControlsBlock;
public ControlPage(string name, string address)
{
InitializeComponent();
@@ -99,24 +99,13 @@ namespace qController
qCell = new QSelectedCueCell();
qCell.HeightRequest = Math.Max(App.Height * .20, 125);
sLayout.Children.Add(qCell);
}
void FinishUI()
{
string workspace_prefix = "/workspace/" + qController.qWorkspace.workspace_id;
List <QButton> buttons = new List<QButton>();
buttons.Add(new QButton("Previous", workspace_prefix + "/select/previous"));
buttons.Add(new QButton("Panic", workspace_prefix + "/panic"));
buttons.Add(new QButton("Next", workspace_prefix + "/select/next"));
buttons.Add(new QButton("Preview", "/preview"));
buttons.Add(new QButton("Pause", "/pause"));
buttons.Add(new QButton("Resume", "/resume"));
qSelectedCueOptions = new QSelectedCueOptionsCell();
qSelectedCueOptions.mainSlider.ValueChanged += (sender, args) =>
@@ -132,62 +121,9 @@ namespace qController
qController.qClient.sendArgs(workspace_prefix + "/cue_id/" + qSelectedCueOptions.activeCue + "/sliderLevel/2", (float)args.NewValue);
};
mainG = new Grid
{
Padding = new Thickness(0),
RowDefinitions = {
new RowDefinition{Height = GridLength.Auto},
new RowDefinition{Height = GridLength.Auto},
new RowDefinition{Height = GridLength.Auto}
},
ColumnDefinitions = {
new ColumnDefinition{Width = new GridLength(1,GridUnitType.Star)},
new ColumnDefinition{Width = new GridLength(1,GridUnitType.Star)},
new ColumnDefinition{Width = new GridLength(1,GridUnitType.Star)}
},
Margin = new Thickness(10),
IsVisible = false
};
int row = 0;
int column = 0;
foreach (var b in buttons)
{
b.Clicked += sendOSC;
if (b.Text == "Panic")
{
b.BackgroundColor = Color.IndianRed;
}
else
{
b.BackgroundColor = Color.FromHex("D8D8D8");
}
b.TextColor = Color.Black;
mainG.Children.Add(b, column, row);
row++;
if (row == 3)
{
row = 0;
column = 2;
}
}
QButton goButton = new QButton("GO", workspace_prefix+"/go");
goButton.Clicked += sendOSC;
goButton.BackgroundColor = Color.SeaGreen;
goButton.TextColor = Color.Black;
mainG.Children.Add(goButton, 1, 0);
Grid.SetRowSpan(goButton, 3);
sLayout.Children.Add(mainG);
}
void sendOSC(object sender, EventArgs e)
{
qController.qClient.sendStringUDP(((QButton)sender).OSCCommand);
qControlsBlock = new QControlsBlock(qController);
sLayout.Children.Add(qControlsBlock);
}
void ShowMenu(object sender, EventArgs e)
@@ -266,8 +202,8 @@ namespace qController
else
sLayout.Children.Remove(qSelectedCueOptions);
qCell.UpdateSelectedCue(args.Cue);
if (!mainG.IsVisible)
mainG.IsVisible = true;
//if (!mainG.IsVisible)
// mainG.IsVisible = true;
if(qSelectedCueOptions != null)
{
qSelectedCueOptions.activeCue = args.Cue.uniqueID;
+13 -2
View File
@@ -39,6 +39,7 @@ namespace qController
listView = new ListView
{
ItemsSource = items,
RowHeight = (int)(App.HeightUnit * 6),
ItemTemplate = new DataTemplate(() =>
{
var grid = new Grid { Padding = new Thickness(5, 10) };
@@ -52,16 +53,26 @@ namespace qController
icon.SetBinding(Label.TextProperty, "Icon");
icon.HorizontalTextAlignment = TextAlignment.Center;
icon.VerticalTextAlignment = TextAlignment.Center;
icon.FontSize = 20;
icon.FontSize = App.HeightUnit * 3;
var label = new Label { VerticalOptions = LayoutOptions.FillAndExpand };
label.SetBinding(Label.TextProperty, "Title");
if (label.Text == "Disconnect")
{
label.TextColor = Color.DarkRed;
}
switch (Device.RuntimePlatform)
{
case Device.iOS:
label.FontSize = App.HeightUnit * 3;
break;
case Device.Android:
label.FontSize = App.HeightUnit * 2.2;
break;
}
grid.Children.Add(icon);
grid.Children.Add(label, 1, 0);
return new ViewCell { View = grid };
return new ViewCell {View = grid};
})
};
Content = new StackLayout