WoW:Creating simple pop-up dialog boxes (source)
Revision as of 10:20, 24 November 2007
, 24 November 2007→Notes and Observations: Changed \ to /
m (→Notes and Observations: Changed \ to /) |
|||
| Line 158: | Line 158: | ||
== Notes and Observations == | == Notes and Observations == | ||
* The 'text' fields and button1/2 fields are usually localized. Blizzard tends to use generic texts like ACCEPT, CANCEL, and OKAY; you can probably do the same. They wrap all those in a call to TEXT() for translation, like <tt>button1 = TEXT(ACCEPT)</tt> | * The 'text' fields and button1/2 fields are usually localized. Blizzard tends to use generic texts like ACCEPT, CANCEL, and OKAY; you can probably do the same. They wrap all those in a call to TEXT() for translation, like <tt>button1 = TEXT(ACCEPT)</tt> | ||
* While creating your popup entries, you will probably be doing a lot of UI reloading. Extract the <tt>FrameXML | * While creating your popup entries, you will probably be doing a lot of UI reloading. Extract the <tt>[[FrameXML/DebugUI.xml]]</tt> file from the default UI, copy it into your addon folder, and add it to your .toc file. This has two effects: it starts verbose logging into FrameXML.log, and it adds a "Reload UI" button to your screen. Very handy timesaver. :-) | ||
* Added by [[user:Layrajha|Layrajha]]: The OnHide function will always be called after OnAccept or OnCancel have finished their execution. Therefore, it is safe to assume that your changes done in OnAccept or OnCancel will be done when OnHide is called. Also note that you can prevent the popup from hiding after clicking the "Accept" button: just make the OnAccept function return "true" (or anything different from "nil" and "false", it will work just as well). | * Added by [[user:Layrajha|Layrajha]]: The OnHide function will always be called after OnAccept or OnCancel have finished their execution. Therefore, it is safe to assume that your changes done in OnAccept or OnCancel will be done when OnHide is called. Also note that you can prevent the popup from hiding after clicking the "Accept" button: just make the OnAccept function return "true" (or anything different from "nil" and "false", it will work just as well). | ||
-Documentation by [[user:Farmbuyer|Farmbuyer]] | -Documentation by [[user:Farmbuyer|Farmbuyer]] | ||
[[Category: HOWTOs|Popup Simple Dialog Boxes]] | [[Category: HOWTOs|Popup Simple Dialog Boxes]] | ||