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.
Сurrent screen parameter
Re: Сurrent screen parameter
Hi,
There is a structure called CurrentScreen that has this information.
Regards,
Filip.
There is a structure called CurrentScreen that has this information.
Regards,
Filip.
Re: Сurrent screen parameter
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:
How to tell the program that screen 2 is currently active?
I can not find structure CurrentScreen.
I use easypic7 and mikroc with glcd.
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);
}
I can not find structure CurrentScreen.
I use easypic7 and mikroc with glcd.
Re: Сurrent screen parameter
Hi,
Yuu can find CurrentScreen variable in the Driver file.
Regards,
Filip.
Yuu can find CurrentScreen variable in the Driver file.
Regards,
Filip.
Re: Сurrent screen parameter
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.
Re: Сurrent screen parameter
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);
}
}