-
Posted by tariel36 on Fri, 03 Sep 2010 17:07:14
Hello, i'm working on my addon and i have probs with resizing function. I'm creating special texture for grabbing and setting script Frame:StartSizing() ondrag and ondrag Frame:Stopmovingorsizing and onload Frame:SetResizable(enable) but when i'm trying to resize it ingame it's not working? any clues?
-
Posted by jnwhiteh on Fri, 03 Sep 2010 17:28:02
Have you set the frame to be resizable?
-
Posted by tariel36 on Fri, 03 Sep 2010 20:21:36
yeah
my xml code: http://paste-it.net/public/h79cade/
-
Posted by jnwhiteh on Sat, 04 Sep 2010 23:30:00
You don't register for drag events, which you need to do in order to enable the drag widget handlers. http://wowprogramming.com/docs/widgets/Frame/RegisterForDrag.
-
Posted by tariel36 on Sun, 05 Sep 2010 00:11:16
so i added registerfordrag but still it's not working. i'm so retarded for this resize code XD
http://paste-it.net/public/sfce068/
maybe someone can wrtie exacly what should i change / change code and paste it? pretty please
-
Posted by jnwhiteh on Sun, 05 Sep 2010 09:21:00
RightButton needs to be a string, not a value. You have
RightButton
which is a nil value, whereas you need"RightButton"
which is a string. -
Posted by tariel36 on Sun, 05 Sep 2010 15:43:59
bah, i added "" but still not working
-
Posted by jnwhiteh on Sun, 05 Sep 2010 16:23:36
Your XML code, being auto-generated is incredibly difficult to read. Making a frame resizable is a matter of the following:
- Enable frame resizing, i.e. resizable="true"
- Enable drag scripts on the frame, i.e. frame:RegisterForDrag("RightButton")
- Set an OnDragStart script: self:StartSizing()
- Set an OnDragStop script: self:StopMovingOrSizing()
Perhaps you should try this with a simple example before you start dropping it in the middle a larger addon.
-
Posted by tariel36 on Sun, 05 Sep 2010 17:59:56
well this addon is very simple^^ . i'm just adding some features. Gonna try your tips and reply soon.
And i'm using wow uidesigner for this while [yes, i'm begginer]
-
Posted by tariel36 on Sun, 05 Sep 2010 20:58:37
oki i fixed almost everything i wanted, but 1 thing remains, how to stick buttons to mainframe?(to make them resize with main frame)
-
Posted by jnwhiteh on Sun, 05 Sep 2010 21:48:35
You'd need to use anchor points with relative anchor points, in short it's not very easy. You can manually adjust those positions as you resize.. but its a bit difficult to get it working right. This is why very few addons do this where the BUTTONS resize, they just maybe reflow themselves to appear different, but stay the same size.
-
Posted by tariel36 on Sun, 05 Sep 2010 22:09:04
aha, oki thanks for replies a lot :)
-
Posted by jnwhiteh on Sun, 05 Sep 2010 23:04:08
Well as a beginner, I recommend my book so you really understand what's going on. That's why I wrote it.