diff Devian.xml @ 13:080dfa4990fb

necessary abstractions for running multiple console buffers in place message prefix can act as a channel selector when tagged in savedvars more frame vars defined in the XML XML parentKey names organized
author Nenue
date Sat, 19 Dec 2015 07:59:12 -0500
parents 65fcb81f4e0a
children 5254d1ba6013
line wrap: on
line diff
--- a/Devian.xml	Sat Dec 19 03:14:25 2015 -0500
+++ b/Devian.xml	Sat Dec 19 07:59:12 2015 -0500
@@ -1,6 +1,18 @@
 <Ui>
-  <Frame name="DevianConsole" parent="UIParent" enableMouse="true" enableMouseWheel="true" movable="true" resizable="true" toplevel="true" hidden="true" clampedToScreen="true">
+  <Frame
+      name="DevianConsole"
+      parent="UIParent"
+      enableMouse="true"
+      enableMouseWheel="true"
+      clampedToScreen="true"
+      movable="true"
+      resizable="true"
+      toplevel="true"
+      hidden="true"
+      virtual="true">
     <KeyValues>
+      <KeyValue key="index" type="number" value="1" />
+      <KeyValue key="name" value="Devian" />
       <KeyValue key="format" value="Devian [%s]" />
     </KeyValues>
     <ResizeBounds>
@@ -10,7 +22,7 @@
     <Scripts>
       <OnMouseDown>
         if button == 'LeftButton' then
-          if self.sizer:IsMouseOver() then
+          if self.grip:IsMouseOver() then
             return self:StartSizing()
           end
           return self:StartMoving()
@@ -18,22 +30,22 @@
       </OnMouseDown>
       <OnMouseUp>
         if button == 'RightButton' then
-          return Devian:ToggleMinMax()
+          return self:MinMax()
         end
         self:StopMovingOrSizing()
-        Devian:SavePos()
+        self:Save()
       </OnMouseUp>
       <OnMouseWheel>
         local up =  delta > 0
         if IsControlKeyDown() then
-          if up then self.console:ScrollToTop()
-          else self.console:ScrollToBottom() end
+          if up then self.out:ScrollToTop()
+          else self.out:ScrollToBottom() end
         elseif IsShiftKeyDown() then
-          if up then self.console:PageUp()
-          else self.console:PageDown() end
+          if up then self.out:PageUp()
+          else self.out:PageDown() end
         else
-          if up then self.console:ScrollUp()
-          else self.console:ScrollDown() end
+          if up then self.out:ScrollUp()
+          else self.out:ScrollDown() end
         end
       </OnMouseWheel>
       <OnUpdate>
@@ -45,12 +57,18 @@
           self.throttle = GetTime()
         end
 
-        self.text:SetText(string.format(self.format, GetTime()))
+        self.header:SetText(string.format(self.format, GetTime()))
       </OnUpdate>
     </Scripts>
 
     <Frames>
-      <ScrollingMessageFrame name="$parentBuffer" parentkey="console" maxLines="500" displayduration="2000000">
+      <ScrollingMessageFrame
+          name="$parentScrollFrame"
+          parentkey="out"
+          maxLines="500"
+          fade="false"
+          displayduration="2147483647"
+          insertMode="BOTTOM">
         <Anchors>
           <Anchor point="TOPLEFT" y="-20" />
           <Anchor point="BOTTOMRIGHT" />
@@ -66,7 +84,7 @@
 
         <Layers>
           <Layer level="BACKGROUND">
-            <Texture name="DevianConsoleBG" parentKey="backdrop" setAllPoints="true" alphaMode="BLEND">
+            <Texture name="$parentbg" parentKey="backdrop" setAllPoints="true" alphaMode="BLEND">
               <Color r="1" g="1" b="1" a="1"/>
               <Gradient orientation="VERTICAL">
                 <MinColor r="0" g="0" b="0" a="0.7"/>
@@ -78,8 +96,8 @@
       </ScrollingMessageFrame>
     </Frames>
     <Layers>
-      <Layer level="OVERLAY">
-        <Texture parentKey="tbar" alphaMode="BLEND">
+      <Layer level="BORDER">
+        <Texture parentKey="titlebar" alphaMode="BLEND">
           <Anchors>
             <Anchor point="TOPLEFT" />
             <Anchor point="TOPRIGHT" />
@@ -91,7 +109,7 @@
             <MaxColor r="0.3" g="0.3" b="0.3" a="0.7"/>
           </Gradient>
         </Texture>
-        <FontString parentKey="text" font="Interface\Addons\Devian\font\SourceCodePro-Bold.ttf" wordwrap="true"
+        <FontString parentKey="header" font="Interface\Addons\Devian\font\SourceCodePro-Bold.ttf" wordwrap="true"
                     justifyH="LEFT"
                     indented="true">
           <Anchors>
@@ -104,13 +122,17 @@
           </FontHeight>
         </FontString>
       </Layer>
-      <Layer level="HIGHLIGHT">
-        <Texture parentKey="sizer" strata="HIGH" alphaMode="ADD">
+      <Layer level="OVERLAY">
+        <Texture parentKey="grip" strata="HIGH" alphaMode="ADD">
           <Anchors>
-            <Anchor point="BOTTOMRIGHT" />
+            <Anchor point="BOTTOMRIGHT" x="-1" y="1" />
           </Anchors>
-          <Size x="20" y="20" />
-          <Color r="1" g="1" b="1" a="0.7"/>
+          <Size x="18" y="18" />
+          <Color r="1" g="1" b="1" a="1"/>
+          <Gradient orientation="VERTICAL">
+            <MaxColor r="0.2" g="0.2" b="0.2" a="1"/>
+            <MinColor r="0.5" g="0.5" b="0.5" a="1"/>
+          </Gradient>
         </Texture>
       </Layer>
     </Layers>