Skip to content

Commit fdacf6a

Browse files
author
Juan Segura
committed
Mixing with master
1 parent 09f2780 commit fdacf6a

File tree

11 files changed

+92
-57
lines changed

11 files changed

+92
-57
lines changed

Bufdio/Bufdio.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="FFmpeg.AutoGen" Version="5.1.1" />
12+
<PackageReference Include="FFmpeg.AutoGen" Version="6.1.0.1" />
1313
</ItemGroup>
1414

1515
</Project>

MsBox.Avalonia/AttachadProperty/HyperLinkCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
using System.Reactive;
21
using System.Windows.Input;
32
using Avalonia;
43
using Avalonia.Data;
54
using Avalonia.Input;
65
using Avalonia.Interactivity;
6+
using Avalonia.Reactive;
77

88
namespace MsBox.Avalonia.AttachadProperty;
99

MsBox.Avalonia/MsBox.Avalonia.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
<AvaloniaResource Include="Assets\*" />
2727
</ItemGroup>
2828
<ItemGroup>
29-
<PackageReference Include="Avalonia" Version="11.1.3" />
29+
<PackageReference Include="Avalonia" Version="11.2.3" />
3030
<PackageReference Include="Avalonia.AvaloniaEdit" Version="11.1.0" />
31-
<PackageReference Include="DialogHost.Avalonia" Version="0.7.9" />
31+
<PackageReference Include="DialogHost.Avalonia" Version="0.9.2" />
3232
<PackageReference Include="Markdown.Avalonia.Tight" Version="11.0.2" />
3333
</ItemGroup>
3434
<ItemGroup>

ZXBStudio/Dialogs/ZXAboutDialog.axaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@
1010
Title="About..." CanResize="False"
1111
WindowStartupLocation="CenterScreen"
1212
Topmost="True">
13-
<Grid RowDefinitions="2.7*,1*,0.5*,0.5*,0.5*,0.5*,1.5*,1.6*,*,0.4*,0.4*,0.4*,*">
13+
<Grid RowDefinitions="Auto,Auto,Auto,*,*,Auto,Auto,Auto,Auto,*,Auto,Auto,*,32">
1414
<Image Margin="10" Width="128" Height="128" VerticalAlignment="Top" Source="avares://ZXBasicStudio/Assets/IconAbout.png"></Image>
1515
<TextBlock Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="36" FontWeight="Black">ZX Basic Studio</TextBlock>
1616
<TextBlock Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="24">Beta release</TextBlock>
17-
<TextBlock Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="16" Name="txtBuild">Build 1.3.5.6</TextBlock>
18-
<TextBlock Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="16" Name="txtDate">2023-10-29</TextBlock>
19-
<TextBlock Grid.Row="6" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" TextAlignment="Center" TextWrapping="Wrap" FontWeight="DemiBold">The ZX Basic Studio development team</TextBlock>
20-
<TextBlock Grid.Row="7" VerticalAlignment="Center" TextAlignment="Center" HorizontalAlignment="Center" FontSize="18" TextWrapping="Wrap">El Dr. Gusman, Duefectu, AdolFITO, Hash6Iron, SirRickster</TextBlock>
21-
<TextBlock Grid.Row="8" VerticalAlignment="Center" TextAlignment="Center" HorizontalAlignment="Center" FontSize="16" TextWrapping="Wrap">Many thanks to Boriel for the ZX Basic compiler and his support to this project.</TextBlock>
22-
<TextBlock Grid.Row="10" VerticalAlignment="Center" TextAlignment="Center" HorizontalAlignment="Center" FontSize="12" TextWrapping="Wrap">(C) 2023, El Dr. Gusman</TextBlock>
23-
<Button Name="btnClose" Grid.Row="12">Close</Button>
17+
<TextBlock Grid.Row="3" VerticalAlignment="Bottom" HorizontalAlignment="Center" FontSize="16" Name="txtBuild">Build 1.3.5.6</TextBlock>
18+
<TextBlock Grid.Row="4" VerticalAlignment="Top" HorizontalAlignment="Center" FontSize="16" Name="txtDate">2023-10-29</TextBlock>
19+
<TextBlock Grid.Row="6" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="16" TextAlignment="Center" TextWrapping="Wrap" FontWeight="DemiBold">The ZX Basic Studio development team</TextBlock>
20+
<TextBlock Grid.Row="7" VerticalAlignment="Center" TextAlignment="Center" HorizontalAlignment="Center" FontSize="18" TextWrapping="Wrap">El Dr. Gusman, Boriel, Duefectu, AdolFITO, Hash6Iron, SirRickster</TextBlock>
21+
<TextBlock Grid.Row="9" VerticalAlignment="Center" TextAlignment="Center" HorizontalAlignment="Center" FontSize="16" TextWrapping="Wrap">Many thanks to Boriel for the ZX Basic compiler and his support to this project.</TextBlock>
22+
<TextBlock Grid.Row="11" VerticalAlignment="Center" TextAlignment="Center" HorizontalAlignment="Center" FontSize="12" TextWrapping="Wrap">(C) 2023, El Dr. Gusman</TextBlock>
23+
<TextBlock Grid.Row="12" VerticalAlignment="Center" TextAlignment="Center" HorizontalAlignment="Center" FontSize="12" TextWrapping="Wrap">(C) 2025, Boriel &amp; DuefectuCorp</TextBlock>
24+
<Button Name="btnClose" Grid.Row="14">Close</Button>
2425
</Grid>
2526
</Window>

