Skip to content

Commit 8de329d

Browse files
committed
Small adjustments to main window size and layout
Database updates
1 parent d139c32 commit 8de329d

File tree

6 files changed

+329
-31
lines changed

6 files changed

+329
-31
lines changed

DiskImageTool/Assets/bootstrap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@
688688
<oemname name="MSDOS3.2"/>
689689
</bootstrap>
690690
<bootstrap crc32="AD7A1931" jmp="EB3490" language="German">
691-
<oemname name="MSDOS3.2"/>
691+
<oemname name="MSDOS3.2" verified="true"/>
692692
</bootstrap>
693693
<bootstrap crc32="ECB53499" jmp="EB3490" language="German">
694694
<oemname name="MSDOS3.2" company="Siemens" description="MS-DOS 3.2"/>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
Imports System.ComponentModel
2+
Imports System.Windows.Forms.Design
3+
4+
<ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.ToolStrip), DebuggerStepThrough()>
5+
Public Class ToolStripSpringTextBox
6+
Inherits ToolStripTextBox
7+
8+
Private _MaxWidth As Single
9+
10+
<Category("Layout")>
11+
Public Property MaxWidth As Single
12+
Get
13+
Return _MaxWidth
14+
End Get
15+
Set(value As Single)
16+
_MaxWidth = value
17+
End Set
18+
End Property
19+
20+
Public Overrides Function GetPreferredSize(constrainingSize As Size) As Size
21+
' Use the default size if the text box is on the overflow menu
22+
' or is on a vertical ToolStrip.
23+
If IsOnOverflow Or Owner.Orientation = Orientation.Vertical Then
24+
Return DefaultSize
25+
End If
26+
27+
' Declare a variable to store the total available width as
28+
' it is calculated, starting with the display width of the
29+
' owning ToolStrip.
30+
Dim width As Int32 = Owner.DisplayRectangle.Width
31+
32+
' Subtract the width of the overflow button if it is displayed.
33+
If Owner.OverflowButton.Visible Then
34+
width = width - Owner.OverflowButton.Width -
35+
Owner.OverflowButton.Margin.Horizontal()
36+
End If
37+
38+
' Declare a variable to maintain a count of ToolStripSpringTextBox
39+
' items currently displayed in the owning ToolStrip.
40+
Dim springBoxCount As Int32 = 0
41+
42+
For Each item As ToolStripItem In Owner.Items
43+
44+
' Ignore items on the overflow menu.
45+
If item.IsOnOverflow Or Not item.Visible Then Continue For
46+
47+
If TypeOf item Is ToolStripSpringTextBox Then
48+
' For ToolStripSpringTextBox items, increment the count and
49+
' subtract the margin width from the total available width.
50+
springBoxCount += 1
51+
width -= item.Margin.Horizontal
52+
Else
53+
' For all other items, subtract the full width from the total
54+
' available width.
55+
width = width - item.Width - item.Margin.Horizontal
56+
End If
57+
Next
58+
59+
' If there are multiple ToolStripSpringTextBox items in the owning
60+
' ToolStrip, divide the total available width between them.
61+
If springBoxCount > 1 Then width = CInt(width / springBoxCount)
62+
63+
' If the available width is less than the default width, use the
64+
' default width, forcing one or more items onto the overflow menu.
65+
If width < DefaultSize.Width Then width = DefaultSize.Width
66+
67+
' Retrieve the preferred size from the base class, but change the
68+
' width to the calculated width.
69+
Dim preferredSize As Size = MyBase.GetPreferredSize(constrainingSize)
70+
If _MaxWidth > 0 And width > MaxWidth Then
71+
width = MaxWidth
72+
End If
73+
preferredSize.Width = width
74+
75+
Return preferredSize
76+
End Function
77+
End Class

DiskImageTool/DiskImage/BiosParameterBlock.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Namespace DiskImage
77
Public Shared ReadOnly ValidNumberOfFATS() As Byte = {1, 2}
88
Public Shared ReadOnly ValidNumberOfHeads() As UShort = {1, 2}
99
Public Shared ReadOnly ValidSectorsPerCluster() As Byte = {1, 2, 4, 8, 16, 32, 64, 128}
10-
Public Shared ReadOnly ValidSectorsPerTrack() As UShort = {8, 9, 15, 18, 19, 21, 23, 36}
10+
Public Shared ReadOnly ValidSectorsPerTrack() As UShort = {8, 9, 10, 15, 18, 19, 21, 23, 36}
1111
Private ReadOnly _FloppyImage As IFloppyImage
1212
Private ReadOnly _Offset As UInteger
1313

DiskImageTool/DiskImageTool.vbproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@
133133
<Compile Include="Controls\SelectablePanel.vb">
134134
<SubType>Component</SubType>
135135
</Compile>
136+
<Compile Include="Controls\ToolStripSpringTextBox.vb">
137+
<SubType>Component</SubType>
138+
</Compile>
136139
<Compile Include="DiskImage\AddFileOptions.vb" />
137140
<Compile Include="DiskImage\Modules\EnumDescriptions.vb" />
138141
<Compile Include="DiskImage\MappedFloppyImage.vb" />

0 commit comments

Comments
 (0)