Сurrent screen parameter

General discussion on Visual GLCD Software.
Post Reply
Author
Message
garisoft
Posts: 1
Joined: 15 Nov 2017 04:32

Сurrent screen parameter

#1 Post by garisoft » 18 Sep 2018 07:30

Dear all.
For example, I created 2 screens in GLCD software (MainScreen and SecondScreen).
I need to check in my Main progmam which screen I am currently on. How I can do it? Which operator is responsible for this?
for example:


if (MainScreen is active) <-- Which operator should be here?

{ do this code }

if (SecondScreen is active)

{ do this code }


I doing standart project for SmartGLCD 240x128.

Thanks in advance.

Igor.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Сurrent screen parameter

#2 Post by filip » 12 Oct 2018 08:27

Hi,

There is a structure called CurrentScreen that has this information.

Regards,
Filip.

Josko
Posts: 3
Joined: 23 Jun 2021 17:40

Re: Сurrent screen parameter

#3 Post by Josko » 23 Jun 2021 18:24

I have the same problem
For example:
If I press the RC3 button, I want the program to draw an Label2 and ProgressBar only if screen2 is active

Like this:

Code: Select all

if(PORTC.F3==1&&Screen2 currently active){
Label2.Visible=1;
DrawLabel(&Label2);

//drive progressbar
for(x=60;x<120;x++){
Glcd_H_Line(60, x, 10, 1);
Glcd_H_Line(60, x, 11, 1);
Glcd_H_Line(60, x, 12, 1);
Glcd_H_Line(60, x, 13, 1);
Glcd_H_Line(60, x, 14, 1);
Glcd_H_Line(60, x, 15, 1);
Glcd_H_Line(60, x, 16, 1);
Glcd_H_Line(60, x, 17, 1);
Delay_ms(50);
}
How to tell the program that screen 2 is currently active?
I can not find structure CurrentScreen.
I use easypic7 and mikroc with glcd.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Сurrent screen parameter

#4 Post by filip » 24 Jun 2021 10:43

Hi,

Yuu can find CurrentScreen variable in the Driver file.

Regards,
Filip.

Josko
Posts: 3
Joined: 23 Jun 2021 17:40

Re: Сurrent screen parameter

#5 Post by Josko » 24 Jun 2021 19:21

I found the CurrentScreen variable, but I still don't understand how to apply it. Please can you show me with an example in the code I have attached? I am a beginner in C programming.

Josko
Posts: 3
Joined: 23 Jun 2021 17:40

Re: Сurrent screen parameter

#6 Post by Josko » 28 Jun 2021 09:27

In the meantime I solved the problem with flag.

Code: Select all

// events_code.c
void Button1() {
DrawScreen(&Screen2);
flag1=1;
}


// main.c
if(PORTC.F3==1&&flag1==1){
Label2.Visible=1;
DrawLabel(&Label2);

// Draw progressbar
for(x=60;x<120;x++){
Glcd_H_Line(60, x, 10, 1);
Glcd_H_Line(60, x, 11, 1);
Glcd_H_Line(60, x, 12, 1);
Glcd_H_Line(60, x, 13, 1);
Glcd_H_Line(60, x,14, 1);
Glcd_H_Line(60, x, 15, 1);
Glcd_H_Line(60, x, 16, 1);
Glcd_H_Line(60, x, 17, 1);
Delay_ms(50);
     }
}


Post Reply

Return to “Visual GLCD General”