Skip to content

Commit ea1b3a7

Browse files
committed
Added support for dtc.exe (Kryoflux)
1 parent e002cc4 commit ea1b3a7

35 files changed

+5957
-5122
lines changed

DiskImageTool/Controls/FloppyTrackGrid.vb

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Public Class FloppyTrackGrid
1818
Private Shared ReadOnly HEADER_FONT As New Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular)
1919
Private Shared ReadOnly SELECTED_BACKCOLOR As Color = Color.LightSkyBlue
2020
Private ReadOnly _SelectedTracks As HashSet(Of UShort)
21+
Private ReadOnly _ToolTip As ToolTip
2122
Private _ActiveTrackCount As Integer
2223
Private _Cells As List(Of CellInfo)
2324

@@ -31,6 +32,7 @@ Public Class FloppyTrackGrid
3132
Private _LastSelected As (Track As Integer, Selected As Boolean) = (-1, False)
3233
Private _NoEventSelectionChanged As Boolean = False
3334
Private _SelectEnabled As Boolean = False
35+
Private _Side As Byte
3436
Private _TrackCount As Integer
3537
Public Event CellClicked(sender As Object, Track As Integer, Row As Integer, Col As Integer, Shift As Boolean)
3638
Public Event CheckChanged(sender As Object, Checked As Boolean)
@@ -48,16 +50,17 @@ Public Class FloppyTrackGrid
4850
DoubleBuffered = True
4951
TabStop = False
5052

53+
_ToolTip = New ToolTip()
5154
_SelectedTracks = New HashSet(Of UShort)
5255
_Cells = New List(Of CellInfo)
5356
End Sub
5457

55-
Public Sub New(TrackCount As Integer, Label As String)
58+
Public Sub New(TrackCount As Integer, Side As Byte)
5659
Me.New()
5760

5861
_ActiveTrackCount = TrackCount
5962
Me.TrackCount = TrackCount
60-
Me.Label = Label
63+
Me.Side = Side
6164
End Sub
6265

6366
<Browsable(True)>
@@ -118,16 +121,15 @@ Public Class FloppyTrackGrid
118121

119122
' Footer label text (what you pass in the New overload)
120123
<Browsable(True)>
121-
<DefaultValue("")>
122-
Public Property Label As String
124+
<DefaultValue(0)>
125+
Public Property Side As Byte
123126
Get
124-
Return _Label
127+
Return _Side
125128
End Get
126-
Set(value As String)
127-
If _Label <> value Then
128-
_Label = value
129-
InvalidateFooter()
130-
End If
129+
Set(value As Byte)
130+
_Side = value
131+
_Label = My.Resources.Label_Side & " " & _Side
132+
InvalidateFooter()
131133
End Set
132134
End Property
133135

@@ -233,7 +235,8 @@ Public Class FloppyTrackGrid
233235
Optional Text As String = Nothing,
234236
Optional BackColor As Color? = Nothing,
235237
Optional ForeColor As Color? = Nothing,
236-
Optional Selected As Boolean? = Nothing)
238+
Optional Selected As Boolean? = Nothing,
239+
Optional Tooltip As String = Nothing)
237240

238241
If TrackIndex < 0 OrElse TrackIndex >= _TrackCount Then
239242
Throw New ArgumentOutOfRangeException(NameOf(TrackIndex))
@@ -249,6 +252,12 @@ Public Class FloppyTrackGrid
249252
End If
250253
End If
251254

255+
If Tooltip IsNot Nothing Then
256+
If Cell.Tooltip <> Tooltip Then
257+
Cell.Tooltip = Tooltip
258+
End If
259+
End If
260+
252261
If BackColor.HasValue AndAlso Cell.BackColor <> BackColor.Value Then
253262
Cell.BackColor = BackColor.Value
254263
Changed = True
@@ -315,6 +324,10 @@ Public Class FloppyTrackGrid
315324
SetCell(TrackIndex, Text:=Text)
316325
End Sub
317326

327+
Public Sub SetCellTooltip(TrackIndex As Integer, Text As String)
328+
SetCell(TrackIndex, Tooltip:=Text)
329+
End Sub
330+
318331
Public Sub SetCheckStateSilent(Checked As Boolean)
319332
If _IsChecked <> Checked Then
320333
_IsChecked = Checked
@@ -813,6 +826,23 @@ Public Class FloppyTrackGrid
813826
RaiseEvent SelectionChanged(Me, Track, Selected)
814827
End Sub
815828

