Quantcast
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd">
    <Frame name="DJBagsSettingsContainer" parent="UIParent" movable="true" enableMouse="true"  inherits="DJBagsContainerTemplate">
        <Size x="545" y="600"/>
        <Anchors>
            <Anchor point="TOPLEFT" x="200" y="-100"/>
        </Anchors>
        <Layers>
            <Layer level="ARTWORK">
                <FontString name="$parentName" inherits="GameFontNormal" text="DJBags_LOCALE_SETTINGS">
                    <Anchors>
                        <Anchor point="TOPLEFT" x="15" y="-5"/>
                    </Anchors>
                </FontString>
            </Layer>
        </Layers>
        <Frames>
            <Frame name="DJBagsSettingsContent">
                <Size x="500" y="565" />
                <Frames>
                    <Frame name="$parentMainSettings" inherits="DJBagsMainSettings">
                        <Anchors>
                            <Anchor point="TOP" />
                        </Anchors>
                    </Frame>
                    <Frame name="$parentSubClassSettings" inherits="DJBagsSubClassSettings">
                        <Anchors>
                            <Anchor point="TOP" relativeTo="$parentMainSettings" relativePoint="BOTTOM" />
                        </Anchors>
                    </Frame>
                    <Frame name="$parentItemContainerSettings" inherits="DJBagsItemContainerSettings">
                        <Anchors>
                            <Anchor point="TOP" relativeTo="$parentSubClassSettings" relativePoint="BOTTOM" />
                        </Anchors>
                    </Frame>
                    <Frame name="$parentContainerSettings" inherits="DJBagsContainerSettings">
                        <Anchors>
                            <Anchor point="TOP" relativeTo="$parentItemContainerSettings" relativePoint="BOTTOM" />
                        </Anchors>
                    </Frame>
                </Frames>
            </Frame>
            <ScrollFrame name="DJBagsSettingsScrollFrame">
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parentName" relativePoint="BOTTOMLEFT" y="-15" />
                    <Anchor point="RIGHT" relativeTo="$parent" relativePoint="RIGHT" x="-25" />
                    <Anchor point="BOTTOM" relativeTo="$parent" relativePoint="BOTTOM" y="25" />
                </Anchors>
                <Scripts>
                    <OnLoad>
                        self:EnableMouseWheel(true)
                        self:SetScrollChild(_G['DJBagsSettingsContent'])
                    </OnLoad>
                    <OnMouseWheel>
                        local scrollBar = _G['DJBagsSettingsContainerScrollBar']
                        local current = scrollBar:GetValue()

                        local _, max = scrollBar:GetMinMaxValues()

                        local up = delta > 0
                        if IsShiftKeyDown() and up then
                            scrollBar:SetValue(0)
                        elseif IsShiftKeyDown() and not up then
                            scrollBar:SetValue(max)
                        elseif not up and not (current >= max) then
                            scrollBar:SetValue(math.min(current + 20, max))
                        elseif up and (current > 1) then
                            scrollBar:SetValue(math.max(current - 20, 0))
                        end
                    </OnMouseWheel>
                </Scripts>
            </ScrollFrame>
            <Slider name="$parentScrollBar" inherits="UIPanelScrollBarTemplate" minValue="0" maxValue="95" defaultValuie="1" valueStep="1">
                <Backdrop bgFile="Interface\Buttons\UI-SliderBar-Background"
                          edgeFile="Interface\Buttons\UI-SliderBar-Border" tile="true">
                    <EdgeSize val="8"/>
                    <TileSize val="8"/>
                    <BackgroundInsets left="3" right="3" top="6" bottom="6"/>
                </Backdrop>
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="DJBagsSettingsScrollFrame" relativePoint="TOPRIGHT" x="5" />
                    <Anchor point="BOTTOM" relativeTo="$parent" relativePoint="BOTTOM" y="25" />
                </Anchors>
                <Scripts>
                    <OnLoad>
                        self:SetValue(0)
                    </OnLoad>
                    <OnValueChanged>
                        DJBagsSettingsScrollFrame:SetVerticalScroll(value)
                    </OnValueChanged>
                </Scripts>
            </Slider>
        </Frames>
        <Scripts>
            <OnLoad>
                table.insert(UISpecialFrames, self:GetName())
                self:RegisterForDrag("LeftButton")
                self:SetScript("OnDragStart", self.StartMoving)
                self:SetScript("OnDragStop", self.StopMovingOrSizing)
                self:SetUserPlaced(true)

                self:SetBackdropColor(0, 0, 0, 0.6)
                self:SetBackdropBorderColor(0.3, 0.3, 0.3, 1)
                function self:Open()
                    self:Show()
                end
            </OnLoad>
        </Scripts>
    </Frame>
</Ui>