-float InputContainer_mouseDrag(entity me, vector pos)
-{
- if(SUPER(InputContainer).mouseDrag(me, pos))
- return 1;
- if(pos.x >= 0 && pos.y >= 0 && pos.x < 1 && pos.y < 1)
- return 1;
- return 0;
-}
-float InputContainer_mouseMove(entity me, vector pos)
-{
- if(me.mouseFocusedChild != me.focusedChild) // if the keyboard moved the focus away
- me.mouseFocusedChild = NULL; // force focusing
- if(me._changeFocusXY(me, pos))
- if(SUPER(InputContainer).mouseMove(me, pos))
- return 1;
- if(pos.x >= 0 && pos.y >= 0 && pos.x < 1 && pos.y < 1)
- return 1;
- return 0;
-}
-float InputContainer_mousePress(entity me, vector pos)
-{
- me.mouseFocusedChild = NULL; // force focusing
- if(me._changeFocusXY(me, pos))
- if(SUPER(InputContainer).mousePress(me, pos))
- return 1;
- if(pos.x >= 0 && pos.y >= 0 && pos.x < 1 && pos.y < 1)
- return 1;
- return 0;
-}
-float InputContainer_mouseRelease(entity me, vector pos)
-{
- SUPER(InputContainer).mouseRelease(me, pos); // return value?
- if(me.focused) // am I still eligible for this? (UGLY HACK, but a mouse event could have changed focus away)
- if(me._changeFocusXY(me, pos))
- return 1;
- if(pos.x >= 0 && pos.y >= 0 && pos.x < 1 && pos.y < 1)
- return 1;
- return 0;
-}
-#endif
+ float InputContainer_mouseDrag(entity me, vector pos)
+ {
+ if (SUPER(InputContainer).mouseDrag(me, pos)) return 1;
+ if (pos.x >= 0 && pos.y >= 0 && pos.x < 1 && pos.y < 1) return 1;
+ return 0;
+ }
+ float InputContainer_mouseMove(entity me, vector pos)
+ {
+ if (me.mouseFocusedChild != me.focusedChild) // if the keyboard moved the focus away
+ me.mouseFocusedChild = NULL; // force focusing
+ if (me._changeFocusXY(me, pos))
+ if (SUPER(InputContainer).mouseMove(me, pos)) return 1;
+ if (pos.x >= 0 && pos.y >= 0 && pos.x < 1 && pos.y < 1) return 1;
+ return 0;
+ }
+ METHOD(InputContainer, mousePress, bool(InputContainer this, vector pos))
+ {
+ this.mouseFocusedChild = NULL; // force focusing
+ if (this._changeFocusXY(this, pos))
+ if (SUPER(InputContainer).mousePress(this, pos)) return true;
+ if (pos.x >= 0 && pos.y >= 0 && pos.x < 1 && pos.y < 1) return true;
+ return false;
+ }
+ float InputContainer_mouseRelease(entity me, vector pos)
+ {
+ SUPER(InputContainer).mouseRelease(me, pos); // return value?
+ if (me.focused) // am I still eligible for this? (UGLY HACK, but a mouse event could have changed focus away)
+ if (me._changeFocusXY(me, pos)) return 1;
+ if (pos.x >= 0 && pos.y >= 0 && pos.x < 1 && pos.y < 1) return 1;
+ return 0;
+ }