#! /usr/bin/env python
#  -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 7.5e
#  in conjunction with Tcl version 8.6
#    May 28, 2022 07:18:03 PM PDT  platform: Linux

import sys
import tkinter as tk
import tkinter.ttk as ttk
from tkinter.constants import *
import os.path

_script = sys.argv[0]
_location = os.path.dirname(_script)

import dual_support

_bgcolor = '#d9d9d9'  # X11 color: 'gray85'
_fgcolor = '#000000'  # X11 color: 'black'
_compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2'
_ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}'
_ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2'
_tabfg1 = 'black' 
_tabfg2 = 'black' 
_tabbg1 = 'grey75' 
_tabbg2 = 'grey89' 
_bgmode = 'light' 
font15 = "-family {DejaVu Sans} -size 12"

_style_code_ran = 0
def _style_code():
    global _style_code_ran
    if _style_code_ran:
       return
    style = ttk.Style()
    if sys.platform == "win32":
       style.theme_use('winnative')
    style.configure('.',background=_bgcolor)
    style.configure('.',foreground=_fgcolor)
    style.configure('.',font='-family {DejaVu Sans} -size 12')
    style.map('.',background =
       [('selected', _compcolor), ('active',_ana2color)])
    if _bgmode == 'black':
       style.map('.',foreground =
         [('selected', 'white'), ('active','white')])
    else:
       style.map('.',foreground =
         [('selected', 'black'), ('active','black')])
    _style_code_ran = 1

def popup1(event, *args, **kwargs):
        Popupmenu1 = tk.Menu(dual_support.root, tearoff=0)
        Popupmenu1.configure(activebackground="#ffffcd")
        Popupmenu1.configure(disabledforeground="#b8a786")
        Popupmenu1.configure(font="-family {DejaVu Sans} -size 10")
        sub_menu = tk.Menu(Popupmenu1,
                activebackground="#ffffcd",
                activeforeground="black",
                disabledforeground="#b8a786",
                foreground="black",
                tearoff=0)
        Popupmenu1.add_cascade(menu=sub_menu,
                activebackground="#f4bcb2",
                activeforeground="#111111",
                background="#d9d9d9",
                font="TkDefaultFont",
                foreground="#000000",
                label="Zoom")
        sub_menu.add_command(
                activebackground="#f4bcb2",
                activeforeground="#000000",
                background="#d9d9d9",
                command=lambda:dual_support.zoom('in'),
                font="TkDefaultFont",
                foreground="#000000",
                label="Zoom In")
        sub_menu.add_command(
                activebackground="#f4bcb2",
                activeforeground="#000000",
                background="#d9d9d9",
                command=lambda:dual_support.zoom('out'),
                font="TkDefaultFont",
                foreground="#000000",
                label="Zoom Out")
        sub_menu.add_command(
                activebackground="#f4bcb2",
                activeforeground="#000000",
                background="#d9d9d9",
                command=lambda:dual_support.zoom('default'),
                font="TkDefaultFont",
                foreground="#000000",
                label="Default Size")
        Popupmenu1.add_command(
                activebackground="#f4bcb2",
                activeforeground="#000000",
                background="#d9d9d9",
                command=dual_support.refresh,
                font="TkDefaultFont",
                foreground="#000000",
                label="Refresh")
        Popupmenu1.add_command(
                activebackground="#f4bcb2",
                activeforeground="#000000",
                background="#d9d9d9",
                command=dual_support.quit,
                font="TkDefaultFont",
                foreground="#000000",
                label="Quit")
        Popupmenu1.post(event.x_root, event.y_root)

