Thread Tools Display Modes
06-03-17, 12:23 PM   #1
galvin
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 265
(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)
  Reply With Quote
06-03-17, 12:35 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Did you try just changing the size of the box?

/edit: SetNumLines() just changes how many lines the scrolling editbox will hold.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
06-03-17, 01:07 PM   #3
galvin
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 265
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.

Last edited by galvin : 06-03-17 at 01:09 PM.
  Reply With Quote
06-03-17, 03:18 PM   #4
galvin
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 265
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.
  Reply With Quote
06-03-17, 06:13 PM   #5
Unrealrules
A Defias Bandit
Join Date: Nov 2015
Posts: 3
Hi

Do you tryed this ?

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.
  Reply With Quote
06-03-17, 07:10 PM   #6
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
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	
}
  Reply With Quote
06-03-17, 08:06 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
I believe he's using AceGUI directly.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
06-06-17, 01:24 AM   #8
galvin
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 265
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

Last edited by galvin : 06-06-17 at 01:26 AM.
  Reply With Quote
06-06-17, 12:04 PM   #9
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Originally Posted by galvin View Post
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?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
06-07-17, 12:05 PM   #10
galvin
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 265
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.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » (ace3) Need help changing the multiline edit box to have more lines

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off