Saturday, August 11, 2012

Centerline Range Guide Program

from Tkinter import *
#Centerline range guide.
#Written by Steve Atchison.
def sw_win():
       win=Toplevel(root)
       win.title('SW')
       win.geometry('300x600')
#East to West line.
       can=Canvas(win,width=300,height=600)
      
       can.create_rectangle(0,0,300,600,fill='white')
      
       can.create_text(150,50,text='East to West')

       can.create_line(30,100,260,100,arrow=FIRST,width=3)#Draw arrow
       can.create_text(30,90,text='Right to')
       can.create_text(30,110,text='Left to')
       can.create_text(250,90,text='Right from')
       can.create_text(250,110,text='Left from')

       can.create_text(150,130,text='Rfadd = 100')
       can.create_text(150,150,text='Lfadd = 101')
       can.create_text(150,170,text='Rtadd = 198')
       can.create_text(150,190,text='Ltadd = 199')

       can.create_text(30,70,text='198')
       can.create_text(30,130,text='199')
       can.create_text(250,70,text='100')
       can.create_text(250,130,text='101')
       can.pack()
#North to South line.
       can.create_line(200,300,200,500,arrow=LAST,width=3)#Draw arrow

       can.create_text(150,260,text='North to South')

       can.create_text(150,300,text='Right from')
       can.create_text(150,500,text='Right to')
       can.create_text(250,300,text='Left from')
       can.create_text(250,500,text='Left to')

       can.create_text(150,320,text='101')
       can.create_text(150,520,text='199')
       can.create_text(250,320,text='100')
       can.create_text(250,520,text='198')

       can.create_text(50,400,text='Rfadd = 101')
       can.create_text(50,420,text='Lfadd = 100')
       can.create_text(50,440,text='Rtadd = 199')
       can.create_text(50,460,text='Ltadd = 198')
      
def se_win():
       win=Toplevel(root)
       win.title('SE')
       win.geometry('300x600')
#East to West line.
       can=Canvas(win,width=300,height=600)
      
       can.create_rectangle(0,0,300,600,fill='white')
      
       can.create_text(150,50,text='West to East')

       can.create_line(30,100,260,100,arrow=LAST,width=3)#Draw arrow

       can.create_text(35,90,text='Left from')
       can.create_text(40,110,text='Right from')
       can.create_text(250,90,text='Left to')
       can.create_text(250,110,text='Right to')

       can.create_text(150,130,text='Rfadd = 101')
       can.create_text(150,150,text='Lfadd = 100')
       can.create_text(150,170,text='Rtadd = 199')
       can.create_text(150,190,text='Ltadd = 198')

       can.create_text(30,70,text='100')
       can.create_text(30,130,text='101')
       can.create_text(250,70,text='198')
       can.create_text(250,130,text='199')
       can.pack()
#North to South line.
       can.create_line(80,300,80,500,arrow=LAST,width=3)#Draw arrow

       can.create_text(150,260,text='North to South')

       can.create_text(42,300,text='Right from')
       can.create_text(45,500,text='Right to')
       can.create_text(120,300,text='Left from')
       can.create_text(120,500,text='Left to')

       can.create_text(50,320,text='101')
       can.create_text(50,520,text='199')
       can.create_text(120,320,text='100')
       can.create_text(120,520,text='198')

       can.create_text(200,400,text='Rfadd = 101')
       can.create_text(200,420,text='Lfadd = 100')
       can.create_text(200,440,text='Rtadd = 199')
       can.create_text(200,460,text='Ltadd = 198')
def nw_win():
       win=Toplevel(root)
       win.title('NW')
       win.geometry('300x600')
#East to West line
       can=Canvas(win,width=300,height=600)
      
       can.create_rectangle(0,0,300,600,fill='white')
      
       can.create_text(150,400,text='East to West')

       can.create_line(30,450,260,450,arrow=FIRST,width=3)#Draw arrow

       can.create_text(35,440,text='Right to')
       can.create_text(40,460,text='Left to')
       can.create_text(250,440,text='Right from')
       can.create_text(250,460,text='Left from')

       can.create_text(150,510,text='Rfadd = 100')
       can.create_text(150,530,text='Lfadd = 101')
       can.create_text(150,550,text='Rtadd = 198')
       can.create_text(150,570,text='Ltadd = 199')

       can.create_text(30,420,text='198')
       can.create_text(30,480,text='199')
       can.create_text(250,420,text='100')
       can.create_text(250,480,text='101')
       can.pack()
#South to North line.
       can.create_line(200,250,200,50,arrow=LAST,width=3)#Draw arrow

       can.create_text(150,30,text='South to North')

       can.create_text(160,240,text='Left from')
       can.create_text(160,60,text='Left to')
       can.create_text(240,60,text='Right to')
       can.create_text(240,240,text='Right from')

       can.create_text(160,80,text='199')
       can.create_text(160,260,text='101')
       can.create_text(240,80,text='198')
       can.create_text(240,260,text='100')
       can.create_text(50,100,text='Rfadd = 100')
       can.create_text(50,120,text='Lfadd = 101')
       can.create_text(50,140,text='Rtadd = 198')
       can.create_text(50,160,text='Ltadd = 199')

def ne_win():
       win=Toplevel(root)
       win.title('NE')
       win.geometry('300x600')
#East to West line
       can=Canvas(win,width=300,height=600)
      
       can.create_rectangle(0,0,300,600,fill='white')
      
       can.create_text(150,400,text='West to East')

       can.create_line(30,450,260,450,arrow=LAST,width=3)#Draw arrow

       can.create_text(35,440,text='Left from')
       can.create_text(40,460,text='Right from')
       can.create_text(250,440,text='Left to')
       can.create_text(250,460,text='Right to')

       can.create_text(150,510,text='Rfadd = 101')
       can.create_text(150,530,text='Lfadd = 100')
       can.create_text(150,550,text='Rtadd = 199')
       can.create_text(150,570,text='Ltadd = 198')

       can.create_text(30,420,text='100')
       can.create_text(30,480,text='101')
       can.create_text(250,420,text='198')
       can.create_text(250,480,text='199')
       can.pack()
#South to North line.
       can.create_line(70,250,70,50,arrow=LAST,width=3)#Draw arrow

       can.create_text(150,30,text='South to North')

       can.create_text(30,240,text='Left from')
       can.create_text(30,60,text='Left to')
       can.create_text(110,60,text='Right to')
       can.create_text(110,240,text='Right from')

       can.create_text(30,80,text='199')
       can.create_text(30,260,text='101')
       can.create_text(100,80,text='198')
       can.create_text(100,260,text='100')

       can.create_text(250,100,text='Rfadd = 100')
       can.create_text(250,120,text='Lfadd = 101')
       can.create_text(250,140,text='Rtadd = 198')
       can.create_text(250,160,text='Ltadd = 199')
                        
  
      
root=Tk()
btn=Button(root,text='SW range guide',command=sw_win)
btn.pack()

btn2=Button(root,text='SE range guide', command=se_win)
btn2.pack()

btn3=Button(root,text='NW range  guide',command=nw_win)
btn3.pack()

btn4=Button(root,text='NE range guide',command=ne_win)
btn4.pack()
root.mainloop()

No comments:

Post a Comment

Followers

Blog Archive

About Me

My photo
Biking helps me to cope with life.