Trouble Aligning txt on label captions. the font is Tahoma27x33_Regular and the max length property is set to 17 on each label.
If there is a space in the string, it shows up at the beginning of the box.
"Text Box " shows up as " TextBox " on the initial screen start up. I must replace the space with "_" like "Text_Box ".
Also, when Label Captions are replaced they shift random amounts.
Example: Here's a list of Labels
"Text_Box1 "
"Text_Box2 "
"Text_Box3 "
"Text_Box4 "
"Text_Box5 "
"Text_Box6 "
And I set all the label_captions to this:
"Text2_Box1 "
"Text2_Box2 "
"Text2_Box3 "
"Text2_Box4 "
"Text2_Box5 "
"Text2_Box6 "
It comes out like this:
"Text2_Box1 "
" Text2_Box2 "
" Text2_Box3 "
"Text2_Box4 "
" Text2_Box5 "
"Text2_Box6 "
Aligning label Captions
-
- Posts: 145
- Joined: 23 Dec 2005 19:36
- Location: Pa
- Contact:
- janko.kaljevic
- Posts: 3565
- Joined: 16 Jun 2011 13:48
Re: Aligning label Captions
Hello,
Thanks for reporting this, I have forwarded it to our developers, and we will fix it soon.
At the moment I can offer you a work around to fix this, so you can continue with your project.
Generate code, and press start compiler. After compiler has been loaded open *_driver.c source and find DrawLabel() function.
Replace that function with following one:
This will fix your issue.
Best regards.
Thanks for reporting this, I have forwarded it to our developers, and we will fix it soon.
At the moment I can offer you a work around to fix this, so you can continue with your project.
Generate code, and press start compiler. After compiler has been loaded open *_driver.c source and find DrawLabel() function.
Replace that function with following one:
Code: Select all
void DrawLabel(TLabel *ALabel) {
int x_pos, y_pos;
x_pos = 0;
y_pos = 0;
if (ALabel->Visible == 1) {
TFT_Set_Font(ALabel->FontName, ALabel->Font_Color, FO_HORIZONTAL);
TFT_Write_Text_Return_Pos(ALabel->Caption, ALabel->Left, ALabel->Top);
x_pos = ALabel->Left;
y_pos = ALabel->Top;
if ((x_pos >= 0) && (y_pos >= 0)) {
TFT_Write_Text(ALabel->Caption, x_pos, y_pos);
}
else {
TFT_Write_Text(ALabel->Caption, ALabel->Left, ALabel->Top);
}
}
}
This will fix your issue.
Best regards.
-
- Posts: 145
- Joined: 23 Dec 2005 19:36
- Location: Pa
- Contact:
Re: Aligning label Captions
Thank you very much. I am programming in Basic Pro. Will the command lines be the same?
Is there a new release coming soon? I still have no basic examples.
Thanks,
Is there a new release coming soon? I still have no basic examples.
Thanks,
- janko.kaljevic
- Posts: 3565
- Joined: 16 Jun 2011 13:48
Re: Aligning label Captions
Hello,
This would be the code for DrawLabel in mikroeBasic
Best regards.
This would be the code for DrawLabel in mikroeBasic
Code: Select all
sub procedure DrawLabel(dim ALabel as ^TLabel)
dim x_pos, y_pos as integer
x_pos = 0
y_pos = 0
if (ALabel^.Visible = 1) then
TFT_Set_Font(ALabel^.FontName, ALabel^.Font_Color, FO_HORIZONTAL)
TFT_Write_Text_Return_Pos(ALabel^.Caption, ALabel^.Left_, ALabel^.Top)
x_pos = ALabel^.Left_
y_pos = ALabel^.Top
if ((x_pos >= 0) and (y_pos >= 0)) then
TFT_Write_Text(ALabel^.Caption, x_pos, y_pos)
else
TFT_Write_Text(ALabel^.Caption, ALabel^.Left_, ALabel^.Top)
end if
end if
end sub
-
- Posts: 145
- Joined: 23 Dec 2005 19:36
- Location: Pa
- Contact:
Re: Aligning label Captions
Janko,
That worked perfectly.
Thanks,
That worked perfectly.
Thanks,