829+
Private Sub FloppyTrackGrid_MouseMove(sender As Object, e As MouseEventArgs) Handles Me.MouseMove
830+
Dim TooltipText As String = ""
831+
832+
Dim Response = HitTestCell(e.Location)
833+
If Response.Result Then
834+
TooltipText = _Cells(Response.TrackIndex).Tooltip
835+
If TooltipText = "" Then
836+
TooltipText = My.Resources.Label_Track & ": " & Response.TrackIndex.ToString & "." & _Side.ToString
837+
End If
838+
839+
End If
840+
841+
If TooltipText <> _ToolTip.GetToolTip(Me) Then
842+
_ToolTip.SetToolTip(Me, TooltipText)
843+
End If
844+
End Sub
845+
816846
' Map track index -> cell rectangle (including header offsets)
817847
Private Function GetCellRectangle(trackIndex As Integer) As Rectangle
818848
Dim row As Integer = trackIndex \ COLUMNS
@@ -841,7 +871,7 @@ Public Class FloppyTrackGrid
841871
Response.Col = (p.X \ CELL_WIDTH) - 1 ' -1 for left header column
842872
Response.Row = (p.Y \ CELL_HEIGHT) - 1 ' -1 for top header row
843873

844-
If Response.Row < 0 OrElse Response.Col < 0 Then
874+
If Response.Row < 0 OrElse Response.Col < 0 OrElse Response.Col >= COLUMNS Then
845875
Return Response
846876
End If
847877

@@ -928,5 +958,6 @@ Public Class FloppyTrackGrid
928958
Public ForeColor As Color
929959
Public Selected As Boolean
930960
Public Text As String
961+
Public Tooltip As String
931962
End Structure
932963
End Class

DiskImageTool/DiskImageTool.vbproj

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
<TargetCulture>en-US</TargetCulture>
3131
<ProductName>DiskImageTool</ProductName>
3232
<PublisherName>Digitoxin</PublisherName>
33-
<ApplicationRevision>1</ApplicationRevision>
34-
<ApplicationVersion>2.21.0.%2a</ApplicationVersion>
33+
<ApplicationRevision>0</ApplicationRevision>
34+
<ApplicationVersion>2.22.0.%2a</ApplicationVersion>
3535
<UseApplicationTrust>false</UseApplicationTrust>
3636
<PublishWizardCompleted>true</PublishWizardCompleted>
3737
<BootstrapperEnabled>true</BootstrapperEnabled>
@@ -172,14 +172,9 @@
172172
<Compile Include="Filters\ImageFilters.vb" />
173173
<Compile Include="Filters\ImageFiltersBase.vb" />
174174
<Compile Include="DiskImageLib.vb" />
175-
<Compile Include="Flux\Greaseweazle\Forms\BaseForm.vb">
176-
<SubType>Form</SubType>
177-
</Compile>
175+
<Compile Include="Flux\Greaseweazle\TrackStatus.vb" />
178176
<Compile Include="Flux\Kryoflux\CommandLineBuilder.vb" />
179-
<Compile Include="Flux\Kryoflux\ConsoleOutputParser.vb" />
180-
<Compile Include="Flux\Kryoflux\Forms\BaseForm.vb">
181-
<SubType>Form</SubType>
182-
</Compile>
177+
<Compile Include="Flux\Kryoflux\ConsoleParser.vb" />
183178
<Compile Include="Flux\Kryoflux\Forms\ConfigurationForm.Designer.vb">
184179
<DependentUpon>ConfigurationForm.vb</DependentUpon>
185180
</Compile>
@@ -190,13 +185,14 @@
190185
<SubType>Form</SubType>
191186
</Compile>
192187
<Compile Include="Flux\Kryoflux\KryofluxLib.vb" />
188+
<Compile Include="Flux\Kryoflux\TrackStatus.vb" />
193189
<Compile Include="Flux\SharedLib.vb" />
194190
<Compile Include="Globals.vb" />
195191
<Compile Include="Flux\Greaseweazle\Forms\CleanDiskForm.vb">
196192
<SubType>Form</SubType>
197193
</Compile>
198194
<Compile Include="Flux\Greaseweazle\CommandLineBuilder.vb" />
199-
<Compile Include="Flux\Greaseweazle\ConsoleOutputParser.vb" />
195+
<Compile Include="Flux\Greaseweazle\ConsoleParser.vb" />
200196
<Compile Include="Flux\Greaseweazle\Enums.vb" />
201197
<Compile Include="Flux\Greaseweazle\Forms\ConfigurationForm.Designer.vb">
202198
<DependentUpon>ConfigurationForm.vb</DependentUpon>

0 commit comments

Comments
 (0)