WoWInterface SVN PhanxConfigWidgets

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 187 to Rev 188
    Reverse comparison

Rev 187 → Rev 188

trunk/PhanxConfig-Panel/PhanxConfig-Panel.lua
2,12 → 2,11
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
trunk/PhanxConfig-Slider/PhanxConfig-Slider.lua
3,12 → 3,11
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
trunk/PhanxConfig-KeyBinding/PhanxConfig-KeyBinding.lua
3,16 → 3,15
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
 
trunk/PhanxConfig-Checkbox/PhanxConfig-Checkbox.lua
3,12 → 3,11
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
trunk/PhanxConfig-Header/PhanxConfig-Header.lua
2,12 → 2,11
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
trunk/README.md
31,13 → 31,12
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
trunk/PhanxConfig-Button/PhanxConfig-Button.lua
2,12 → 2,11
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
trunk/PhanxConfig-OptionsPanel/PhanxConfig-OptionsPanel.lua
2,12 → 2,11
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
trunk/PhanxConfig-ColorPicker/PhanxConfig-ColorPicker.lua
3,12 → 3,11
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
trunk/PhanxConfig-Dropdown/PhanxConfig-Dropdown.lua
3,12 → 3,11
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
314,20 → 313,6
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
 
369,13 → 354,6
self.valueText:SetFontObject(GameFontDisableSmall)
self.button:Disable()
end
function methods:SetEnabled(enable)
if enable then
self:Enable()
else
self:Disable()
end
end
 
------------------------------------------------------------------------
 
trunk/PhanxConfigWidgets.toc
5,7 → 5,7
## 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
 
trunk/LICENSE.txt
1,33 → 1,31
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.
trunk/PhanxConfig-EditBox/PhanxConfig-EditBox.lua
2,12 → 2,11
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
39,7 → 38,7
GameTooltip:SetText(container.tooltipText, nil, nil, nil, nil, true)
end
end
function scripts:OnLeave()
local function OnLeave()
GameTooltip:Hide()
end
 
54,16 → 53,16
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
74,7 → 73,7
self:ClearFocus()
 
local parent = self:GetParent()
local callback = parent.OnValueChanged
local callback = parent.Callback or parent.OnValueChanged
if callback then
callback(parent, text)
end
85,59 → 84,17
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
 
------------------------------------------------------------------------
190,7 → 147,6
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)
199,22 → 155,20
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)