LLColorSwatchCtrl::~LLColorSwatchCtrl () { // parent dialog is destroyed so we are too and we need to cancel selection LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)mPickerHandle.get(); if (pickerp) { pickerp->cancelSelection(); pickerp->close(); } mAlphaGradientImage = NULL; }
////////////////////////////////////////////////////////////////////////////// // called when 'cancel' clicked void LLFloaterColorPicker::onClickCancel ( void* data ) { if (data) { LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data; if ( self ) { self->cancelSelection (); self->close(); } } }
////////////////////////////////////////////////////////////////////////////// // called when 'select' clicked void LLFloaterColorPicker::onClickSelect ( void* data ) { if (data) { LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data; if ( self ) { // apply to selection LLColorSwatchCtrl::onColorChanged ( self->getSwatch (), LLColorSwatchCtrl::COLOR_SELECT ); self->close(); } } }
void LLColorSwatchCtrl::setEnabled( BOOL enabled ) { mCaption->setEnabled( enabled ); LLView::setEnabled( enabled ); if (!enabled) { LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)mPickerHandle.get(); if (pickerp) { pickerp->cancelSelection(); pickerp->close(); } } }