376 views
in GUI Development by

Hi,

I want to know how to update STRING on OSD by Chora code, I made a simple project as attached(http://ask.embedded-wizard.de/?qa=blob&qa_blobid=8195206956717990746).
Please open this project : Project > E_Plus > Application > Decoder_Slot.
I expected result as follows.

A. Press F5 key for Prototype in "Application"
B. Press '1' key for drawing OSD menu.
C. Press '1' key again for update STRING of OSD menu. (Add '2' char at last for each item)
    For example: PICTURE -> PICTURE2
                 BACKLIGHT -> BACKLIGHT2
                 xxx -> xxx2
                 ...

I can saw "trace" information on step C, but can't saw any OSD update.

So I have two question as follows.
1. In this case, I hope OSD update on Prototype, could you provide your idea for this? 
2. If this isn't good idea for two layer OSD design in same page, please give us your suggestion.

Thank you. 

2 Answers

0 votes
by
 
Best answer

The problem within your implementation is the following:

  case Core::KeyCode.Key1:
  {
    var Category::Category_Pattern Pop_OSD = new Category::Category_Pattern;
    if( Form_ID != New_Form_ID )
    {
      Form_ID = New_Form_ID;
      Pop_OSD.Text_Item.Item_Text.String = "PICTURE";
      Pop_OSD.Text_Item_List.Text_Item.Item_Text.String = "BACKLIGHT";
   ...         
      Pop_OSD.FadeIn( this );
      GetRoot().BeginModal( Pop_OSD );
    }
    else
    {
      Pop_OSD.Text_Item.Item_Text.String = "PICTURE2";
      Pop_OSD.Text_Item_List.Text_Item.Item_Text.String = "BACKLIGHT2";
   ... 
    }

The first time the user presses 'Key1' you create a new Pop_OSD and initialize the strings as desired (without the '2'). The next time the user presses 'Key1' you create again a new Pop_OSD and assign the new strings (with the '2'). But the new Pop_OSD will not appear on the screen. There is still the first one visible. If you want to access the original Pop_OSD, you need to create it only once and store it in a variable instead of a local variable.

+1 vote
by

Chora supports several instant (built-in) functions, operators and type conversions when working with strings. In particular the operator '+' (plus) is very useful when you wish to concate two strings together. Fo example, to append the sign '2' at the end of text shown in a text view, following can be used:

SomeTextView.String = SomeTextView.String + "2";

This above expression will produce a new string from the both operands and assign the result to the 'SomeTextView.String' property.

More details about the operators and functions can be found in 'Chora User Manual' chapter 7 (Operators):

http://www.embedded-wizard.de/support.html#quick-tour-documentation

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

...