class Toplevel1:
    def __init__(self, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''

        top.geometry("1097x789+398+109")
        top.minsize(1, 1)
        top.maxsize(1905, 1050)
        top.resizable(0,  0)
        top.title("Two Custom Widgets")
        top.configure(highlightbackground="#f5deb3")
        top.configure(highlightcolor="black")

        self.top = top

        self.menubar = tk.Menu(top, font="-family {DejaVu Sans} -size 12"
                ,bg=_bgcolor, fg=_fgcolor)
        top.configure(menu = self.menubar)

        self.sub_menu = tk.Menu(top,
                activebackground="#ffffcd",
                activeforeground="black",
                disabledforeground="#b8a786",
                foreground="black",
                tearoff=0)
        self.menubar.add_cascade(menu=self.sub_menu,
                activebackground="#f4bcb2",
                activeforeground="#111111",
                background="#d9d9d9",
                font="TkDefaultFont",
                foreground="#000000",
                label="Zoom")
        self.sub_menu.add_command(
                activebackground="#f4bcb2",
                activeforeground="#000000",
                background="#d9d9d9",
                command=lambda:dual_support.zoom('in'),
                font="TkDefaultFont",
                foreground="#000000",
                label="Zoom In")
        self.sub_menu.add_command(
                activebackground="#f4bcb2",
                activeforeground="#000000",
                background="#d9d9d9",
                command=lambda:dual_support.zoom('out'),
                font="TkDefaultFont",
                foreground="#000000",
                label="Zoom Out")
        self.sub_menu.add_command(
                activebackground="#f4bcb2",
                activeforeground="#000000",
                background="#d9d9d9",
                command=lambda:dual_support.zoom('default'),
                font="TkDefaultFont",
                foreground="#000000",
                label="Default Size")
        self.menubar.add_command(
                activebackground="#f4bcb2",
                activeforeground="#000000",
                background="#d9d9d9",
                command=dual_support.refresh,
                font="TkDefaultFont",
                foreground="#000000",
                label="Refresh")
        self.menubar.add_command(
                activebackground="#f4bcb2",
                activeforeground="#000000",
                background="#d9d9d9",
                command=dual_support.quit,
                font="TkDefaultFont",
                foreground="#000000",
                label="Quit")

        self.Frame1 = tk.Frame(self.top)
        self.Frame1.place(x=80, y=80, height=375, width=265)
        self.Frame1.configure(relief='groove')
        self.Frame1.configure(borderwidth="2")
        self.Frame1.configure(relief="groove")
        self.Frame1.configure(highlightbackground="#f5deb3")

        self.Custom1_4 = dual_support.Custom_g(self.Frame1)
        self.Custom1_4.place(x=0, y=0, height=375, width=265)

        self.btnGetChecks = tk.Button(self.top)
        self.btnGetChecks.place(x=130, y=490, height=30, width=160)
        self.btnGetChecks.configure(activebackground="#d9d9d9")
        self.btnGetChecks.configure(command=dual_support.on_btnGetChecks)
        self.btnGetChecks.configure(disabledforeground="#b8a786")
        self.btnGetChecks.configure(font="-family {DejaVu Sans Mono} -size 14")
        self.btnGetChecks.configure(highlightbackground="#f5deb3")
        self.btnGetChecks.configure(text='''Get Checks''')

        self.btnClearChecks = tk.Button(self.top)
        self.btnClearChecks.place(x=130, y=560, height=30, width=160)
        self.btnClearChecks.configure(activebackground="#d9d9d9")
        self.btnClearChecks.configure(command=dual_support.on_btnClearChecks)
        self.btnClearChecks.configure(disabledforeground="#b8a786")
        self.btnClearChecks.configure(font="-family {DejaVu Sans Mono} -size 14")
        self.btnClearChecks.configure(highlightbackground="#f5deb3")
        self.btnClearChecks.configure(text='''Clear Checks''')

        self.btnExit = tk.Button(self.top)
        self.btnExit.place(x=160, y=650, height=30, width=110)
        self.btnExit.configure(activebackground="#d9d9d9")
        self.btnExit.configure(command=dual_support.on_btnExit)
        self.btnExit.configure(disabledforeground="#b8a786")
        self.btnExit.configure(font="-family {DejaVu Sans Mono} -size 14")
        self.btnExit.configure(highlightbackground="#f5deb3")
        self.btnExit.configure(state='active')
        self.btnExit.configure(text='''Exit''')

        self.Message1 = tk.Message(self.top)
        self.Message1.place(x=10, y=10, height=63, width=421)
        self.Message1.configure(font="-family {DejaVu Sans Mono} -size 11")
        self.Message1.configure(highlightbackground="#f5deb3")
        self.Message1.configure(relief="sunken")
        self.Message1.configure(text='''Message''')
        self.Message1.configure(width=421)

        _style_code()
        self.TSizegrip1 = ttk.Sizegrip(self.top)
        self.TSizegrip1.place(anchor='se', relx=1.0, rely=1.0)
        self.TSizegrip1.bind('<ButtonRelease-1>',lambda e:dual_support.refresh())

        self.Frame2 = tk.Frame(self.top)
        self.Frame2.place(x=470, y=83, height=504, width=555)
        self.Frame2.configure(relief='groove')
        self.Frame2.configure(borderwidth="2")
        self.Frame2.configure(relief="groove")
        self.Frame2.configure(highlightbackground="#f5deb3")

        self.Custom1 = dual_support.Custom_d(self.Frame2)
        self.Custom1.place(x=0, y=0, height=504, width=555)

def start_up():
    dual_support.main()

if __name__ == '__main__':
    dual_support.main()




