final change for 0.17 to sync up with other platforms. focused targeted touch of ui objects to deck menus.
This commit is contained in:
@@ -444,7 +444,8 @@ static NSString *_MY_AD_WHIRL_APPLICATION_KEY_IPAD = @"2e70e3f3da40408588b9a3170
|
|||||||
{
|
{
|
||||||
// we want some delay for the left click to take place before clicking on OK.
|
// we want some delay for the left click to take place before clicking on OK.
|
||||||
g_engine->LeftClicked( newCoordinates.x, newCoordinates.y);
|
g_engine->LeftClicked( newCoordinates.x, newCoordinates.y);
|
||||||
[self performSelector: @selector(handleOK:) withObject: recognizer afterDelay: 0.25];
|
if (recognizer.state == UIGestureRecognizerStateEnded)
|
||||||
|
[self performSelector: @selector(handleOK:) withObject: recognizer afterDelay: 0.25];
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(currentLocation.y < es2renderer.viewPort.top) {
|
else if(currentLocation.y < es2renderer.viewPort.top) {
|
||||||
|
|||||||
@@ -195,13 +195,13 @@
|
|||||||
|
|
||||||
- (BOOL)textFieldShouldEndEditing:(UITextField *)textField
|
- (BOOL)textFieldShouldEndEditing:(UITextField *)textField
|
||||||
{
|
{
|
||||||
[eaglView updateKeyboard: @"SAVE"];
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (BOOL) textFieldShouldReturn:(UITextField *)textField
|
- (BOOL) textFieldShouldReturn:(UITextField *)textField
|
||||||
{
|
{
|
||||||
|
[eaglView updateKeyboard: @"SAVE"];
|
||||||
[textField resignFirstResponder];
|
[textField resignFirstResponder];
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ private:
|
|||||||
|
|
||||||
DeckMenu* parent;
|
DeckMenu* parent;
|
||||||
float mTitleResetWidth;
|
float mTitleResetWidth;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void checkUserClick();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
string imageFilename;
|
string imageFilename;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ protected:
|
|||||||
float mXOffset;
|
float mXOffset;
|
||||||
|
|
||||||
bool mIsValidSelection;
|
bool mIsValidSelection;
|
||||||
void checkUserClick();
|
virtual void checkUserClick();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -145,6 +145,22 @@ bool DeckMenuItem::ButtonPressed()
|
|||||||
return SimpleMenuItem::ButtonPressed();
|
return SimpleMenuItem::ButtonPressed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DeckMenuItem::checkUserClick()
|
||||||
|
{
|
||||||
|
int x1 = -1, y1 = -1;
|
||||||
|
if (mEngine->GetLeftClickCoordinates(x1, y1))
|
||||||
|
{
|
||||||
|
mIsValidSelection = false;
|
||||||
|
int x2 = static_cast<int>(mXOffset), y2 = static_cast<int>(mY + mYOffset);
|
||||||
|
if ( (x1 >= x2) && (x1 <= (x2 + 200)) && (y1 >= y2) && (y1 < (y2 + 30)))
|
||||||
|
mIsValidSelection = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mIsValidSelection = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Accessors
|
||||||
float DeckMenuItem::GetWidth()
|
float DeckMenuItem::GetWidth()
|
||||||
{
|
{
|
||||||
WFont * mFont = WResourceManager::Instance()->GetWFont(fontId);
|
WFont * mFont = WResourceManager::Instance()->GetWFont(fontId);
|
||||||
|
|||||||
@@ -60,16 +60,7 @@ void SimpleMenuItem::Update(float dt)
|
|||||||
|
|
||||||
void SimpleMenuItem::checkUserClick()
|
void SimpleMenuItem::checkUserClick()
|
||||||
{
|
{
|
||||||
int x1 = -1, y1 = -1;
|
mIsValidSelection = true;
|
||||||
if (mEngine->GetLeftClickCoordinates(x1, y1))
|
|
||||||
{
|
|
||||||
mIsValidSelection = false;
|
|
||||||
int x2 = static_cast<int>(mXOffset), y2 = static_cast<int>(mY + mYOffset);
|
|
||||||
if ( (x1 >= x2) && (x1 <= (x2 + 200)) && (y1 >= y2) && (y1 < (y2 + 30)))
|
|
||||||
mIsValidSelection = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
mIsValidSelection = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleMenuItem::Entering()
|
void SimpleMenuItem::Entering()
|
||||||
|
|||||||
Reference in New Issue
Block a user