lotrointerface.com
Search Downloads

LoTROInterface SVN SequenceBars

[/] [trunk/] [Thurallor/] [SequenceBars/] [EventTableControl.lua] - Blame information for rev 179

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 176 Thurallor-7095
EventTableControl = class(Thurallor.UI.TableControl);
2 Thurallor-7095
 
3 177 Thurallor-7095
local barPrefix = L:GetText("/DirectoryWindow/EventTable/Bar");
4 Thurallor-7095
local groupPrefix = L:GetText("/DirectoryWindow/EventTable/Group");
5 Thurallor-7095
local hotkeyPrefix = L:GetText("/DirectoryWindow/EventTable/Hotkey");
6 Thurallor-7095
local chatTriggerPrefix = L:GetText("/DirectoryWindow/EventTable/ChatTrigger");
7 Thurallor-7095
 
8 176 Thurallor-7095
function EventTableControl:Constructor(manager)
9 Thurallor-7095
    Thurallor.UI.TableControl.Constructor(self);
10 Thurallor-7095
    self.manager = manager;
11 177 Thurallor-7095
    self.settings = manager.settings.eventDirectory or {};
12 Thurallor-7095
    manager.settings.eventDirectory = self.settings;
13 Thurallor-7095
    self.cells = {};
14 Thurallor-7095
    self.constructing = true;
15 179 Thurallor-7095
    self.via = L:GetText("/DirectoryWindow/EventTable/via");
16 176 Thurallor-7095
 
17 177 Thurallor-7095
    -- Disable sorting of all columns except event name
18 Thurallor-7095
    local textSort = self.style.column.SortMethod;
19 Thurallor-7095
    self.style.column.SortMethod = nil;
20 Thurallor-7095
 
21 Thurallor-7095
    self.style.heading.FontStyle = Turbine.UI.FontStyle.Outline;
22 Thurallor-7095
    self.style.heading.OutlineColor = Turbine.UI.Color.Black;
23 Thurallor-7095
    self.style.cell.FontStyle = Turbine.UI.FontStyle.Outline;
24 Thurallor-7095
    self.style.cell.OutlineColor = Turbine.UI.Color.Black;
25 Thurallor-7095
    --self.style.marquee.AntsEnabled = false;
26 Thurallor-7095
 
27 Thurallor-7095
    -- Disable cell locking/unlocking
28 Thurallor-7095
    self.options.columnLockingEnabled = false;
29 Thurallor-7095
 
30 176 Thurallor-7095
    local prevContext = L:SetContext("/DirectoryWindow/EventTable");
31 177 Thurallor-7095
    self:AddColumn("eventName", L:GetText("EventName"), 1, textSort);
32 Thurallor-7095
    self:AddColumn("generators", L:GetText("TriggeredBy"), 1, nil);
33 176 Thurallor-7095
    self:AddColumn("watchers", L:GetText("WatchedBy"), 1, nil);
34 Thurallor-7095
    self:AddColumn("script", L:GetText("LuaScript"), 1, nil);
35 Thurallor-7095
    L:SetContext(prevContext);
36 177 Thurallor-7095
 
37 Thurallor-7095
    if (self.settings.presentation) then
38 Thurallor-7095
        self:SetPresentation(self.settings.presentation);
39 Thurallor-7095
    end
40 Thurallor-7095
 
41 Thurallor-7095
    self:FillTable();
42 Thurallor-7095
    self:ReSort(true);
43 Thurallor-7095
    self.constructing = false;
44 176 Thurallor-7095
end
45 Thurallor-7095
 
46 177 Thurallor-7095
function EventTableControl:PresentationChanged(args)
47 Thurallor-7095
    if (not self.constructing) then
48 Thurallor-7095
        self.settings.presentation = self:GetPresentation();
49 Thurallor-7095
        --self:SaveSettings(false);
50 Thurallor-7095
    end
51 Thurallor-7095
end
52 Thurallor-7095
 
53 Thurallor-7095
function EventTableControl:AddMouseOverHighlight(control, foreColor)
54 Thurallor-7095
    control.foreColor = foreColor;
55 Thurallor-7095
    control:SetForeColor(control.foreColor);
56 Thurallor-7095
    control.MouseEnter = function(ctl)
57 Thurallor-7095
        ctl:SetForeColor(Turbine.UI.Color.White);
58 Thurallor-7095
        ctl:SetBackColor(Turbine.UI.Color(1, 0, 0.282, 0.498));
59 Thurallor-7095
    end
