WoW:UIOBJECT ColorSelect: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(CategorySelect - Adding categories)
mNo edit summary
Line 1: Line 1:
{{widget}}
If you want to use a ColorSelect widget, you may want to consider using the [[Using the ColorPickerFrame]]. This is a frame already defined by Blizzard. You can display it by calling: ColorPickerFrame:Show()
If you want to use a ColorSelect widget, you may want to consider using the [[Using the ColorPickerFrame]]. This is a frame already defined by Blizzard. You can display it by calling: ColorPickerFrame:Show()


Line 6: Line 8:
* ColorPickerFrame.cancelFunc()
* ColorPickerFrame.cancelFunc()


==Example Code==
== Examples ==


:ColorPickerFrame.func = my_cpf_func;
:ColorPickerFrame.func = my_cpf_func;

Revision as of 06:50, 14 February 2015

Widget API < ColorSelect

If you want to use a ColorSelect widget, you may want to consider using the Using the ColorPickerFrame. This is a frame already defined by Blizzard. You can display it by calling: ColorPickerFrame:Show()

However, displaying it is not enough. You also need to define three functions:

  • ColorPickerFrame.func()
  • ColorPickerFrame.opacityFunc()
  • ColorPickerFrame.cancelFunc()

Examples

ColorPickerFrame.func = my_cpf_func;
ColorPickerFrame.opacityFunc = my_cpf_opacityfunc;
ColorPickerFrame.cancelFunc = my_cpf_cancelfunc;
function my_cpf_func()
print( "my_cpf_func()");
-- called when any member function is called on a ColorPickerFrame object
-- called numerous times when a point is clicked on the color wheel
-- called numerous times when a point is clicked on the shader bar
end
function my_cpf_opacityfunc()
print("my_cpf_opacityfunc()");
-- called when the user clicks the "Okay" button that is on the ColorPickerFrame
end
function my_cpf_cancelfunc()
print("my_cuf_cancelfunc()");
-- called when the user clicks the "Cancel" button that is on the ColorPickerFrame
end