From 57207d81e574cb1247b88052d835d754b83e6e03 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Tue, 29 Apr 2008 09:33:15 +0000 Subject: [PATCH] Change the resizing so the code pane will grow instead of the interpreter output --- WowLua.lua | 71 +--- WowLua.xml | 1206 ++++++++++++++++++++++++++++++------------------------------ 2 files changed, 623 insertions(+), 654 deletions(-) diff --git a/WowLua.lua b/WowLua.lua index 507380d..298f6a7 100644 --- a/WowLua.lua +++ b/WowLua.lua @@ -428,37 +428,21 @@ function WowLua.OnSizeChanged(self) bg4:Hide() end - if WowLuaFrameResizeBar then - -- Don't move too high, or too low + if WowLuaFrameResizeBar and false then local parent = WowLuaFrameResizeBar:GetParent() - local top = parent:GetTop() - local bot = parent:GetBottom() - local maxpoint = (top - bot - 80) * -1 - - -- This is the current point, actually - + local cursorY = select(2, GetCursorPosition()) local newPoint = select(5, WowLuaFrameResizeBar:GetPoint()) - - -- Don't move past the edges of the frame - if newPoint < maxpoint then - newPoint = maxpoint - elseif newPoint > -125 then - newPoint = -125 + local maxPoint = parent:GetHeight() - 175; + + if newPoint < 100 then + newPoint = 100 + elseif newPoint > maxPoint then + newPoint = maxPoint end - - WowLuaFrameResizeBar:ClearAllPoints() - WowLuaFrameResizeBar:SetPoint("TOPLEFT", 14, newPoint) - WowLuaFrameResizeBar:SetPoint("TOPRIGHT", 0, newPoint) - --[[ - -- Get our bottom, and the bottom of the frame - local sbot,pbot = WowLuaFrameResizeBar:GetBottom(), parent:GetBottom() - -- Diff - local diff = pbot - sbot - local numLines = math.abs((diff / 14) + 1.3) - if numLines <= 1 then numLines = 1 end - WowLuaFrameOutput:SetMaxLines(numLines) - --]] + WowLuaFrameResizeBar:ClearAllPoints() + WowLuaFrameResizeBar:SetPoint("TOPLEFT", parent, "BOTTOMLEFT", 14, newPoint) + WowLuaFrameResizeBar:SetPoint("TOPRIGHT", parent, "BOTTOMRIGHT", 0, newPoint) end end @@ -473,35 +457,20 @@ function WowLua.ResizeBar_OnMouseUp(self, button) end function WowLua.ResizeBar_OnUpdate(self, elapsed) + local parent = self:GetParent() local cursorY = select(2, GetCursorPosition()) local newPoint = self.anchorStart - (self.cursorStart - cursorY)/self:GetEffectiveScale() + local maxPoint = parent:GetHeight() - 175; - -- Don't move too high, or too low - local parent = self:GetParent() - local top = parent:GetTop() - local bot = parent:GetBottom() - local maxpoint = (top - bot - 80) * -1 - - -- Don't move past the edges of the frame - if newPoint < maxpoint then - newPoint = maxpoint - elseif newPoint > -125 then - newPoint = -125 + if newPoint < 100 then + newPoint = 100 + elseif newPoint > maxPoint then + newPoint = maxPoint end - + self:ClearAllPoints() - self:SetPoint("TOPLEFT", 14, newPoint) - self:SetPoint("TOPRIGHT", 0, newPoint) - - --[[ - -- Get our bottom, and the bottom of the frame - local sbot,pbot = self:GetBottom(), parent:GetBottom() - -- Diff - local diff = pbot - sbot - local numLines = math.abs((diff / 14) + 1.3) - if numLines <= 1 then numLines = 1 end - WowLuaFrameOutput:SetMaxLines(numLines) - --]] + self:SetPoint("TOPLEFT", parent, "BOTTOMLEFT", 14, newPoint) + self:SetPoint("TOPRIGHT", parent, "BOTTOMRIGHT", 0, newPoint) end function WowLua.OnVerticalScroll(scrollFrame) diff --git a/WowLua.xml b/WowLua.xml index 95b23f2..06deae6 100644 --- a/WowLua.xml +++ b/WowLua.xml @@ -1,617 +1,617 @@ - - - - - - WowLua.OpenDropDownOnLoad(self) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - local parent = self:GetParent() - if parent:IsMovable() then - parent:StartMoving() - end - - - local parent = self:GetParent() - parent:StopMovingOrSizing() - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WowLuaFrameLineNumScrollFrame:SetVerticalScroll(offset) - WowLua.OnVerticalScroll(self); - - - WowLua.OnVerticalScroll(self); - - - self.scrollBarHideable = 1; - - - - - - - - - - - - - - - - - - - - - WowLua.indent.enable(self, nil, 3) - - - self:ClearFocus(); - - - WowLua.highlightNum = nil - - - ScrollingEdit_OnCursorChanged(x,y,w,h) - WowLua.UpdateLineNums() - WowLuaFrameEditScrollFrameScrollBar:SetValue(WowLuaFrameEditScrollFrame:GetVerticalScroll()) - - - ScrollingEdit_OnUpdate(WowLuaFrameEditScrollFrame) - - - - - - - - - + + - - WowLuaFrameEditBox:SetFocus() - + + WowLua.OpenDropDownOnLoad(self) + - - - + + + + - - - - - - + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - self:ClearFocus() - - - WowLuaFrameEditBox:SetFocus() - - - WowLua.indent.enable(self) - - - WowLua:ProcessLine(self:GetText()) - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + local parent = self:GetParent() + if parent:IsMovable() then + parent:StartMoving() + end + + + local parent = self:GetParent() + parent:StopMovingOrSizing() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WowLuaFrameLineNumScrollFrame:SetVerticalScroll(offset) + WowLua.OnVerticalScroll(self); + + + WowLua.OnVerticalScroll(self); + + + self.scrollBarHideable = 1; + + + + + + + + + + + + + + + + + + + + + WowLua.indent.enable(self, nil, 3) + + + self:ClearFocus(); + + + WowLua.highlightNum = nil + + + ScrollingEdit_OnCursorChanged(x,y,w,h) + WowLua.UpdateLineNums() + WowLuaFrameEditScrollFrameScrollBar:SetValue(WowLuaFrameEditScrollFrame:GetVerticalScroll()) + + + ScrollingEdit_OnUpdate(WowLuaFrameEditScrollFrame) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + self:ClearFocus() + + + WowLuaFrameEditBox:SetFocus() + + + WowLua.indent.enable(self) + + + WowLua:ProcessLine(self:GetText()) + + + + + + + + + + + + + + + + + + + + + + + + + + + local direction; + if delta > 0 then + direction = "up"; + else + direction = "down"; + end + local type = ( IsShiftKeyDown() and "end" ) or + ( IsControlKeyDown() and "page" ) or "line"; + WowLua.ScrollingMessageFrameScroll(self, direction, type); + + + WowLua.UpdateScrollingMessageFrame(self); + + + WowLua.UpdateScrollingMessageFrame(self); + + + + + + - - local direction; - if delta > 0 then - direction = "up"; - else - direction = "down"; - end - local type = ( IsShiftKeyDown() and "end" ) or - ( IsControlKeyDown() and "page" ) or "line"; - WowLua.ScrollingMessageFrameScroll(self, direction, type); - - - WowLua.UpdateScrollingMessageFrame(self); - - - WowLua.UpdateScrollingMessageFrame(self); - + + WowLua.Initialize(self) + + + PlaySound("igMainMenuQuit"); + + + WowLua.OnSizeChanged(self) + - - - - - - - - WowLua.Initialize(self) - - - PlaySound("igMainMenuQuit"); - - - WowLua.OnSizeChanged(self) - - - + -- 1.7.9.5