Thread Tools Display Modes
02-19-11, 09:26 AM   #1
Lanodar
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 6
Ui Escape and DropDownMenu

Hey

wanted to add a DropDownMenu to my Addon CCMark, to let the player select specific RaidTargetIcons.

I added a DropDownMenu with the following Code

Code:
if not DropDownMenuTest then
   CreateFrame("Button", "DropDownMenuTest", UIParent, "UIDropDownMenuTemplate")
end
 
DropDownMenuTest:ClearAllPoints()
DropDownMenuTest:SetPoint("CENTER", 0, 0)
DropDownMenuTest:Show()
 
local items = {
   "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_2:0|t".." Circle",
   "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_8:0|t".." Skull",
}
 
local function OnClick(self)
   UIDropDownMenu_SetSelectedID(DropDownMenuTest, self:GetID())
end
 
local function initialize(self, level)
   local info = UIDropDownMenu_CreateInfo()
   for k,v in pairs(items) do
      info = UIDropDownMenu_CreateInfo()
      info.text = v
      info.value = v
      info.func = OnClick
      UIDropDownMenu_AddButton(info, level)
   end
end
 
 
UIDropDownMenu_Initialize(DropDownMenuTest, initialize)
UIDropDownMenu_SetWidth(DropDownMenuTest, 100);
UIDropDownMenu_SetButtonWidth(DropDownMenuTest, 124)
UIDropDownMenu_SetSelectedID(DropDownMenuTest, 1)
UIDropDownMenu_JustifyText(DropDownMenuTest, "LEFT")
Everything works, except the RaidTargetIcons. When the DropDown Items show up, the Icons are shown, but when i select an Item, there's no Icon in my DropdownMenu.

Here are two Screenshots to show you what i'm talking about.



  Reply With Quote
02-19-11, 10:30 AM   #2
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
I've done something similar, but with an UI escape sequence texture in an Ace3 select itemtype, where it also wouldn't show up. I think the texture (sometimes) not showing up, occurs randomly, and in my case a quick /reload would make it show up again.

If in your case it never shows up at all ... then nvm ><

p.s. welcome to WoWInterface =)

Last edited by Ketho : 02-19-11 at 10:41 AM.
  Reply With Quote
02-19-11, 10:42 AM   #3
Lanodar
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 6
No it's random too.

Sometimes all icons are shown, and sometimes all but one or two are shown.

Very strange
  Reply With Quote
02-19-11, 06:33 PM   #4
Akkorian
A Flamescale Wyrmkin
 
Akkorian's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 111
Hi Lanodar,

Try changing your OnClick function to set the text on the dropdown again yourself. I’ve had problems with UIDropDownMenu_SetSelected* not always setting the text correctly.

Code:
local function OnClick(self)
   UIDropDownMenu_SetSelectedID(DropDownMenuTest, self:GetID())
   DropDownMenuTestText:SetText( items[ self:GetID() ] )
end
__________________
“Be humble, for you are made of earth. Be noble, for you are made of stars.”
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Ui Escape and DropDownMenu


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