/
PhanxConfig-Panel |
Simple background panel widget generator. |
Requires LibStub. |
https://github.com/phanx/PhanxConfigWidgets |
Copyright (c) 2009-2014 Phanx. All rights reserved. |
See the accompanying README and LICENSE files for more information. |
https://github.com/phanx/PhanxConfigWidgets |
----------------------------------------------------------------------]] |
local MINOR_VERSION = tonumber(strmatch("$Revision$", "%d+")) |
local MINOR_VERSION = 172 |
local lib, oldminor = LibStub:NewLibrary("PhanxConfig-Panel", MINOR_VERSION) |
if not lib then return end |
Simple slider widget generator. |
Based on tekKonfig-Slider and AceGUI-3.0-Slider. |
Requires LibStub. |
https://github.com/phanx/PhanxConfigWidgets |
Copyright (c) 2009-2014 Phanx. All rights reserved. |
See the accompanying README and LICENSE files for more information. |
https://github.com/phanx/PhanxConfigWidgets |
----------------------------------------------------------------------]] |
local MINOR_VERSION = tonumber(strmatch("$Revision$", "%d+")) |
local MINOR_VERSION = 176 |
local lib, oldminor = LibStub:NewLibrary("PhanxConfig-Slider", MINOR_VERSION) |
if not lib then return end |
Key binding button widget generator. |
Originally based on AceGUI-3.0-Keybinding. |
Requires LibStub. |
https://github.com/phanx/PhanxConfigWidgets |
Copyright (c) 2009-2014 Phanx. All rights reserved. |
See the accompanying README and LICENSE files for more information. |
https://github.com/phanx/PhanxConfigWidgets |
----------------------------------------------------------------------]] |
local MINOR_VERSION = 172 |
local PhanxConfigButton = LibStub:GetLibrary("PhanxConfig-Button", true) |
assert(PhanxConfigButton, "PhanxConfig-KeyBinding requires PhanxConfig-Button") |
local MINOR_VERSION = tonumber(string.match("$Revision$", "%d+")) |
local lib, oldminor = LibStub:NewLibrary("PhanxConfig-KeyBinding", MINOR_VERSION) |
if not lib then return end |
Simple checkbox widget generator. |
Originally based on tekKonfig-Checkbox by Tekkub. |
Requires LibStub. |
https://github.com/phanx/PhanxConfigWidgets |
Copyright (c) 2009-2014 Phanx. All rights reserved. |
See the accompanying README and LICENSE files for more information. |
https://github.com/phanx/PhanxConfigWidgets |
----------------------------------------------------------------------]] |
local MINOR_VERSION = tonumber(strmatch("$Revision$", "%d+")) |
local MINOR_VERSION = 176 |
local lib, oldminor = LibStub:NewLibrary("PhanxConfig-Checkbox", MINOR_VERSION) |
if not lib then return end |
PhanxConfig-Header |
Simple options panel header generator. |
Requires LibStub. |
https://github.com/phanx/PhanxConfigWidgets |
Copyright (c) 2009-2014 Phanx. All rights reserved. |
See the accompanying README and LICENSE files for more information. |
https://github.com/phanx/PhanxConfigWidgets |
----------------------------------------------------------------------]] |
local MINOR_VERSION = tonumber(strmatch("$Revision$", "%d+")) |
local MINOR_VERSION = 172 |
local lib, oldminor = LibStub:NewLibrary("PhanxConfig-Header", MINOR_VERSION) |
if not lib then return end |
may change at any time without any warning. If you are interested in |
using it, you are strongly encouraged to fork and rename it. |
If you need to contact me, you can send me (Phanx) a private message |
on WoWInterface or WowAce, or email me at <addons@phanx.net>. |
License |
---------- |
Copyright (c) 2009-2014 Phanx. All rights reserved. |
See the accompanying LICENSE file for information about the conditions |
under which redistribution and modification may be allowed. |
Do not upload this library to other websites. Do not distribute modified |
versions of this library under the same or a similar name. Refer to the |
included [LICENSE.txt][] for more info. |
[LICENSE.txt]: https://github.com/Phanx/PhanxConfigWidgets/blob/master/LICENSE.txt |
PhanxConfig-Button |
Simple button widget generator. |
Requires LibStub. |
https://github.com/phanx/PhanxConfigWidgets |
Copyright (c) 2009-2014 Phanx. All rights reserved. |
See the accompanying README and LICENSE files for more information. |
https://github.com/phanx/PhanxConfigWidgets |
----------------------------------------------------------------------]] |
local MINOR_VERSION = tonumber(string.match("$Revision$", "%d+")) |
local MINOR_VERSION = 172 |
local lib, oldminor = LibStub:NewLibrary("PhanxConfig-Button", MINOR_VERSION) |
if not lib then return end |
PhanxConfig-OptionsPanel |
Simple options panel frame generator. |
Requires LibStub. |
https://github.com/phanx/PhanxConfigWidgets |
Copyright (c) 2009-2014 Phanx. All rights reserved. |
See the accompanying README and LICENSE files for more information. |
https://github.com/phanx/PhanxConfigWidgets |
----------------------------------------------------------------------]] |
local MINOR_VERSION = tonumber(string.match("$Revision$", "%d+")) |
local MINOR_VERSION = 172 |
local lib, oldminor = LibStub:NewLibrary("PhanxConfig-OptionsPanel", MINOR_VERSION) |
if not lib then return end |
Simple color picker widget generator. |
Based on OmniCC_Options by Tuller. |
Requires LibStub. |
https://github.com/phanx/PhanxConfigWidgets |
Copyright (c) 2009-2014 Phanx. All rights reserved. |
See the accompanying README and LICENSE files for more information. |
https://github.com/phanx/PhanxConfigWidgets |
----------------------------------------------------------------------]] |
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+")) |
local MINOR_VERSION = 176 |
local lib, oldminor = LibStub:NewLibrary("PhanxConfig-ColorPicker", MINOR_VERSION) |
if not lib then return end |
Simple scrolling dropdown widget generator. |
Based on tekKonfig-Dropdown by Tekkub and OmniCC_Options by Tuller. |
Requires LibStub. |
https://github.com/phanx/PhanxConfigWidgets |
Copyright (c) 2009-2014 Phanx. All rights reserved. |
See the accompanying README and LICENSE files for more information. |
https://github.com/phanx/PhanxConfigWidgets |
----------------------------------------------------------------------]] |
local MINOR_VERSION = tonumber(strmatch("$Revision$", "%d+")) |
local MINOR_VERSION = 182 |
local lib, oldminor = LibStub:NewLibrary("PhanxConfig-Dropdown", MINOR_VERSION) |
if not lib then return end |
end |
function methods:SetValue(value, text) |
self.selected = value |
if not text and self.items and type(self.items[1]) == "table" then |
local found |
for i = 1, #self.items do |
local item = self.items[i] |
if type(item) == "table" and item.value == value then |
text = item.text |
found = true |
break |
end |
end |
if not found then |
text = CUSTOM |
end |
end |
self.valueText:SetText(text or value) |
end |
self.valueText:SetFontObject(GameFontDisableSmall) |
self.button:Disable() |
end |
function methods:SetEnabled(enable) |
if enable then |
self:Enable() |
else |
self:Disable() |
end |
end |
------------------------------------------------------------------------ |
## Author: Phanx |
## X-Email: addons@phanx.net |
## X-Copyright: Copyright (c) 2009-2014 Phanx. All rights reserved. |
## X-License: See the accompanying LICENSE file for details. |
## X-Website: https://github.com/Phanx/PhanxConfigWidgets |
## OptionalDependencies: LibStub |
Copyright (c) 2009-2014 Phanx. All rights reserved.Phanx. All rights reserved. |
Copyright (c) 2009-2014 Phanx <addons@phanx.net>. All rights reserved. |
Permission is granted for anyone to use, read, or otherwise interpret |
this software for any purpose, without any restrictions. |
Permission is granted for anyone to use, read, or otherwise interpret this |
software for any purpose, without any restrictions. |
Permission is granted for anyone to embed or include this software in |
another work not derived from this software that makes use of the |
interface provided by this software for the purpose of creating a |
package of the work and its required libraries, and to distribute such |
packages as long as the software is not modified in any way, including |
by modifying or removing any files. |
Permission is granted for anyone to distribute this software with another |
work not derived from this software that uses of the interface provided by |
this software for the purpose of creating a package of the work and its |
required libraries, and to distribute such packages as long as the software |
is not modified in any way, including by modifying or removing any files. |
Permission is granted for anyone to modify this software or sample from |
it, and to distribute such modified versions or derivative works as long |
as neither the names of this software nor its authors are used in the |
name or title of the work or in any other way that may cause it to be |
confused with or interfere with the simultaneous use of this software. |
Permission is granted for anyone to modify this software or reuse portions |
of it, and to distribute such modified versions or derivative works as long |
as the names of this software and/or its author are not used in the work, |
including in its name or title and in any associated documentation, outside |
of an optional attribution or credit. |
This software may not be distributed standalone or in any other way, in |
whole or in part, modified or unmodified, without specific prior written |
permission from the authors of this software. |
This software may not be redistributed by itself or in any other way, in whole |
or in part, modified or unmodified, without specific prior written permission |
from the author of this software. |
The names of this software and/or its authors may not be used to |
promote or endorse works derived from this software without specific |
prior written permission from the authors of this software. |
The names of this software and/or its author may not be used to promote or |
endorse works derived from this software without specific prior written |
permission from the author of this software. |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
OTHER DEALINGS IN THE SOFTWARE. |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
PhanxConfig-EditBox |
Simple text input widget generator. |
Requires LibStub. |
https://github.com/phanx/PhanxConfigWidgets |
Copyright (c) 2009-2014 Phanx. All rights reserved. |
See the accompanying README and LICENSE files for more information. |
https://github.com/phanx/PhanxConfigWidgets |
----------------------------------------------------------------------]] |
local MINOR_VERSION = tonumber(string.match("$Revision$", "%d+")) |
local MINOR_VERSION = 176 |
local lib, oldminor = LibStub:NewLibrary("PhanxConfig-EditBox", MINOR_VERSION) |
if not lib then return end |
GameTooltip:SetText(container.tooltipText, nil, nil, nil, nil, true) |
end |
end |
function scripts:OnLeave() |
local function OnLeave() |
GameTooltip:Hide() |
end |
self.currText, self.origText = nil, nil |
end |
function scripts:OnTextChanged(userInput) |
function scripts:OnTextChanged() |
if not self:HasFocus() then return end |
local text = self:GetText() |
if text:len() == 0 then text = nil end -- experimental |
local parent = self:GetParent() |
local callback = parent.OnTextChanged |
local callback = parent.CallbackOnTextChanged or parent.OnTextChanged |
if callback and text ~= self.currText then |
callback(parent, text, userInput) |
callback(parent, text) |
self.currText = text |
end |
end |
self:ClearFocus() |
local parent = self:GetParent() |
local callback = parent.OnValueChanged |
local callback = parent.Callback or parent.OnValueChanged |
if callback then |
callback(parent, text) |
end |
end |
function scripts:OnReceiveDrag() |
local type, arg1, arg2, arg3, arg4 = GetCursorInfo() |
local type, id, info = GetCursorInfo() |
if type == "item" then |
-- itemID, itemLink |
if self:IsNumeric() then |
self:SetNumber(arg1) |
else |
local name = GetItemInfo(arg1) |
self:SetText(name) |
end |
elseif type == "macro" then |
-- index |
if self:IsNumeric() then |
self:SetNumber(arg1) |
else |
local name = GetMacroInfo(arg1) |
self:SetText(name) |
end |
elseif type == "merchant" then |
-- index |
if self:IsNumeric() then |
local link = GetMerchantItemLink(arg1) |
local id = strmatch(link, "|Hitem:(%d+)") |
if id then |
self:SetNumber(id) |
else |
self:SetText("") |
end |
else |
local name = GetMerchantItemInfo(arg1) |
self:SetText(name) |
end |
elseif type == "money" then |
-- amount in copper |
if self:IsNumeric() then |
self:SetNumber(arg1) |
else |
local mode = ENABLE_COLORBLIND_MODE |
ENABLE_COLORBLIND_MODE = "1" |
local text = GetMoneyString(arg1) |
ENABLE_COLORBLIND_MODE = mode |
self:SetText(text) |
end |
self:SetText(info) |
scripts.OnEnterPressed(self) |
ClearCursor() |
elseif type == "spell" then |
-- index, bookType, spellID |
if self:IsNumeric() then |
self:SetNumber(arg3) |
else |
local name = GetSpellInfo(arg3) |
self:SetText(name) |
end |
local name = GetSpellInfo(id, info) |
self:SetText(name) |
scripts.OnEnterPressed(self) |
ClearCursor() |
end |
scripts.OnEnterPressed(self) |
ClearCursor() |
end |
------------------------------------------------------------------------ |
editbox:SetPoint("RIGHT", -5, 0) |
editbox:SetHeight(19) |
editbox:EnableMouse(true) |
editbox:SetAltArrowKeyMode(false) |
editbox:SetAutoFocus(false) |
editbox:SetFontObject(ChatFontNormal) |
editbox:SetMaxLetters(maxLetters or 256) |
frame.editbox = editbox |
editbox.bgLeft = editbox:CreateTexture(nil, "BACKGROUND") |
editbox.bgLeft:SetPoint("TOPLEFT", 0, 0) |
editbox.bgLeft:SetPoint("BOTTOMLEFT", 0, 0) |
editbox.bgLeft:SetPoint("LEFT", 0, 0) |
editbox.bgLeft:SetSize(8, 20) |
editbox.bgLeft:SetTexture([[Interface\Common\Common-Input-Border]]) |
editbox.bgLeft:SetTexCoord(0, 0.0625, 0, 0.625) |
editbox.bgRight = editbox:CreateTexture(nil, "BACKGROUND") |
editbox.bgRight:SetPoint("TOPRIGHT", 0, 0) |
editbox.bgRight:SetPoint("BOTTOMRIGHT", 0, 0) |
editbox.bgRight:SetPoint("RIGHT", 0, 0) |
editbox.bgRight:SetSize(8, 20) |
editbox.bgRight:SetTexture([[Interface\Common\Common-Input-Border]]) |
editbox.bgRight:SetTexCoord(0.9375, 1, 0, 0.625) |
editbox.bgMiddle = editbox:CreateTexture(nil, "BACKGROUND") |
editbox.bgMiddle:SetPoint("TOPLEFT", editbox.bgLeft, "TOPRIGHT") |
editbox.bgMiddle:SetPoint("BOTTOMRIGHT", editbox.bgRight, "BOTTOMLEFT") |
editbox.bgMiddle:SetPoint("LEFT", editbox.bgLeft, "RIGHT") |
editbox.bgMiddle:SetPoint("RIGHT", editbox.bgRight, "LEFT") |
editbox.bgMiddle:SetSize(10, 20) |
editbox.bgMiddle:SetTexture([[Interface\Common\Common-Input-Border]]) |
editbox.bgMiddle:SetTexCoord(0.0625, 0.9375, 0, 0.625) |