60 Thurallor-7095
    control.MouseMove = control.MouseEnter;
61 Thurallor-7095
    control.MouseLeave = function(ctl)
62 Thurallor-7095
        ctl:SetForeColor(ctl.foreColor);
63 Thurallor-7095
        ctl:SetBackColor(nil);
64 Thurallor-7095
    end
65 Thurallor-7095
end
66 Thurallor-7095
 
67 179 Thurallor-7095
function EventTableControl:AddTextItem(cell, top, color, font, text)
68 Thurallor-7095
    local control = Thurallor.UI.ComplexLabel();
69 Thurallor-7095
    control:SetParent(cell);
70 Thurallor-7095
    control:SetPosition(1, top);
71 Thurallor-7095
    control:SetFont(font);
72 Thurallor-7095
    control:SetForeColor(color);
73 Thurallor-7095
    control:SetInteriorAlignment(Turbine.UI.ContentAlignment.TopLeft);
74 Thurallor-7095
    local label = control:SetText(" " .. text .. " ");
75 Thurallor-7095
    self:AddMouseOverHighlight(label, color);
76 Thurallor-7095
    control:SetForeColor(Turbine.UI.Color.Silver);
77 Thurallor-7095
    control:SetFont(Turbine.UI.Lotro.Font.Verdana14);
78 Thurallor-7095
    control:SetZOrder(1);
79 Thurallor-7095
    control:SetSize(cell:GetWidth()- 2, 15);
80 Thurallor-7095
    AddCallback(cell, "SizeChanged", function()
81 Thurallor-7095
        control:SetWidth(cell:GetWidth() - 2);
82 Thurallor-7095
    end);
83 Thurallor-7095
    return control, label;
84 Thurallor-7095
end
85 Thurallor-7095
 
86 Thurallor-7095
function EventTableControl:AddNodeMouseBehaviors(label, node)
87 Thurallor-7095
    label.node = node;
88 Thurallor-7095
    self:AddMouseOverHighlight(label, node:GetColor());
89 Thurallor-7095
    label.MouseClick = function(ctl, args)
90 177 Thurallor-7095
        -- When row is selected, left- or right-click displays the settings menu.
91 Thurallor-7095
        ctl.node:ShowSettingsMenu(true);
92 Thurallor-7095
    end
93 179 Thurallor-7095
end
94 Thurallor-7095
 
95 Thurallor-7095
function EventTableControl:AddNodeLink(cell, top, node, includes)
96 Thurallor-7095
    local text = node:GetName();
97 Thurallor-7095
    local control, label = self:AddTextItem(cell, top, node:GetColor(), Turbine.UI.Lotro.Font.TrajanPro15, text);
98 Thurallor-7095
    self:AddNodeMouseBehaviors(label, node);
99 Thurallor-7095
 
100 Thurallor-7095
    if (includes and next(includes)) then
101 Thurallor-7095
        control:SetForeColor(Turbine.UI.Color.Silver);
102 Thurallor-7095
        control:SetFont(Turbine.UI.Lotro.Font.Verdana14);
103 Thurallor-7095
        control:AddText(self.via);
104 Thurallor-7095
        text = text .. " (" .. self.via;
105 Thurallor-7095
        for bar, _ in pairs(includes) do
106 Thurallor-7095
            control:SetFont(Turbine.UI.Lotro.Font.TrajanPro15);
107 Thurallor-7095
            control:SetForeColor(bar:GetColor());
108 Thurallor-7095
            local barName = bar:GetName();
109 Thurallor-7095
            local label = control:AddText(" " .. barName .. " ");
110 Thurallor-7095
            text = text .. " " .. barName .. ",";
111 Thurallor-7095
            self:AddNodeMouseBehaviors(label, bar);
112 Thurallor-7095
        end
113 Thurallor-7095
        control:SetForeColor(Turbine.UI.Color.Silver);
114 Thurallor-7095
        control:SetFont(Turbine.UI.Lotro.Font.Verdana14);
115 Thurallor-7095
        text = text:gsub(",$", ")");
116 Thurallor-7095
    end
117 Thurallor-7095
 
118 177 Thurallor-7095
    return top + 15, text;
119 Thurallor-7095
end
120 Thurallor-7095
 
121 Thurallor-7095
function EventTableControl:AddChatTriggerLink(cell, top, channel, pattern, text)
122 Thurallor-7095
    text = chatTriggerPrefix .. text;
