WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   (ace3) Need help changing the multiline edit box to have more lines (https://www.wowinterface.com/forums/showthread.php?t=55437)

galvin 06-03-17 12:23 PM

(ace3) Need help changing the multiline edit box to have more lines
 
trying to use a custom control to change the default size of the editbox, but its not working. Any ideas?


Code:

local function MultiLineEditBoxConstructor()
  local Widget = AceGUI:Create('MultiLineEditBox')

  Widget.type = MultiLineEditBoxWidgetType
  Widget:SetNumLines(20)

  return AceGUI:RegisterAsWidget(Widget)
end

AceGUI:RegisterWidgetType(MultiLineEditBoxWidgetType, MultiLineEditBoxConstructor, MultiLineEditBoxWidgetVersion)


Seerah 06-03-17 12:35 PM

Did you try just changing the size of the box?

/edit: SetNumLines() just changes how many lines the scrolling editbox will hold.

galvin 06-03-17 01:07 PM

SetNumLines does that. If you look at the lib AceGUIWidget-MultiLineEditBox.lua

SetNumLines calls Layout
Code:

local function Layout(self)
        self:SetHeight(self.numlines * 14 + (self.disablebutton and 19 or 41) + self.labelHeight)

        if self.labelHeight == 0 then
                self.scrollBar:SetPoint("TOP", self.frame, "TOP", 0, -23)
        else
                self.scrollBar:SetPoint("TOP", self.label, "BOTTOM", 0, -19)
        end

        if self.disablebutton then
                self.scrollBar:SetPoint("BOTTOM", self.frame, "BOTTOM", 0, 21)
                self.scrollBG:SetPoint("BOTTOMLEFT", 0, 4)
        else
                self.scrollBar:SetPoint("BOTTOM", self.button, "TOP", 0, 18)
                self.scrollBG:SetPoint("BOTTOMLEFT", self.button, "TOPLEFT")
        end
end

I don't fully understand how all of ace3 works. Maybe this isn't doing what I think it does. I need to be sure if I do change the size that it works well with aceconfig dialog.

galvin 06-03-17 03:18 PM

Looks like I figured it out. Widget.button:SetPoint("BOTTOMLEFT", 0, -200)
Or what not will make the box larger.

Too bad there's no way to make it autosize on the vertical, that I know of. But this will do.

Unrealrules 06-03-17 06:13 PM

Hi

Do you tryed this ?

Quote:

local eb = AceGUI:Create(MultiLineEditBoxWidgetType)
eb:SetLabel('abc')
eb:SetMaxLetters(0)
eb:SetText("")
eb:SetWidth(300)

local f = AceGUI:Create("Frame")
f:SetWidth(300)

f:AddChild(eb)
PS:I had same problems. :rolleyes:

Vrul 06-03-17 07:10 PM

If you are using AceConfig to build your options then you can set the number of lines in the declaration:
Code:

custom = {
        type = 'input',
        multiline = 20,
        name = "OptionName",
        desc = "Option Description",
        width = 'full',
        get = function() return "" end,
        set = function() end       
}


Seerah 06-03-17 08:06 PM

I believe he's using AceGUI directly.

galvin 06-06-17 01:24 AM

I'm using aceconfig, I already got it to work. But had to use a custom control to modify the multiline editbox.
I didn't want to rewrite the multiline editbox control that was already coded in the acelib. So it was easier to just use the existing one and modify it. Lot less work.

Thanks

Seerah 06-06-17 12:04 PM

Quote:

Originally Posted by galvin (Post 323643)
I'm using aceconfig

Ah, that's helpful to know. The documented method to change the size, and what Vrul posted above, does not work?

galvin 06-07-17 12:05 PM

I don't know they had the lower left anchored to a button. I haven't tried that way, but I also needed to remove the accept button, so the custom control is the only way to go now. Its all working anyway.


All times are GMT -6. The time now is 01:55 PM.

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