Hello,
I have a probleme with Label, the texts are superimposed on each refresh
I dont have the function "Clearlabel" in driver.pas, just "Drawlabel"
Pic18F4685 and display controller NT7108C
Problem with label (Glcd V2.70, Mikropascal)
- dejan.odabasic
- mikroElektronika team
- Posts: 2649
- Joined: 30 Apr 2012 14:20
Re: Problem with label (Glcd V2.70, Mikropascal)
Hello,
You need manually to clear the old value before writing the new label with new caption.
You can clear old value by draw rectangle with background color, or you can write UpdateLabel function.
You'll need to sent address of label and new caption to UpdateLabel function.
- change the font color to background color
- call DrawLabel function
- change caption of label
- change the font color back to text color
- call DrawLabel function.
Best regards.
You need manually to clear the old value before writing the new label with new caption.
You can clear old value by draw rectangle with background color, or you can write UpdateLabel function.
You'll need to sent address of label and new caption to UpdateLabel function.
- change the font color to background color
- call DrawLabel function
- change caption of label
- change the font color back to text color
- call DrawLabel function.
Best regards.
Re: Problem with label (Glcd V2.70, Mikropascal)
Hello,
Thanks for your reply.
I wrote this code and it work fine, i found this code in this topic:http://www.mikroe.com/forum/viewtopic.php?f=152&t=50835 and i adapted the mikroC code to mikroPascal code
Best regards
Thanks for your reply.
I wrote this code and it work fine, i found this code in this topic:http://www.mikroe.com/forum/viewtopic.php?f=152&t=50835 and i adapted the mikroC code to mikroPascal code
Code: Select all
procedure ClearLabel(ALabel : ^TLabel);
begin
Glcd_Set_Font_Adv(ALabel^.FontName, 0,0);
Glcd_Write_Text_Adv(ALabel^.Caption, ALabel^.Left, ALabel^.Top);
end;