592 views
in Getting started by

Hello!

I am currently evaluating the Embedded Wizard. As one of the first steps i tried to create an analog clock with date/time set option.
For this, i have created 2 components:

  • Analog Clock
    • Properties for Hour/Minute/Second
    • 3 lines for Hour/Minute/Second that are updated inthe UpdateViewState()
    • Bitmap Background
  • Date/Time Set
    • Customized Date Picker, based on template
    • Customized Time Picker, based on template

These two have then be combined to a component:

  • Clock with date/time selection
    • Clock and Date7Time Picker as described above
    • additional touch Area (to allow showing the Date/Time picker when pressing the clock)
    • Additional Save and Cancel Buttons to store/dismiss new time settings and return to the analog clock
    • A toggle function to display either date/time pick + buttons or clock

 

When I prototy the Component itself, everything works as intended.

However, when added to the application, the Analog Clock is not displayed. I get no error messages.

Touching the location where the clock should be displays the date/time picker, and on pressing save/cancel in the date/time picker the picker is hidden, but again no clock is shown.

 

I dont know what possible causes for this behavious may be.

Any idea on what I might check to find the cause?

1 Answer

0 votes
by

Hello,

it's not so easy to give good advices without seeing your particular implementation...

Some ideas that you can check:

  • Is the property Visible of the Analog Clock set to true?
  • Is the Analog Clock hidden by another component, that is lying above the clock?
  • Is the size of Analog Clock zero (check the Bounds property)?
  • Maybe you have implemented some code that changes the original initialization of the Analog Clock.

If you still do not find the reason, you can post your example here...
Best regards,
Manfred.

by
I can answer all of those with "no". Id like to provide the project data but do not see how to add an attachment.

Regards,
Lars
by
Hi,

when you write a comment, you can use the link (chain symbol) to upload a file. Just pack you *.ewp, *.ewu and resource files. (No generated code).

Regards,

Manfred.
by

Hello Manfred,

oops I missed that.
Project hast been attached.

https://ask.embedded-wizard.de/?qa=blob&qa_blobid=6288602277772901266

Thank you very much!

Lars

by

Hi Lars,

the problem is your method UpdateViewState() within ClockSTM::ClockWithMenu - there you have the following statement:

SimpleClock.Bounds = Bounds;

This statement is (a) unneccessary and (b) causes the embedded SimpleClock to be repositioned according to the position of the component itself.

This means, when you prototype the ClockWithMenu, then the origin of the Bounds is 0/0 - the embedded SimpleClock is also at 0/0 releative to the origin of ClockWithMenu. As soon as you embed the ClockWithMenu into the Application, the origin is 225/40 and due to your code, the SimpleClock will be positioned to 225/40 releative to the origin of ClockWithMenu.

Better to use the layout mechanism...

Best regards,

Manfred.

by
Ah i see, I was basically overwriting relative positions of the clock with global positions of the whole ClockWithMenu Object.

I only wanted to have the width and height properties for the clock. Thanks a lot of your review!

Embedded Wizard Website | Privacy Policy | Imprint

...