mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(ui): add CSimpleSlider::OnLayerMouseDown
This commit is contained in:
parent
79482ea860
commit
01bea8630e
@ -133,6 +133,16 @@ void CSimpleSlider::OnLayerHide() {
|
||||
this->CSimpleFrame::OnLayerHide();
|
||||
}
|
||||
|
||||
int32_t CSimpleSlider::OnLayerMouseDown(const CMouseEvent& evt, const char* btn) {
|
||||
// TODO something like CSimpleFrame::IsEnabled or CSimpleFrame::GetFrameFlag
|
||||
if (!(this->m_flags & 0x400)) {
|
||||
this->m_buttonDown = 1;
|
||||
this->OnLayerTrackUpdate(evt);
|
||||
}
|
||||
|
||||
return this->CSimpleFrame::OnLayerMouseDown(evt, btn);
|
||||
}
|
||||
|
||||
int32_t CSimpleSlider::OnLayerTrackUpdate(const CMouseEvent& evt) {
|
||||
if (this->m_buttonDown && this->m_thumbTexture) {
|
||||
auto thumbTexture = this->m_thumbTexture;
|
||||
|
||||
@ -36,6 +36,7 @@ class CSimpleSlider : public CSimpleFrame {
|
||||
virtual void OnLayerHide();
|
||||
virtual void OnLayerUpdate(float elapsedSec);
|
||||
virtual int32_t OnLayerTrackUpdate(const CMouseEvent& evt);
|
||||
virtual int32_t OnLayerMouseDown(const CMouseEvent& evt, const char* btn);
|
||||
|
||||
// Member functions
|
||||
CSimpleSlider(CSimpleFrame* parent)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user