Thread: Resizing Frames
View Single Post
05-06-18, 05:57 PM   #6
JDoubleU00
A Firelord
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 463
Originally Posted by Phanx View Post
Actually after looking at the grand total of 3 objects in the default UI that are resizable using this method, I think the (main) problem is that you need to specify a direction in which to resize the frame, like:

Code:
object:StartSizing("BOTTOMRIGHT")
References:
If you want your frame to be resizable by any edge or corner, then you'll need to do some math to figure out which edge or corner to use based on the cursor location on mousedown.

The other option would be to add additional "drag handle" buttons on top of your frame, each sized and placed appropriately, and call "object:GetParent():StartSizing(point)" in their mousedown handlers. You can see that technique in use in my chat addon (written so long ago I'd forgotten about it initially) here:

https://github.com/phanx-wow/PhanxCh...esizeEdges.lua

You could make them invisible, or have them only appear when the shift button was pressed (by registering for the MODIFIER_STATE_CHANGED event on your frame).
Thanks, I've already tweaked the code with your suggestions. It will take me some time to look at your code and the Blizz code to decide how to implement it. I guess I did not look hard enough at the chat frame code and I rarely look at XML files.
__________________
Author of JWExpBar and JWRepBar.
  Reply With Quote