About Store Forum Documentation Contact
Donations:
158$/mo



Post Reply 
Touch[i].selecting() not working after last updates?
Author Message
tiagolapa Offline
Member

Post: #1
Touch[i].selecting() not working after last updates?
Hello Esenthel community

After last updates my Touch[i].selecting() and Touch[i].dragging() stopped working.

I get no response from this functions.

I have custom buttons inside region. Before, I had to handle region scrolling but now it works out of the box. The problem is that now my buttons no longer get deselected when I scroll.

This is my code to update custom button:

(Button is set to BUTTON_TOGGLE mode.)

Code:
class MyButton : Button // Create a new class extending the default Gui Button
{
   virtual void update(C GuiPC &gpc) // extend updating object
   {
      super.update(gpc); // call default method
      
      FREPA(Touches)
         if(Touches[i].guiObj()==this)
            if(Touches[i].selecting())
               T.set(false, true);
   }

Someone can confirm this?

Thank you
(This post was last modified: 05-11-2015 08:56 AM by tiagolapa.)
05-11-2015 08:49 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: Touch[i].selecting() not working after last updates?
Hi,

I'm guessing the problem is not with touch.selecting but with your guiObj()==this line

I've tested the following on Windows touch screen and works fine:
Code:
/******************************************************************************/
ImagePtr logo;
Region r;
/******************************************************************************/
namespace EE
{
   bool LogEnable()
   {
      extern bool LogInit;
      LogInit=true;
      return true;
   }
}
//class Test{Test(){LogEnable();}}Test t;
/******************************************************************************/
void InitPre()
{
   EE_INIT();
}
bool Init()
{
   logo=UID(181111025, 1245255428, 320051877, 2205688464);
   //LogEnable();
   Gui+=r.create(Rect_C(0, 0, 1, 1));
   r.virtualSize(&Vec2(2, 2));
   return true;
}
void Shut()
{
}
/******************************************************************************/
bool Update()
{
   if(Kb.bp(KB_ESC))return false;
   Gui.update();
   return true;
}
void Draw()
{
   D.clear(WHITE);
   if(logo)logo->drawFs();
   Gui.draw();
   REPA(Touches)Circle(0.1, Touches[i].pos()).draw(Touches[i].selecting() ? RED : BLUE);
}
/******************************************************************************/

In latest update touches automatically change their focus (guiObj) upon scrolling into the Region gui object.
So this if(Touches[i].guiObj()==this) fails

I'll update button codes to not get toggled by touch if they belong to a region.
05-11-2015 10:05 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #3
RE: Touch[i].selecting() not working after last updates?
Hi, for next release you can remove your code, the button won't get pushed when scrolling is detected.
05-11-2015 11:47 PM
Find all posts by this user Quote this message in a reply
tiagolapa Offline
Member

Post: #4
RE: Touch[i].selecting() not working after last updates?
Thank you for your time. Great support from esenthel!
05-12-2015 06:29 AM
Find all posts by this user Quote this message in a reply
Post Reply