comparison Frames.lua @ 145:6a52272a0e5a

Added a craft button to the queue window. This is still very experimental.
author Zerotorescue
date Thu, 20 Jan 2011 00:07:47 +0100
parents 12a8ea5af671
children 5d13830e8b0d
comparison
equal deleted inserted replaced
144:12a8ea5af671 145:6a52272a0e5a
398 btnCancel:SetScript("OnClick", function(this) this.OnClick(this); end); 398 btnCancel:SetScript("OnClick", function(this) this.OnClick(this); end);
399 btnCancel:SetScript("OnEnter", ShowTooltip); 399 btnCancel:SetScript("OnEnter", ShowTooltip);
400 btnCancel:SetScript("OnLeave", HideTooltip); 400 btnCancel:SetScript("OnLeave", HideTooltip);
401 401
402 frame.btnCancel = btnCancel; 402 frame.btnCancel = btnCancel;
403
404 -- Craft
405 local btnCraft = CreateFrame("Button", "$parentCraft", frame, "UIPanelButtonTemplate");
406 btnCraft:SetHeight(21);
407 --btnCraft:SetWidth(125);
408 btnCraft:SetPoint("TOPLEFT", btnProceed, "TOPRIGHT", 15, 0);
409 btnCraft:SetPoint("BOTTOMRIGHT", btnCancel, "BOTTOMLEFT", -15, 0);
410 btnCraft:SetScript("OnClick", function(this) this.OnClick(this); end);
411 btnCraft:SetScript("OnEnter", ShowTooltip);
412 btnCraft:SetScript("OnLeave", HideTooltip);
413
414 frame.btnCraft = btnCraft;
403 415
404 -- Because the scrolling table code-behind will change the scrolltable element's height, we can't rely on that. Make a dummy frame which we can measure 416 -- Because the scrolling table code-behind will change the scrolltable element's height, we can't rely on that. Make a dummy frame which we can measure
405 local frmMeasureDummy = CreateFrame("Frame", nil, frame); 417 local frmMeasureDummy = CreateFrame("Frame", nil, frame);
406 frmMeasureDummy:SetPoint("TOP", frame.lblDescription, "BOTTOM", 0, -18); 418 frmMeasureDummy:SetPoint("TOP", frame.lblDescription, "BOTTOM", 0, -18);
407 frmMeasureDummy:SetPoint("LEFT", frame, "LEFT", 15, 0); 419 frmMeasureDummy:SetPoint("LEFT", frame, "LEFT", 15, 0);
618 InventoriumQueuerUnqueueables.scrollTable:SetData(unqueueables); 630 InventoriumQueuerUnqueueables.scrollTable:SetData(unqueueables);
619 631
620 InventoriumQueuer:Show(); 632 InventoriumQueuer:Show();
621 end 633 end
622 634
623 function addon:SetQueueFrameSettings(title, description, proceed, cancel, headers, unqueueablesHeaders) 635 function addon:SetQueueFrameSettings(title, description, proceed, cancel, craft, headers, unqueueablesHeaders)
624 local frame = InventoriumQueuer; 636 local frame = InventoriumQueuer;
625 637
626 frame.lblTitle:SetText(title); 638 frame.lblTitle:SetText(title);
627 -- Adjust size for the title background 639 -- Adjust size for the title background
628 frame.titleBackground:SetWidth((frame.lblTitle:GetWidth() or 0) + 10); -- 10 pixels margin 640 frame.titleBackground:SetWidth((frame.lblTitle:GetWidth() or 0) + 10); -- 10 pixels margin
637 frame.btnCancel:SetText(cancel.text); 649 frame.btnCancel:SetText(cancel.text);
638 frame.btnCancel.tooltipTitle = cancel.tooltipTitle; 650 frame.btnCancel.tooltipTitle = cancel.tooltipTitle;
639 frame.btnCancel.tooltip = cancel.tooltip; 651 frame.btnCancel.tooltip = cancel.tooltip;
640 frame.btnCancel.OnClick = cancel.onClick; 652 frame.btnCancel.OnClick = cancel.onClick;
641 653
654 frame.btnCraft:SetText(craft.text);
655 frame.btnCraft.tooltipTitle = craft.tooltipTitle;
656 frame.btnCraft.tooltip = craft.tooltip;
657 frame.btnCraft.OnClick = craft.onClick;
658
642 frame.scrollTable:SetDisplayCols(headers); 659 frame.scrollTable:SetDisplayCols(headers);
643 660
644 InventoriumQueuerUnqueueables.scrollTable:SetDisplayCols(unqueueablesHeaders); 661 InventoriumQueuerUnqueueables.scrollTable:SetDisplayCols(unqueueablesHeaders);
645 end 662 end