1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
ZO_IME_CANDIDATES_MIN_WIDTH = 200
return object
end
windowManager : SetHandler ( "OnIMECandidateListUpdated" , function ( ... ) self : OnIMECandidateListUpdated ( ... ) end )
end
end
end
local leftControlSpace , topControlSpace , rightControlSpace , bottomControlSpace = editControl : GetIMECompositionExclusionArea ( )
local remainingBottomUISpace = GuiRoot : GetHeight ( ) - bottomUISpace - ZO_DEFAULT_BACKDROP_ANCHOR_OFFSET
self . control : SetAnchor ( TOPLEFT , editControl , TOPLEFT , leftControlSpace , bottomControlSpace + ZO_DEFAULT_BACKDROP_ANCHOR_OFFSET )
else
self . control : SetAnchor ( BOTTOMLEFT , editControl , TOPLEFT , leftControlSpace , topControlSpace - ZO_DEFAULT_BACKDROP_ANCHOR_OFFSET )
end
end
if numCandidates > 0 then
--Init this to ZO_IME_CANDIDATES_MIN_WIDTH so we have at least that much space in the final control
local maxWidth = ZO_IME_CANDIDATES_MIN_WIDTH
--We usually get a number of pages with a fixed page size and on the last page the page size becomes smaller if we don't have enough to fill it.
--Instead of shrinking the view on the last page we lay it out to be as big as the other, just with empty space filling the rest.
end
local previousRow
local candidateTextHeight
local getMoreCandidatesEntryIndex
for i = 1 , numCandidates do
--An entry of " " is included in the list where there should be an arrow indicating more results below
if candidate == " " then
getMoreCandidatesEntryIndex = i
end
if previousRow then
else
end
if not candidateTextHeight then
candidateTextHeight = textHeight
end
if i == selectedIndex then
--Only apply the highlight if the candidate list is active
if inCandidateWindow then
end
end
previousRow = candidateRow
end
--Make all the rows the same width so the highlight is uniform across all of them
end
if getMoreCandidatesEntryIndex then
self . moreCandidatesRow : SetAnchor ( TOPLEFT , nil , TOPLEFT , 0 , candidateTextHeight * ( getMoreCandidatesEntryIndex - 1 ) )
else
end
local pageStartOffset
--How many entries to show additionally on a scrollable edge. If you can scroll up and down and this value was 1 you'd see one additional entry above the page start and one after the page end
local NUM_EXTRA_ENTRIES_ON_SCROLLABLE_EDGE = 0.65
--if we don't have enough candidates to fill even one page it doesn't scroll so just start at the top
pageStartOffset = 0
else
--if we have enough to scroll figure out in which directions we can scroll and add the proper space
local numExtraEntries
if pageStartIndex == 1 then
--Page 1, can only scroll down
numExtraEntries = NUM_EXTRA_ENTRIES_ON_SCROLLABLE_EDGE
pageStartOffset = 0
elseif ( pageStartIndex + pageSize - 1 ) == numCandidates then
--Last page, can only scroll up
numExtraEntries = NUM_EXTRA_ENTRIES_ON_SCROLLABLE_EDGE
pageStartOffset = - NUM_EXTRA_ENTRIES_ON_SCROLLABLE_EDGE
else
--Middle page, can scroll up or down
numExtraEntries = NUM_EXTRA_ENTRIES_ON_SCROLLABLE_EDGE * 2
pageStartOffset = - NUM_EXTRA_ENTRIES_ON_SCROLLABLE_EDGE
end
if numRowsOnLastPage > 0 then
--Pad out the scroll child to fill a full page
self . scrollChild : SetResizeToFitPadding ( 0 , candidateTextHeight * ( self . maxPageSize - numRowsOnLastPage ) )
end
end
local SCROLL_BAR_WIDTH = 16
--Scroll to put the page top in view taking into account one line of scroll fade
else
end
end
end |