123 179 Thurallor-7095
    local control, label = self:AddTextItem(cell, top, Turbine.UI.Color.Silver, Turbine.UI.Lotro.Font.Verdana14, text);
124 Thurallor-7095
    label.channel, label.pattern = channel, pattern;
125 Thurallor-7095
    self:AddMouseOverHighlight(label, Turbine.UI.Color.Silver);
126 Thurallor-7095
    AddCallback(label, "MouseClick", function()
127 177 Thurallor-7095
        DoCallbacks(self, "ChatTriggerClicked", { ChatType = channel; Pattern = pattern });
128 Thurallor-7095
    end);
129 Thurallor-7095
    return top + 14, text;
130 Thurallor-7095
end
131 Thurallor-7095
 
132 Thurallor-7095
function EventTableControl:AddHotkeyLink(cell, top, text)
133 Thurallor-7095
    text = hotkeyPrefix .. text;
134 179 Thurallor-7095
    local control, label = self:AddTextItem(cell, top, Turbine.UI.Color.Silver, Turbine.UI.Lotro.Font.Verdana14, text);
135 Thurallor-7095
    self:AddMouseOverHighlight(label, Turbine.UI.Color.Silver);
136 Thurallor-7095
    AddCallback(label, "MouseClick", function()
137 177 Thurallor-7095
        DoCallbacks(self, "HotkeyClicked");
138 Thurallor-7095
    end);
139 Thurallor-7095
    return top + 14, text;
140 Thurallor-7095
end
141 Thurallor-7095
 
142 Thurallor-7095
function EventTableControl:MakeEmptyCell(cell)
143 Thurallor-7095
    cell:GetControls():Clear();
144 Thurallor-7095
    cell:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleCenter);
145 Thurallor-7095
    cell:SetFont(Turbine.UI.Lotro.Font.Verdana14);
146 Thurallor-7095
    cell:SetForeColor(Turbine.UI.Color.Silver);
147 Thurallor-7095
    cell:SetMultiline(false);
148 Thurallor-7095
    cell:SetText("—");
149 Thurallor-7095
    cell.GetText = function() return ""; end -- suppress this line in row tooltip
150 Thurallor-7095
end
151 Thurallor-7095
 
152 179 Thurallor-7095
function EventTableControl:MakeNodeListCell(cell, nodeList, includes, hotkeyList, chatTriggerList)
153 177 Thurallor-7095
    if (not nodeList and not hotkeyList and not chatTriggerList) then
154 Thurallor-7095
        return self:MakeEmptyCell(cell);
155 Thurallor-7095
    end
156 178 Thurallor-7095
    cell:SetText(nil);
157 177 Thurallor-7095
    cell:GetControls():Clear();
158 Thurallor-7095
 
159 Thurallor-7095
    -- Display node list
160 Thurallor-7095
    local top, text = 5;
161 Thurallor-7095
    local tooltipText = {};
162 Thurallor-7095
    if (nodeList) then
163 Thurallor-7095
        table.sort(nodeList, function(a, b)
164 Thurallor-7095
            return a:GetName() < b:GetName();
165 Thurallor-7095
        end);
166 Thurallor-7095
        for n, node in ipairs(nodeList) do
167 179 Thurallor-7095
            top, text = self:AddNodeLink(cell, top, node, includes[node]);
168 177 Thurallor-7095
            local prefix = barPrefix;
169 Thurallor-7095
            if (node:CanHaveChildren()) then
170 Thurallor-7095
                prefix = groupPrefix;
171 Thurallor-7095
            end
172 Thurallor-7095
            table.insert(tooltipText, prefix .. text);
173 Thurallor-7095
        end
174 Thurallor-7095
    end
175 Thurallor-7095
 
176 Thurallor-7095
    -- Display hotkey list
177 Thurallor-7095
    if (hotkeyList) then
178 Thurallor-7095
        table.sort(hotkeyList);
179 Thurallor-7095
        for n, text in ipairs(hotkeyList) do
180 Thurallor-7095
            top, text = self:AddHotkeyLink(cell, top, text);
181 Thurallor-7095
            table.insert(tooltipText, text);
182 Thurallor-7095
        end
183 Thurallor-7095
    end
184 Thurallor-7095
 
185 Thurallor-7095
    -- Display chat trigger list
186 Thurallor-7095
    if (chatTriggerList) then
187 Thurallor-7095
        for _, info in ipairs(chatTriggerList) do
188 Thurallor-7095
            local channel, pattern, description = unpack(info);
