WoWInterface SVN PhanxConfigWidgets

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 57 to Rev 58
    Reverse comparison

Rev 57 → Rev 58

trunk/PhanxConfig-Checkbox/PhanxConfig-Checkbox.lua
33,10 → 33,14
end
end
 
function lib.CreateCheckbox(parent, text, desc, size)
function lib.CreateCheckbox(parent, text, desc)
assert( type(parent) == "table" and parent.GetFrameType, "PhanxConfig-Checkbox: Parent is not a valid frame!" )
if type(name) ~= "string" then name = nil end
if type(desc) ~= "string" then desc = nil end
 
local check = CreateFrame("CheckButton", nil, parent)
check:SetWidth(size or 26)
check:SetHeight(size or 26)
check:SetWidth(26)
check:SetHeight(26)
 
check:SetNormalTexture("Interface\\Buttons\\UI-CheckBox-Up")
check:SetPushedTexture("Interface\\Buttons\\UI-CheckBox-Down")
trunk/PhanxConfig-Header/PhanxConfig-Header.lua
14,6 → 14,10
if not lib then return end
 
function lib.CreateHeader( parent, titleText, notesText, noPrefix )
assert( type(parent) == "table" and parent.GetFrameType, "PhanxConfig-Header: Parent is not a valid frame!" )
if type(titleText) ~= "string" then name = nil end
if type(notesText) ~= "string" then desc = nil end
 
if not titleText then
titleText = parent.name
end
trunk/PhanxConfig-ScrollingDropdown/PhanxConfig-ScrollingDropdown.lua
189,9 → 189,13
self.dropdown.selected = value
end
 
function lib.CreateScrollingDropdown(parent, name, items)
local container = PhanxConfigDropdown.CreateDropdown(parent, name)
function lib.CreateScrollingDropdown(parent, name, items, desc)
assert( type(parent) == "table" and parent.GetFrameType, "PhanxConfig-ScrollingDropdown: Parent is not a valid frame!" )
if type(name) ~= "string" then name = nil end
if type(desc) ~= "string" then desc = nil end
 
local container = PhanxConfigDropdown.CreateDropdown(parent, name, nil, desc)
 
if type(items) == "table" then
container.button:SetScript("OnClick", DropdownButton_OnClick)
container.dropdown.items = items
trunk/PhanxConfig-Button/PhanxConfig-Button.lua
26,6 → 26,10
end
 
function lib.CreateButton( parent, name, desc )
assert( type(parent) == "table" and parent.GetFrameType, "PhanxConfig-Button: Parent is not a valid frame!" )
if type(name) ~= "string" then name = nil end
if type(desc) ~= "string" then desc = nil end
 
local button = CreateFrame( "Button", nil, parent )
 
button:SetNormalFontObject( GameFontNormalSmall )
trunk/PhanxConfig-OptionsPanel/PhanxConfig-OptionsPanel.lua
48,7 → 48,7
end
 
function lib.CreateOptionsPanel( name, parent, construct, refresh )
if type( name ) ~= "string" then return end
assert( type( name ) == "string", "PhanxConfig-OptionsPanel: Name is not a string!" )
if type( parent ) ~= "string" then parent = nil end
if type( construct ) ~= "function" then construct = nil end
if type( refresh ) ~= "function" then refresh = nil end
trunk/PhanxConfig-ColorPicker/PhanxConfig-ColorPicker.lua
65,7 → 65,11
end
end
 
function lib.CreateColorPicker(parent, name)
function lib.CreateColorPicker(parent, name, desc)
assert( type(parent) == "table" and parent.GetFrameType, "PhanxConfig-ColorPicker: Parent is not a valid frame!" )
if type(name) ~= "string" then name = nil end
if type(desc) ~= "string" then desc = nil end
 
local frame = CreateFrame("Button", nil, parent)
frame:SetHeight(19)
 
