Add win32 mouse button events.
This commit is contained in:
parent
2bc53186bc
commit
78a4fa99ff
20 changed files with 141 additions and 53 deletions
|
@ -5,8 +5,7 @@
|
|||
#include "TransformNode.h"
|
||||
|
||||
#include "MouseEvent.h"
|
||||
|
||||
#include <iostream>
|
||||
#include "FileLogger.h"
|
||||
|
||||
Button::Button()
|
||||
: Widget(),
|
||||
|
@ -44,7 +43,8 @@ void Button::setLabel(const std::string& text)
|
|||
|
||||
void Button::onMyMouseEvent(const MouseEvent* event)
|
||||
{
|
||||
if(event->GetAction() == MouseEvent::Action::Pressed)
|
||||
MLOG_INFO("Widget mouse event");
|
||||
if(event->getAction() == MouseEvent::Action::Pressed)
|
||||
{
|
||||
mCachedColor = mBackgroundColor;
|
||||
setBackgroundColor(mClickedColor);
|
||||
|
@ -53,7 +53,7 @@ void Button::onMyMouseEvent(const MouseEvent* event)
|
|||
mClickFunc(this);
|
||||
}
|
||||
}
|
||||
else if(event->GetAction() == MouseEvent::Action::Released)
|
||||
else if(event->getAction() == MouseEvent::Action::Released)
|
||||
{
|
||||
setBackgroundColor(mCachedColor);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue