338 views
in GUI Development by
Hi,

   I have created small form with few details lie name ,age mobile...

  when i select name_texteditor using mouse button  or  touch screen border color will be need to change.how to apply this property for other texteditor also.

I am using virtual keyboard for enter the field.so iam not able to use touch handlers.please guide me if other posiibility is there to change border color

 

With Regards

Ramesh.G

1 Answer

0 votes
by

Hello Ramesh,

the Text Editor you are using is a template. The desired special behavior (e.g. border color) is custom specific and has to be added to this template explicitly. How you do this is up to you. Possibly approach:

1. Add a Border view to the Text Editor component.

2. Arrange the Border view to fill the component's area.

3. Configure the Border's property Layout to the value Core::Layout[AlignToBottom, AlignToLeft, AlignToRight, AlignToTop, ResizeHorz, ResizeVert] This ensures that the position/size of the Border view is automatically adapted if the Text Editor component is resized at the runtime. See also the section: Configuring component layout.

4. Within the Text Editor component open its method UpdateViewState() for editing. This method is executed each time the state of the component changes. For more details see the section Common component states.

5. In the method UpdateViewState() add following code to show/hide the Border view depending on the Focused state of the Text Editor:

Border.Visible = aState.contains( Core::ViewState[ Focused ]);

Best regards

Paul Banach

by
Hi paul,

  i added code in update view state menthod.but it is appying all the texteditors.

my screen have 10 texteditor fields.

i want to apply border color in selected texteditor only. here how to find focus.please help me to resolve this.

 

With regards,

Ramesh.G
by

Hello Ramesh,

without knowing your implementation it is difficult to give you an advice. The implementation mentioned in my answer above evaluates the focused state already. I would expect it to handle the focus properly. Please note the evaluation of the state Focused in the implementation:

Border.Visible = aState.contains( Core::ViewState[ Focused ]);

Best regards

Paul Banach

by
Hi Paul,

     I am using Extendededvirtualkeyboard::Texteditor . i have added 2 property in TextEditor and apply signal slot mechanism to acheive border color.

   but from virtual keyboard i am not able to type any word.it is reflect in texteditor.

can you please help me to resolve this

With regards,

Ramesh.G
by
Hi Ramesh,

can you please upload an example of your code.

I think this would be very helpful.

Regards,

Julian
by

Hi julian,

   here i have added my implenation

  inside slot method i am adding trace statement only.

when i click texteditor signal and slot working fine.but from virtual keybaord i am not able to enter any data.

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

 

 

with Regards

Ramesh G

by

Hi Ramesh,

I would recommend to remove those two slots and slot properties and change the visibility of the border, as Paul suggests, within the UpdateViewState() of the TextEditor by:

Border.Visible = aState.contains( Core::ViewState[ Focused ]);

Only one component can have the focused viewstate at a time. The TextEditor with the blinking caret has, in your case, the focus. Only components with focus can receive keyevents.

Regards,

Julian

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

...