Feb 18, 2022 Replies: 14 Hi everyone, for necessity i added some fields to the famous AutoTextSizeLabel class. The fields added are: Version 1.4 Access Tag Property: You can now use the .Tag property to set/access this value also from designer Version 1.3 Min Text Size: Specify the minium size of the text of the label (less than this can't go) Max Text Size: Specify the minium size of the text of the label (more than this can't go) Ignore User Font Scale: Specify if the label should ignore the fact that the user could have widened the interface (n.b. default: True) maybe that are dumb changes, but to me were useful, so.. here you are. Bye Attachments AutoTextSizeLabel.bas AutoTextSizeLabel.bas 7.3 KB · Views: 482 Last edited: May 23, 2024 Click to expand...
Hi everyone, for necessity i added some fields to the famous AutoTextSizeLabel class. The fields added are: Version 1.4 Access Tag Property: You can now use the .Tag property to set/access this value also from designer Version 1.3 Min Text Size: Specify the minium size of the text of the label (less than this can't go) Max Text Size: Specify the minium size of the text of the label (more than this can't go) Ignore User Font Scale: Specify if the label should ignore the fact that the user could have widened the interface (n.b. default: True) maybe that are dumb changes, but to me were useful, so.. here you are. Bye
Alhootti Active Member Nov 25, 2022 #2 Why when i use long text the font size come small automatically ?
M Mike1970 Well-Known Member Licensed User Longtime User Nov 27, 2022 #3 Alhootti said: Why when i use long text the font size come small automatically ? Click to expand... It's the desired effect. Once you set the Label size (e.g. in the designer) the text inside will be scaled automatically to fit inside, taking in account also the Min Text Size and Max Text Size limits. (maybe I didn't understand correctly what you meant)
Alhootti said: Why when i use long text the font size come small automatically ? Click to expand... It's the desired effect. Once you set the Label size (e.g. in the designer) the text inside will be scaled automatically to fit inside, taking in account also the Min Text Size and Max Text Size limits. (maybe I didn't understand correctly what you meant)
Alhootti Active Member Nov 27, 2022 #4 i used this B4X: ASL.BaseLabel.TextSize(Max("50"),Min("10")) but not working there is error
M Mike1970 Well-Known Member Licensed User Longtime User Nov 28, 2022 #5 Alhootti said: i used this B4X: ASL.BaseLabel.TextSize(Max("50"),Min("10")) but not working there is error Click to expand... At the moment I can’t pick you an example. I’ll do it later. However you are not supposed to use it like this. you can set the limits using the ASL methods. that should be MinTextSize and MaxTextSize I think (I do not remember). is this what you wanted to do?
Alhootti said: i used this B4X: ASL.BaseLabel.TextSize(Max("50"),Min("10")) but not working there is error Click to expand... At the moment I can’t pick you an example. I’ll do it later. However you are not supposed to use it like this. you can set the limits using the ASL methods. that should be MinTextSize and MaxTextSize I think (I do not remember). is this what you wanted to do?
M Mike1970 Well-Known Member Licensed User Longtime User Nov 29, 2022 #7 Alhootti said: yes it is. Click to expand... Ok well, with the version you have just set them in the Designer However, i updated the class adding the two methods MinTextSize and MaxTextSize B4X: Private lblA As AutoTextSizeLabel lblA.MaxTextSize = 20 lblA.MinTextSize = 5 lblA.Text = "Hello" (P.S. If you call those methods AFTER you already set the text, you have to call also RefreshView) The Updated class (Version 1.4) is attached Attachments AutoTextSizeLabel.bas AutoTextSizeLabel.bas 7 KB · Views: 618
Alhootti said: yes it is. Click to expand... Ok well, with the version you have just set them in the Designer However, i updated the class adding the two methods MinTextSize and MaxTextSize B4X: Private lblA As AutoTextSizeLabel lblA.MaxTextSize = 20 lblA.MinTextSize = 5 lblA.Text = "Hello" (P.S. If you call those methods AFTER you already set the text, you have to call also RefreshView) The Updated class (Version 1.4) is attached
Alhootti Active Member Nov 29, 2022 #9 I tested it this is not i want it excatlly. i want when i insert long text the label should extend horizontally only (increase in width only) to occupies the long text automatically dose not matter it extend out of the form. but the more important thing is the font size still as before not change totally.
I tested it this is not i want it excatlly. i want when i insert long text the label should extend horizontally only (increase in width only) to occupies the long text automatically dose not matter it extend out of the form. but the more important thing is the font size still as before not change totally.
M Mike1970 Well-Known Member Licensed User Longtime User Nov 29, 2022 #10 Alhootti said: I tested it this is not i want it excatlly. i want when i insert long text the label should extend horizontally only (increase in width only) to occupies the long text automatically dose not matter it extend out of the form. but the more important thing is the font size still as before not change totally. Click to expand... Ouh ok, so you want the opposite behaviour... You want the text size to be FIXED and the label size to be dynamic based on the sentence length?... right?
Alhootti said: I tested it this is not i want it excatlly. i want when i insert long text the label should extend horizontally only (increase in width only) to occupies the long text automatically dose not matter it extend out of the form. but the more important thing is the font size still as before not change totally. Click to expand... Ouh ok, so you want the opposite behaviour... You want the text size to be FIXED and the label size to be dynamic based on the sentence length?... right?
M Mike1970 Well-Known Member Licensed User Longtime User Dec 1, 2022 #12 Alhootti said: yes exactly Click to expand... Ok this is not the right view You need… it does the opposite ? take a better look on the forum. Personally I never used it
Alhootti said: yes exactly Click to expand... Ok this is not the right view You need… it does the opposite ? take a better look on the forum. Personally I never used it
Andrew (Digitwell) Well-Known Member Licensed User Longtime User Dec 1, 2022 #13 Take a look at resizingtextcomponent. That might do what you need. [B4X] [SOLVED] xCustomListView Text Padding question I'm using a customlistview to display formatted text using clv.AddTextItem I use clv.getPanel to set the background to white. The problem is that that the text is too close to the edges. Does anyone known a simple way to add some more padding to this text I can add space to the top and... www.b4x.com
Take a look at resizingtextcomponent. That might do what you need. [B4X] [SOLVED] xCustomListView Text Padding question I'm using a customlistview to display formatted text using clv.AddTextItem I use clv.getPanel to set the background to white. The problem is that that the text is too close to the edges. Does anyone known a simple way to add some more padding to this text I can add space to the top and... www.b4x.com
Andrew (Digitwell) Well-Known Member Licensed User Longtime User Dec 1, 2022 #14 This is a better example, with a test project how to make views align vertically and shrink base on dynamic text content? Hi, I have a stack of views: imageview, label, and a few checkboxes that load its content dynamically (check the picture), how I can align them vertically ? avoiding blank spaces ? shrinking the height of each www.b4x.com
This is a better example, with a test project how to make views align vertically and shrink base on dynamic text content? Hi, I have a stack of views: imageview, label, and a few checkboxes that load its content dynamically (check the picture), how I can align them vertically ? avoiding blank spaces ? shrinking the height of each www.b4x.com
M Mike1970 Well-Known Member Licensed User Longtime User May 23, 2024 #15 Hi everyone, I made a stupid improvement -> access the Tag property ?