@@ -234,6 +234,12 @@ namespace lsp
234234 handler_id_t id;
235235 id = sSlots .add (SLOT_CHANGE , slot_on_change, self ());
236236 if (id >= 0 ) id = sSlots .add (SLOT_SUBMIT , slot_on_change, self ());
237+ if (id >= 0 ) id = sSlots .add (SLOT_CANCEL , slot_on_cancel, self ());
238+ if (id < 0 )
239+ return -id;
240+
241+ // Bind ListBox slots
242+ id = sLBox .slots ()->bind (SLOT_CANCEL , slot_on_listbox_cancel, self ());
237243 if (id < 0 )
238244 return -id;
239245
@@ -669,14 +675,27 @@ namespace lsp
669675
670676 status_t ComboGroup::slot_on_change (Widget *sender, void *ptr, void *data)
671677 {
672- ComboGroup *_this = widget_ptrcast<ComboGroup>(ptr);
673- return (_this != NULL ) ? _this ->on_change () : STATUS_BAD_ARGUMENTS ;
678+ ComboGroup *const self = widget_ptrcast<ComboGroup>(ptr);
679+ return (self != NULL ) ? self ->on_change () : STATUS_BAD_ARGUMENTS ;
674680 }
675681
676682 status_t ComboGroup::slot_on_submit (Widget *sender, void *ptr, void *data)
677683 {
678- ComboGroup *_this = widget_ptrcast<ComboGroup>(ptr);
679- return (_this != NULL ) ? _this->on_submit () : STATUS_BAD_ARGUMENTS ;
684+ ComboGroup *const self = widget_ptrcast<ComboGroup>(ptr);
685+ return (self != NULL ) ? self->on_submit () : STATUS_BAD_ARGUMENTS ;
686+ }
687+
688+ status_t ComboGroup::slot_on_cancel (Widget *sender, void *ptr, void *data)
689+ {
690+ ComboGroup *const self = widget_ptrcast<ComboGroup>(ptr);
691+ return (self != NULL ) ? self->on_cancel () : STATUS_BAD_ARGUMENTS ;
692+ }
693+
694+ status_t ComboGroup::slot_on_listbox_cancel (Widget *sender, void *ptr, void *data)
695+ {
696+ ComboGroup * const self = widget_ptrcast<ComboGroup>(ptr);
697+ self->sOpened .set (false );
698+ return self->sSlots .execute (SLOT_CANCEL , self, NULL );
680699 }
681700
682701 status_t ComboGroup::on_change ()
@@ -689,6 +708,11 @@ namespace lsp
689708 return STATUS_OK ;
690709 }
691710
711+ status_t ComboGroup::on_cancel ()
712+ {
713+ return STATUS_OK ;
714+ }
715+
692716 status_t ComboGroup::on_mouse_down (const ws::event_t *e)
693717 {
694718 if (nMBState == 0 )
0 commit comments