#! /usr/bin/env python
#  -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 4.26
#  in conjunction with Tcl version 8.6
#    Mar 09, 2020 02:47:41 PM +0200  platform: Windows NT

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 handler_gui_support
return_values = False
entry_values = []


def vp_start_gui(first_time):
    '''Starting point when module is the main routine.'''
    global val, w, root
    global return_values
    global entry_values
    entry_values = []
    root = tk.Tk()
    top = Toplevel1(root)
    handler_gui_support.init(root, top)
    while not return_values:
        root.update()
    if first_time:
        root.destroy()
    else:
        root.destroy()
    print('OUT')
    return_values = False
    return entry_values[0], entry_values[1]


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)
    handler_gui_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):
        global Entry1
        global Entry2
        global Entry3
        '''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'

        top.geometry("550x309+382+207")
        top.minsize(120, 1)
        top.maxsize(1364, 749)
        top.resizable(1, 1)
        top.title("New Toplevel")
        top.configure(background="#f1e1d3")
        top.configure(highlightbackground="#d9d9d9")
        top.configure(highlightcolor="black")

        self.Label1 = tk.Label(top)
        self.Label1.place(relx=0.327, rely=0.032, height=31, width=204)
        self.Label1.configure(activebackground="#7c6249")
        self.Label1.configure(activeforeground="white")
        self.Label1.configure(activeforeground="#7c6249")
        self.Label1.configure(background="#f1e1d3")
        self.Label1.configure(disabledforeground="#a3a3a3")
        self.Label1.configure(font="-family {Segoe UI Historic} -size 17")
        self.Label1.configure(foreground="#000000")
        self.Label1.configure(highlightbackground="#d9d9d9")
        self.Label1.configure(highlightcolor="black")
        self.Label1.configure(text='''Calculation Settings''')

        self.Entry1 = tk.Entry(top)
        self.Entry1.place(relx=0.109, rely=0.259,height=40, relwidth=0.244)
        self.Entry1.configure(background="#e7ccb4")
        self.Entry1.configure(disabledforeground="#a3a3a3")
        self.Entry1.configure(font="TkFixedFont")
        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.Entry1_1 = tk.Entry(top)
        self.Entry1_1.place(relx=0.673, rely=0.259,height=40, relwidth=0.244)
        self.Entry1_1.configure(background="#e7ccb4")
        self.Entry1_1.configure(disabledforeground="#a3a3a3")
        self.Entry1_1.configure(font="TkFixedFont")
        self.Entry1_1.configure(foreground="#000000")
        self.Entry1_1.configure(highlightbackground="#d9d9d9")
        self.Entry1_1.configure(highlightcolor="black")
        self.Entry1_1.configure(insertbackground="black")
        self.Entry1_1.configure(selectbackground="#c4c4c4")
        self.Entry1_1.configure(selectforeground="black")

        self.Entry1_2 = tk.Entry(top)
        self.Entry1_2.place(relx=0.236, rely=0.518,height=40, relwidth=0.553)
        self.Entry1_2.configure(background="#e7ccb4")
        self.Entry1_2.configure(disabledforeground="#a3a3a3")
        self.Entry1_2.configure(font="TkFixedFont")
        self.Entry1_2.configure(foreground="#000000")
        self.Entry1_2.configure(highlightbackground="#d9d9d9")
        self.Entry1_2.configure(highlightcolor="black")
        self.Entry1_2.configure(insertbackground="black")
        self.Entry1_2.configure(selectbackground="#c4c4c4")
        self.Entry1_2.configure(selectforeground="black")

        self.Label2 = tk.Label(top)
        self.Label2.place(relx=0.127, rely=0.162, height=21, width=114)
        self.Label2.configure(activebackground="#f9f9f9")
        self.Label2.configure(activeforeground="black")
        self.Label2.configure(background="#f1e1d3")
        self.Label2.configure(disabledforeground="#a3a3a3")
        self.Label2.configure(font="-family {Segoe UI} -size 11")
        self.Label2.configure(foreground="#000000")
        self.Label2.configure(highlightbackground="#d9d9d9")
        self.Label2.configure(highlightcolor="black")
        self.Label2.configure(text='''Hash Algorithem''')

        self.Label2_3 = tk.Label(top)
        self.Label2_3.place(relx=0.691, rely=0.162, height=21, width=114)
        self.Label2_3.configure(activebackground="#f1e1d3")
        self.Label2_3.configure(activeforeground="black")
        self.Label2_3.configure(background="#f1e1d3")
        self.Label2_3.configure(disabledforeground="#a3a3a3")
        self.Label2_3.configure(font="-family {Segoe UI} -size 11")
        self.Label2_3.configure(foreground="#000000")
        self.Label2_3.configure(highlightbackground="#d9d9d9")
        self.Label2_3.configure(highlightcolor="black")
        self.Label2_3.configure(text='''Password Length''')

        self.Label2_4 = tk.Label(top)
        self.Label2_4.place(relx=0.4, rely=0.421, height=21, width=114)
        self.Label2_4.configure(activebackground="#f9f9f9")
        self.Label2_4.configure(activeforeground="black")
        self.Label2_4.configure(background="#f1e1d3")
        self.Label2_4.configure(disabledforeground="#a3a3a3")
        self.Label2_4.configure(font="-family {Segoe UI} -size 11")
        self.Label2_4.configure(foreground="#000000")
        self.Label2_4.configure(highlightbackground="#d9d9d9")
        self.Label2_4.configure(highlightcolor="black")
        self.Label2_4.configure(text='''Hashed Password''')

        self.Button1 = tk.Button(top)
        self.Button1.place(relx=0.436, rely=0.777, height=34, width=77)
        self.Button1.configure(activebackground="#ececec")
        self.Button1.configure(activeforeground="#000000")
        self.Button1.configure(background="#e0bc9c")
        self.Button1.configure(disabledforeground="#a3a3a3")
        self.Button1.configure(foreground="#000000")
        self.Button1.configure(highlightbackground="#d9d9d9")
        self.Button1.configure(highlightcolor="black")
        self.Button1.configure(pady="0")
        self.Button1.configure(relief="flat")
        self.Button1.configure(text='''Proceed''')
        self.Button1.configure(command=lambda: get_input(self))


def get_input(self):
    global return_values
    hash_type = self.Entry1.get()
    pass_len = self.Entry1_1.get()
    hashed_pass = self.Entry1_2.get()

    # handler_gui_support.destroy_window()
    entry_values.append(hash_type)
    entry_values.append(hashed_pass + "#" + pass_len)
    return_values = True


if __name__ == '__main__':
    vp_start_gui()
