| 46 | } |
| 47 | |
| 48 | bool IClickable::TestClick(float x, float y, bool right, bool testOnly /* = false */) |
| 49 | { |
| 50 | if (!mShowing) |
| 51 | return false; |
| 52 | |
| 53 | float w, h; |
| 54 | GetDimensions(w, h); |
| 55 | |
| 56 | float titleBarHeight = 0; |
| 57 | IDrawableModule* module = dynamic_cast<IDrawableModule*>(this); |
| 58 | if (module && module->HasTitleBar()) |
| 59 | titleBarHeight = IDrawableModule::TitleBarHeight(); |
| 60 | |
| 61 | if (x >= mX && y >= mY - titleBarHeight && x <= mX + w && y <= mY + h) |
| 62 | { |
| 63 | if (!testOnly) |
| 64 | OnClicked(x - mX, y - mY, right); |
| 65 | return true; |
| 66 | } |
| 67 | return false; |
| 68 | } |
| 69 | |
| 70 | bool IClickable::NotifyMouseMoved(float x, float y) |
| 71 | { |
no test coverage detected