mirror of https://github.com/fadden/6502bench.git
Compare commits
2 Commits
89df3278bc
...
da91d9fc0e
Author | SHA1 | Date |
---|---|---|
Andy McFadden | da91d9fc0e | |
Andy McFadden | 8532cfb433 |
|
@ -75,7 +75,7 @@ limitations under the License.
|
|||
<DockPanel Grid.Column="3" Grid.Row="2">
|
||||
<TextBlock DockPanel.Dock="Left" Margin="0,1,0,0">Work directory:</TextBlock>
|
||||
<TextBox DockPanel.Dock="Right" Name="workDirectoryTextBox" Margin="8,0,0,0"
|
||||
Text="C:\this\that\theother"/>
|
||||
IsReadOnly="True" Text="C:\this\that\theother"/>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
|
|
|
@ -56,15 +56,20 @@ limitations under the License.
|
|||
</ListBox>
|
||||
|
||||
<TextBlock Text="Font size:" Margin="0,8,0,0"/>
|
||||
<ComboBox Name="sizeComboBox" IsReadOnly="True" Margin="0,4,0,0" Width="75"
|
||||
HorizontalAlignment="Left">
|
||||
<!-- these are parsed directly, so only use numeric values -->
|
||||
<ComboBoxItem>8</ComboBoxItem>
|
||||
<ComboBoxItem>10</ComboBoxItem>
|
||||
<ComboBoxItem>12</ComboBoxItem>
|
||||
<ComboBoxItem>16</ComboBoxItem>
|
||||
<ComboBoxItem>20</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ComboBox Name="sizeComboBox" Margin="0,4,0,0" Width="75"
|
||||
HorizontalAlignment="Left" IsEditable="True">
|
||||
<!-- these are parsed directly, so only use numeric values -->
|
||||
<ComboBoxItem>8</ComboBoxItem>
|
||||
<ComboBoxItem>10</ComboBoxItem>
|
||||
<ComboBoxItem>12</ComboBoxItem>
|
||||
<ComboBoxItem>14</ComboBoxItem>
|
||||
<ComboBoxItem>16</ComboBoxItem>
|
||||
<ComboBoxItem>20</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<TextBlock Name="sizeErrMsg" Margin="8,6,0,0" Text="Must be an integer from 3 to 64."
|
||||
Foreground="Red" Visibility="Hidden"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,8,0,0">
|
||||
<Button Name="okButton" Content="OK" IsDefault="True"
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace SourceGen.WpfGui {
|
|||
|
||||
GenerateMonoFontList(initialFamily);
|
||||
|
||||
int selIndex = 0;
|
||||
int selIndex = -1;
|
||||
string sizeStr = initialSize.ToString();
|
||||
for (int i = 0; i < sizeComboBox.Items.Count; i++) {
|
||||
ComboBoxItem item = (ComboBoxItem)sizeComboBox.Items[i];
|
||||
|
@ -53,6 +53,10 @@ namespace SourceGen.WpfGui {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (selIndex < 0) {
|
||||
// Size is not one of the standard combo box items.
|
||||
sizeComboBox.Text = initialSize.ToString();
|
||||
}
|
||||
sizeComboBox.SelectedIndex = selIndex;
|
||||
}
|
||||
|
||||
|
@ -114,7 +118,21 @@ namespace SourceGen.WpfGui {
|
|||
|
||||
private void OkButton_Click(object sender, RoutedEventArgs e) {
|
||||
ComboBoxItem item = (ComboBoxItem)sizeComboBox.SelectedItem;
|
||||
SelectedSize = int.Parse((string)item.Content);
|
||||
if (item != null) {
|
||||
SelectedSize = int.Parse((string)item.Content);
|
||||
} else {
|
||||
// Catch bad font sizes when "OK" is hit. Not as nice as disabling the OK
|
||||
// button on bad input, but much simpler.
|
||||
try {
|
||||
SelectedSize = int.Parse(sizeComboBox.Text);
|
||||
} catch (FormatException) {
|
||||
SelectedSize = -1; // trigger next test
|
||||
}
|
||||
if (SelectedSize < 3 || SelectedSize > 64) {
|
||||
sizeErrMsg.Visibility = Visibility.Visible;
|
||||
return;
|
||||
}
|
||||
}
|
||||
DialogResult = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ limitations under the License.
|
|||
</Style>
|
||||
|
||||
<RoutedUICommand x:Key="AboutCmd" Text="About..."/>
|
||||
<RoutedUICommand x:Key="AssembleCmd" Text="Assemble...">
|
||||
<RoutedUICommand x:Key="AssembleCmd" Text="Generate Assembly...">
|
||||
<RoutedUICommand.InputGestures>
|
||||
<KeyGesture>Ctrl+Shift+A</KeyGesture>
|
||||
</RoutedUICommand.InputGestures>
|
||||
|
|
|
@ -19,7 +19,7 @@ the target assembler, will recreate the original data file exactly.
|
|||
Every assembler is different, so support must be added to SourceGen
|
||||
for each.</p>
|
||||
<p>The generation / assembly dialog can be opened with
|
||||
<samp>File > Assemble</samp>.</p>
|
||||
<samp>File > Generate Assembly</samp>.</p>
|
||||
<p>If you want to show code to others, perhaps by adding a page to
|
||||
your web site, you can "export" the formatted code as text or HTML.
|
||||
This is explained in more detail <a href="#export-source">below</a>.
|
||||
|
|
|
@ -91,7 +91,8 @@
|
|||
</div>
|
||||
<div class="grid-item-text">
|
||||
<p>You can generate assembly source code from the disassembled data.
|
||||
Select <samp>File > Assemble</samp> (or hit <kbd class="key">Ctrl+Shift+A</kbd>)
|
||||
Select <samp>File > Generate Assembly</samp>
|
||||
(or hit <kbd class="key">Ctrl+Shift+A</kbd>)
|
||||
to open the source generation and assembly dialog.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue