No interaction with non-visible components"
This commit is contained in:
parent
c13b05d272
commit
e9fc64eed6
@ -164,7 +164,7 @@ void Window::DoKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool a
|
||||
//on key press
|
||||
if(focusedComponent_ != NULL)
|
||||
{
|
||||
if(!focusedComponent_->Locked)
|
||||
if(!focusedComponent_->Locked && focusedComponent_->Visible)
|
||||
focusedComponent_->OnKeyPress(key, character, shift, ctrl, alt);
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ void Window::DoKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool
|
||||
//on key unpress
|
||||
if(focusedComponent_ != NULL)
|
||||
{
|
||||
if(!focusedComponent_->Locked)
|
||||
if(!focusedComponent_->Locked && focusedComponent_->Visible)
|
||||
focusedComponent_->OnKeyRelease(key, character, shift, ctrl, alt);
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ void Window::DoMouseDown(int x_, int y_, unsigned button)
|
||||
bool clickState = false;
|
||||
for(int i = Components.size() - 1; i > -1 && !halt; --i)
|
||||
{
|
||||
if(!Components[i]->Locked)
|
||||
if(!Components[i]->Locked && Components[i]->Visible)
|
||||
{
|
||||
if(x >= Components[i]->Position.X && y >= Components[i]->Position.Y && x < Components[i]->Position.X + Components[i]->Size.X && y < Components[i]->Position.Y + Components[i]->Size.Y)
|
||||
{
|
||||
@ -213,7 +213,7 @@ void Window::DoMouseDown(int x_, int y_, unsigned button)
|
||||
//on mouse down
|
||||
for(int i = Components.size() - 1; i > -1 && !halt; --i)
|
||||
{
|
||||
if(!Components[i]->Locked)
|
||||
if(!Components[i]->Locked && Components[i]->Visible)
|
||||
Components[i]->OnMouseDown(x, y, button);
|
||||
}
|
||||
|
||||
@ -229,7 +229,7 @@ void Window::DoMouseMove(int x_, int y_, int dx, int dy)
|
||||
int y = y_ - Position.Y;
|
||||
for(int i = Components.size() - 1; i > -1 && !halt; --i)
|
||||
{
|
||||
if(!Components[i]->Locked)
|
||||
if(!Components[i]->Locked && Components[i]->Visible)
|
||||
{
|
||||
Point local (x - Components[i]->Position.X, y - Components[i]->Position.Y)
|
||||
, a (local.X - dx, local.Y - dy);
|
||||
@ -280,7 +280,7 @@ void Window::DoMouseUp(int x_, int y_, unsigned button)
|
||||
//on mouse unclick
|
||||
for(int i = Components.size() - 1; i >= 0 && !halt; --i)
|
||||
{
|
||||
if(!Components[i]->Locked)
|
||||
if(!Components[i]->Locked && Components[i]->Visible)
|
||||
{
|
||||
if(x >= Components[i]->Position.X && y >= Components[i]->Position.Y && x < Components[i]->Position.X + Components[i]->Size.X && y < Components[i]->Position.Y + Components[i]->Size.Y)
|
||||
{
|
||||
@ -293,7 +293,7 @@ void Window::DoMouseUp(int x_, int y_, unsigned button)
|
||||
//on mouse up
|
||||
for(int i = Components.size() - 1; i >= 0 && !halt; --i)
|
||||
{
|
||||
if(!Components[i]->Locked)
|
||||
if(!Components[i]->Locked && Components[i]->Visible)
|
||||
Components[i]->OnMouseUp(x, y, button);
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@ void Window::DoMouseWheel(int x_, int y_, int d)
|
||||
{
|
||||
if(x >= Components[i]->Position.X && y >= Components[i]->Position.Y && x < Components[i]->Position.X + Components[i]->Size.X && y < Components[i]->Position.Y + Components[i]->Size.Y)
|
||||
{
|
||||
if(!Components[i]->Locked)
|
||||
if(!Components[i]->Locked && Components[i]->Visible)
|
||||
Components[i]->OnMouseWheelInside(x - Components[i]->Position.X, y - Components[i]->Position.Y, d);
|
||||
break;
|
||||
}
|
||||
@ -320,7 +320,7 @@ void Window::DoMouseWheel(int x_, int y_, int d)
|
||||
//on mouse wheel
|
||||
for(int i = Components.size() - 1; i >= 0 && !halt; --i)
|
||||
{
|
||||
if(!Components[i]->Locked)
|
||||
if(!Components[i]->Locked && Components[i]->Visible)
|
||||
Components[i]->OnMouseWheel(x - Components[i]->Position.X, y - Components[i]->Position.Y, d);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user