Lay the station form out the way N1MM lays it out

The dialog now carries N1MM's fields in N1MM's order, with the labels to
the left of the boxes and the tip text at the top right. New fields in
StoredStation: the address, the licence class, the position, the radio,
the antenna and the email address.

The grid square and the position fill each other in, as they do in N1MM.
Which box has focus decides the direction, because TextChanged arrives
too late to tell a typed edit from a programmed one.

The fields N1MM's form does not have are gone from it. Continent and the
country prefix are looked up from the callsign after Ok; the rest keep
the value they had.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-28 11:32:22 +00:00
parent 682932c35d
commit d347538fbc
6 changed files with 283 additions and 65 deletions

View File

@@ -1,56 +1,123 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Nonemm.App.Dialogs.StationDialog"
Title="Station" Width="440" SizeToContent="Height"
Title="Edit Station Information" Width="545" SizeToContent="Height"
WindowStartupLocation="CenterOwner" CanResize="False">
<Window.Styles>
<Style Selector="TextBlock.field">
<Style Selector="TextBlock.label">
<Setter Property="FontSize" Value="11" />
<Setter Property="Opacity" Value="0.7" />
<Setter Property="Margin" Value="0,6,0,1" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="6,0,6,0" />
</Style>
<Style Selector="TextBlock.first">
<Setter Property="Width" Value="95" />
<Setter Property="TextAlignment" Value="Right" />
</Style>
<Style Selector="TextBox">
<Setter Property="FontSize" Value="11" />
<Setter Property="MinHeight" Value="22" />
<Setter Property="Padding" Value="4,1" />
</Style>
<Style Selector="ComboBox">
<Setter Property="FontSize" Value="11" />
<Setter Property="MinHeight" Value="22" />
<Setter Property="Padding" Value="4,1" />
</Style>
<Style Selector="StackPanel.row">
<Setter Property="Orientation" Value="Horizontal" />
<Setter Property="Margin" Value="0,0,0,4" />
</Style>
</Window.Styles>
<StackPanel Margin="14" Spacing="0">
<Grid ColumnDefinitions="*,8,*,8,*" RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
<TextBlock Classes="field" Text="Callsign" />
<TextBox Name="CallsignBox" Grid.Row="1" />
<TextBlock Classes="field" Grid.Column="2" Text="CQ zone" />
<TextBox Name="CqZoneBox" Grid.Row="1" Grid.Column="2" />
<TextBlock Classes="field" Grid.Column="4" Text="ITU zone" />
<TextBox Name="ItuZoneBox" Grid.Row="1" Grid.Column="4" />
<TextBlock Classes="field" Grid.Row="2" Text="Continent" />
<TextBox Name="ContinentBox" Grid.Row="3" />
<TextBlock Classes="field" Grid.Row="2" Grid.Column="2" Text="Country prefix" />
<TextBox Name="CountryBox" Grid.Row="3" Grid.Column="2" />
<TextBlock Classes="field" Grid.Row="2" Grid.Column="4" Text="Grid square" />
<TextBox Name="GridBox" Grid.Row="3" Grid.Column="4" />
<TextBlock Classes="field" Grid.Row="4" Text="State" />
<TextBox Name="StateBox" Grid.Row="5" />
<TextBlock Classes="field" Grid.Row="4" Grid.Column="2" Text="Province" />
<TextBox Name="ProvinceBox" Grid.Row="5" Grid.Column="2" />
<TextBlock Classes="field" Grid.Row="4" Grid.Column="4" Text="ARRL section" />
<TextBox Name="SectionBox" Grid.Row="5" Grid.Column="4" />
<TextBlock Classes="field" Grid.Row="6" Text="Name" />
<TextBox Name="NameBox" Grid.Row="7" />
<TextBlock Classes="field" Grid.Row="6" Grid.Column="2" Text="Power" />
<TextBox Name="PowerBox" Grid.Row="7" Grid.Column="2" />
<TextBlock Classes="field" Grid.Row="6" Grid.Column="4" Text="Club" />
<TextBox Name="ClubBox" Grid.Row="7" Grid.Column="4" />
<TextBlock Classes="field" Grid.Row="8" Text="Check (year first licensed)" />
<TextBox Name="CheckBox" Grid.Row="9" />
<TextBlock Classes="field" Grid.Row="8" Grid.Column="2" Text="Precedence" />
<TextBox Name="PrecedenceBox" Grid.Row="9" Grid.Column="2" />
<TextBlock Classes="field" Grid.Row="8" Grid.Column="4" Text="County" />
<TextBox Name="CountyBox" Grid.Row="9" Grid.Column="4" />
<StackPanel Margin="10">
<Grid ColumnDefinitions="Auto,*">
<StackPanel>
<StackPanel Classes="row">
<TextBlock Classes="label first" Text="Call" />
<TextBox Name="CallsignBox" Width="190" />
</StackPanel>
<StackPanel Classes="row">
<TextBlock Classes="label first" Text="Name" />
<TextBox Name="NameBox" Width="190" />
</StackPanel>
<StackPanel Classes="row">
<TextBlock Classes="label first" Text="Address" />
<TextBox Name="AddressBox" Width="190" />
</StackPanel>
<StackPanel Classes="row">
<TextBlock Classes="label first" Text="Address" />
<TextBox Name="Address2Box" Width="190" />
</StackPanel>
</StackPanel>
<TextBlock Grid.Column="1" FontSize="11" TextWrapping="Wrap" Margin="12,2,0,0"
Foreground="#0000C0"
Text="Tip: You need to fill out this form or the program will not perform properly... Also, make sure your computer date and time are set to the LOCAL date and time zone for your location." />
</Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="6" Margin="0,14,0,0">
<Button Content="Cancel" Click="OnCancel" />
<Button Content="Save" Click="OnSave" IsDefault="True" />
<StackPanel Classes="row">
<TextBlock Classes="label first" Text="City" />
<TextBox Name="CityBox" Width="105" />
<TextBlock Classes="label" Text="State" />
<TextBox Name="StateBox" Width="45" />
<TextBlock Classes="label" Text="Zip" />
<TextBox Name="ZipBox" Width="140" />
</StackPanel>
<StackPanel Classes="row">
<TextBlock Classes="label first" Text="Country" />
<TextBox Name="CountryBox" Width="130" />
</StackPanel>
<StackPanel Classes="row">
<TextBlock Classes="label first" Text="Grid Square" />
<TextBox Name="GridBox" Width="105" />
<TextBlock Classes="label" Text="CQ" />
<TextBox Name="CqZoneBox" Width="60" />
<TextBlock Classes="label" Text="ITU" />
<TextBox Name="ItuZoneBox" Width="90" />
</StackPanel>
<StackPanel Classes="row">
<TextBlock Classes="label first" Text="License" />
<TextBox Name="LicenseBox" Width="60" />
<TextBlock Classes="label" Text="Latitude" />
<TextBox Name="LatitudeBox" Width="55" />
<ComboBox Name="LatitudeSignBox" Width="55" Margin="4,0,0,0" />
<TextBlock Classes="label" Text="Longitude" />
<TextBox Name="LongitudeBox" Width="60" />
<ComboBox Name="LongitudeSignBox" Width="55" Margin="4,0,0,0" />
</StackPanel>
<StackPanel Classes="row" Margin="0,6,0,4">
<TextBlock Classes="label first" Text="Station" />
<TextBox Name="RigBox" Width="175" />
<TextBlock Classes="label" Text="Power" />
<TextBox Name="PowerBox" Width="80" />
</StackPanel>
<StackPanel Classes="row">
<TextBlock Classes="label first" Text="Antenna" />
<TextBox Name="AntennaBox" Width="120" />
<TextBlock Classes="label" Text="Ant. Height" />
<TextBox Name="AntennaHeightBox" Width="60" />
<TextBlock Classes="label" Text="a.s.l." />
<TextBox Name="AboveSeaLevelBox" Width="70" />
</StackPanel>
<StackPanel Classes="row" Margin="0,6,0,4">
<TextBlock Classes="label first" Text="ARRL Section" />
<TextBox Name="SectionBox" Width="100" />
</StackPanel>
<StackPanel Classes="row">
<TextBlock Classes="label first" Text="Rover QTH" />
<TextBox Name="RoverQthBox" Width="100" />
</StackPanel>
<StackPanel Classes="row">
<TextBlock Classes="label first" Text="Club" />
<TextBox Name="ClubBox" Width="235" />
</StackPanel>
<StackPanel Classes="row">
<TextBlock Classes="label first" Text="Email address" />
<TextBox Name="EmailBox" Width="305" />
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="30" Margin="0,14,0,4">
<Button Content="Ok" Width="85" HorizontalContentAlignment="Center" Click="OnSave" IsDefault="True" />
<Button Content="Cancel" Width="85" HorizontalContentAlignment="Center" Click="OnCancel" IsCancel="True" />
</StackPanel>
</StackPanel>
</Window>