Skip to content

Commit

Permalink
fix (handlers): Proper testing for handler applicability.
Browse files Browse the repository at this point in the history
  • Loading branch information
v-ein authored and hoffstadt committed Jan 6, 2024
1 parent 01f646e commit 7445213
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/mvItemHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,47 +65,47 @@ void mvItemHandlerRegistry::onBind(mvAppItem* item)

case mvAppItemType::mvDeactivatedHandler:
{
if (!(applicableState & ~MV_STATE_DEACTIVATED))
if (!(applicableState & MV_STATE_DEACTIVATED))
mvThrowPythonError(mvErrorCode::mvNone, "bind_item_handler_registry",
"Item Handler Registry includes inapplicable handler: mvDeactivatedHandler", item);
break;
}

case mvAppItemType::mvEditedHandler:
{
if (!(applicableState & ~MV_STATE_EDITED))
if (!(applicableState & MV_STATE_EDITED))
mvThrowPythonError(mvErrorCode::mvNone, "bind_item_handler_registry",
"Item Handler Registry includes inapplicable handler: mvEditedHandler", item);
break;
}

case mvAppItemType::mvFocusHandler:
{
if (!(applicableState & ~MV_STATE_FOCUSED))
if (!(applicableState & MV_STATE_FOCUSED))
mvThrowPythonError(mvErrorCode::mvNone, "bind_item_handler_registry",
"Item Handler Registry includes inapplicable handler: mvFocusHandler", item);
break;
}

case mvAppItemType::mvHoverHandler:
{
if (!(applicableState & ~MV_STATE_HOVER))
if (!(applicableState & MV_STATE_HOVER))
mvThrowPythonError(mvErrorCode::mvNone, "bind_item_handler_registry",
"Item Handler Registry includes inapplicable handler: mvHoverHandler", item);
break;
}

case mvAppItemType::mvResizeHandler:
{
if (!(applicableState & ~MV_STATE_RECT_SIZE))
if (!(applicableState & MV_STATE_RECT_SIZE))
mvThrowPythonError(mvErrorCode::mvNone, "bind_item_handler_registry",
"Item Handler Registry includes inapplicable handler: mvResizeHandler", item);
break;
}

case mvAppItemType::mvToggledOpenHandler:
{
if (!(applicableState & ~MV_STATE_TOGGLED_OPEN))
if (!(applicableState & MV_STATE_TOGGLED_OPEN))
mvThrowPythonError(mvErrorCode::mvNone, "bind_item_handler_registry",
"Item Handler Registry includes inapplicable handler: mvToggledOpenHandler", item);
break;
Expand Down

0 comments on commit 7445213

Please sign in to comment.