<Ui>

	<EventFrame name="OctoWowTrimhorizontalScrollBar" inherits="horizontalScrollBarTemplate" mixin="WowTrimScrollBarMixin" virtual="true">
		<Size x="560" y="8"/>
		<KeyValues>
			<KeyValue key="minThumbExtent" value="23" type="number"/>
		</KeyValues>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture>
					<Anchors>
						<Anchor point="TOPLEFT" x="3"/>
						<Anchor point="BOTTOMRIGHT" x="-3"/>
					</Anchors>
					<Color r="0" g="0" b="0" a=".75"/>
				</Texture>
			</Layer>
		</Layers>
		<Frames>
			<Frame parentKey="Track" enableMouse="true">
				<Anchors>
					<Anchor point="TOPLEFT" x="19" y="0"/>
					<Anchor point="BOTTOMRIGHT" x="-19" y="0"/>
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<Texture parentKey="Begin" atlas="minimal-scrollbar-track-top" useAtlasSize="true">
							<Anchors>
								<Anchor point="TOPLEFT"/>
							</Anchors>
						</Texture>
						<Texture parentKey="End" atlas="minimal-scrollbar-track-bottom" useAtlasSize="true">
							<Anchors>
								<Anchor point="TOPRIGHT"/>
							</Anchors>
						</Texture>
						<Texture parentKey="Middle" atlas="!minimal-scrollbar-track-middle" useAtlasSize="true">
							<Anchors>
								<Anchor point="TOPLEFT" relativeKey="$parent.Begin" relativePoint="TOPRIGHT"/>
								<Anchor point="BOTTOMRIGHT" relativeKey="$parent.End" relativePoint="BOTTOMLEFT"/>
							</Anchors>
						</Texture>
					</Layer>
				</Layers>
				<Frames>
					<EventButton parentKey="Thumb" mixin="MinimalScrollBarThumbScriptsMixin" enableMouse="true">
						<Size y="8"/>
						<HitRectInsets>
							<AbsInset left="-4" right="-4" top="-4" bottom="-4"/>
						</HitRectInsets>
						<KeyValues>
							<KeyValue key="isHorizontal" value="false" type="boolean"/>
							<KeyValue key="upBeginTexture" value="minimal-scrollbar-small-thumb-top" type="string"/>
							<KeyValue key="upMiddleTexture" value="minimal-scrollbar-small-thumb-middle" type="string"/>
							<KeyValue key="upEndTexture" value="minimal-scrollbar-small-thumb-bottom" type="string"/>
							<KeyValue key="overBeginTexture" value="minimal-scrollbar-small-thumb-top-over" type="string"/>
							<KeyValue key="overMiddleTexture" value="minimal-scrollbar-small-thumb-middle-over" type="string"/>
							<KeyValue key="overEndTexture" value="minimal-scrollbar-small-thumb-bottom-over" type="string"/>
							<KeyValue key="downBeginTexture" value="minimal-scrollbar-small-thumb-top-down" type="string"/>
							<KeyValue key="downMiddleTexture" value="minimal-scrollbar-small-thumb-middle-down" type="string"/>
							<KeyValue key="downEndTexture" value="minimal-scrollbar-small-thumb-bottom-down" type="string"/>
							<KeyValue key="mouseDownSoundKitID" value="SOUNDKIT.U_CHAT_SCROLL_BUTTON" type="global"/>
						</KeyValues>
						<Layers>
							<Layer level="BACKGROUND" textureSubLevel="1">
								<Texture parentKey="Middle">
									<Anchors>
										<Anchor point="TOPLEFT" x="5"/>
										<Anchor point="BOTTOMRIGHT" x="-5"/>
									</Anchors>
								</Texture>
							</Layer>
							<Layer level="BACKGROUND" textureSubLevel="2">
								<Texture parentKey="Begin">
									<Anchors>
										<Anchor point="TOPLEFT"/>
									</Anchors>
								</Texture>
								<Texture parentKey="End">
									<Anchors>
										<Anchor point="TOPRIGHT"/>
									</Anchors>
								</Texture>
							</Layer>
						</Layers>
						<Scripts>
							<OnLoad method="OnLoad"/>
							<!-- <OnSizeChanged method="OnSizeChanged"/> -->
							<OnEnter method="OnEnter"/>
							<OnLeave method="OnLeave"/>
							<OnMouseDown method="OnMouseDown"/>
							<OnMouseUp method="OnMouseUp"/>
							<OnEnable method="OnEnable"/>
							<OnDisable method="OnDisable"/>
						</Scripts>
					</EventButton>
				</Frames>
			</Frame>
			<EventButton parentKey="Back" inherits="MinimalScrollBarStepperScripts">
				<Size x="11" y="17"/>
				<Anchors>
					<Anchor point="LEFT"/>
				</Anchors>
				<KeyValues>
					<KeyValue key="direction" value="ScrollControllerMixin.Directions.Decrease" type="global"/>
					<KeyValue key="normalTexture" value="minimal-scrollbar-arrow-top" type="string"/>
					<KeyValue key="overTexture" value="minimal-scrollbar-arrow-top-over" type="string"/>
					<KeyValue key="downTexture" value="minimal-scrollbar-arrow-top-down" type="string"/>
					<KeyValue key="disabledTexture" value="minimal-scrollbar-arrow-top" type="string"/>
					<KeyValue key="mouseDownSoundKitID" value="SOUNDKIT.SCROLLBAR_STEP" type="global"/>
				</KeyValues>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture parentKey="Texture"/>
					</Layer>
					<Layer level="OVERLAY">
						<Texture parentKey="Overlay" atlas="UI-ScrollBar-ScrollLeftButton-Highlight" useAtlasSize="true" hidden="true"/>
					</Layer>
				</Layers>
			</EventButton>
			<EventButton parentKey="Forward" inherits="MinimalScrollBarStepperScripts">
				<Size x="11" y="17"/>
				<Anchors>
					<Anchor point="RIGHT"/>
				</Anchors>
				<KeyValues>
					<KeyValue key="direction" value="ScrollControllerMixin.Directions.Increase" type="global"/>
					<KeyValue key="normalTexture" value="minimal-scrollbar-arrow-bottom" type="string"/>
					<KeyValue key="overTexture" value="minimal-scrollbar-arrow-bottom-over" type="string"/>
					<KeyValue key="downTexture" value="minimal-scrollbar-arrow-bottom-down" type="string"/>
					<KeyValue key="disabledTexture" value="minimal-scrollbar-bottom-top" type="string"/>
					<KeyValue key="mouseDownSoundKitID" value="SOUNDKIT.SCROLLBAR_STEP" type="global"/>
				</KeyValues>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture parentKey="Texture"/>
					</Layer>
					<Layer level="OVERLAY">
						<Texture parentKey="Overlay" atlas="UI-ScrollBar-ScrollRightButton-Highlight" useAtlasSize="true" hidden="true"/>
					</Layer>
				</Layers>
			</EventButton>
		</Frames>
		<Scripts>
			<OnLoad method="OnLoad"/>
		</Scripts>
	</EventFrame>

	<EditBox name="OCTOEditBoxTemplate" inherits="InputBoxScriptTemplate,BackdropTemplate" multiLine="false" autoFocus="false" virtual="true">
		<FontString inherits="GameFontHighlightSmall" justifyH="Center"/>
		<Scripts>
			<OnLoad>
				local E = OctoEngine
				if E and E.menuBackdrop then
					self:SetBackdrop(E.menuBackdrop)
					self:SetBackdropColor(0, 0, 0, .5)
					self:SetBackdropBorderColor(.3, .3, .3, .8)
				end
			</OnLoad>
			<OnEnterPressed function="EditBox_ClearFocus"/>
			<OnEnter>if self:IsEnabled() then self:SetBackdropBorderColor(.5, .5, .5, .8) end</OnEnter>
			<OnLeave>self:SetBackdropBorderColor(.3, .3, .3, .8)</OnLeave>
			<OnEnable>self:SetTextColor(HIGHLIGHT_FONT_COLOR:GetRGB())</OnEnable>
			<OnDisable>self:SetTextColor(GRAY_FONT_COLOR:GetRGB())</OnDisable>
		</Scripts>
	</EditBox>

	<Button name="OctoPropagateTemplate" propagateMouseInput="Both" virtual="true">
	</Button>

	<Button name="OctoRectTemplate" inherits="OctoPropagateTemplate" virtual="true">
		<HitRectInsets>
			<AbsInset left="1" right="1" top="1" bottom="1"/>
		</HitRectInsets>
	</Button>

	<Frame name="OctoBackdropTemplate" inherits="BackdropTemplate" virtual="true">
		<Scripts>
			<OnShow>
				local E = OctoEngine
				if E and E.PROFTBL and E.PROFTBL.ConfigColor_MAIN_MainFrame_r then
					self:SetBackdrop(E.menuBackdrop)
					self:SetBackdropColor(E.PROFTBL.ConfigColor_MAIN_MainFrame_r, E.PROFTBL.ConfigColor_MAIN_MainFrame_g, E.PROFTBL.ConfigColor_MAIN_MainFrame_b, E.PROFTBL.ConfigColor_MAIN_MainFrame_a)
					self:SetBackdropBorderColor(E.PROFTBL.ConfigColor_MAIN_Border_r, E.PROFTBL.ConfigColor_MAIN_Border_g, E.PROFTBL.ConfigColor_MAIN_Border_b, E.PROFTBL.ConfigColor_MAIN_Border_a)
					if Octo_ToDo_DB_Vars and Octo_ToDo_DB_Vars.Config_ClampedToScreen then
						self:SetClampedToScreen(Octo_ToDo_DB_Vars.Config_ClampedToScreen)
					else
						self:SetClampedToScreen(false)
					end
				end
			</OnShow>
		</Scripts>
	</Frame>


	<Frame name="OctoBackdropPropagateTemplate" inherits="OctoRectTemplate,OctoBackdropTemplate" virtual="true">
	</Frame>







	<Frame name="OctoTooltipBackdropTemplate" propagateMouseInput="Clicks" inherits="BackdropTemplate" virtual="true">
		<Scripts>
			<OnShow>
				local E = OctoEngine
				if E and E.PROFTBL and E.PROFTBL.ConfigColor_MAIN_MainFrame_r then
					self:SetBackdrop(E.menuBackdrop)
					self:SetBackdropColor(E.PROFTBL.ConfigColor_TOOLTIP_TooltipFrame_r, E.PROFTBL.ConfigColor_TOOLTIP_TooltipFrame_g, E.PROFTBL.ConfigColor_TOOLTIP_TooltipFrame_b, E.PROFTBL.ConfigColor_TOOLTIP_TooltipFrame_a)
					self:SetBackdropBorderColor(E.PROFTBL.ConfigColor_MAIN_Border_r, E.PROFTBL.ConfigColor_MAIN_Border_g, E.PROFTBL.ConfigColor_MAIN_Border_b, E.PROFTBL.ConfigColor_MAIN_Border_a)
				end
			</OnShow>
		</Scripts>
	</Frame>

	<Frame name="OctoSettingsDropdownControlTemplate" inherits="SettingsDropdownControlTemplate" virtual="true">
		<Scripts>
			<OnLoad inherit="prepend">
				local E = OctoEngine
				if E and LibStub then
					local LibSFDropDown = LibStub("LibSFDropDown-1.5")
					local Center = self.Control.Dropdown
					LibSFDropDown:SetMixin(Center)
					Center:ddSetDisplayMode("menu")
					Center:ddHideWhenButtonHidden()
					Center:ddSetNoGlobalMouseEvent(true)
					Center:ddSetMinMenuWidth(Center:GetWidth()-24)
					Center:SetScript("OnClick", function(dd)
						if E.sound_OnClick then
							E.sound_OnClick()
						end
						dd:ddToggle(1, nil, dd, -2, 0)
					end)
				end
			</OnLoad>
		</Scripts>
	</Frame>



	<Frame name="OctoSliderFrameTemplate" hidden="true" virtual="true">
		<Size x="200" y="31"/>
		<Frames>
			<EditBox parentKey="edit" inherits="OctoEditBoxTemplate" letters="3">
				<Size x="28" y="17"/>
				<Anchors>
					<Anchor point="RIGHT" x="-1" y="-4"/>
				</Anchors>
				<Scripts>
					<OnTextChanged>
						if userInput then
							local int, dec = self:GetText():gsub(",", "."):match("(%-?%d*)(%.?%d*)")
							if int == "" and dec ~= "" then int = "0" end
							self:SetText(int..dec)
						end
					</OnTextChanged>
					<OnEnterPressed>
						local parent = self:GetParent()
						local slider = parent.slider
						local value = tonumber(self:GetText()) or 0
						if not parent.noLimit then
							local min, max = slider:GetMinMaxValues()
							if min > value then value = min
							elseif value > max then value = max end
						end
						slider:GetScript("OnValueChanged")(slider, value, true)
						self:ClearFocus()
					</OnEnterPressed>
					<OnEditFocusLost>
						self:SetNumber(self.curValue)
					</OnEditFocusLost>
					<OnMouseWheel>
						local parent = self:GetParent()
						local slider = parent.slider
						local value = (tonumber(self:GetText()) or 0) + parent.step * delta
						if not parent.noLimit then
							local min, max = slider:GetMinMaxValues()
							if min > value then value = min
							elseif value > max then value = max end
						end
						slider:GetScript("OnValueChanged")(slider, value, true)
					</OnMouseWheel>
				</Scripts>
			</EditBox>
			<Slider parentKey="slider" inherits="MinimalSliderTemplate">
				<Size y="17"/>
				<Anchors>
					<Anchor point="BOTTOMLEFT" x="0" y="2"/>
					<Anchor point="RIGHT" relativeKey="$parent.edit" relativePoint="LEFT" x="-4"/>
				</Anchors>
				<HitRectInsets left="0" right="0" top="-4" bottom="-4"/>
				<Layers>
					<Layer level="ARTWORK">
						<FontString parentKey="text" inherits="GameFontNormalSmall">
							<Anchors>
								<Anchor point="BOTTOM" relativePoint="TOP" y="1"/>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad inherit="prepend">
						hooksecurefunc(self, "SetValue", function(self, value)
							local edit = self:GetParent().edit
							edit.curValue = value
							edit:SetNumber(value)
							edit:SetCursorPosition(0)
						end)
					</OnLoad>
					<OnValueChanged>
						if not userInput then return end
						local parent = self:GetParent()
						local step = 1 / parent.step
						value = math.floor(value * step + .5) / step
						self:SetValue(value)
						parent:onValueChanged(value)
					</OnValueChanged>
					<OnMouseWheel>
						local edit = self:GetParent().edit
						edit:GetScript("OnMouseWheel")(edit, delta)
					</OnMouseWheel>
					<OnDisable>
						self.text:SetVertexColor(GRAY_FONT_COLOR:GetRGB())
					</OnDisable>
					<OnEnable>
						self.text:SetVertexColor(NORMAL_FONT_COLOR:GetRGB())
					</OnEnable>
				</Scripts>
			</Slider>
		</Frames>
		<Scripts>
			<OnLoad>
				self.setOnChanged = function(self, func)
				self.onValueChanged = func
				end
				self.step = 1
				self.setStep = function(self, step)
				self.step = step
				end
				self.setMinMax = function(self, min, max)
				self.slider:SetMinMaxValues(min, max)
				end
				self.setValue = function(self, value)
				self.slider:SetValue(value)
				end
				self.setText = function(self, text)
				self.slider.text:SetText(text)
				end
				self.setMaxLetters = function(self, value)
				self.edit:SetWidth(value * 7 + 7)
				self.edit:SetMaxLetters(value)
				end
				self.SetEnabled = function(self, value)
				self.edit:SetEnabled(value)
				self.slider:SetEnabled(value)
				end
			</OnLoad>
		</Scripts>
	</Frame>



</Ui>