cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Container

ABeck.1
Associate II

Can we add digital clock to custom container,? I have to display time on all the screens.I added digital clock to Custom Container but not getting how to write and where to write logic for timer (in custom container have to write timer logic or on respective screens have to write)

5 REPLIES 5
HP
Senior III

if you add a clock to the custom container you can access it on the screens where you are using that container.

My use case:

I have a custom container with a background and some indicators.

I use this custom container on all my screens and in the constructor I set the values for the custom container.

This effectively means that I need to send the settings to ALL screens where I use the custom container rather than having a single custom container 'globally' available. There is a workaround for that but I figured that it would be just as easy to set the values when I enter the screen

ABeck.1
Associate II

custom container (having digital clock ) I added to all the screens,its customContainer1.handleTickEvent(); calling in all the screens, and its properly ticking, but its is starting from 00:00:00 all the time, its not taking previous screens time ,

Whener I switch screens, its time starts from initial, its not carrying current time to other screens,

I know have to use modal and presenter to carry value to other screens

but screens are not identifying Timer widget which is there in Custom container.

  with this ---- digitalClock.setTime24Hour(digitalHours, digitalMinutes, digitalSeconds); --- I can update in Custom container but if I try to update same in any screen it wont recognize clock only, then how will I update clock in any screen?????

I am stuck at updating time on diff screens.

Anju

in my case i am using the 'activate' method in the presenter.cpp to call the set method in the view.

my customcontainer is called 'bgContainer' and to access the elements in there i just have to write 'bgContainer.' and then I can see the suggestions and all elements available in the custom container..

ABeck.1
Associate II

Thank you,

Can you share your code with me, still m Trying.....non of the screens are able to update clock....

HP
Senior III

currently I am setting a background color (just a box that sits in the back behind a semitransparent image)

The colors[] is known in the model

therefore, in my presenters I have:

void MainScreenPresenter::activate()
{
	view.setBGColor(model->colors[0], model->colors[1], model->colors[2]);
 
}

and the view obviously have the setBGColor method:

void MainScreenView::setBGColor(int R, int G, int B)
{
	bgContainer.setBgColor(R, G, B);
	bgContainer.invalidate();
 
....
 
}

Did you remember the invalidate call?