#! /usr/bin/env python
#  -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 4.15
# In conjunction with Tcl version 8.6
#    Oct 02, 2018 10:02:43 PM

import sys
import trips
import transactions

try:
    from Tkinter import *
except ImportError:
    from tkinter import *

try:
    import ttk

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

    py3 = True

import admin_support


def get_root(r):
    global root
    root = r


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


w = None


def create_Admin_Access(root, *args, **kwargs):
    '''Starting point when module is imported by another program.'''
    global w, w_win, rt
    rt = root
    w = Toplevel(root)
    top = Admin_Access(w)
    admin_support.init(w, top, *args, **kwargs)
    return (w, top)


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


class Admin_Access:
    def onClickTrips(self):
        trips.create_Trips(root)

    def onClickTransactions(self):
        transactions.create_Transactions(root)

    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 = '#d9d9d9'  # X11 color: 'gray85'
        font9 = "-family Roboto -size 18 -weight normal -slant roman " \
                "-underline 0 -overstrike 0"

        top.geometry("600x450+647+248")
        top.title("Admin Access")
        top.configure(background="#7fafd8")

        self.tripButton = Button(top)
        self.tripButton.place(relx=0.12, rely=0.42, height=162, width=162)
        self.tripButton.configure(activebackground="#d9d9d9")
        self._img1 = PhotoImage(file="images/trip_logo.png")
        self.tripButton.configure(image=self._img1)
        self.tripButton.configure(text='''Button''')
        self.tripButton.configure(command=self.onClickTrips)

        self.tripLabel = Label(top)
        self.tripLabel.place(relx=0.22, rely=0.78, height=41, width=54)
        self.tripLabel.configure(font=font9)
        self.tripLabel.configure(text='''Trip''')

        self.transactionButton = Button(top)
        self.transactionButton.place(relx=0.55, rely=0.42, height=166, width=161)

        self.transactionButton.configure(activebackground="#d9d9d9")
        self.transactionButton.configure(background="#e8e8e8")
        self._img2 = PhotoImage(file="images/transaction_logo.png")
        self.transactionButton.configure(image=self._img2)
        self.transactionButton.configure(text='''Button''')
        self.transactionButton.configure(width=161)
        self.transactionButton.configure(command=self.onClickTransactions)

        self.transactionLabel = Label(top)
        self.transactionLabel.place(relx=0.55, rely=0.78, height=41, width=168)
        self.transactionLabel.configure(font=font9)
        self.transactionLabel.configure(text='''Transactions''')

        self.Label3 = Label(top)
        self.Label3.place(relx=0.1, rely=0.02, height=152, width=442)
        self.Label3.configure(background="#7fafd8")
        self._img3 = PhotoImage(file="images/Admin.png")
        self.Label3.configure(image=self._img3)
        self.Label3.configure(text='''Label''')
        self.Label3.configure(width=442)


if __name__ == '__main__':
    vp_start_gui()
