How to deactivate a button created on different page

#if 1
#include <Adafruit_GFX.h>
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;
#include <TouchScreen.h>
#include <UTFTGLUE.h>
#define MINPRESSURE 10
#define MAXPRESSURE 1000
const int XP = 7, XM = A1, YP = A2, YM = 6; //ID=0x9814
const int TS_LEFT = 99, TS_RT = 900, TS_TOP = 869, TS_BOT = 177;
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 100);

int col_ref=10, row_ref=10;

Adafruit_GFX_Button q_btn, w_btn, edit1_btn, copy_btn, edit_btn, jog_btn, num1_btn, num2_btn, num3_btn;

int pixel_x, pixel_y; //Touch_getXY() updates global vars
bool Touch_getXY(void)
{
TSPoint p = ts.getPoint();
pinMode(YP, OUTPUT); //restore shared pins
pinMode(XM, OUTPUT);
digitalWrite(YP, HIGH); //because TFT control pins
digitalWrite(XM, HIGH);
bool pressed = (p.z > MINPRESSURE && p.z < MAXPRESSURE);
if (pressed)
{
pixel_x = map(p.y, TS_LEFT, TS_RT, 0, 480); //.kbv makes sense to me
pixel_y = map(p.x, TS_TOP, TS_BOT, 0, 320);
}
return pressed;

}

#define BLACK 0x0000
#define WHITE 0xFFFF

