Skip to content

Instantly share code, notes, and snippets.

@rupython
Created September 20, 2020 04:02
Show Gist options
  • Save rupython/f95cd74cf4eff0f3ca9ede1c072a7e5d to your computer and use it in GitHub Desktop.
Save rupython/f95cd74cf4eff0f3ca9ede1c072a7e5d to your computer and use it in GitHub Desktop.
From: Roman
import ctypes
import os
image_3max0 = 'C:\\cal\\3max0.png'
image_3max2 = 'C:\\cal\\3max2.png'
image_3max3 = 'C:\\cal\\3max3.png'
image_3max4 = 'C:\\cal\\3max4.png'
image_3max5 = 'C:\\cal\\3max5.png'
image_3max6 = 'C:\\cal\\3max6.png'
image_3max7 = 'C:\\cal\\3max7.png'
image_3max8 = 'C:\\cal\\3max8.png'
image_3max9 = 'C:\\cal\\3max9.png'
image_3max10 = 'C:\\cal\\3max10.png'
image_3max11 = 'C:\\cal\\3max11.png'
image_3max12 = 'C:\\cal\\3max12.png'
image_3max13 = 'C:\\cal\\3max13.png'
image_3max14 = 'C:\\cal\\3max14.png'
image_3max15 = 'C:\\cal\\3max15.png'
image_3max16 = 'C:\\cal\\3max16.png'
image_3max17 = 'C:\\cal\\3max17.png'
image_3max18 = 'C:\\cal\\3max18.png'
image_3max19 = 'C:\\cal\\3max19.png'
image_3max20 = 'C:\\cal\\3max20.png'
image_3max21 = 'C:\\cal\\3max21.png'
image_3max22 = 'C:\\cal\\3max22.png'
image_3max23 = 'C:\\cal\\3max23.png'
image_3max24 = 'C:\\cal\\3max24.png'
image_3max25 = 'C:\\cal\\3max25.png'
image_hu0 = 'C:\\cal\\hu0.png'
image_hu2 = 'C:\\cal\\hu2.png'
image_hu3 = 'C:\\cal\\hu3.png'
image_hu4 = 'C:\\cal\\hu4.png'
image_hu5 = 'C:\\cal\\hu5.png'
image_hu6 = 'C:\\cal\\hu6.png'
image_hu7 = 'C:\\cal\\hu7.png'
image_hu8 = 'C:\\cal\\hu8.png'
image_hu9 = 'C:\\cal\\hu9.png'
image_hu10 = 'C:\\cal\\hu10.png'
image_hu11 = 'C:\\cal\\hu11.png'
image_hu12 = 'C:\\cal\\hu12.png'
image_hu13 = 'C:\\cal\\hu13.png'
image_hu14 = 'C:\\cal\\hu14.png'
image_hu15 = 'C:\\cal\\hu15.png'
image_hu16 = 'C:\\cal\\hu16.png'
image_hu17 = 'C:\\cal\\hu17.png'
image_hu18 = 'C:\\cal\\hu18.png'
image_hu19 = 'C:\\cal\\hu19.png'
image_hu20 = 'C:\\cal\\hu20.png'
image_hu21 = 'C:\\cal\\hu21.png'
image_hu22 = 'C:\\cal\\hu22.png'
image_hu23 = 'C:\\cal\\hu23.png'
image_hu24 = 'C:\\cal\\hu24.png'
image_hu25 = 'C:\\cal\\hu25.png'
SPI_SETDESKWALLPAPER = 20
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
class BoxApp(App):
def build(self):
self.title = "Ежедневник"
bl = BoxLayout()
gl = GridLayout(rows=2, cols=25, padding=[2], spacing=2, size_hint= (.95, 1))
bl.add_widget( Label(text="24", font_size=30, size_hint= (.05, 1)))
gl.add_widget( Button(text="0", on_press = self.btn_3max0) )
gl.add_widget( Button(text="2", on_press = self.btn_3max2) )
gl.add_widget( Button(text="3", on_press = self.btn_3max3) )
gl.add_widget( Button(text="4", on_press = self.btn_3max4) )
gl.add_widget( Button(text="5", on_press = self.btn_3max5) )
gl.add_widget( Button(text="6", on_press = self.btn_3max6) )
gl.add_widget( Button(text="7", on_press = self.btn_3max7) )
gl.add_widget( Button(text="8", on_press = self.btn_3max8) )
gl.add_widget( Button(text="9", on_press = self.btn_3max9) )
gl.add_widget( Button(text="10", on_press = self.btn_3max10) )
gl.add_widget( Button(text="11", on_press = self.btn_3max11) )
gl.add_widget( Button(text="12", on_press = self.btn_3max12) )
gl.add_widget( Button(text="13", on_press = self.btn_3max13) )
gl.add_widget( Button(text="14", on_press = self.btn_3max14) )
gl.add_widget( Button(text="15", on_press = self.btn_3max15) )
gl.add_widget( Button(text="16", on_press = self.btn_3max16) )
gl.add_widget( Button(text="17", on_press = self.btn_3max17) )
gl.add_widget( Button(text="18", on_press = self.btn_3max18) )
gl.add_widget( Button(text="19", on_press = self.btn_3max19) )
gl.add_widget( Button(text="20", on_press = self.btn_3max20) )
gl.add_widget( Button(text="21", on_press = self.btn_3max21) )
gl.add_widget( Button(text="22", on_press = self.btn_3max22) )
gl.add_widget( Button(text="23", on_press = self.btn_3max23) )
gl.add_widget( Button(text="24", on_press = self.btn_3max24) )
gl.add_widget( Button(text="25", on_press = self.btn_3max25) )
gl.add_widget( Button(text="0", background_color=[1,0,0,1], on_press = self.btn_hu0) )
gl.add_widget( Button(text="--", background_color=[1,0,0,1], on_press = self.btn_hu2) )
gl.add_widget( Button(text="--", background_color=[1,0,0,1], on_press = self.btn_hu3) )
gl.add_widget( Button(text="4", background_color=[1,0,0,1], on_press = self.btn_hu4) )
gl.add_widget( Button(text="5", background_color=[1,0,0,1], on_press = self.btn_hu5) )
gl.add_widget( Button(text="6", background_color=[1,0,0,1], on_press = self.btn_hu6) )
gl.add_widget( Button(text="7", background_color=[1,0,0,1], on_press = self.btn_hu7) )
gl.add_widget( Button(text="8", background_color=[1,0,0,1], on_press = self.btn_hu8) )
gl.add_widget( Button(text="9", background_color=[1,0,0,1], on_press = self.btn_hu9) )
gl.add_widget( Button(text="10", background_color=[1,1,.2,1], on_press = self.btn_hu10) )
gl.add_widget( Button(text="11", background_color=[1,1,.2,1], on_press = self.btn_hu11) )
gl.add_widget( Button(text="12", background_color=[1,1,.2,1], on_press = self.btn_hu12) )
gl.add_widget( Button(text="13", background_color=[1,1,.2,1], on_press = self.btn_hu13) )
gl.add_widget( Button(text="14", background_color=[1,1,.2,1], on_press = self.btn_hu14) )
gl.add_widget( Button(text="15", background_color=[.5,1,1,1], on_press = self.btn_hu15) )
gl.add_widget( Button(text="16", background_color=[.5,1,1,1], on_press = self.btn_hu16) )
gl.add_widget( Button(text="17", background_color=[.5,1,1,1], on_press = self.btn_hu17) )
gl.add_widget( Button(text="18", background_color=[.5,1,1,1], on_press = self.btn_hu18) )
gl.add_widget( Button(text="19", background_color=[.5,1,1,1], on_press = self.btn_hu19) )
gl.add_widget( Button(text="20", background_color=[.5,1,1,1], on_press = self.btn_hu20) )
gl.add_widget( Button(text="21", background_color=[.5,1,1,1], on_press = self.btn_hu21) )
gl.add_widget( Button(text="22", background_color=[.5,1,1,1], on_press = self.btn_hu22) )
gl.add_widget( Button(text="23", background_color=[.5,1,1,1], on_press = self.btn_hu23) )
gl.add_widget( Button(text="24", background_color=[.5,1,1,1], on_press = self.btn_hu24) )
gl.add_widget( Button(text="25", background_color=[.5,1,1,1], on_press = self.btn_hu25) )
bl.add_widget(gl)
return bl
def btn_3max0(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max0, 3)
def btn_3max2(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max2, 3)
def btn_3max3(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max3, 3)
def btn_3max4(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max4, 3)
def btn_3max5(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max5, 3)
def btn_3max6(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max6, 3)
def btn_3max7(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max7, 3)
def btn_3max8(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max8, 3)
def btn_3max9(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max9, 3)
def btn_3max10(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max10, 3)
def btn_3max11(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max11, 3)
def btn_3max12(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max12, 3)
def btn_3max13(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max13, 3)
def btn_3max14(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max14, 3)
def btn_3max15(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max15, 3)
def btn_3max16(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max16, 3)
def btn_3max17(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max17, 3)
def btn_3max18(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max18, 3)
def btn_3max19(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max19, 3)
def btn_3max20(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max20, 3)
def btn_3max21(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max21, 3)
def btn_3max22(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max22, 3)
def btn_3max23(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max23, 3)
def btn_3max24(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max24, 3)
def btn_3max25(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_3max25, 3)
def btn_hu0(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu0, 3)
def btn_hu2(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu2, 3)
def btn_hu3(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu3, 3)
def btn_hu4(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu4, 3)
def btn_hu5(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu5, 3)
def btn_hu6(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu6, 3)
def btn_hu7(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu7, 3)
def btn_hu8(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu8, 3)
def btn_hu9(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu9, 3)
def btn_hu10(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu10, 3)
def btn_hu11(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu11, 3)
def btn_hu12(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu12, 3)
def btn_hu13(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu13, 3)
def btn_hu14(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu14, 3)
def btn_hu15(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu15, 3)
def btn_hu16(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu16, 3)
def btn_hu17(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu17, 3)
def btn_hu18(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu18, 3)
def btn_hu19(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu19, 3)
def btn_hu20(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu20, 3)
def btn_hu21(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu21, 3)
def btn_hu22(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu22, 3)
def btn_hu23(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu23, 3)
def btn_hu24(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu24, 3)
def btn_hu25(self, instance):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_hu25, 3)
if __name__== "__main__":
BoxApp().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment