#! /usr/bin/env python
#  -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 4.19
#  in conjunction with Tcl version 8.6
#    Dec 07, 2018 09:28:34 AM CET  platform: Windows NT
import _constants
a = _constants.Current_date()




import sys

try:
    import Tkinter as tk
except ImportError:
    import tkinter as tk

try:
    import ttk
    py3 = False
except ImportError:
    import tkinter.ttk as ttk
    py3 = True

import Productions_support

def vp_start_gui():
    '''Starting point when module is the main routine.'''
    global val, w, root
    root = tk.Tk()
    top = Toplevel1 (root)
    Productions_support.init(root, top)
    root.mainloop()

w = None
def create_Toplevel1(root, *args, **kwargs):
    '''Starting point when module is imported by another program.'''
    global w, w_win, rt
    rt = root
    w = tk.Toplevel (root)
    top = Toplevel1 (w)
    Productions_support.init(w, top, *args, **kwargs)
    return (w, top)

def destroy_Toplevel1():
    global w
    w.destroy()
    w = None

class Toplevel1:
    def __init__(self, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''
        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'
        _fgcolor = '#000000'  # X11 color: 'black'
        _compcolor = '#d9d9d9' # X11 color: 'gray85'
        _ana1color = '#d9d9d9' # X11 color: 'gray85' 
        _ana2color = '#ececec' # Closest X11 color: 'gray92' 
        font10 = "-family {Courier New} -size 10 -weight normal -slant"  \
            " roman -underline 0 -overstrike 0"
        font9 = "-family {Segoe UI} -size 9 -weight normal -slant "  \
            "roman -underline 0 -overstrike 0"
        self.style = ttk.Style()
        if sys.platform == "win32":
            self.style.theme_use('winnative')
        self.style.configure('.',background=_bgcolor)
        self.style.configure('.',foreground=_fgcolor)
        self.style.map('.',background=
            [('selected', _compcolor), ('active',_ana2color)])

        top.geometry("883x910+273+222")
        top.title("Material production")
        top.configure(background="#d9d9d9")
        top.configure(highlightbackground="#d9d9d9")
        top.configure(highlightcolor="black")
        top.wm_iconbitmap('logo.ico')

        self.Label1 = tk.Label(top)
        self.Label1.place(relx=0.011, rely=0.011, height=21, width=264)
        self.Label1.configure(activebackground="#f9f9f9")
        self.Label1.configure(activeforeground="#000000")
        self.Label1.configure(background="#b1d8cf")
        self.Label1.configure(disabledforeground="#a3a3a3")
        self.Label1.configure(foreground="#000000")
        self.Label1.configure(highlightbackground="#d9d9d9")
        self.Label1.configure(highlightcolor="black")
        self.Label1.configure(text='''Input order ID''')

        self.Entry1 = tk.Entry(top)
        self.Entry1.place(relx=0.317, rely=0.253,height=20, relwidth=0.31)
        self.Entry1.configure(background="white")
        self.Entry1.configure(disabledforeground="#a3a3a3")
        self.Entry1.configure(font=font10)
        self.Entry1.configure(foreground="#000000")
        self.Entry1.configure(highlightbackground="#d9d9d9")
        self.Entry1.configure(highlightcolor="black")
        self.Entry1.configure(insertbackground="black")
        self.Entry1.configure(selectbackground="#c4c4c4")
        self.Entry1.configure(selectforeground="black")

        self.Label1_1 = tk.Label(top)
        self.Label1_1.place(relx=0.011, rely=0.121, height=21, width=264)
        self.Label1_1.configure(activebackground="#f9f9f9")
        self.Label1_1.configure(activeforeground="#000000")
        self.Label1_1.configure(background="#b1d8cf")
        self.Label1_1.configure(disabledforeground="#a3a3a3")
        self.Label1_1.configure(foreground="#000000")
        self.Label1_1.configure(highlightbackground="#d9d9d9")
        self.Label1_1.configure(highlightcolor="black")
        self.Label1_1.configure(text='''Input manufacturing lead time''')

        self.Labelframe1 = tk.LabelFrame(top)
        self.Labelframe1.place(relx=0.011, rely=0.473, relheight=0.511
                , relwidth=0.974)
        self.Labelframe1.configure(relief='groove')
        self.Labelframe1.configure(foreground="black")
        self.Labelframe1.configure(text='''Track the production runs''')
        self.Labelframe1.configure(background="#d9d9d9")
        self.Labelframe1.configure(highlightbackground="#d9d9d9")
        self.Labelframe1.configure(highlightcolor="black")
        self.Labelframe1.configure(width=860)

        self.Scrolledlistbox1 = ScrolledListBox(self.Labelframe1)
        self.Scrolledlistbox1.place(relx=0.012, rely=0.129, relheight=0.376
                , relwidth=0.978, bordermode='ignore')
        self.Scrolledlistbox1.configure(background="white")
        self.Scrolledlistbox1.configure(disabledforeground="#a3a3a3")
        self.Scrolledlistbox1.configure(font=font10)
        self.Scrolledlistbox1.configure(foreground="black")
        self.Scrolledlistbox1.configure(highlightbackground="#d9d9d9")
        self.Scrolledlistbox1.configure(highlightcolor="#d9d9d9")
        self.Scrolledlistbox1.configure(selectbackground="#c4c4c4")
        self.Scrolledlistbox1.configure(selectforeground="black")
        self.Scrolledlistbox1.configure(width=10)

        self.Label1_3 = tk.Label(self.Labelframe1)
        self.Label1_3.place(relx=0.012, rely=0.065, height=21, width=154
                , bordermode='ignore')
        self.Label1_3.configure(activebackground="#f9f9f9")
        self.Label1_3.configure(activeforeground="#000000")
        self.Label1_3.configure(background="#b1d8cf")
        self.Label1_3.configure(disabledforeground="#a3a3a3")
        self.Label1_3.configure(foreground="#000000")
        self.Label1_3.configure(highlightbackground="#d9d9d9")
        self.Label1_3.configure(highlightcolor="black")
        self.Label1_3.configure(text='''track by order ID''')

        self.Entry3 = tk.Entry(self.Labelframe1)
        self.Entry3.place(relx=0.198, rely=0.065, height=24, relwidth=0.237
                , bordermode='ignore')
        self.Entry3.configure(background="white")
        self.Entry3.configure(disabledforeground="#a3a3a3")
        self.Entry3.configure(font=font10)
        self.Entry3.configure(foreground="#000000")
        self.Entry3.configure(highlightbackground="#d9d9d9")
        self.Entry3.configure(highlightcolor="black")
        self.Entry3.configure(insertbackground="black")
        self.Entry3.configure(selectbackground="#c4c4c4")
        self.Entry3.configure(selectforeground="black")

        self.Label1_4 = tk.Label(self.Labelframe1)
        self.Label1_4.place(relx=0.012, rely=0.538, height=21, width=154
                , bordermode='ignore')
        self.Label1_4.configure(activebackground="#f9f9f9")
        self.Label1_4.configure(activeforeground="#000000")
        self.Label1_4.configure(background="#b1d8cf")
        self.Label1_4.configure(disabledforeground="#a3a3a3")
        self.Label1_4.configure(foreground="#000000")
        self.Label1_4.configure(highlightbackground="#d9d9d9")
        self.Label1_4.configure(highlightcolor="black")
        self.Label1_4.configure(text='''track by task ID''')

        self.Entry3_5 = tk.Entry(self.Labelframe1)
        self.Entry3_5.place(relx=0.198, rely=0.538, height=20, relwidth=0.237
                , bordermode='ignore')
        self.Entry3_5.configure(background="white")
        self.Entry3_5.configure(disabledforeground="#a3a3a3")
        self.Entry3_5.configure(font=font10)
        self.Entry3_5.configure(foreground="#000000")
        self.Entry3_5.configure(highlightbackground="#d9d9d9")
        self.Entry3_5.configure(highlightcolor="black")
        self.Entry3_5.configure(insertbackground="black")
        self.Entry3_5.configure(selectbackground="#c4c4c4")
        self.Entry3_5.configure(selectforeground="black")
        self.Entry3_5.configure(width=204)

        self.Scrolledlistbox1_7 = ScrolledListBox(self.Labelframe1)
        self.Scrolledlistbox1_7.place(relx=0.012, rely=0.602, relheight=0.376
                , relwidth=0.978, bordermode='ignore')
        self.Scrolledlistbox1_7.configure(background="white")
        self.Scrolledlistbox1_7.configure(disabledforeground="#a3a3a3")
        self.Scrolledlistbox1_7.configure(font=font10)
        self.Scrolledlistbox1_7.configure(foreground="black")
        self.Scrolledlistbox1_7.configure(highlightbackground="#d9d9d9")
        self.Scrolledlistbox1_7.configure(highlightcolor="#d9d9d9")
        self.Scrolledlistbox1_7.configure(selectbackground="#c4c4c4")
        self.Scrolledlistbox1_7.configure(selectforeground="black")
        self.Scrolledlistbox1_7.configure(width=10)

        self.Entry1_3 = tk.Entry(top)
        self.Entry1_3.place(relx=0.317, rely=0.011,height=20, relwidth=0.31)
        self.Entry1_3.configure(background="white")
        self.Entry1_3.configure(disabledforeground="#a3a3a3")
        self.Entry1_3.configure(font=font10)
        self.Entry1_3.configure(foreground="#000000")
        self.Entry1_3.configure(highlightbackground="#d9d9d9")
        self.Entry1_3.configure(highlightcolor="black")
        self.Entry1_3.configure(insertbackground="black")
        self.Entry1_3.configure(selectbackground="#c4c4c4")
        self.Entry1_3.configure(selectforeground="black")

        self.Label1_2 = tk.Label(top)
        self.Label1_2.place(relx=0.011, rely=0.253, height=21, width=264)
        self.Label1_2.configure(activebackground="#f9f9f9")
        self.Label1_2.configure(activeforeground="#000000")
        self.Label1_2.configure(background="#b1d8cf")
        self.Label1_2.configure(disabledforeground="#a3a3a3")
        self.Label1_2.configure(foreground="#000000")
        self.Label1_2.configure(highlightbackground="#d9d9d9")
        self.Label1_2.configure(highlightcolor="black")
        self.Label1_2.configure(text='''Actual manufacturing lead time''')

        self.Entry1_4 = tk.Entry(top)
        self.Entry1_4.place(relx=0.317, rely=0.121,height=20, relwidth=0.31)
        self.Entry1_4.configure(background="white")
        self.Entry1_4.configure(disabledforeground="#a3a3a3")
        self.Entry1_4.configure(font=font10)
        self.Entry1_4.configure(foreground="#000000")
        self.Entry1_4.configure(highlightbackground="#d9d9d9")
        self.Entry1_4.configure(highlightcolor="black")
        self.Entry1_4.configure(insertbackground="black")
        self.Entry1_4.configure(selectbackground="#c4c4c4")
        self.Entry1_4.configure(selectforeground="black")

        self.Labelframe2 = tk.LabelFrame(top)
        self.Labelframe2.place(relx=0.657, rely=0.11, relheight=0.126
                , relwidth=0.317)
        self.Labelframe2.configure(relief='groove')
        self.Labelframe2.configure(foreground="black")
        self.Labelframe2.configure(text='''Forecasted Manufacturing lead time''')
        self.Labelframe2.configure(background="#d9d9d9")
        self.Labelframe2.configure(highlightbackground="#d9d9d9")
        self.Labelframe2.configure(highlightcolor="black")
        self.Labelframe2.configure(width=280)

        self.Text2 = tk.Text(self.Labelframe2)
        self.Text2.place(relx=0.036, rely=0.522, relheight=0.296, relwidth=0.943
                , bordermode='ignore')
        self.Text2.configure(background="white")
        self.Text2.configure(font=font9)
        self.Text2.configure(foreground="black")
        self.Text2.configure(highlightbackground="#d9d9d9")
        self.Text2.configure(highlightcolor="black")
        self.Text2.configure(insertbackground="black")
        self.Text2.configure(selectbackground="#c4c4c4")
        self.Text2.configure(selectforeground="black")
        self.Text2.configure(width=264)
        self.Text2.configure(wrap='word')

        self.Button3 = tk.Button(self.Labelframe2)
        self.Button3.place(relx=0.036, rely=0.261, height=23, width=76
                , bordermode='ignore')
        self.Button3.configure(activebackground="#ececec")
        self.Button3.configure(activeforeground="#000000")
        self.Button3.configure(background="#d9d9d9")
        self.Button3.configure(disabledforeground="#a3a3a3")
        self.Button3.configure(foreground="#000000")
        self.Button3.configure(highlightbackground="#d9d9d9")
        self.Button3.configure(highlightcolor="black")
        self.Button3.configure(pady="0")
        self.Button3.configure(text='''Query''')
        self.Button3.configure(width=76)

        self.Button2 = tk.Button(top)
        self.Button2.place(relx=0.657, rely=0.011, height=23, width=286)
        self.Button2.configure(activebackground="#ececec")
        self.Button2.configure(activeforeground="#000000")
        self.Button2.configure(background="#d9d9d9")
        self.Button2.configure(disabledforeground="#a3a3a3")
        self.Button2.configure(foreground="#000000")
        self.Button2.configure(highlightbackground="#d9d9d9")
        self.Button2.configure(highlightcolor="black")
        self.Button2.configure(pady="0")
        self.Button2.configure(text='''view pending design changes''')
        self.Button2.configure(width=286)

        self.Button2_4 = tk.Button(top)
        self.Button2_4.place(relx=0.657, rely=0.044, height=23, width=286)
        self.Button2_4.configure(activebackground="#ececec")
        self.Button2_4.configure(activeforeground="#000000")
        self.Button2_4.configure(background="#d9d9d9")
        self.Button2_4.configure(disabledforeground="#a3a3a3")
        self.Button2_4.configure(foreground="#000000")
        self.Button2_4.configure(highlightbackground="#d9d9d9")
        self.Button2_4.configure(highlightcolor="black")
        self.Button2_4.configure(pady="0")
        self.Button2_4.configure(text='''view order information''')

        self.Button3_5 = tk.Button(top)
        self.Button3_5.place(relx=0.317, rely=0.286, height=23, width=76)
        self.Button3_5.configure(activebackground="#ececec")
        self.Button3_5.configure(activeforeground="#000000")
        self.Button3_5.configure(background="#d9d9d9")
        self.Button3_5.configure(disabledforeground="#a3a3a3")
        self.Button3_5.configure(foreground="#000000")
        self.Button3_5.configure(highlightbackground="#d9d9d9")
        self.Button3_5.configure(highlightcolor="black")
        self.Button3_5.configure(pady="0")
        self.Button3_5.configure(text='''Update''')

        self.Label1_2 = tk.Label(top)
        self.Label1_2.place(relx=0.011, rely=0.319, height=21, width=264)
        self.Label1_2.configure(activebackground="#f9f9f9")
        self.Label1_2.configure(activeforeground="#000000")
        self.Label1_2.configure(background="#b1d8cf")
        self.Label1_2.configure(disabledforeground="#a3a3a3")
        self.Label1_2.configure(foreground="#000000")
        self.Label1_2.configure(highlightbackground="#d9d9d9")
        self.Label1_2.configure(highlightcolor="black")
        self.Label1_2.configure(text='''Latest date: release-for-manufacturing''')

        self.Entry1_6 = tk.Entry(top)
        self.Entry1_6.place(relx=0.317, rely=0.319,height=20, relwidth=0.31)
        self.Entry1_6.configure(background="white")
        self.Entry1_6.configure(disabledforeground="#a3a3a3")
        self.Entry1_6.configure(font=font10)
        self.Entry1_6.configure(foreground="#000000")
        self.Entry1_6.configure(highlightbackground="#d9d9d9")
        self.Entry1_6.configure(highlightcolor="black")
        self.Entry1_6.configure(insertbackground="black")
        self.Entry1_6.configure(selectbackground="#c4c4c4")
        self.Entry1_6.configure(selectforeground="black")

        self.Button3_6 = tk.Button(top)
        self.Button3_6.place(relx=0.317, rely=0.352, height=23, width=76)
        self.Button3_6.configure(activebackground="#ececec")
        self.Button3_6.configure(activeforeground="#000000")
        self.Button3_6.configure(background="#d9d9d9")
        self.Button3_6.configure(disabledforeground="#a3a3a3")
        self.Button3_6.configure(foreground="#000000")
        self.Button3_6.configure(highlightbackground="#d9d9d9")
        self.Button3_6.configure(highlightcolor="black")
        self.Button3_6.configure(pady="0")
        self.Button3_6.configure(text='''Query''')

        self.Label1_3 = tk.Label(top)
        self.Label1_3.place(relx=0.011, rely=0.396, height=21, width=264)
        self.Label1_3.configure(activebackground="#f9f9f9")
        self.Label1_3.configure(activeforeground="#000000")
        self.Label1_3.configure(background="#b1d8cf")
        self.Label1_3.configure(disabledforeground="#a3a3a3")
        self.Label1_3.configure(foreground="#000000")
        self.Label1_3.configure(highlightbackground="#d9d9d9")
        self.Label1_3.configure(highlightcolor="black")
        self.Label1_3.configure(text='''Input date: release-for-manufacturing''')

        self.Entry1_4 = tk.Entry(top)
        self.Entry1_4.place(relx=0.317, rely=0.396,height=20, relwidth=0.31)
        self.Entry1_4.configure(background="white")
        self.Entry1_4.configure(disabledforeground="#a3a3a3")
        self.Entry1_4.configure(font=font10)
        self.Entry1_4.configure(foreground="#000000")
        self.Entry1_4.configure(highlightbackground="#d9d9d9")
        self.Entry1_4.configure(highlightcolor="black")
        self.Entry1_4.configure(insertbackground="black")
        self.Entry1_4.configure(selectbackground="#c4c4c4")
        self.Entry1_4.configure(selectforeground="black")

        self.Button3_6 = tk.Button(top)
        self.Button3_6.place(relx=0.317, rely=0.429, height=23, width=76)
        self.Button3_6.configure(activebackground="#ececec")
        self.Button3_6.configure(activeforeground="#000000")
        self.Button3_6.configure(background="#d9d9d9")
        self.Button3_6.configure(disabledforeground="#a3a3a3")
        self.Button3_6.configure(foreground="#000000")
        self.Button3_6.configure(highlightbackground="#d9d9d9")
        self.Button3_6.configure(highlightcolor="black")
        self.Button3_6.configure(pady="0")
        self.Button3_6.configure(text='''Update''')

# The following code is added to facilitate the Scrolled widgets you specified.
class AutoScroll(object):
    '''Configure the scrollbars for a widget.'''

    def __init__(self, master):
        #  Rozen. Added the try-except clauses so that this class
        #  could be used for scrolled entry widget for which vertical
        #  scrolling is not supported. 5/7/14.
        try:
            vsb = ttk.Scrollbar(master, orient='vertical', command=self.yview)
        except:
            pass
        hsb = ttk.Scrollbar(master, orient='horizontal', command=self.xview)

        #self.configure(yscrollcommand=_autoscroll(vsb),
        #    xscrollcommand=_autoscroll(hsb))
        try:
            self.configure(yscrollcommand=self._autoscroll(vsb))
        except:
            pass
        self.configure(xscrollcommand=self._autoscroll(hsb))

        self.grid(column=0, row=0, sticky='nsew')
        try:
            vsb.grid(column=1, row=0, sticky='ns')
        except:
            pass
        hsb.grid(column=0, row=1, sticky='ew')

        master.grid_columnconfigure(0, weight=1)
        master.grid_rowconfigure(0, weight=1)

        # Copy geometry methods of master  (taken from ScrolledText.py)
        if py3:
            methods = tk.Pack.__dict__.keys() | tk.Grid.__dict__.keys() \
                  | tk.Place.__dict__.keys()
        else:
            methods = tk.Pack.__dict__.keys() + tk.Grid.__dict__.keys() \
                  + tk.Place.__dict__.keys()

        for meth in methods:
            if meth[0] != '_' and meth not in ('config', 'configure'):
                setattr(self, meth, getattr(master, meth))

    @staticmethod
    def _autoscroll(sbar):
        '''Hide and show scrollbar as needed.'''
        def wrapped(first, last):
            first, last = float(first), float(last)
            if first <= 0 and last >= 1:
                sbar.grid_remove()
            else:
                sbar.grid()
            sbar.set(first, last)
        return wrapped

    def __str__(self):
        return str(self.master)

def _create_container(func):
    '''Creates a ttk Frame with a given master, and use this new frame to
    place the scrollbars and the widget.'''
    def wrapped(cls, master, **kw):
        container = ttk.Frame(master)
        container.bind('<Enter>', lambda e: _bound_to_mousewheel(e, container))
        container.bind('<Leave>', lambda e: _unbound_to_mousewheel(e, container))
        return func(cls, container, **kw)
    return wrapped

class ScrolledListBox(AutoScroll, tk.Listbox):
    '''A standard Tkinter Text widget with scrollbars that will
    automatically show/hide as needed.'''
    @_create_container
    def __init__(self, master, **kw):
        tk.Listbox.__init__(self, master, **kw)
        AutoScroll.__init__(self, master)

import platform
def _bound_to_mousewheel(event, widget):
    child = widget.winfo_children()[0]
    if platform.system() == 'Windows' or platform.system() == 'Darwin':
        child.bind_all('<MouseWheel>', lambda e: _on_mousewheel(e, child))
        child.bind_all('<Shift-MouseWheel>', lambda e: _on_shiftmouse(e, child))
    else:
        child.bind_all('<Button-4>', lambda e: _on_mousewheel(e, child))
        child.bind_all('<Button-5>', lambda e: _on_mousewheel(e, child))
        child.bind_all('<Shift-Button-4>', lambda e: _on_shiftmouse(e, child))
        child.bind_all('<Shift-Button-5>', lambda e: _on_shiftmouse(e, child))

def _unbound_to_mousewheel(event, widget):
    if platform.system() == 'Windows' or platform.system() == 'Darwin':
        widget.unbind_all('<MouseWheel>')
        widget.unbind_all('<Shift-MouseWheel>')
    else:
        widget.unbind_all('<Button-4>')
        widget.unbind_all('<Button-5>')
        widget.unbind_all('<Shift-Button-4>')
        widget.unbind_all('<Shift-Button-5>')

def _on_mousewheel(event, widget):
    if platform.system() == 'Windows':
        widget.yview_scroll(-1*int(event.delta/120),'units')
    elif platform.system() == 'Darwin':
        widget.yview_scroll(-1*int(event.delta),'units')
    else:
        if event.num == 4:
            widget.yview_scroll(-1, 'units')
        elif event.num == 5:
            widget.yview_scroll(1, 'units')

def _on_shiftmouse(event, widget):
    if platform.system() == 'Windows':
        widget.xview_scroll(-1*int(event.delta/120), 'units')
    elif platform.system() == 'Darwin':
        widget.xview_scroll(-1*int(event.delta), 'units')
    else:
        if event.num == 4:
            widget.xview_scroll(-1, 'units')
        elif event.num == 5:
            widget.xview_scroll(1, 'units')

if __name__ == '__main__':
    vp_start_gui()





