53 views
in Embedded Wizard Studio by
Hi, I am using a Attributed text on a middle part of the screen, and the string is really big, i am trying to scroll it through a physical knob on the device. It is scrolling but the View of the text does not remain within the bounds of the Attributed Text View. It changes automatically and covers up the whole screen till the end of the screen (overlapping other content of the screen). How can i contain huge strings with in a certain area of the screen. I have tried using Outline concept but it did not work.

Your help is highly appreciated as always,

Thanks in advance.

Mariam Sohail

1 Answer

0 votes
by

Hello Mariam,

the View of the text does not remain within the bounds of the Attributed Text View.

I don't understand your description. Please provide screenshots or a small (minimal) example demonstrating the behavior. From technical point view, the content of a Text view may not cross the borders of the view. May be in your implementation the property Bounds of the Tetx view is modified.

Best regards

Paul Banach

by

for some reason I see issues attaching the screenshots here. But yes may be you are right where you say that bounds are modified during implementation because I had to set Autosize property for the AttrText to true. Because if i don't set it to true, the text does not scroll anymore. I am sure I am missing something. I have a code snippet for scrolling part at the end and i am somehow able to attach the links for screenshots. I hope it helps.

The first link shows how it should look and i want center Attrtext box to scroll through a knob. Here Autosize property= false and it does not scroll if this property is false.

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

The second link shows how it looks when i try to implement scrolling and for scrolling i had to set the Autosize property=true. Scrolling works fine but it overlaps everything under it.

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

 

 

// Code for scrolling down
//scroll_offset is set to zero initially
// MainStatusInfoCenter is the AttrText that needs to be scrolled


  if (scroll_offset<-MainStatusInfoCenter.Bounds.h+(200-MainStatusInfoCenter.Bounds.y1))
  return;
  scroll_offset=scroll_offset-20;
  MainStatusInfoCenter.ScrollOffset=point(0,scroll_offset);

  InvalidateViewState();


//Code for Scrolling up 
 
 if (scroll_offset==0)
 return;
 scroll_offset=scroll_offset+20;
 MainStatusInfoCenter.ScrollOffset=point(0,scroll_offset);
 InvalidateViewState();

Please Let me know if i am still unclear i will try providing more details.

Best Regards

Mariam Sohail

ago by

Hello Mariam,

based on the provided information it is difficult to deduce what is wrong. I would recommend following:

1. Don't use AutoSize. Just set the Bounds property (size/position) of the text view to be fixed.

2. To scroll the content use the property ScrollOffset.

3. When using ScrollOffset it may be useful to know how much content can be scrolled (how is the complete size of the text content). For this purpose use the method GetContentArea(). See also Arrange other views on the content of the Attributed Text view.

I hope it helps you further.

Best regards

Paul Banach

Embedded Wizard Website | Privacy Policy | Imprint

...