About: OptionHouse/Widgets   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

This page is dedicated to example widgets for OptionHouse. There will also be code for easily making the code work with your options. This code block provides RegisterCheckOption and RegisterSliderOption which take a get, set, and help function. The get function just returns what the value should be for the widget (checked or SetValue status), set is called whenever the value of the widget changes. Finally the option help function is called when the widget is moused-over. The mouse-over action is actually delayed to behave more like other UI elements outside of WoW. The code doesn't do any error checking so as such it is only provided as is. It has been pointed out that the behavior for the tooltips when using the help function is not the default in wow. As such, you can just set the toolt

AttributesValues
rdfs:label
  • OptionHouse/Widgets
rdfs:comment
  • This page is dedicated to example widgets for OptionHouse. There will also be code for easily making the code work with your options. This code block provides RegisterCheckOption and RegisterSliderOption which take a get, set, and help function. The get function just returns what the value should be for the widget (checked or SetValue status), set is called whenever the value of the widget changes. Finally the option help function is called when the widget is moused-over. The mouse-over action is actually delayed to behave more like other UI elements outside of WoW. The code doesn't do any error checking so as such it is only provided as is. It has been pointed out that the behavior for the tooltips when using the help function is not the default in wow. As such, you can just set the toolt
dcterms:subject
abstract
  • This page is dedicated to example widgets for OptionHouse. There will also be code for easily making the code work with your options. This code block provides RegisterCheckOption and RegisterSliderOption which take a get, set, and help function. The get function just returns what the value should be for the widget (checked or SetValue status), set is called whenever the value of the widget changes. Finally the option help function is called when the widget is moused-over. The mouse-over action is actually delayed to behave more like other UI elements outside of WoW. The code doesn't do any error checking so as such it is only provided as is. It has been pointed out that the behavior for the tooltips when using the help function is not the default in wow. As such, you can just set the tooltipText and not provide a help function to Register*Option, this will force the default behavior of the widgets os defined in the CreateCheckButton and CreateSlider. local RegisterCheckOption, RegisterSliderOption do -- put everything in a do..end block to make it private -- this could be any frame you want it to be you don't need the OnUpdate function for -- and will be shown with your options. local visFrame = CreateFrame("Frame") local helps = {} -- for storing help stuff -- timeout is how long before we forget we were showing, timeToShow is how -- long before we actually show, these values seem fairly sane local timeOut, timeToShow = 2.0, 0.5 local totalElapsed, showTooltip, state = 0 local onUpdate = function(frame, elapsed) totalElapsed = totalElapsed + elapsed if showTooltip then if totalElapsed > timeToShow and state == 1 then -- actually show stuff helps[showTooltip](showTooltip) state = 2 totalElapsed = 0 end -- we need to reshow the tooltip quickly if totalElapsed < timeOut and state == 2 then helps[showTooltip](showTooltip) state = 2 totalElapsed = 0 end else if totalElapsed > timeOut then -- reset our timeout state = 1 visFrame:SetScript("OnUpdate", nil) end end end local registerHelp = function(frame, helpFunc) helps[frame] = helpFunc end local showHelp = function(frame) showTooltip = frame totalElapsed = 0 if state ~= 2 then state = 1 end if visFrame then visFrame:SetScript("OnUpdate", onUpdate) end end local hideHelp = function() totalElapsed = 0 showTooltip = nil state = 2 GameTooltip:Hide() end RegisterCheckOption = function(frame, get, set, help) frame:SetScript("OnClick", function(self) set(self:GetChecked() or false) end ) frame:SetScript("OnShow", function(self) self:SetChecked(get()) end ) if help then registerHelp(frame, help) frame:SetScript("OnEnter", showHelp) frame:SetScript("OnLeave", hideHelp) end end RegisterSliderOption = function(frame, get, set, help) frame:SetScript("OnValueChanged", function(self) set(self:GetValue()) end ) frame:SetScript("OnShow", function(self) self:SetValue(get()) end ) if help then registerHelp(frame, help) frame:SetScript("OnEnter", showHelp) frame:SetScript("OnLeave", hideHelp) end end end
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software