189 Thurallor-7095
            top, text = self:AddChatTriggerLink(cell, top, channel, pattern, description);
190 Thurallor-7095
            table.insert(tooltipText, description);
191 Thurallor-7095
        end
192 Thurallor-7095
    end
193 Thurallor-7095
 
194 Thurallor-7095
    cell.text = table.concat(tooltipText, "\n");
195 Thurallor-7095
    cell.GetText = function(ctl)
196 Thurallor-7095
        return ctl.text;
197 Thurallor-7095
    end
198 Thurallor-7095
    cell.SetWidth = function(ctl, width)
199 Thurallor-7095
        Turbine.UI.Lotro.TextBox.SetWidth(ctl, width);
200 Thurallor-7095
        DoCallbacks(ctl, "SizeChanged");
201 Thurallor-7095
    end
202 Thurallor-7095
    cell:SetHeight(top + 5);
203 Thurallor-7095
end
204 Thurallor-7095
 
205 Thurallor-7095
function EventTableControl:FillTable()
206 Thurallor-7095
    local eventNames = self.manager:GetEventNames();
207 Thurallor-7095
    for _, eventName in ipairs(eventNames) do
208 Thurallor-7095
        self:AppendRow(eventName);
209 Thurallor-7095
    end
210 Thurallor-7095
end
211 Thurallor-7095
 
212 Thurallor-7095
function EventTableControl:AppendRow(eventName)
213 Thurallor-7095
    local manager = self.manager;
214 Thurallor-7095
    manager.settings.userEvents[eventName] = manager.settings.userEvents[eventName] or {};
215 Thurallor-7095
    local settings = manager.settings.userEvents[eventName];
216 Thurallor-7095
 
217 Thurallor-7095
    local rowContainer, cells, rowNum = self:AddRow(eventName, true);
218 Thurallor-7095
    self.cells[eventName] = cells;
219 Thurallor-7095
 
220 Thurallor-7095
    -- Add behaviors to event name cell
221 Thurallor-7095
    cells.eventName.eventName = eventName;
222 Thurallor-7095
    cells.eventName:SetReadOnly(false);
223 Thurallor-7095
    cells.eventName.Evaluate = function(cell, newName)
224 Thurallor-7095
        local newName = cell:GetText();
225 Thurallor-7095
        newName = newName:gsub("^[%s]+", "");
226 Thurallor-7095
        newName = newName:gsub("[%s]+$", "");
227 Thurallor-7095
        local eventExists = self:GetRow(newName);
228 Thurallor-7095
        if ((newName == "") or (eventExists and newName ~= cell.eventName)) then
229 Thurallor-7095
            cell:SetBackColor(Turbine.UI.Color.Red);
230 Thurallor-7095
        else
231 Thurallor-7095
            cell:SetBackColor(Turbine.UI.Color.Black);
232 Thurallor-7095
            return newName;
233 Thurallor-7095
        end
234 Thurallor-7095
    end
235 Thurallor-7095
    AddCallback(cells.eventName, "FocusGained", function(cell)
236 Thurallor-7095
        cell:SetForeColor(Turbine.UI.Color.White);
237 Thurallor-7095
        cell:Evaluate();
238 Thurallor-7095
    end);
239 Thurallor-7095
    AddCallback(cells.eventName, "TextChanged", function(cell)
240 Thurallor-7095
        cell:Evaluate();
241 Thurallor-7095
    end);
242 Thurallor-7095
    AddCallback(cells.eventName, "FocusLost", function(cell)
243 Thurallor-7095
        local newName = cell:Evaluate();
244 Thurallor-7095
        if (newName and (newName ~= cell.eventName)) then
245 Thurallor-7095
            self:RenameEvent(cell.eventName, newName);
246 Thurallor-7095
        else
247 Thurallor-7095
            cell:SetText(cell.eventName);
248 Thurallor-7095
        end
249 Thurallor-7095
        cell:SetForeColor(Turbine.UI.Color.Silver);
250 Thurallor-7095
        cell:SetBackColor(Turbine.UI.Color(1, 0, 0.19, 0.33));
251 Thurallor-7095
    end);
252 Thurallor-7095
 
253 Thurallor-7095
    -- Add behaviors to Lua script cell
254 Thurallor-7095
    cells.script.eventName = eventName;
255 178 Thurallor-7095
    cells.script:SetMultiline(true);
256 177 Thurallor-7095
    cells.script.UpdateHeight = function(cell)
257 Thurallor-7095
        local _, lines = cell:GetText():gsub("\n", "");
