Good day to all.
Thank you for all the responses on my earlier questions.
My current problem is as follows.
i have a horizontal slider to control the backlight of my screen. On my hardware there is DimmerButton which pops up the backlight component when pressed. The green triangle moves to the slider thumb area and simulates the DriveCursorHitting operation. Here is the code.
var int32 val = Application::Storage.Backlight;
x1 = 401 - 26 + (val * 5 / 2);
y1 = 442;
Triangle.Bounds = rect(x1, y1, x1 + 16, y1 + 16);
if (Application::Storage.BacklightBoolStatus == true)
{
this.Setup_Backlight.Visible = true;
this.Setup_Backlight.Enabled = true;
this.Focus = this.Setup_Backlight;
Triangle.Visible = true;
GetRoot().DriveCursorHitting(true, 0, Triangle.Bounds.origin);
}
else
{
this.Setup_Backlight.Visible = false;
this.Setup_Backlight.Enabled = false;
Triangle.Visible = false;
GetRoot().DriveCursorHitting(false, 0, Triangle.Bounds.origin);
}
Application::Storage.BacklightBoolStatus = !Application::Storage.BacklightBoolStatus; // open if closed, close if opened
i also have a on my hardware an encoder button. when i turn it left or right my triangle position gets updated and by simulating DriveCursorMovement i can do the press and drag operation. Encoder and dimmer algorithms work fine. Here is the Code.
x1 = Triangle.Bounds.x1;
y1 = Triangle.Bounds.y1;
if (sender == EncoderRight)
{
y1 = y1;
if (x1 - 2 <= 401)
{
x1 = 401;
}
else
{
x1 = x1 - 2;
}
}
if (sender == EncoderLeft)
{
y1 = y1;
if (x1 + 2 >= 625)
{
x1 = 625;
}
else
{
x1 = x1 + 2;
}
}
Triangle.Bounds = rect(x1, y1, x1 + 16, y1 + 16);
GetRoot().DriveMultiTouchMovement(0, Triangle.Bounds.origin);
While controlling the backlight slider with encoder if by any chance i touch somewhere on the actual LCD Touch panel. GetRoot.DriveCursorMovement functions thinks that i tried to drag it to the last touch position (not the triangle is currently on) and moves the slider all the way to right or left depending on where LCD press happened. Any suggestions?