From c4a056bd0a988dd544f243d73c8267b8ea81bd8f Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Thu, 23 May 2019 13:38:41 -0700 Subject: [PATCH] Merge ListView style from DisasmUiTest project Long comments and notes now occupy the correct columns. --- SourceGenWPF/DisplayList.cs | 8 +- SourceGenWPF/ProjWin/CodeListItemStyle.xaml | 142 ++++++++++++++++++++ SourceGenWPF/ProjWin/MainWindow.xaml | 99 +++----------- SourceGenWPF/SourceGenWPF.csproj | 4 + 4 files changed, 171 insertions(+), 82 deletions(-) create mode 100644 SourceGenWPF/ProjWin/CodeListItemStyle.xaml diff --git a/SourceGenWPF/DisplayList.cs b/SourceGenWPF/DisplayList.cs index bb88081..00f0481 100644 --- a/SourceGenWPF/DisplayList.cs +++ b/SourceGenWPF/DisplayList.cs @@ -298,9 +298,9 @@ namespace SourceGenWPF { public string Opcode { get; private set; } public string Operand { get; private set; } public string Comment { get; private set; } - public bool IsSingleLine { get; private set; } + public bool IsLongComment { get; private set; } - // Construct with factory methods. + // Private constructor -- create instances with factory methods. private FormattedParts() { } public static FormattedParts Create(string offset, string addr, string bytes, @@ -316,7 +316,7 @@ namespace SourceGenWPF { parts.Opcode = opcode; parts.Operand = operand; parts.Comment = comment; - parts.IsSingleLine = false; + parts.IsLongComment = false; return parts; } @@ -324,7 +324,7 @@ namespace SourceGenWPF { public static FormattedParts Create(string longComment) { FormattedParts parts = new FormattedParts(); parts.Comment = longComment; - parts.IsSingleLine = true; + parts.IsLongComment = true; return parts; } diff --git a/SourceGenWPF/ProjWin/CodeListItemStyle.xaml b/SourceGenWPF/ProjWin/CodeListItemStyle.xaml new file mode 100644 index 0000000..e5d84db --- /dev/null +++ b/SourceGenWPF/ProjWin/CodeListItemStyle.xaml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SourceGenWPF/ProjWin/MainWindow.xaml b/SourceGenWPF/ProjWin/MainWindow.xaml index d18a222..7fe5e13 100644 --- a/SourceGenWPF/ProjWin/MainWindow.xaml +++ b/SourceGenWPF/ProjWin/MainWindow.xaml @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - + - - - Ctrl+Shift+A - - - + + + + + - - - - - + + @@ -285,7 +227,8 @@ limitations under the License. FontFamily="{StaticResource GeneralMonoFont}" Visibility="{Binding Path=CodeListVisibility}" VirtualizingStackPanel.VirtualizationMode="Recycling" - ItemContainerStyle="{StaticResource codeListViewItemStyle}" SelectionChanged="CodeListView_SelectionChanged"> + ItemContainerStyle="{StaticResource codeListItemStyle}" + SelectionChanged="CodeListView_SelectionChanged"> diff --git a/SourceGenWPF/SourceGenWPF.csproj b/SourceGenWPF/SourceGenWPF.csproj index bc70778..3554142 100644 --- a/SourceGenWPF/SourceGenWPF.csproj +++ b/SourceGenWPF/SourceGenWPF.csproj @@ -138,6 +138,10 @@ + + MSBuild:Compile + Designer + Designer MSBuild:Compile