258 Thurallor-7095
        cell:SetHeight(10 + (lines + 1) * 12);
259 Thurallor-7095
    end
260 Thurallor-7095
    cells.script.Evaluate = function(cell, script)
261 Thurallor-7095
        local success = loadstring(script);
262 Thurallor-7095
        if (success) then
263 Thurallor-7095
            cell:SetBackColor(Turbine.UI.Color.Black);
264 Thurallor-7095
        else
265 Thurallor-7095
            cell:SetBackColor(Turbine.UI.Color.Red);
266 Thurallor-7095
        end
267 Thurallor-7095
    end
268 178 Thurallor-7095
    AddCallback(cells.script, "MouseEnter", function(cell)
269 Thurallor-7095
        -- Weird bug: Cell contents aren't drawn properly if I set this flag at initialization.
270 Thurallor-7095
        -- Also doesn't work in the "FocusGained" handler; apparently that's too late.
271 Thurallor-7095
        cell:SetReadOnly(false);
272 Thurallor-7095
    end);
273 177 Thurallor-7095
    AddCallback(cells.script, "FocusGained", function(cell)
274 Thurallor-7095
        cell:SetForeColor(Turbine.UI.Color.White);
275 Thurallor-7095
        local settings = manager.settings.userEvents[cell.eventName];
276 Thurallor-7095
        if (settings.luaScript) then
277 Thurallor-7095
            cell:Evaluate(settings.luaScript);
278 Thurallor-7095
        else
279 Thurallor-7095
            cell:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft);
280 Thurallor-7095
            cell:SetFont(Turbine.UI.Lotro.Font.LucidaConsole12);
281 Thurallor-7095
            cell:SetText("");
282 Thurallor-7095
            cell.GetText = nil;
283 Thurallor-7095
        end
284 Thurallor-7095
    end);
285 Thurallor-7095
    AddCallback(cells.script, "TextChanged", function(cell)
286 Thurallor-7095
        local text = cell:GetText();
287 Thurallor-7095
        cell:Evaluate(text);
288 Thurallor-7095
        text = text:gsub("^[%s\n]+", "");
289 Thurallor-7095
        text = text:gsub("[%s\n]+$", "");
290 Thurallor-7095
        if (text == "") then
291 Thurallor-7095
            text = nil;
292 Thurallor-7095
        end
293 Thurallor-7095
        manager:SetEventScript(cell.eventName, text);
294 Thurallor-7095
    end);
295 Thurallor-7095
    AddCallback(cells.script, "FocusLost", function(cell)
296 Thurallor-7095
        cell:SetForeColor(Turbine.UI.Color.Silver);
297 Thurallor-7095
        cell:SetBackColor(Turbine.UI.Color(1, 0, 0.19, 0.33));
298 Thurallor-7095
        self:UpdateCellContents(cell.eventName);
299 Thurallor-7095
    end);
300 Thurallor-7095
 
301 Thurallor-7095
    -- Add right-click behavior to show bar/group context menu if row isn't selected
302 Thurallor-7095
    AddCallback(rowContainer, "ContextMenu", function(ctl, args)
303 Thurallor-7095
        -- Find which bar/group was right-clicked on, if any
304 Thurallor-7095
        for _, cell in pairs(rowContainer.cells) do
305 Thurallor-7095
            local controls = cell:GetControls();
306 Thurallor-7095
            for c = 1, controls:GetCount() do
307 Thurallor-7095
                local control = controls:Get(c);
308 Thurallor-7095
                if (control.node) then
309 Thurallor-7095
                    local left, top = control:PointToScreen(0, 0);
310 Thurallor-7095
                    local width, height = control:GetSize();
311 Thurallor-7095
                    local right, bottom = left + width, top + height;
312 Thurallor-7095
                    local mouseX, mouseY = Turbine.UI.Display.GetMousePosition();
313 Thurallor-7095
                    if ((mouseX >= left) and (mouseX < right) and (mouseY >= top) and (mouseY < bottom)) then
314 Thurallor-7095
                        return control.node:ShowSettingsMenu(true);
315 Thurallor-7095
                    end
316 Thurallor-7095
                end
317 Thurallor-7095
            end
318 Thurallor-7095
        end
319 Thurallor-7095
    end);
320 Thurallor-7095
    AddCallback(rowContainer, "MouseClick", function(ctl, args)
321 Thurallor-7095
        DoCallbacks(ctl, "ContextMenu", args);
322 Thurallor-7095
    end);
