Mercurial > wow > breuesk
comparison SelectorList.lua @ 90:dcbe1f04bb31
Bugfix
author | John@Yosemite-PC |
---|---|
date | Mon, 16 Apr 2012 07:06:27 -0400 |
parents | f0450883c283 |
children |
comparison
equal
deleted
inserted
replaced
89:b89558d3e833 | 90:dcbe1f04bb31 |
---|---|
182 button.icon:SetTexCoord(0, 1, 0, 1) | 182 button.icon:SetTexCoord(0, 1, 0, 1) |
183 end | 183 end |
184 end | 184 end |
185 | 185 |
186 | 186 |
187 | |
188 local methods = { | 187 local methods = { |
189 | 188 |
190 ["OnAcquire"] = function(self) | 189 ["OnAcquire"] = function(self) |
191 self:SetWidth(DEFAULT_SL_WIDTH) | 190 self:SetWidth(DEFAULT_SL_WIDTH) |
192 self:SetNumLines() | 191 self:SetNumLines() |
219 | 218 |
220 ["SetInteractive"] = function(self, value) | 219 ["SetInteractive"] = function(self, value) |
221 self.localstatus.enableInteractive = value | 220 self.localstatus.enableInteractive = value |
222 end, | 221 end, |
223 | 222 |
224 ["ShowScroll"] = function(self, show) -- todo: not a user function. hide. | |
225 self.showscroll = show | |
226 if show then | |
227 self.scrollbar:Show() | |
228 if self.buttons[1] then | |
229 self.buttons[1]:SetPoint("TOPRIGHT", self.slframe,"TOPRIGHT",-22,-10) | |
230 end | |
231 else | |
232 self.scrollbar:Hide() | |
233 if self.buttons[1] then | |
234 self.buttons[1]:SetPoint("TOPRIGHT", self.slframe,"TOPRIGHT",0,-10) | |
235 end | |
236 end | |
237 end, | |
238 | |
239 ["Refresh"] = function(self) | 223 ["Refresh"] = function(self) |
224 local ShowScroll = function(show) | |
225 self.showscroll = show | |
226 if show then | |
227 self.scrollbar:Show() | |
228 if self.buttons[1] then | |
229 self.buttons[1]:SetPoint("TOPRIGHT", self.slframe,"TOPRIGHT",-22,-10) | |
230 end | |
231 else | |
232 self.scrollbar:Hide() | |
233 if self.buttons[1] then | |
234 self.buttons[1]:SetPoint("TOPRIGHT", self.slframe,"TOPRIGHT",0,-10) | |
235 end | |
236 end | |
237 end | |
238 | |
240 local f = self.slframe | 239 local f = self.slframe |
241 local buttons = self.buttons | 240 local buttons = self.buttons |
242 local lines = self.lines | 241 local lines = self.lines |
243 local status = self.status or self.localstatus | 242 local status = self.status or self.localstatus |
244 | 243 |
248 local numlines = #lines | 247 local numlines = #lines |
249 local maxlines = self.numlines | 248 local maxlines = self.numlines |
250 | 249 |
251 if numlines <= maxlines then | 250 if numlines <= maxlines then |
252 status.scrollvalue = 0 | 251 status.scrollvalue = 0 |
253 self:ShowScroll(false) | 252 ShowScroll(false) |
254 first, last = 1, numlines | 253 first, last = 1, numlines |
255 else | 254 else |
256 self:ShowScroll(true) | 255 ShowScroll(true) |
257 self.noupdate = true | 256 self.noupdate = true |
258 self.scrollbar:SetMinMaxValues(0, numlines - maxlines) | 257 self.scrollbar:SetMinMaxValues(0, numlines - maxlines) |
259 if numlines - status.scrollvalue < maxlines then | 258 if numlines - status.scrollvalue < maxlines then |
260 status.scrollvalue = numlines - maxlines | 259 status.scrollvalue = numlines - maxlines |
261 end | 260 end |