106 lines
4.4 KiB
Python
106 lines
4.4 KiB
Python
if menu_count >= 16:
|
|
scroll_height = 1725
|
|
else:
|
|
scroll_height = 1400
|
|
|
|
out_xml('<FrameScroll> \r\n')
|
|
out_xml('<X> 0 </X>\r\n')
|
|
out_xml('<Y> 520 </Y>\r\n')
|
|
out_xml('<Width> 1080 </Width>\r\n')
|
|
out_xml('<Height> 1400 </Height>\r\n')
|
|
out_xml('<ScrollHeight> "auto" </ScrollHeight>\r\n')
|
|
out_xml('<Scroll> "Vertical" </Scroll>\r\n')
|
|
|
|
for i in range( menu_count):
|
|
i_str = str(i + 1)
|
|
out_xml( '\t; button i='+ i_str + ' ' + product_code[i]+ ' \r\n')
|
|
|
|
out_xml( '<Block>\r\n')
|
|
out_xml('\t<Width> 225 </Width>\r\n')
|
|
out_xml('\t<Height> 296 </Height>\r\n')
|
|
|
|
out_xml( '\t<Button>\r\n')
|
|
out_xml( '\t<X> 0 </X> \r\n')
|
|
out_xml( '\t<Y> 0 </Y> \r\n')
|
|
|
|
out_xml( '\t<State> $' + product_code[i] + '.Button </State> \r\n')
|
|
out_xml( '\t<Filename> "' + default_dir + ''+ bt_pic[i].replace('#','n') +'" </Filename>\r\n')
|
|
out_xml( '\t<FilenamePress> "' + default_dir_press + ''+ bt_pic[i].replace('#','n') +'" </FilenamePress>\r\n')
|
|
out_xml( '\t<FilenameDisable> "' + default_dir_disable + ''+ bt_pic[i].replace('#','n') +'" </FilenameDisable>\r\n')
|
|
out_xml( '\t<Sound> "/mnt/sdcard/coffeevending/wav/click.wav" </Sound>\r\n')
|
|
out_xml( '\t<Volume> SoundVolume </Volume>\r\n')
|
|
out_xml( '\t<EventOnClick> \r\n')
|
|
|
|
out_xml( '\t\tVar SelectDrink = "'+ product_code[i] +'"\r\n')
|
|
out_xml( '\t\tVar NameDrink = $' + product_code[i] + '.NameE\r\n')
|
|
out_xml( '\t\tVar NameDrinkTH = $' + product_code[i] + '.Name\r\n')
|
|
out_xml( '\t\tVar DrinkDescriptionTH = $' + product_code[i] + '.description\r\n')
|
|
out_xml( '\t\tVar DrinkDescription = $' + product_code[i] + '.descriptionE\r\n')
|
|
out_xml( '\t\tVar PriceDrink = $' + product_code[i] + '.Price\r\n')
|
|
out_xml( '\t\tVar PictureDrink = "' + default_dir2 + '/' + bt_pic[i].replace('#','n') + '"\r\n')
|
|
out_xml( '\t\tTopping "Load" SelectDrink\r\n')
|
|
out_xml( '\t\tSAVELOG NameDrink\r\n')
|
|
out_xml( '\t\tVar PriceShowValue = charOfBaht + PriceDrink\r\n')
|
|
#out_xml( '\t\tVar PriceShowValue = "Free"\r\n')
|
|
out_xml( '\t\tOpen "ROOT/taobin_project/xml/page_topping_alter.xml"\r\n')
|
|
|
|
out_xml( '\t</EventOnClick>\r\n')
|
|
out_xml( '\t</Button>\r\n')
|
|
|
|
if RoadShow :
|
|
out_xml( '\t<Text>\r\n')
|
|
out_xml( '\t<X> 164 </X>\r\n')
|
|
out_xml( '\t<Y> 12 </Y>\r\n')
|
|
out_xml( '\t<Width>200</Width>\r\n')
|
|
out_xml( '\t<Size> 27 </Size>\r\n')
|
|
out_xml( '\t<Font> KanitTTF </Font>\r\n')
|
|
out_xml( '\t<Color> 0xB78F24 </Color>\r\n')
|
|
out_xml( '\t<Value> "Free!" </Value>\r\n')
|
|
out_xml( '\t</Text>\r\n')
|
|
else:
|
|
out_xml( '\t<Text>\r\n')
|
|
out_xml( '\t<X> 182 </X>\r\n')
|
|
out_xml( '\t<Y> 12 </Y>\r\n')
|
|
out_xml( '\t<Align> "Hurr" </Align>\r\n')
|
|
out_xml( '\t<Width>150</Width>\r\n')
|
|
out_xml( '\t<Size> 27 </Size>\r\n')
|
|
out_xml( '\t<Font> KanitTTF </Font>\r\n')
|
|
out_xml( '\t<Color> 0xB78F24 </Color>\r\n')
|
|
out_xml( '\t<Value> $' + product_code[i] + '.Price </Value>\r\n')
|
|
out_xml( '\t</Text>\r\n')
|
|
|
|
out_xml( '\t<Text>\r\n')
|
|
out_xml( '\t<X> 164 </X>\r\n')
|
|
out_xml( '\t<Y> 12 </Y>\r\n')
|
|
out_xml( '\t<Width>20</Width>\r\n')
|
|
out_xml( '\t<Size> 27 </Size>\r\n')
|
|
out_xml( '\t<Font> KanitTTF </Font>\r\n')
|
|
out_xml( '\t<Color> 0xB78F24 </Color>\r\n')
|
|
out_xml( '\t<Value> "฿"" </Value>\r\n')
|
|
out_xml( '\t</Text>\r\n')
|
|
|
|
out_xml( '\t<Text>\r\n')
|
|
out_xml( '\t<X> 16 </X>\r\n')
|
|
out_xml( '\t<Y> 214 </Y>\r\n')
|
|
out_xml( '\t<Size> 26 </Size>\r\n')
|
|
out_xml( '\t<Width>220</Width>\r\n')
|
|
out_xml( '\t<Mode> "bound" </Mode>\r\n')
|
|
out_xml( '\t<Font> KanitMediumTTF </Font>\r\n')
|
|
out_xml( '\t<Color> 0x322B26 </Color>\r\n')
|
|
out_xml( '\t<Value> $' + product_code[i] + '.Name </Value>\r\n')
|
|
out_xml( '\t</Text>\r\n')
|
|
|
|
out_xml( '\t<Text>\r\n')
|
|
out_xml( '\t<X> 16 </X>\r\n')
|
|
out_xml( '\t<Y> 246 </Y>\r\n')
|
|
out_xml( '\t<Size> 14 </Size>\r\n')
|
|
out_xml( '\t<Width>220</Width>\r\n')
|
|
out_xml( '\t<Font> KanitMediumTTF </Font>\r\n')
|
|
out_xml( '\t<Color> 0x6F5F51 </Color>\r\n')
|
|
out_xml( '\t<Value> $' + product_code[i] + '.description </Value>\r\n')
|
|
out_xml( '\t</Text>\r\n')
|
|
|
|
out_xml( '</Block>\r\n')
|
|
|
|
|
|
out_xml('</FrameScroll>\r\n')
|