View Single Post
04/08/14, 08:40 PM   #31
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Hmm, guess ZoFontGameLarge isn't that much larger than ZoFontGame rofl. I probably didn't notice the difference.

I added another combo box with a selection of built in fonts listed in Zgoo, not figured out whether there is a way to set the font per option but probably not a good idea seeing as it seems to be using the same font for the whole control.

I adjusted my combo box function to add an option callback function and in the OnSelect function I return the font selected to the callback function so that it can use it and I told it to change the font for the dropdowns of the combo boxes. It changes the selected font to the same font as well.

Some don't look much different but some of them you can definitely see the change.

SetResizeToFitDescendents don't seem to work unless I am expecting it to do something different at the wrong time.

Anyway,

Function header line was changed to
Lua Code:
  1. local function CreateDropDown(name,parent,data,selected,callback)
And the OnSelect function was changed to
Lua Code:
  1. combo.dropdown.OnSelect = function(self,value)
  2.     self:SetSelectedItem(value)
  3.     if callback then callback(value) end
  4. end
The call to this function changed to ..
Lua Code:
  1. Fonts = CreateDropDown("Fonts",testTLW,choices3,"ZoFontGame",function(value) UseFont(value) end)
And that callback function
Lua Code:
  1. local function UseFont(fontName)
  2.     Fonts.dropdown:SetFont(fontName)
  3.     GreekAlphabet.dropdown:SetFont(fontName)
  4.     Weekdays.dropdown:SetFont(fontName)
  5. end

Picture showing what it looks like now. Just did a quick test to see if you can turn off the names but nada .. so even though the variables are local the frames/windows still have global names .. which is a pity.
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20140409_033706.jpg
Views:	675
Size:	406.5 KB
ID:	113  
  Reply With Quote