Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:Creating simple pop-up dialog boxes
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Editable text fields === To add a editbox in the popup set the ''hasEditBox'' option field to true. The EditBox gets the name "$parentEditBox", relative to the Popup, and is also available in the popup's ''.editBox'' field. (Recall that the popup dialog is the value returned from the ''StaticPopup_Show()'' function.) To get and set the value of the EditBox use the following code: OnShow = function (self, data) self.editBox:SetText("Some text goes here") end, OnAccept = function (self, data, data2) local text = self.editBox:GetText() -- do whatever you want with it end, hasEditBox = true More complicated usage might be to use OnShow to call <tt>self.button1:Disable()</tt> (graying out the Accept button), and then including the following in your options table to allow the Accept button to be clicked as soon as the user types something in the text field: EditBoxOnTextChanged = function (self, data) -- careful! 'self' here points to the editbox, not the dialog self:GetParent().button1:Enable() -- self:GetParent() is the dialog end Using ''hasEditBox''/''.editBox'' causes a small one-line text field to appear. You can use the ''hasWideEditBox'' option field (and the corresponding ''.wideEditBox'' dialog field) to cause the text field to have the full width of the dialog box instead. To do this, you must set both options, but only the wide edit box will be used. Both normal and wide editboxes will respect the ''maxLetters'' field if you set it (most editbox popups used by Blizzard set this to 24 or 31).
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)