[Carradio\RENAULT\22DC259_62]

Size(310,460);  

Form {
    	HexDigit(Code,"Code ",70,15,100,4);
    	CheckBox(ResetCounter,"Обнулить счётчик попыток",82,45);
	ComboBox(CodeRequest,"Запрос кода",32,80,100,"Off","On");
	
	Group("Информация",5,110,300,50)		 
    {
        Label(message," ",0,22);			 
    }
    	Group("Описание",5,165,300,220) 		 
    {
        Label(lb1,"Code calculator for RENAULT :",0,15);
    	Label(lb2,"Model:  22 DC259/62  without display",32,30);
    	Label(lb3,"Sec. Type:  CODE 0000-9999",32,45);
	Label(lb4,"Manufacturen: PHILIPS.",32,60);
	Label(lb5,"Partnumer:  RN259  ",32,75);
    	Label(lb6,"MCU: PN-R1-V1.13   93CW44DF1A10 ",32,90);
	Label(lb7,"EEPROM: 24C32 smd",32,105);
	Label(lb8,"Sec.loc.: EEPROM",32,120);
    	Label(lb9,"Autor:  telik@ukrwest.net   2008",0,200);
    	Label(lb10,"Enter code: ",32,135);
    }
	Picture(Logo,"renault.bmp",240,10,0,0);
    {
        Label(msg," ",0,395);				 
    } 
}

OnShow {
	msg.Color=0x0000FF;				 
        msg.Bold=1;					 
	msg="http://www.eeprom.lg.ua";		
        
	var1=((@0xFF8 & 0x0F) << 12);
	var2=((@0xFF9 & 0xF0) << 4);
	var3=((@0xFFA & 0x0F) << 4);
	var4=((@0xFFB & 0xF0) >> 4);	
        Code = var1 |var2 |var3 |var4;
	
	Var5 = 0;
	CodeRequest = 1;
    	if(@0xFEF = 0x12) { var5 = 1; }			 
    	if(@0xFEF = 0x22) { var5 = 0; } 		 
    	CodeRequest = var5;  
	
	ResetCounter = 1;
	if (@0xFEE != 0x10)   { ResetCounter = 0;}
	if (ResetCounter = 0) 
	{	
	message.Color = 0x0000FF; 
	message.Bold = 1; 
	message = "Обнулите счётчик попыток !!!"; 
	ResetCounter = 1;
	}
    else
	{
	message.Color = 0xFF0000;
	message.Bold = 1;
	message = "Счётчик попыток OK.";
	ResetCounter = 0;
	}
}

OnApply {
	var15 = 0;
	if(ResetCounter = 0) { var15 = Var15+1;}
	if(CodeRequest = 0)  { var15 = Var15+1;}
	if(var15 = 2)  
	{
	message.Color=0xFF0000;
	message.Bold=1;
	message="Нажмите кнопку <Применить>. ";
	}
	ResetCounter = 1;
    else
    	{
	if(ResetCounter = 1) { @0xFEE = 0x10;}
	if(CodeRequest = 1) { @0xFEF = 0x12; }
	if(CodeRequest = 0) { @0xFEF = 0x22; }
	message.Color = 0xFF0000;
        message.Bold = 1;
       	message = "Попытки и запрос кода успешно изменёны.";
    	}
}
