<Window x:Class="ActuBoardConsole.ActuBoardApp"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:ActuBoardConsole"
        mc:Ignorable="d"
        Title="ActuBoard Console" Height="560" Width="720"
        Background="#FF111111">
    <Window.Resources>
        <Style TargetType="{x:Type Label}">
            <Setter Property="Control.Foreground" Value="Gray"/>
        </Style>
    </Window.Resources>

    <Grid>

        <Border Padding="10">
        <StackPanel>
            <Grid Margin="10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="10" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="90" />
                        <ColumnDefinition Width="150" />
                        <ColumnDefinition Width="100" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="50" />
                    </Grid.ColumnDefinitions>

                <Label Grid.Row="0" Grid.Column="0" x:Name="lbl_com" Content="COM" HorizontalAlignment="Right" />
                    <ComboBox Grid.Row="0" Grid.Column="1" x:Name="drop_com" HorizontalAlignment="Left" Width="130"/>
                    <Button x:Name="btn_connect" Grid.Row="0" Grid.Column="2" Content="Connect" HorizontalAlignment="Left" Width="75"/>
                    <Button x:Name="btn_output" Grid.Row="0" Grid.Column="3" Content="Toggle Output" HorizontalAlignment="Left" Width="90"/>

                    <Button x:Name="btn_debug" HorizontalAlignment="Left" Width="100" Margin="110,0,0,0" Grid.Column="3" Grid.Row="0" Content="Toggle Debug" />

                    <Ellipse x:Name="el_status" Grid.Row="0" Grid.Column="4" Fill="Gray" Height="20" Width="20"/>


                    <Label Grid.Row="2" Grid.Column="0" x:Name="lbl_command" Content="Command" HorizontalAlignment="Right"/>
                    <TextBox x:Name="txt_command" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" Text="" Width="130" KeyDown="txt_command_KeyDown"/>
                    <Button x:Name="btn_send" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Left" Content="Send" Width="75" />
                    <Label Grid.Row="2" Grid.Column="3" x:Name="lbl_hexinfo" Content="(only hex values!)" HorizontalAlignment="Left" FontStyle="Italic" FontSize="10" />
                    <Ellipse x:Name="el_error" Grid.Row="2" Grid.Column="4" Fill="Black" Height="15" Width="15"/>
                </Grid>


            <Grid Margin="10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="25" />
                    <RowDefinition Height="10" />
                    <RowDefinition Height="25" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="90" />
                    <ColumnDefinition Width="120" />
                    <ColumnDefinition Width="120" />
                    <ColumnDefinition Width="120" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <!-- Predefined commands -->
                    <Button x:Name="btn_list" HorizontalAlignment="Left" Width="100" Grid.Column="4" Grid.Row="0" Content="List Devices" />
                    <Label Grid.Row="0" Grid.Column="0" x:Name="lbl_read" Content="Channel (Int)" HorizontalAlignment="Right"/>
                    <TextBox x:Name="txt_channel" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" Text="" Width="40" KeyDown="txt_command_KeyDown"/>
                    <Button x:Name="btn_read" HorizontalAlignment="Right" Margin="0,0,20,0" Width="50" Grid.Column="1" Grid.Row="0" Content="Read" />


                    <Label Grid.Row="0" Grid.Column="2" x:Name="lbl_value" Content="Value (Int: 0-255)" HorizontalAlignment="Right"/>
                    <TextBox x:Name="txt_value" Grid.Row="0" Grid.Column="3" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" Text="" Width="40" />
                    <Button x:Name="btn_send_value" HorizontalAlignment="Right" Margin="0,0,20,0" Width="50" Grid.Column="3" Grid.Row="0" Content="Send" />



                    <Button x:Name="btn_test" HorizontalAlignment="Left" Width="100" Grid.Column="1" Grid.Row="3" Content="Test wrong cmd" />
                    <Button x:Name="btn_group_m" HorizontalAlignment="Left" Width="100" Grid.Column="2" Grid.Row="3" Content="Test Group (m)" />
                    <Button x:Name="btn_group_n" HorizontalAlignment="Left" Width="100" Grid.Column="3" Grid.Row="3" Content="Test Group (n)" />

                </Grid>

                <Label x:Name="lbl_console" Content="Console Output" HorizontalAlignment="Left" Margin="20,0,20,0"/>
                <TextBox x:Name="txt_console" Height="310" Padding="5" Margin="20,0,20,20" AcceptsReturn="True" TextWrapping="Wrap" Text="" Background="Black" Foreground="LimeGreen" FontFamily="Courier New" FontSize="12" />



            </StackPanel>
    </Border>
    </Grid>
</Window>
