Thread Tools Display Modes
05-31-09, 05:50 PM   #1
Sorian
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 19
EditBox problem

I am trying to add an input box the the in-game addon options panel. I am adding the current value into the box, but it is off the left side of the box, so you cant see it unless you click the box and hit the left arrow so it scrolls. Any ideas why this might be happening?

Basically, the box appears empty, until you click it and scroll left.

I have tried adjusting the insets and centering the text in the box, neither of which worked.

Code:
CreateFrame("EditBox", "CR_EditBox_Stone", InterfaceOptionsFrame, "InputBoxTemplate")
CR_EditBox_Stone:SetWidth(30)
CR_EditBox_Stone:SetHeight(28)
CR_EditBox_Stone:SetAutoFocus(false)
CR_EditBox_Stone:SetNumeric(true)
CR_EditBox_Stone:SetMaxLetters(2)
CR_EditBox_Stone:SetFontObject("GameFontNormal")
CR_EditBox_Stone:SetPoint("TOPLEFT", CR_CheckButton_Stone, "BOTTOMLEFT", 0, 0)
__________________
  Reply With Quote
05-31-09, 06:43 PM   #2
Nirrudn
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 17
Try a CR_EditBox_Stone:SetCursorPosition(0) in there? Might have to follow with a ClearFocus, I'm not sure if SetCursorPosition causes it start receiving keyboard input or not.

Are you setting the value via InsertText or SetText? Sounds like they might behave differently.
  Reply With Quote
05-31-09, 06:49 PM   #3
Sorian
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 19
I have tried SetText and SetNumber.

I will try your suggestion and report back.
__________________
  Reply With Quote
05-31-09, 07:03 PM   #4
Sorian
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 19
That appears to have solved my problem, thanks.
__________________
  Reply With Quote
01-07-11, 03:53 AM   #5
silentstone7
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 14
Talking

For the record, I just wanted to add that :SetCursorPosition(0) by itself does solve the problem.

Thanks a million for this post, I didn't even know that this was the problem I was having until I read this thread. I just kept wondering why my editboxes were always empty.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » EditBox problem


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