43 views
in GUI Development by
I would like to create a lock screen, which as soon as the user touches it, the image disappears and the main menu appears. What should I use?

I would like to understand the logic to be adopted and implemented in the slot

1 Answer

0 votes
by

Hello manuelBax,

following could be the steps to achieve such functionality:

1. Add a new component to your project.

2. Name it, e.g. LockScreen.

3. Open the component for editing.

4. Adjust the size of the component to fill the entire screen. For example, if your LCD has the resolution 320x240, adjust the size of the component to be 320x240.

5. Design the appearance of the component according to your needs. You can e.g. add an Image view and display in this view a Bitmap resource.

6. Add a Simple Touch Handler to the component.

7. Arrange the handler so it fills the entire component.

8. Add a slot method to the component.

9. Name it e.g. onTouch.

10. Assign the slot method to Simple Touch Handlers property OnPress.

11. Implement the slot method with following code:

if ( IsCurrentDialog())
{
  rootthis.EndModal( this );
  rootthis.DismissDialog( this, null, null, null, null, null, false );
}

12. When the device enters the lock mode, just present the component LockScreen as dialog and make it modal:

var Core::Group group = new Application::LockScreen;

rootthis.PresentDialog( group, null, null, null, null, null, null, null, null, false );
rootthis.BeginModal( group );

I hope it helps you further.

Best regards

Paul Banach

by

it gives me some type of error, I'm sending photos of the project as an attachment, for personal reasons I have to darken the images, perhaps I didn't understand some step of the explanation, I didn't implement everything in the slot where the lockscreen is located, but I separated the elsewhere in the main application, I await your explanations

 

 

by

Hello manuelBax,

rootthis is a feature introduced in version 12. It seems you are working with an older version. In such case replace rootthis by GetRoot() as shown below:

if ( IsCurrentDialog())
{
  GetRoot().EndModal( this );
  GetRoot().DismissDialog( this, null, null, null, null, null, false );
}

and

var Core::Group group = new Application::LockScreen;

GetRoot().PresentDialog( group, null, null, null, null, null, null, null, null, false );
GetRoot().BeginModal( group );

I hope it solves the error.

Best regards

Paul Banach

by
i done with the method DriveCursorHitting, anyway thank you so much for the support!
by

hi, sorry, I tried to use your method but I didn't understand how to use your logic, I should use the lockscreen by overlaying it on my homescreen, I'm having problems instead of group should I insert properties?

by

Hello VonMartello,

I should use the lockscreen by overlaying it on my homescreen, 

Please follow the steps described in my answer. Note the step 12. In this step the lock screen is presented. It means, to display the lock screen just execute this code. 

I'm having problems instead of group should I insert properties?

I'm sorry, but I don't understand your question.

Best retards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...