1. Hello,

    I'm familiar with creating movable frames but would like to make one where only the title bar can be clicked to move it. My goal is to allow mouse clicks through the general area of the frame but still make it movable. I've created a separate frame for the title bar and tried putting it both inside and outside the frame I want to move but can't get it to work. What is the best way to make only a portion of the frame movable?

    Any help would be greatly appreciated

    Thanks.

    LUA

     function AddonTest_Titlebox_OnLoad(self)
    
        self:RegisterForDrag("LeftButton")
    
     end
    

    XML

     <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/http://wowprogramming.com/FrameXML/UI.xsd">
    
        <Button name="AddonTest_Titlebox" frameStrata="HIGH" enableMouse="true" movable="true" >
            <Size>
                <AbsDimension x="280" y="60"/>
            </Size>
            <Anchors>
                <Anchor point="TOP">
                    <Offset x="-2" y="-2"/>
                </Anchor>
            </Anchors>
            <Layers>
                <Layer level="ARTWORK">
                    <Texture name="$parent_FrameHeader" file="Interface\DialogFrame\UI-DialogBox-Header">
                        <Size>
                            <AbsDimension x="280" y="60"/>
                        </Size>
                        <Anchors>
                            <Anchor point="TOP">
                                <Offset>
                                    <AbsDimension x="0" y="12"/>
                                </Offset>
                            </Anchor>
                        </Anchors>
                    </Texture>
                </Layer>
                <Layer level="OVERLAY">
                    <FontString name="$parent_Title" parentKey="title" inherits="GameFontNormal" text="AddonTest">
                        <Size>
                            <AbsDimension x="100" y="20"/>
                        </Size>
                        <Anchors>
                            <Anchor point="CENTER" relativeTo="$parent_FrameHeader">
                                <Offset>
                                    <AbsDimension x="3" y="12"/>
                                </Offset>
                            </Anchor>
                        </Anchors>
                    </FontString>
                </Layer>
            </Layers>
            <Scripts>
                <OnLoad function="AddonTest_Titlebox_OnLoad"/>
                <OnDragStart>
                    self:StartMoving()
                </OnDragStart>
                <OnDragStop>
                    self:StopMovingOrSizing()
                </OnDragStop>
            </Scripts>
        </Button>
    
        <Frame name="AddonTest" parent="AddonTest_Titlebox" movable="true" >
            <Size x="300" y="700"/>
            <Anchors>
                <Anchor point="TOPLEFT" relativePoint="TOPLEFT" relativeTo="UIParent"/>
            </Anchors>
            <TitleRegion>
                <Size x="100" y="20"/>
                <Anchors>
                    <Anchor point="TOP"/>
                </Anchors>
             </TitleRegion>
            <Layers>
                <Layer level="OVERLAY">
                    <FontString name="$parentTest1" parentKey="test1" inherits="GameFontNormal" justifyH="LEFT" text="Seriously!">
                        <Size x="400" y="20"/>
                        <Anchors>
                            <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT">
                                <Offset>
                                    <AbsDimension x="25" y="-35"/>
                                </Offset>
                            </Anchor>
                        </Anchors>
                    </FontString>
                </Layer>
            </Layers>
            <Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
                <BackgroundInsets>
                    <AbsInset left="8" right="8" top="8" bottom="8"/>
                </BackgroundInsets>
                <TileSize>
                    <AbsValue val="32"/>
                </TileSize> 
                <EdgeSize>
                    <AbsValue val="25"/>
                </EdgeSize>
            </Backdrop>
            <Frames>
                <Button name="$parent_Close" parentKey="close" inherits="UIPanelCloseButton">
                    <Anchors>
                        <Anchor point="TOPRIGHT" relativeTo="$parent">
                            <Offset x="-2" y="-2"/>
                        </Anchor>
                    </Anchors>
                    <Layers>
                        <Layer level="BORDER">
                            <Texture name="$parent_CloseBorder" parentKey="closeBorder" file="Interface\DialogFrame\UI-DialogBox-Corner">
                                <Size x="33" y="33"/>
                                <Anchors>
                                    <Anchor>
                                        <Offset x="-5" y="-4"/>
                                    </Anchor>
                                </Anchors>
                            </Texture>
                        </Layer> 
                    </Layers>
                </Button>
            </Frames>
        </Frame>
    
     </Ui>
    

    Without specifically addressing your code, since I don't have access to WoW on this machine, you'd do the following:

    1. Create your frame as you would normally, don't do anything special with it other than movable="true".
    2. Create a button as a sub-frame of the main frame that overlaps the 'title bar region' you're talking about.
    3. However you want to start the move, click/mousedown/drag, call self:GetParent():StartMoving() and call self:GetParent():StopMovingOrSizing() when you're done

    That should be it, really!

    Great, thanks very much.