WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Small help with AceGUI layout (https://www.wowinterface.com/forums/showthread.php?t=59134)

onesock 05-25-22 01:56 PM

Small help with AceGUI layout
 
1 Attachment(s)
I am trying to follow a simple example posted by the AceGUI author. I think I am missing something simple.
Ultimately I am trying to have an independent frame that contains large textbox that scales to size.

Code:

function CreateScrollFrame(widget, height)
    local scrollcontainer = AceGUI:Create("SimpleGroup") -- "InlineGroup" is also good
    scrollcontainer:SetFullWidth(true)
    if height then
        scrollcontainer:SetHeight(height)
    else
        scrollcontainer:SetFullHeight(true)
    end
    scrollcontainer:SetLayout("Fill")

    widget:AddChild(scrollcontainer)

    local scrollFrame = AceGUI:Create("ScrollFrame")
    scrollFrame:SetLayout("Flow")
    scrollcontainer:AddChild(scrollFrame)

    return scrollFrame
end

initImportGui = function ()
    local frame = AceGUI:Create("Frame")
    frame:SetWidth(500)
    frame:SetHeight(600)
    frame:SetTitle("Import/Export List")

    local scrollFrame = CreateScrollFrame(frame)
   
    local editBox = AceGUI:Create("MultiLineEditBox")
    editBox:DisableButton(true)
    editBox:SetLabel("")
    editBox:SetFullWidth(true)

    scrollFrame:AddChild(editBox)
    editBox:SetFullHeight(true)

    return frame
end

I commented out the actual editbox and the frame defined as "SimpleGroup" that has "SetFullHeight(true)" does not scale to the height of the containing frame. Any idea what I'm missing?

myrroddin 05-25-22 06:58 PM

Lua Code:
  1. widget:SetNumLines(integer)
  2. widget:SetRelativeWidth(1.0)

You can see how I did it by looking at lines 43-53 of Main.lua of TradeSkillMaster_StringConverter.

onesock 05-27-22 09:27 PM

Thanks that helped to scale the editbox itself to 1:1 ratio for height. I was actually wondering if it could be automatically done or if I had to hook into the container's resize event. I found OnHeightSet digging into the codebase.

Thanks


All times are GMT -6. The time now is 07:29 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI