View Single Post
03-26-12, 01:46 AM   #9
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Maybe I can help out. This is how I make the frame movable in rActionBarStyler:

lua Code:
  1. --holder frame
  2.   local bar = CreateFrame("Frame","rABS_ExtraActionBar",UIParent,"SecureHandlerStateTemplate")
  3.   bar:SetSize(barcfg.buttonsize,barcfg.buttonsize)
  4.   bar:SetPoint(barcfg.pos.a1,barcfg.pos.af,barcfg.pos.a2,barcfg.pos.x,barcfg.pos.y)
  5.   bar:SetHitRectInsets(-cfg.barinset, -cfg.barinset, -cfg.barinset, -cfg.barinset)
  6.   bar:SetScale(barcfg.barscale)
  7.   cfg.applyDragFunctionality(bar,barcfg.userplaced,barcfg.locked)
  8.  
  9.   --the frame
  10.   local f = ExtraActionBarFrame
  11.   f:SetParent(bar)
  12.   f:ClearAllPoints()
  13.   f:SetPoint("CENTER", 0, 0)
  14.   f:EnableMouse(false)
  15.   f.ignoreFramePositionManager = true
  16.  
  17.   --the button
  18.   local b = ExtraActionButton1
  19.   b:SetSize(barcfg.buttonsize,barcfg.buttonsize)
  20.   bar.button = b

The drag function is this one:
http://code.google.com/p/rothui/sour...config.lua#186

Unlocking/locking is done via slash command:
http://code.google.com/p/rothui/sour...s/slashcmd.lua

If additional styling is needed I have an example for this aswell:
http://code.google.com/p/rothui/sour...er/core.lua#68

Maybe that helps.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 03-26-12 at 01:49 AM.