Skip to content

Commit

Permalink
Start knocking out new UI elements required for custom hotkeys
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerhelland committed Sep 6, 2024
1 parent 5ae6a3e commit 58e755b
Show file tree
Hide file tree
Showing 10 changed files with 1,960 additions and 14 deletions.
16 changes: 8 additions & 8 deletions Classes/pdListSupport.cls
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Private m_ListMode As PD_ListSupportMode
'If custom sizes are in use, PD needs to store each listbox item position independently, since we can't infer it.
' Note that this struct (and the corresponding position array) may or may not be in use - or certain parts of it
' may be in use, but not other parts - depending on the combination of parameters sent to us by the user.
Private m_Items() As PD_LISTITEM
Private m_Items() As PD_ListItem

'Current list item count. May or may not correspond to the size of m_Items, FYI.
Private Const INITIAL_LIST_SIZE As Long = 16&
Expand Down Expand Up @@ -128,7 +128,7 @@ Friend Sub AddItem(Optional ByRef srcItemText As String = vbNullString, Optional
If (Not PDMain.IsProgramRunning()) Then Exit Sub

'Make sure there's room in the array for this item.
If (m_NumOfItems > UBound(m_Items)) Then ReDim Preserve m_Items(0 To m_NumOfItems * 2 - 1) As PD_LISTITEM
If (m_NumOfItems > UBound(m_Items)) Then ReDim Preserve m_Items(0 To m_NumOfItems * 2 - 1) As PD_ListItem

'Change the rendering mode, as necessary
If (itemHeight <> -1) And (m_SizeMode <> PDLH_Custom) Then
Expand Down Expand Up @@ -245,7 +245,7 @@ Friend Sub Clear(Optional ByVal newListSize As Long = INITIAL_LIST_SIZE)

'Reset the array (but only if necessary!)
If (m_NumOfItems = 0) Then
ReDim m_Items(0 To newListSize - 1) As PD_LISTITEM
ReDim m_Items(0 To newListSize - 1) As PD_ListItem
Else
If UBound(m_Items) = newListSize - 1 Then
Dim i As Long
Expand All @@ -259,7 +259,7 @@ Friend Sub Clear(Optional ByVal newListSize As Long = INITIAL_LIST_SIZE)
End With
Next i
Else
ReDim m_Items(0 To newListSize - 1) As PD_LISTITEM
ReDim m_Items(0 To newListSize - 1) As PD_ListItem
End If
End If

Expand All @@ -274,7 +274,7 @@ Friend Sub Clear(Optional ByVal newListSize As Long = INITIAL_LIST_SIZE)

FailsafeReset:
If (newListSize <= 0) Then newListSize = INITIAL_LIST_SIZE
ReDim m_Items(0 To newListSize - 1) As PD_LISTITEM
ReDim m_Items(0 To newListSize - 1) As PD_ListItem

End Sub

Expand All @@ -292,7 +292,7 @@ Friend Sub CloneExternalListSupport(ByRef srcListSupport As pdListSupport, Optio
m_NumOfItems = srcListSupport.ListCount
If (m_NumOfItems > 0) Then

ReDim m_Items(0 To srcListSupport.GetSizeOfInternalListStruct) As PD_LISTITEM
ReDim m_Items(0 To srcListSupport.GetSizeOfInternalListStruct) As PD_ListItem

Dim i As Long
For i = 0 To m_NumOfItems - 1
Expand Down Expand Up @@ -335,7 +335,7 @@ End Sub

'Need to render a specific list item? Call this to retrieve a full copy of a given list item's data, plus
' rendering-specific information like the item's literal position in the current list box.
Friend Function GetDirectListItem(ByVal srcListIndex As Long) As PD_LISTITEM
Friend Function GetDirectListItem(ByVal srcListIndex As Long) As PD_ListItem
GetDirectListItem = m_Items(srcListIndex)
End Function

Expand Down Expand Up @@ -863,7 +863,7 @@ End Sub

'Need to render a specific list item? Call this to retrieve a full copy of a given list item's data,
' plus rendering-specific information like the item's literal position in the current list box.
Friend Sub GetRenderingItem(ByVal srcListIndex As Long, ByRef dstListItem As PD_LISTITEM, ByRef dstItemTop As Long, ByRef dstItemHeight As Long, ByRef dstItemHeightWithoutSeparator As Long)
Friend Sub GetRenderingItem(ByVal srcListIndex As Long, ByRef dstListItem As PD_ListItem, ByRef dstItemTop As Long, ByRef dstItemHeight As Long, ByRef dstItemHeightWithoutSeparator As Long)

dstListItem = m_Items(srcListIndex)

Expand Down
Loading

0 comments on commit 58e755b

Please sign in to comment.