void Home()
{
tft.setCursor(180,10);
tft.setTextSize(4);
tft.setTextColor(BLACK);
tft.print(" HOME “);
edit_btn.initButton(&tft, 60, 300, 90, 40 , BLACK, SILVER, BLACK, “EDIT”, 2);
jog_btn.initButton(&tft, 180, 300, 90, 40, BLACK, SILVER, BLACK, “JOG”, 2);
offset_btn.initButton(&tft, 290, 300, 90, 40, BLACK, SILVER, BLACK, “OFFSET”, 2);
edit_btn.drawButton(false);
jog_btn.drawButton(false);
offset_btn.drawButton(false);
}
void Edit()
{
tft.setCursor(0,0);
tft.setTextSize(4);
tft.setTextColor(BLACK);
tft.print(” EDIT MODE ");
edit1_btn.initButton(&tft, 40, 250, 60, 40 , BLACK, WHITE, BLACK, “EDIT”, 2);
copy_btn.initButton(&tft, 110, 250, 60, 40, BLACK, WHITE, BLACK, “COPY”, 2);
delete_btn.initButton(&tft, 200, 250, 90, 40, BLACK, WHITE, BLACK, “DELETE”, 2);
rename_btn.initButton(&tft, 300, 250, 90, 40, BLACK, WHITE, BLACK, “RENAME”, 2);
home_btn.initButton(&tft, 390, 300, 90, 40, BLACK, SILVER, BLACK, “HOME”, 2);
edit1_btn.drawButton(false);
copy_btn.drawButton(false);
delete_btn.drawButton(false);
rename_btn.drawButton(false);
home_btn.drawButton(false);
}
void jog()
{
home_btn.initButton(&tft, 390, 300, 90, 40, BLACK, SILVER, BLACK, “HOME”, 2);
home_btn.drawButton(false);
tft.setCursor(0,0); //(column, row)
tft.setTextSize(4);
tft.setTextColor(BLACK);
tft.print(“JOG MODE”);

}
void offset()
{
home_btn.initButton(&tft, 390, 300, 90, 40, BLACK, SILVER, BLACK, “HOME”, 2);
home_btn.drawButton(false);
tft.setCursor(0,0); //(column, row)
tft.setTextSize(4);
tft.setTextColor(BLACK);
tft.print(" OFFSET MODE");
tft.setTextColor(BLACK);
tft.setTextSize(2);
tft.setCursor(20,40);
}
void WriteProgram()
{
num1_btn.initButton(&tft, 60, 160, 30, 40, BLACK, WHITE, BLACK, “1”, 2);
num2_btn.initButton(&tft, 100, 160, 30, 40, BLACK, WHITE, BLACK, “2”, 2);
num3_btn.initButton(&tft, 140, 160, 30, 40, BLACK, WHITE, BLACK, “3”, 2);
q_btn.initButton(&tft, 60, 200, 30, 40, BLACK, WHITE, BLACK, “Q”, 2);
w_btn.initButton(&tft, 100, 200, 30, 40, BLACK, WHITE, BLACK, “W”, 2);
e_btn.initButton(&tft, 140, 200, 30, 40, BLACK, WHITE, BLACK, “E”, 2);
q_btn.drawButton(false);
w_btn.drawButton(false);
e_btn.drawButton(false);
num1_btn.drawButton(false);
num2_btn.drawButton(false);
num3_btn.drawButton(false);
}
void setup(void) //main function
{
Serial.begin(9600);
uint16_t ID = tft.readID();
Serial.print(“TFT ID = 0x”);
Serial.println(ID, HEX);
Serial.println(“Calibrate for your Touch Panel”);
if (ID == 0xD3D3) ID = 0x9486; // write-only shield
tft.begin(ID);
tft.setRotation(1); //PORTRAIT
tft.fillScreen(WHITE);
Home();
}

void loop(void)
{
bool down = Touch_getXY();
edit_btn.press(down && edit_btn.contains(pixel_x, pixel_y));
jog_btn.press(down && jog_btn.contains(pixel_x, pixel_y));
offset_btn.press(down && offset_btn.contains(pixel_x, pixel_y));
home_btn.press(down && home_btn.contains(pixel_x, pixel_y));
edit1_btn.press(down && edit1_btn.contains(pixel_x, pixel_y));
q_btn.press(down && q_btn.contains(pixel_x, pixel_y));
num1_btn.press(down && num1_btn.contains(pixel_x, pixel_y));
num2_btn.press(down && num2_btn.contains(pixel_x, pixel_y));
num3_btn.press(down && num3_btn.contains(pixel_x, pixel_y));
if (edit_btn.justReleased())
{
tft.fillScreen(BLACK);
tft.fillScreen(WHITE);
Edit();
}
else if (jog_btn.justReleased())
{
tft.fillScreen(BLACK);
tft.fillScreen(WHITE);
jog();
}
else if (offset_btn.justReleased())
{
tft.fillScreen(BLACK);
tft.fillScreen(WHITE);
offset();
}
else if (home_btn.justReleased())
{
tft.fillScreen(BLACK);
tft.fillScreen(WHITE);
Home();
}
else if (edit1_btn.justReleased())
{
tft.setCursor(0,0);
tft.fillScreen(BLACK);
tft.fillScreen(WHITE);
WriteProgram();
}
else if (q_btn.justReleased())
{
tft.setCursor(col_ref,row_ref);
tft.setTextSize(2);
tft.print(“Q”);
delay(250);
col_ref = col_ref +10; //
}
else if (num1_btn.justReleased())
{
//col_ref += 10;
tft.setCursor(col_ref,row_ref);
tft.setTextSize(2);
tft.print(“1”);
delay(500);
col_ref += 10;
}
else if (semicolon_btn.justReleased())
{
//col_ref = col;
//row_ref = row+10;
tft.setCursor(col_ref,row_ref);
}
else if (clr_btn.justReleased())
{
col_ref = col_ref-10;
tft.setCursor(col_ref,row_ref);
tft.fillRect(col_ref, row_ref, 10, 14, BLACK );
delay(200);
tft.fillRect(col_ref, row_ref, 10, 14, WHITE );
}
}
#endif

OK, first things first.

You need to go and read the forum instructions so that you can go back and modify your original post (not re-post it) - using the “More → Modify” option below the right hand corner of your post - to mark up your code as such using the “</>” icon in the posting window. Just highlight each section of code (or output if you need to post that) from the IDE and click the icon.

In fact, the IDE itself has a “copy for forum” link to put these markings on a highlighted block for you so you then just paste it here in a posting window. But even before doing that, don’t forget to use the “Auto-Format” (Ctrl-T) option first to make it easy to read. If you do not post it as “code” it can easily be quite garbled and is always more difficult to read due to the font.

It is inappropriate to attach it as a “.ino” file unless it is clearly too long to include in the post proper. People can usually see the mistakes directly and do not want to have to actually load it in their own IDE. And even that would also assume they are using a PC and have the IDE running on that PC.

Also tidy up your blank space. Do use blank lines, but only single blanks between complete functional blocks.