313 views
in GUI Development by

Thanks Manfred and Paul,

I modified by your proposol as attached. (http://ask.embedded-wizard.de/?qa=blob&qa_blobid=5491428242995234551)

By the way, I have one more question as follows.

a. Press 'F5 key' for Prototype
b. Press '1 key' for show 'menu1'
c. Press '2 key' for show 'menu2'
d. Loop again by 'step b' and 'step c'.
e. Then you will see the flicker phenomenon on Prototype.

The cause is I need close 'menu1' before open 'menu2', is possible open 'menu2' at first and close 'menu1' at seconds?

related to an answer for: How to update STRING on OSD by Chora code

1 Answer

0 votes
by

The flicker effect is caused by the fade-in and fade-out animation. In the current project the menu component implements the appear and disappear operation with a short opacity fade effect. When switching between the menus for a short period both menus are semitransparent.

These fade-in and fade-out animations exist in the default menu template as they provide an often desired behaviors. Because of the template idea you can modify, extend or even remove functionality from the menu created from the template.

To disable the fade-in and fade-out effects modify first the method BasicClass::BasicGroup.FadeIn so it contains only following code:

// If an owner group has been specified -> the panel should be added now to
// this group. Dont't forget to remove the panel again from the group when 
// the panel is closed.
autoRemove = ( aOwner != null );

// If no owner group has been specified, assume that the panel already belongs
// to a group and thus is visible.
if ( aOwner == null )
  aOwner = Owner;

// As already mentioned, the panel should have an owner where it can be seen
if ( aOwner == null )
  throw "No owner group known where the panel should appear";

// If the panel is still not arranged within an owner group -> do it now.
if ( aOwner != Owner )
{
  if ( Owner != null )
    throw "Panel already belongs to an owner group";

  // Add the panel to the group
  aOwner.Add( this, 0 );
}

In the second step modify the method BasicClass::BasicGroup.FadeOut so it contains only following code:

// In case of 'fade-out' effect -> remove the panel from its owner group if it
// was specified explicitly in the previous FadeIn() call.
if ( autoRemove && ( FadeInOutEffect.Value == 0 ))
  Owner.Remove( this );

These adaptations cause the menus to appear/disappaer immediately. If you like you can cleanup the BasicClass::BasicGroup now. e.g. remove the members FadeInOutEffect and onFinishEffect as these are not needed anymore.

Important in this context is to understand the idea of 'templates'. With Embedded Wizard we provide a set of component templates like the menu, which can be simply integrated in your project. These templates contain already predefined behavior and appearance. This is the starting point for EmWi developers.

When you drag a component template to your project you create a copy of the template. Now you can modify this copy. Add new behavior. Change its default look and feel. Or even remove undesired functionality. You are also free to create multiple copies from the same template and implement these in a different manner.

Hope it helps you further.

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

...