Implement mouse event propagation
This commit is contained in:
parent
7f7363e30b
commit
1697c4fc5d
18 changed files with 135 additions and 60 deletions
|
|
@ -55,19 +55,21 @@ void CheckboxLabel::OnPaint(Canvas* canvas)
|
|||
canvas->drawText(Point(14.0, GetHeight() - 5.0), Colorf::fromRgba8(255, 255, 255), text);
|
||||
}
|
||||
|
||||
void CheckboxLabel::OnMouseDown(const Point& pos, int key)
|
||||
bool CheckboxLabel::OnMouseDown(const Point& pos, int key)
|
||||
{
|
||||
mouseDownActive = true;
|
||||
SetFocus();
|
||||
return true;
|
||||
}
|
||||
|
||||
void CheckboxLabel::OnMouseUp(const Point& pos, int key)
|
||||
bool CheckboxLabel::OnMouseUp(const Point& pos, int key)
|
||||
{
|
||||
if (mouseDownActive)
|
||||
{
|
||||
Toggle();
|
||||
}
|
||||
mouseDownActive = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CheckboxLabel::OnMouseLeave()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue