Thread Tools Display Modes
09/02/14, 02:18 PM   #1
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Minceraft View Post
So, I was messing around with these, like you suggested:

Lua Code:
  1. BOXUIBackdrop:ClearAnchors()
  2. BOXUIBackdrop:SetAnchorFill(BOXUI)
  3.  
  4. --This one works like a charm!! Makes it the same size as the main window, like you said!--
  5. --But then I tried to use this one to anchor the EditBox to the Backdrop.....--
  6.  
  7. BOXUIBox:ClearAnchors()
  8. BOXUIBox:SetAnchorFill(BOXUI)
  9. --it's expecting something instead of what it gets, I'm assuming, because it can't find it for some reason??--
woops, my bad. This is because when I wrote that I expected (which is my own fault) the editBox to be a child of the TLW, but it is not. Your editBox is a child of the backdrop so I typed the wrong name. You do not have any control named: BOXUIBox.
Your editBox control is a child of the backdrop and named $(parent)Box.
The backdrop is a child of the TLW and is named: $(parent)Backdrop

So your editBox control is really named: BOXUIBackdropBox

So the second part, anchoring the editBox should have looked like this:
Lua Code:
  1. BOXUIBackdropBox:ClearAnchors()
  2. BOXUIBackdropBox:SetAnchorFill(BOXUI)


Originally Posted by Minceraft View Post
I get what you were saying about the anchors needing to be cleared, though, because they are still anchored to the last point I set!
So, I'm guessing the (0, 0) on the other format are x and y? That could be really handy in other situations, as well.
Yes the 0, 0 are the offsetX & offsetY from the anchor point.
Lua Code:
  1. BOXUIBackdrop:SetAnchor(TOPLEFT, BOXUI, TOPLEFT, OffsetX, OffsetY)



Originally Posted by Minceraft View Post
But what about SavedVariables? This is what I'm using to remember where the window is....
Lua Code:
  1. function BOX.OnMoveStop( self )
  2.  BOX.settings.wndMain.x = self:GetLeft();    
  3.   BOX.settings.wndMain.y = self:GetTop();    
  4.  --These work for my other Addons but not this one...  --
  5. --the others are movable perfectly and  they remain after ReloadUI--
  6.  BOX.settings.wndMain.width = self:GetWidth();
  7.   BOX.settings.wndMain.height = self:GetHeight();
  8. end

What is the difference?And, I was looking around for examples of SavedVariable use but nothing seemed to match what I was needing...
I don't know what your asking when you say what is the difference. The difference between what and what? I don't see anything wrong with that code you posted to save settings.

From what I remember & what I see here, I did not see any problems with how you were handling the saved variables. You have to get them all anchored properly first or they won't work regardless of how your handling the saved variables because your only restoring the position of the TLW in your code, which is the only window you cant actually see. If the others are not anchored to the TLW they will not necessarily be in the same spot as the TLW, so it will look like your saved variables (restoring the windows position) is not working...but it really is because the TLW is where it is supposed to be, where you told it to be. Its the other windows (background & edit box) that are not where they are supposed to be (anchored to the TLW).
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » SUCCESS!!!!....Sorta! But I'm proud!!!


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off