<Ui>

	<Frame name="TellMeWhen_CBarOptions" inherits="TellMeWhen_OptionsModuleContainer" virtual="true">
		<Size y="60"/>
		<Frames>
			<CheckButton name="$parentShowCBar" inherits="TellMeWhen_CheckTemplate" parentKey="ShowCBar">
				<Anchors>
					<Anchor point="TOP" y="-1"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self, {
							setting = "ShowCBar",
							title = TMW.L["ICONMENU_ENABLE"],
							tooltip = TMW.L["ICONMENU_SHOWCBAR_DESC"],
						})
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="$parentInvertCBar" inherits="TellMeWhen_CheckTemplate" parentKey="InvertCBar">
				<Scripts>
					<OnLoad>
						TMW:CInit(self, {
							setting = "InvertCBar",
							title = TMW.L["ICONMENU_INVERTBARS"],
							tooltip = TMW.L["ICONMENU_INVERTCBAR_DESC"],
							disabled = function(self)
								return not TMW.CI.ics.ShowCBar
							end,
						})
					</OnLoad>
				</Scripts>
			</CheckButton>
			<EditBox name="$parentCBarOffs" inherits="TellMeWhen_TimeEditBoxTemplate" parentKey="CBarOffs" autoFocus="false">
				<Size x="45" y="15"/>
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentInvertCBar" relativePoint="RIGHT" y="1"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.text:SetText(TMW.L["ICONMENU_OFFS"])
						self.text:SetWidth(50)
						self.setting = "CBarOffs"
						
						self.text:ClearAllPoints()
						self.text:SetPoint("LEFT", self, "RIGHT", 1, 0)
						
						TMW:CInit(self, {
							setting = "CBarOffs",
							title = TMW.L["ICONMENU_OFFS"],
							tooltip = TMW.L["ICONMENU_BAROFFS"],
							disabled = function(self)
								return not TMW.CI.ics.ShowCBar
							end,
							ModifySettingValue = function(self, value)
								return tonumber(value) or 0
							end,
						})
					</OnLoad>
				</Scripts>
			</EditBox>
			
			<CheckButton name="$parentOverlay_BarGCD" inherits="TellMeWhen_CheckTemplate" parentKey="Overlay_BarGCD">
				<Anchors>
					<Anchor point="TOP" relativeTo="$parentShowCBar" relativePoint="BOTTOM" y="2"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						TMW:CInit(self, {
							setting = "Overlay_BarGCD",
							title = TMW.L["ICONMENU_ALLOWGCD"],
							tooltip = TMW.L["ICONMENU_ALLOWGCD_DESC"],
							disabled = function(self)
								return not TMW.CI.ics.ShowCBar
							end,
							hidden = function(self)
								return TMW.CI.icon.typeData.hasNoGCD
							end,
						})
					</OnLoad>
					<OnHide>
						self:GetParent():SetHeight(30)
					</OnHide>
					<OnShow>
						self:GetParent():SetHeight(60)
					</OnShow>
				</Scripts>
			</CheckButton>
		</Frames>
		<Scripts>
			<OnLoad>
				self.Header:SetText(TMW.L["CONFIGPANEL_CBAR_HEADER"])
				
				self.ShowCBar:ConstrainLabel(self.InvertCBar)
				self.InvertCBar:ConstrainLabel(self.CBarOffs)
				
				TMW.IE:DistributeFrameAnchorsLaterally(self, 3, self.ShowCBar, self.InvertCBar, self.CBarOffs)
				TMW.IE:DistributeFrameAnchorsLaterally(self, 3, self.Overlay_BarGCD)
			</OnLoad>
		</Scripts>
	</Frame>
 
</Ui>