Search and stamps scolling with mouse wheel, Esc to exit
This commit is contained in:
parent
838a612026
commit
299c1da9ae
@ -97,6 +97,8 @@ public:
|
||||
{
|
||||
cc->gameModel->SetStamp(cc->stamps->GetStamp());
|
||||
}
|
||||
else
|
||||
cc->gameModel->SetStamp(NULL);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -717,6 +717,10 @@ void GameView::OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bo
|
||||
|
||||
void GameView::OnTick(float dt)
|
||||
{
|
||||
if(selectMode==PlaceStamp && !stampThumb)
|
||||
selectMode = SelectNone;
|
||||
if(selectMode==PlaceClipboard&& !clipboardThumb)
|
||||
selectMode = SelectNone;
|
||||
if(zoomEnabled && !zoomCursorFixed)
|
||||
c->SetZoomPosition(currentMouse);
|
||||
if(drawMode == DrawPoints)
|
||||
|
@ -9,6 +9,7 @@
|
||||
#define KEY_TAB SDLK_TAB
|
||||
#define KEY_RETURN SDLK_RETURN
|
||||
#define KEY_ENTER SDLK_KP_ENTER
|
||||
#define KEY_ESCAPE SDLK_ESCAPE
|
||||
|
||||
#define KEY_CTRL SDLK_LCTRL
|
||||
#define KEY_ALT SDLK_LALT
|
||||
|
@ -241,3 +241,19 @@ void SearchView::OnTick(float dt)
|
||||
{
|
||||
c->Update();
|
||||
}
|
||||
|
||||
void SearchView::OnMouseWheel(int x, int y, int d)
|
||||
{
|
||||
if(!d)
|
||||
return;
|
||||
if(d<0)
|
||||
c->NextPage();
|
||||
else
|
||||
c->PrevPage();
|
||||
}
|
||||
void SearchView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt)
|
||||
{
|
||||
if(key==KEY_ESCAPE)
|
||||
c->Exit();
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,9 @@ public:
|
||||
virtual ~SearchView();
|
||||
void AttachController(SearchController * _c) { c = _c; }
|
||||
virtual void OnTick(float dt);
|
||||
virtual void OnMouseWheel(int x, int y, int d);
|
||||
virtual void OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt);
|
||||
|
||||
};
|
||||
|
||||
#endif // SEARCHVIEW_H
|
||||
|
@ -133,6 +133,21 @@ void StampsView::NotifyStampsListChanged(StampsModel * sender)
|
||||
}
|
||||
}
|
||||
|
||||
void StampsView::OnMouseWheel(int x, int y, int d)
|
||||
{
|
||||
if(!d)
|
||||
return;
|
||||
if(d<0)
|
||||
c->NextPage();
|
||||
else
|
||||
c->PrevPage();
|
||||
}
|
||||
void StampsView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt)
|
||||
{
|
||||
if(key==KEY_ESCAPE)
|
||||
c->Exit();
|
||||
}
|
||||
|
||||
StampsView::~StampsView() {
|
||||
// TODO Auto-generated destructor stub
|
||||
}
|
||||
|
@ -29,6 +29,8 @@ public:
|
||||
void AttachController(StampsController * c_) { c = c_; };
|
||||
void NotifyPageChanged(StampsModel * sender);
|
||||
void NotifyStampsListChanged(StampsModel * sender);
|
||||
virtual void OnMouseWheel(int x, int y, int d);
|
||||
virtual void OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt);
|
||||
virtual ~StampsView();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user