100,5 → 104,7
frame:SetScript("OnEnter", OnEnter)
frame:SetScript("OnLeave", OnLeave)
 
frame.desc = desc
 
return frame
end
\ No newline at end of file
trunk/PhanxConfig-Dropdown/PhanxConfig-Dropdown.lua
49,6 → 49,10
 
local i = 0
function lib.CreateDropdown(parent, name, init, desc)
assert( type(parent) == "table" and parent.GetFrameType, "PhanxConfig-Button: Parent is not a valid frame!" )
if type(name) ~= "string" then name = nil end
if type(desc) ~= "string" then desc = nil end
 
i = i + 1
 
local frame = CreateFrame("Frame", nil, parent)
121,7 → 125,7
frame.GetValue = GetValue
frame.SetValue = SetValue
 
if init then
if type(init) == "function" then
UIDropDownMenu_Initialize(dropdown, init)
end
 
trunk/PhanxConfigWidgets.toc
1,18 → 1,20
## Interface: 40000
## Version: 4.0.3.wowi:revision
## Version: 4.0.6.wowi:revision
 
## Title: |cffffcc00Lib:|r PhanxConfigWidgets
## Notes: Simple GUI configuration widgets.
## Author: Phanx
## X-Email: addons@phanx.net
 
## Dependencies: LibStub
## OptionalDependencies: LibStub
 
PhanxConfig-Button\PhanxConfig-Button.lua
PhanxConfig-Checkbox\PhanxConfig-Checkbox.lua
PhanxConfig-ColorPicker\PhanxConfig-ColorPicker.lua
PhanxConfig-Dropdown\PhanxConfig-Dropdown.lua
PhanxConfig-EditBox\PhanxConfig-EditBox.lua
PhanxConfig-Header\PhanxConfig-Header.lua
PhanxConfig-OptionsPanel\PhanxConfig-OptionsPanel.lua
PhanxConfig-Panel\PhanxConfig-Panel.lua
PhanxConfig-ScrollingDropdown\PhanxConfig-ScrollingDropdown.lua
PhanxConfig-Slider\PhanxConfig-Slider.lua
\ No newline at end of file
trunk/PhanxConfig-EditBox/PhanxConfig-EditBox.lua
95,6 → 95,11
end
 
function lib.CreateEditBox( parent, name, desc, maxLetters )
assert( type(parent) == "table" and parent.GetFrameType, "PhanxConfig-EditBox: Parent is not a valid frame!" )
if type(name) ~= "string" then name = nil end
if type(desc) ~= "string" then desc = nil end
if type(maxLetters) ~= "number" then maxLetters = nil end
 
local frame = CreateFrame( "Frame", nil, parent )
frame:SetWidth( 144 )
frame:SetHeight( 42 )
trunk/PhanxConfig-Panel/PhanxConfig-Panel.lua
19,6 → 19,8
}
 
function lib.CreatePanel(parent, width, height)
assert( type(parent) == "table" and parent.GetFrameType, "PhanxConfig-Panel: Parent is not a valid frame!" )
 
local frame = CreateFrame("Frame", nil, parent)
frame:SetFrameStrata(parent:GetFrameStrata())
frame:SetFrameLevel(parent:GetFrameLevel() + 1)
trunk/PhanxConfig-Slider/PhanxConfig-Slider.lua
71,6 → 71,12
}
 
function lib.CreateSlider(parent, name, lowvalue, highvalue, valuestep, percent, desc)
assert( type(parent) == "table" and parent.GetFrameType, "PhanxConfig-Slider: Parent is not a valid frame!" )
if type(name) ~= "string" then name = nil end
if type(desc) ~= "string" then desc = nil end
if type(lowvalue) ~= "number" then lowvalue = 0 end
if type(highvalue) ~= "number" then highvalue = 100 end
 
local frame = CreateFrame("Frame", nil, parent)
frame:SetWidth(144)
frame:SetHeight(42)