summaryrefslogtreecommitdiff
path: root/src/ui/widget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r--src/ui/widget.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c
index b07b5709..0db8b8fd 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -551,11 +551,18 @@ iBool isSelected_Widget(const iWidget *d) {
551 return (d->flags & selected_WidgetFlag) != 0; 551 return (d->flags & selected_WidgetFlag) != 0;
552} 552}
553 553
554iBool equalWidget_Command(const char *cmd, const iWidget *widget, const char *checkCommand) {
555 if (equal_Command(cmd, checkCommand)) {
556 const iWidget *src = pointer_Command(cmd);
557 iAssert(!src || strstr(cmd, " ptr:"));
558 return src == widget || hasParent_Widget(src, widget);
559 }
560 return iFalse;
561}
562
554iBool isCommand_Widget(const iWidget *d, const SDL_Event *ev, const char *cmd) { 563iBool isCommand_Widget(const iWidget *d, const SDL_Event *ev, const char *cmd) {
555 if (isCommand_UserEvent(ev, cmd)) { 564 if (ev->type == SDL_USEREVENT && ev->user.code == command_UserEventCode) {
556 const iWidget *src = pointer_Command(command_UserEvent(ev)); 565 return equalWidget_Command(command_UserEvent(ev), d, cmd);
557 iAssert(!src || strstr(ev->user.data1, " ptr:"));
558 return src == d || hasParent_Widget(src, d);
559 } 566 }
560 return iFalse; 567 return iFalse;
561} 568}