ZXBStudio/DocumentEditors/ZXGraphics/log/ExportManager.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Collections.Generic;
55
using System.IO;
66
using System.Linq;
7-
using System.Reactive.Joins;
87
using System.Text;
98
using System.Threading.Tasks;
109
using ZXBasicStudio.BuildSystem;

ZXBStudio/DocumentEditors/ZXTextEditor/Classes/LanguageDefinitions/ZXBasicCompletionData.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public ZXBasicCompletionData(ZXBasicCompletionType DataType, string Text, string
5555

5656
public string Text { get; }
5757

58-
public object Content => Text;
58+
public object Content => this; // Text;
5959

6060
public object Description { get; }
6161

@@ -66,8 +66,11 @@ public void Complete(TextArea textArea, ISegment completionSegment,
6666
{
6767
textArea.Document.Replace(completionSegment, Text);
6868
}
69+
70+
public override string ToString() => Text;
6971
}
7072

73+
7174
public enum ZXBasicCompletionType
7275
{
7376
Keyword,

ZXBStudio/DocumentEditors/ZXTextEditor/Controls/ZXBasicEditor.cs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,16 @@ static ZXBasicEditor()
475475
public ZXBasicEditor() : base() { }
476476
public ZXBasicEditor(string DocumentPath) : base(DocumentPath, ZXBasicDocument.Id) { }
477477

478+
479+
/// <summary>
480+
/// Gestion de autocompletar
481+
/// </summary>
482+
/// <param name="Document"></param>
483+
/// <param name="Line"></param>
484+
/// <param name="Column"></param>
485+
/// <param name="RequestedChar"></param>
486+
/// <param name="ByRequest"></param>
487+
/// <returns></returns>
478488
protected override IEnumerable<ICompletionData>? ShouldComplete(IDocument Document, int Line, int Column, char? RequestedChar, bool ByRequest)
479489
{
480490
var line = Document.GetLineByNumber(Line);
@@ -487,8 +497,10 @@ public ZXBasicEditor(string DocumentPath) : base(DocumentPath, ZXBasicDocument.I
487497

488498
if (!ByRequest)
489499
{
490-
if(ZXOptions.Current.DisableAuto)
500+
if (ZXOptions.Current.DisableAuto)
501+
{
491502
return null;
503+
}
492504
}
493505

494506
if (ByRequest)
@@ -522,25 +534,33 @@ public ZXBasicEditor(string DocumentPath) : base(DocumentPath, ZXBasicDocument.I
522534
}
523535

524536
if (context == ContextType.Comment)
537+
{
525538
return null;
539+
}
526540

527541
string trimmed = preText.Trim();
528542

529-
if(context == ContextType.Assembler)
543+
if (context == ContextType.Assembler)
530544
{
531545
if (!char.IsLetter(RequestedChar ?? ' ') || regCommentAsm.IsMatch(trimmed))
546+
{
532547
return null;
533548

549+
}
534550
if (string.IsNullOrWhiteSpace(trimmed))
551+
{
535552
PrioritizeAssemblerKeywords();
553+
}
536554
else
555+
{
537556
PrioritizeAssemblerRegisters();
538-
557+
}
539558
return assembler;
540559
}
541560

542561

543562
if (string.IsNullOrWhiteSpace(preText))
563+
//if(trimmed.Length > 1)
544564
{
545565
if (RequestedChar == '#')
546566
return directives;

ZXBStudio/DocumentEditors/ZXTextEditor/Controls/ZXTextEditor.axaml.cs

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
using AvaloniaEdit.Utils;
3636
using static System.Runtime.InteropServices.JavaScript.JSType;
3737
using System.Diagnostics;
38+
using SixLabors.ImageSharp.Formats.Webp;
3839

3940
namespace ZXBasicStudio.DocumentEditors.ZXTextEditor.Controls
4041
{
@@ -99,14 +100,14 @@ public partial class ZXTextEditor : ZXDocumentEditorBase, IObserver<AvaloniaProp
99100
public override string DocumentName => _docName;
100101
public override string DocumentPath => _docPath;
101102
public override bool Modified
102-
{
103-
get
104-
{
105-
if (_docPath == ZXConstants.DISASSEMBLY_DOC || _docPath == ZXConstants.ROM_DOC)
106-
return false;
107-
108-
return editor?.IsModified ?? false;
109-
}
103+
{
104+
get
105+
{
106+
if (_docPath == ZXConstants.DISASSEMBLY_DOC || _docPath == ZXConstants.ROM_DOC)
107+
return false;
108+
109+
return editor?.IsModified ?? false;
110+
}
110111
}
111112
#endregion
112113

@@ -139,15 +140,15 @@ public int? BreakLine
139140
#region Constructors
140141
public ZXTextEditor() : this("Untitled", ZXTextDocument.Id)
141142
{
142-
143+
143144
}
144145
public ZXTextEditor(string DocumentPath, Guid DocumentTypeId)
145146
{
146147
InitializeComponent();
147148

148149
_docTypeId = DocumentTypeId;
149150
InitializeShortcuts();
150-
151+
151152
editor.DataContext = editor;
152153
editor.FontSize = ZXOptions.Current.EditorFontSize;
153154
editor.WordWrap = ZXOptions.Current.WordWrap;
@@ -208,19 +209,25 @@ private void TextArea_TextEntering(object? sender, TextInputEventArgs e)
208209
{
209210

210211
if (e.Text == null || e.Text.Length == 0)
212+
{
211213
return;
214+
}
212215

213216
if (completionWindow == null && !string.IsNullOrWhiteSpace(e.Text) && !char.IsNumber(e.Text[0]))
214217
{
215218
var d = (IDocument)editor.Document;
216219
var completionData = ShouldComplete(editor.Document, editor.TextArea.Caret.Line, editor.TextArea.Caret.Column - 1, e.Text[0], false);
217220

218221
if (completionData != null)
222+
{
219223
ShowCompletion(completionData, false);
224+
}
220225
}
221226
else if (completionWindow != null && !char.IsLetterOrDigit(e.Text[0]))
227+
{
222228
completionWindow.CompletionList.RequestInsertion(e);
223-
229+
}
230+
224231
}
225232

226233
private void TextArea_KeyDown(object? sender, KeyEventArgs e)
@@ -231,7 +238,9 @@ private void TextArea_KeyDown(object? sender, KeyEventArgs e)
231238
var completionData = ShouldComplete(editor.Document, editor.TextArea.Caret.Line, editor.TextArea.Caret.Column - 1, null, true);
232239

233240
if (completionData != null)
241+
{
234242
ShowCompletion(completionData, true);
243+
}
235244
}
236245
}
237246

@@ -240,10 +249,9 @@ private void ShowCompletion(IEnumerable<ICompletionData> completions, bool reque
240249
if (completionWindow == null)
241250
{
242251
completionWindow = new CompletionWindow(editor.TextArea);
243-
244252
ICompletionData? selectedItem = null;
245253

246-
if (requested)
254+
//if (requested)
247255
{
248256
var line = editor.Document.GetLineByNumber(editor.TextArea.Caret.Line);
249257
var text = editor.Document.GetText(line);
@@ -270,6 +278,7 @@ private void ShowCompletion(IEnumerable<ICompletionData> completions, bool reque
270278
data.AddRange(completions);
271279
completionWindow.Show();
272280
completionWindow.CompletionList.SelectedItem = selectedItem;
281+
273282
completionWindow.KeyDown += (s, e) =>
274283
{
275284
if (e.Key == Key.F1 && completionWindow.CompletionList.SelectedItem != null)
@@ -512,20 +521,20 @@ public override bool SaveDocument(TextWriter OutputLog)
512521

513522
return true;
514523
}
515-
catch(Exception ex)
524+
catch (Exception ex)
516525
{
517526
OutputLog.WriteLine($"Error saving file {_docPath}: {ex.Message}");
518527
return false;
519528
}
520529
}
521530
public override bool RenameDocument(string NewName, TextWriter OutputLog)
522531
{
523-
try
532+
try
524533
{
525534
UpdateFileName(_docPath, NewName);
526535
return true;
527536
}
528-
catch(Exception ex)
537+
catch (Exception ex)
529538
{
530539
OutputLog.WriteLine($"Error internally updating the document name: {ex.Message}");
531540
return false;
@@ -602,22 +611,22 @@ public void Expand()
602611
foreach (var fold in fManager.AllFoldings)
603612
fold.IsFolded = false;
604613
}
605-
614+
606615
public void FontIncrease()
607616
{
608617
editor.FontSize++;
609618
}
610-
619+
611620
public void FontDecrease()
612621
{
613622
editor.FontSize--;
614623
}
615-
624+
616625
public void CommentSelection()
617626
{
618627
if (editor.IsReadOnly || commentChar == null || editor.TextArea.Selection == null)
619628
return;
620-
629+
621630
TextDocument document = editor.TextArea.Document;
622631

623632
if (editor.TextArea.Selection.Length == 0)
@@ -629,7 +638,7 @@ public void CommentSelection()
629638
else
630639
{
631640
IEnumerable<SelectionSegment> selectionSegments = editor.TextArea.Selection.Segments;
632-
641+
633642
foreach (SelectionSegment segment in selectionSegments)
634643
{
635644
int lineStart = document.GetLineByOffset(segment.StartOffset).LineNumber;
@@ -741,17 +750,17 @@ private void Document_Changing(object? sender, DocumentChangeEventArgs e)
741750

742751
if (e.RemovalLength > 0)
743752
{
744-
753+
745754
int end = start + e.RemovalLength;
746755
int linesRemoved = 0;
747756
int pos = start;
748-
while(pos < end)
757+
while (pos < end)
749758
{
750759
var line = editor.Document.GetLineByOffset(pos);
751760
if (pos >= line.EndOffset)
752761
firstLine++;
753762

754-
763+
755764
string lineText = editor.Document.GetText(line.Offset, line.Length);
756765
int removalLength = Math.Min(line.EndOffset - pos, end - pos);
757766
string leftText = lineText.Remove(pos - line.Offset, removalLength);
@@ -766,11 +775,11 @@ private void Document_Changing(object? sender, DocumentChangeEventArgs e)
766775
linesRemoved++;
767776
}
768777

769-
if(linesRemoved > 0)
778+
if (linesRemoved > 0)
770779
changed |= MoveBreakpoints(firstLine, -linesRemoved);
771780
}
772781

773-
if(changed)
782+
if (changed)
774783
bpMargin?.InvalidateVisual();
775784
}
776785
private void Document_Changed(object? sender, DocumentChangeEventArgs e)
@@ -801,7 +810,7 @@ private void Document_Changed(object? sender, DocumentChangeEventArgs e)
801810

802811
var firstText = editor.Document.GetText(firstLine.Offset, firstLine.Length);
803812

804-
if(!string.IsNullOrWhiteSpace(firstText))
813+
if (!string.IsNullOrWhiteSpace(firstText))
805814
changed = MoveBreakpoints(firstLine.LineNumber + 1, addedLines);
806815
else
807816
changed = MoveBreakpoints(firstLine.LineNumber, addedLines);
@@ -873,12 +882,12 @@ public void UpdateFontSize(bool increase)
873882
#region IObserver implementation for modified document notifications
874883
public void OnCompleted()
875884
{
876-
885+
877886
}
878887

879888
public void OnError(Exception error)
880889
{
881-
890+
882891
}
883892

884893
public void OnNext(AvaloniaPropertyChangedEventArgs value)

ZXBStudio/MainWindow.axaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ public MainWindow()
217217
regView.Registers = emu.Registers;
218218
memView.Initialize(emu.Memory);
219219
CreateRomBreakpoints();
220+
#if DEBUG
221+
this.AttachDevTools();
222+
#endif
220223
#endregion
221224

222225
#region Player intialization

0 commit comments

Comments
 (0)