It is currently 25 Feb 2018 00:46

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 06 Feb 2018 22:33 
Offline

Joined: 20 Jul 2010 13:56
Posts: 25
Hello,

I work to an project and I want to modify the text from label without success.
I attached my code.
Please explain how should I proceed in order to modify the text from label.
I use MikroBasic, Visual GLCD and EasyPIC5 with PIC18F4550 at 8MHz.

Thank you,
Mihai


Attachments:
Test 02-04-2018.zip [205.35 KiB]
Downloaded 9 times
Top
 Profile  
 
PostPosted: 08 Feb 2018 18:08 
Offline
mikroElektronika team
User avatar

Joined: 18 Dec 2017 18:19
Posts: 173
Hi,

Have you checked our examples from within the compiler?

There are a couple for GLCD where you can see how this is done.

Kind regards,

_________________
Strahinja Jacimovic


Top
 Profile  
 
PostPosted: 08 Feb 2018 18:28 
Offline

Joined: 20 Jul 2010 13:56
Posts: 25
Hello,

Thank you for response.
Yes, I checked and the examples from MikroBasic compiler work very well.
My problem is with Visual GLCD: the label text is not changed if I modify the follow lines:
Label1.Caption = @Label1_Caption
Label1_Caption = "qwer"
So, please, provide me an short example of this action.
Please see my attachment, maybe I am doing something wrong there.
And, your example is only for that big GLCD; I use the small one, 128x64.

Thank you,

Mihai


Top
 Profile  
 
PostPosted: 12 Feb 2018 16:15 
Offline
mikroElektronika team
User avatar

Joined: 18 Dec 2017 18:19
Posts: 173
Hi,

I was able to create a simple example.

Basically, it's the same as yours. I just added this piece of code in the events part.
//--------------------- User code ---------------------//
void updateLabel(TLabel *lbl, char *str)
{
  Glcd_Write_Text_Adv(lbl->Caption, Label1.Left, Label1.Top);
  strcpy(lbl->Caption, str);
  DrawLabel(lbl);
}

//----------------- End of User code ------------------//

// Event Handlers
void Button1OnClick()
{
  char str[20] = {'N','E','W'};
  updateLabel(&Label1,&str);
}


Basically, whenever I click on the button, the caption of the label will change to NEW.

I did this on a PICv7 board using PIC18F45K22, but it should work on yours as well.

Kind regards,

_________________
Strahinja Jacimovic


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: