I took a quick scan through the search results on this forum and am still confused as to how an EditBox can be resized. I noticed the addendum at the end of this wiki article (http://www.wowwiki.com/UIOBJECT_EditBox) regarding my issue. However, I am still unable to make any heigh changes.
This is my example code... the EditBox is still extending beyond the bottom of the parent frame.
I haven't played with editbox's that much, but I'm confused, as you're complaining that you're unable to change the Height, yet your code doesn't appear to have a :SetHeight call at all.
FYI, if you're setting it to be the same as a parent you can use :SetAllPoints(parent)
I haven't played with editbox's that much, but I'm confused, as you're complaining that you're unable to change the Height, yet your code doesn't appear to have a :SetHeight call at all.
FYI, if you're setting it to be the same as a parent you can use :SetAllPoints(parent)
Well as I'll point you to my original post... I referenced a wowwiki page which specifically dictated to set your EditBox's TOP and BOTTOM points to fixate the height.
To reiterate, I have attempted to "SetHeight()" to no success. The EditBox continues to flow past the bounds of any "heigh" I set.
I'm sure you meant to include a SetPoint() et al. call... however that produces the same results. The "SetHeight()" call is completely negligible. Remember, fixating the width works as expected, fixating the height is what I'm having problems with.
I'm sure you meant to include a SetPoint() et al. call... however that produces the same results. The "SetHeight()" call is completely negligible. Remember, fixating the width works as expected, fixating the height is what I'm having problems with.
No, I didn't mean to include one. I typed the code exactly as you should have. You should be setting the points on the frame you're placing it on.
No, I didn't mean to include one. I typed the code exactly as you should have. You should be setting the points on the frame you're placing it on.
Running the code as you state... basically creates an editbox with 0 anchor points. Not sure if that's what you had intended or not. In effect, an invisible (offscreen) frame.
Running the code as you state... basically creates an editbox with 0 anchor points. Not sure if that's what you had intended or not. In effect, an invisible (offscreen) frame.
Running the code as you state... basically creates an editbox with 0 anchor points. Not sure if that's what you had intended or not. In effect, an invisible (offscreen) frame.
editbox = CreateFrame("EditBox", nil, frame)
Like I already told you, set the point on the frame you're placing it on. E.g. Here's a rip from my addon, BasicChatMods, that works fine.
Like I already told you, set the point on the frame you're placing it on. E.g. Here's a rip from my addon, BasicChatMods, that works fine.
I know you're attempting to help out. I'm not using a ScrollFrame... if that's the only way to fixate the size of the EditBox then so be it, and say that specifically. I was merely attempting to determine (using the wowwiki info) why I was unable to specify a height on a multiline EditBox.
Also to note, it might be a good idea to edit the wowwiki page stating your findings funkydude.
Your editbox's height is determined by its parent's TOP and BOTTOM anchors (as written in code after your SetParent call), thus any attempts to change the editbox's height is ignored.
To make height changes, you have to change's the parent's height, or ClearAllPoints() and set new anchor points.
Also, the anchor points are NOT related to its parent. You need to call it like this:
You can anchor any point to any other frame's points (without creating cyclic dependencies). Parenting has its own set of hierarchy (affects alpha and show/hide status only) separate from anchoring hierarchy (affects frame position only).
Took me a while searching around I found this thread... here is a working minimal version of the above without unnecessary noise
it doesn't quite answer the OP's question though, on how to set a multi line edit box without a scroll bar, but can be useful for others (works when pasted in /lua wowlua addon; every line is necessary for it to work)
local s = CreateFrame("ScrollFrame", nil, UIParent, "UIPanelScrollFrameTemplate") -- or you actual parent instead s:SetSize(300,200) s:SetPoint("CENTER") local e = CreateFrame("EditBox", nil, s) e:SetMultiLine(true) e:SetFontObject(ChatFontNormal) e:SetWidth(280) -- 300 - 20 or so for scroll bar s:SetScrollChild(e) --- demo multi line text e:SetText("line 1\nline 2\nline 3\nmore...\n\n\n\n\n\nanother one\n" .."some very long...dsf v asdf a sdf asd df as df asdf a sdfd as ddf as df asd f asd fd asd f asdf LONG LINE\n\n\nsome more.\nlast!") e:HighlightText() -- select all (if to be used for copy paste) -- optional/just to close that frame e:SetScript("OnEscapePressed", function() s:Hide() end)
This is my example code... the EditBox is still extending beyond the bottom of the parent frame.
editbox = CreateFrame("EditBox");
editbox:SetMultiLine( true );
editbox:SetParent(frame); -- parent frame has fixed dimensions
editbox:SetPoint("TOP");
editbox:SetPoint("BOTTOM");
editbox:SetWidth(parentwidth);
editbox:SetFontObject(ErrorFont);
FYI, if you're setting it to be the same as a parent you can use :SetAllPoints(parent)
Well as I'll point you to my original post... I referenced a wowwiki page which specifically dictated to set your EditBox's TOP and BOTTOM points to fixate the height.
To reiterate, I have attempted to "SetHeight()" to no success. The EditBox continues to flow past the bounds of any "heigh" I set.
I'm sure you meant to include a SetPoint() et al. call... however that produces the same results. The "SetHeight()" call is completely negligible. Remember, fixating the width works as expected, fixating the height is what I'm having problems with.
No, I didn't mean to include one. I typed the code exactly as you should have. You should be setting the points on the frame you're placing it on.
Running the code as you state... basically creates an editbox with 0 anchor points. Not sure if that's what you had intended or not. In effect, an invisible (offscreen) frame.
Please post your entire code.
I will, however, say try this,
editbox = CreateFrame("EditBox", nil, frame)
Like I already told you, set the point on the frame you're placing it on. E.g. Here's a rip from my addon, BasicChatMods, that works fine.
I know you're attempting to help out. I'm not using a ScrollFrame... if that's the only way to fixate the size of the EditBox then so be it, and say that specifically. I was merely attempting to determine (using the wowwiki info) why I was unable to specify a height on a multiline EditBox.
Also to note, it might be a good idea to edit the wowwiki page stating your findings funkydude.
Thank you for the help.
To make height changes, you have to change's the parent's height, or ClearAllPoints() and set new anchor points.
Also, the anchor points are NOT related to its parent. You need to call it like this:
editbox:SetPoint("TOP", frame, "TOP", 0, 0);
editbox:SetPoint("BOTTOM", frame, "BOTTOM", 0, 0);
You can anchor any point to any other frame's points (without creating cyclic dependencies). Parenting has its own set of hierarchy (affects alpha and show/hide status only) separate from anchoring hierarchy (affects frame position only).
Took me a while searching around I found this thread... here is a working minimal version of the above without unnecessary noise
it doesn't quite answer the OP's question though, on how to set a multi line edit box without a scroll bar, but can be useful for others (works when pasted in /lua wowlua addon; every line is necessary for it to work)