Author Topic: Simulator bug -- PushButton not working when changed png  (Read 1997 times)

stuckerj

  • Guest
Simulator bug -- PushButton not working when changed png
« on: August 24, 2012, 12:14:16 am »
I'm seeing a quirky bug in the simulator for my app.  I recently replaced the graphics for a couple of PushButtons, and they aren't firing the event.  They look right visually and change between 1 and two when clicked.   Running on the device, the buttons work fine.

When I switch back to the older graphics, the buttons work on the simulator.   I closed and reopened Visual Studio, same behavior both ways.  Old png's, they work; new png's, they don't.  Any suggestions?

tim

  • Administrator
  • Hero Member
  • *****
  • Posts: 1595
  • Karma: +11/-1
    • View Profile
    • DragonFireSDK
Re: Simulator bug -- PushButton not working when changed png
« Reply #1 on: August 24, 2012, 08:46:20 am »
What is different between the two sets of images?  Can you provide any sample code (with the assest in question) to illustrate the issue?

Thanks,
Tim Sommers
DragonFireSDK Team

stuckerj

  • Guest
Re: Simulator bug -- PushButton not working when changed png
« Reply #2 on: August 26, 2012, 07:23:07 pm »
I've attached the two buttons that work (back arrow and smiley) in the simulator, and the two that don't (X and check mark).

Here's the code to add the buttons in AppMain():

Code: [Select]
ButtonAdd(containerFlashCards, "Images/32/ok", CARD_LEFT+CARD_WIDTH+6, SCREEN_H/2-TOOLBAR_H, OnSwipeButton, BUTTON_CARD_MASTERED);
ButtonAdd(containerFlashCards, "Images/32/close_b", 0, SCREEN_H/2-TOOLBAR_H, OnSwipeButton, BUTTON_CARD_LEARNING);

And here's the event code:

Code: [Select]
int OnSwipeButton(int id)
{
    switch (id)
{
case BUTTON_CARD_MASTERED:
if (!(isSwipeLeft|isSwipeRight|isSnapCenter))
{
SwipeRight();
}
break;
case BUTTON_CARD_LEARNING:
if (!(isSwipeLeft|isSwipeRight|isSnapCenter))
{
SwipeLeft();
}
break;

default:
printf("error in OnSwipeButton function");
}
    return(0);
}

stuckerj

  • Guest
Re: Simulator bug -- PushButton not working when changed png
« Reply #3 on: August 26, 2012, 08:27:53 pm »
Here's an interesting update... When I swap in slightly larger png's (48x48 instead of 32x32), then the buttons only work when you click the very top of them.

tim

  • Administrator
  • Hero Member
  • *****
  • Posts: 1595
  • Karma: +11/-1
    • View Profile
    • DragonFireSDK
Re: Simulator bug -- PushButton not working when changed png
« Reply #4 on: August 28, 2012, 07:52:12 am »
I can't tell from the snippets you posted, but by any chance is there anything covering up part of the buttons?
Tim Sommers
DragonFireSDK Team

stuckerj

  • Guest
Re: Simulator bug -- PushButton not working when changed png
« Reply #5 on: September 02, 2012, 08:48:10 pm »
Nothing covering the buttons.  They even switch from 1 to 2 when clicked in the simulator.  Again, they work just fine on the device.

tim

  • Administrator
  • Hero Member
  • *****
  • Posts: 1595
  • Karma: +11/-1
    • View Profile
    • DragonFireSDK
Re: Simulator bug -- PushButton not working when changed png
« Reply #6 on: September 05, 2012, 12:27:23 pm »
If you could send me a sample that illustrates the issue (with assets included) I'll be happy to take a look.

Thanks,
Tim Sommers
DragonFireSDK Team

stuckerj

  • Guest
Re: Simulator bug -- PushButton not working when changed png
« Reply #7 on: September 05, 2012, 04:40:33 pm »
You have my permission to pull them from the build server if you can do that.