323 Thurallor-7095
 
324 Thurallor-7095
    self:UpdateCellContents(eventName);
325 Thurallor-7095
end
326 Thurallor-7095
 
327 Thurallor-7095
-- Updates the "Generated by" and "Watched by" cells and readjusts the row height
328 Thurallor-7095
function EventTableControl:UpdateCellContents(eventName)
329 Thurallor-7095
    local cells = self.cells[eventName];
330 Thurallor-7095
 
331 Thurallor-7095
    -- Display event name
332 Thurallor-7095
    cells.eventName:SetText(eventName);
333 Thurallor-7095
    cells.eventName:SetHeight(24);
334 Thurallor-7095
 
335 Thurallor-7095
    -- Create list of generators
336 179 Thurallor-7095
    local barList, includes = self.manager:GetEventGenerators(eventName);
337 177 Thurallor-7095
    local hotkeyList = self.manager:GetEventHotkeys(eventName);
338 Thurallor-7095
    local chatTriggerList = self.manager:GetEventChatTriggers(eventName);
339 179 Thurallor-7095
    self:MakeNodeListCell(cells.generators, barList, includes, hotkeyList, chatTriggerList);
340 177 Thurallor-7095
 
341 Thurallor-7095
    -- Create list of watchers
342 Thurallor-7095
    local nodeList = self.manager:GetEventListeners(eventName);
343 179 Thurallor-7095
    self:MakeNodeListCell(cells.watchers, nodeList, {});
344 177 Thurallor-7095
 
345 Thurallor-7095
    -- Display lua script
346 Thurallor-7095
    local settings = self.manager.settings.userEvents[eventName];
347 Thurallor-7095
    if (settings.luaScript) then
348 Thurallor-7095
        cells.script:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft);
349 Thurallor-7095
        cells.script:SetFont(Turbine.UI.Lotro.Font.LucidaConsole12);
350 Thurallor-7095
        cells.script:SetText(settings.luaScript);
351 Thurallor-7095
    else
352 Thurallor-7095
        self:MakeEmptyCell(cells.script);
353 Thurallor-7095
    end
354 Thurallor-7095
    cells.script:UpdateHeight();
355 Thurallor-7095
 
356 Thurallor-7095
    self:EqualizeCellHeights(eventName);
357 Thurallor-7095
end
358 Thurallor-7095
 
359 Thurallor-7095
function EventTableControl:EqualizeCellHeights(eventName)
360 Thurallor-7095
    local cells = self.cells[eventName];
361 Thurallor-7095
 
362 Thurallor-7095
    -- Find maximum cell height
363 Thurallor-7095
    local maxCellHeight = 0;
364 Thurallor-7095
    for colName, cell in pairs(cells) do
365 Thurallor-7095
        maxCellHeight = math.max(maxCellHeight, cell:GetHeight());
366 Thurallor-7095
    end
367 Thurallor-7095
 
368 Thurallor-7095
    -- Make all cells the same height.
369 Thurallor-7095
    for colName, cell in pairs(cells) do
370 Thurallor-7095
        cell:SetHeight(maxCellHeight);
371 Thurallor-7095
    end
372 Thurallor-7095
 
373 Thurallor-7095
    -- Adjust height of rowContainer
374 Thurallor-7095
    local rowNum = self.rows:IndexOfItem(self:GetRow(eventName));
375 Thurallor-7095
    self:SetRowVisible(rowNum, true);
376 Thurallor-7095
end
377 Thurallor-7095
 
378 Thurallor-7095
function EventTableControl:CreateEvent(eventName)
379 Thurallor-7095
    self.manager:CreateUserEvent(eventName);
380 Thurallor-7095
    self:AppendRow(eventName);
381 Thurallor-7095
    self:ReSort();
382 Thurallor-7095
    self:SelectRow(eventName);
383 Thurallor-7095
    self:EnsureVisible(eventName);
384 Thurallor-7095
end
385 Thurallor-7095
 
386 Thurallor-7095
function EventTableControl:RenameEvent(oldName, newName)
387 Thurallor-7095
    self.manager:RenameUserEvent(oldName, newName);
388 Thurallor-7095
end
389 Thurallor-7095
 
390 Thurallor-7095
function EventTableControl:DeleteEvent(eventName)
391 Thurallor-7095
    self.manager:DeleteUserEvent(eventName);
392 Thurallor-7095
    self:DeleteRow(eventName);
393 Thurallor-7095
end

All times are GMT -5. The time now is 03:21 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui