def main(alljobs, stagelist):
    # print (x)
    print("-")
    print(alljobs[0])
    stage = stagelist[0]
    # stage = 'ced'
    print("-" * 70)
    weeks = current_delivery(alljobs, stage)

    # for week in weeks:
    #    print (week['title'])
    #    for job in week['jobs']:
    #        print (job['jobname'])

    title = GLabel("Title", width=300, height=20, text="Latest CRC Jobs")

    header = GFrame_Row("Header", [title], height=40, parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]])
    footer = GFrame_Row("Footer", [exit_button], height=40, parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]])

    stagelabel = GLabel("Title", width=100, height=20, text=stage)
    stagerow = GFrame_Row("StageRow", [stagelabel], height=40, parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]])

    # Create stage selection button
    cedbutton = GButton("GetCED", width=100, height=30, text="CED")
    initialbutton = GButton("GetInitial", width=100, height=30, text="Initial")
    secondpagesbutton = GButton("SecondPages", width=100, height=30, text="Second Pages")
    finalpagesbutton = GButton("FinalPages", width=100, height=30, text="Final Pages")
    sbutton = GFrame_Row(
        "SButtonRow",
        [cedbutton, initialbutton, secondpagesbutton, finalpagesbutton],
        height=40,
        parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]],
    )

    widgets = [header, sbutton, stagerow]
    # Create table
    for i, week in enumerate(weeks):
        tb = create_stuff(i, week)
        widgets.append(tb)
    widgets.append(footer)
    con3 = HBox("MainBox", widgets)

    root = TK.Tk()

    g = con3
    build_gui(root, g)
    status = ["quit"]
    exit_button.set_command(root.destroy)
    cedbutton.set_command(lambda: clicked(root, status, "ced"))
    initialbutton.set_command(lambda: clicked(root, status, "initial"))
    secondpagesbutton.set_command(lambda: clicked(root, status, "2ndpages"))
    finalpagesbutton.set_command(lambda: clicked(root, status, "finalpages"))
    title.widget.configure(foreground="black", font="arial 14 bold", background="white")
    stagelabel.widget.configure(foreground="black", font="arial 12 bold", background="white")
    root.mainloop()
    # Now which button was pressed?
    return status
Esempio n. 2
0
def main(alljobs, stagelist):
    #print (x)
    print ('-')
    print (alljobs[0])
    stage = stagelist[0]
    #stage = 'ced'
    print ('-'*70)
    weeks = current_delivery(alljobs, stage)

    #for week in weeks:
    #    print (week['title'])
    #    for job in week['jobs']:
    #        print (job['jobname'])

 
    title = GLabel('Title', width=300, height=20, text='Latest CRC Jobs')

    header = GFrame_Row('Header', [title], height = 40, parms=[WIN, HIN, HC, VC,[0,0,0], [0,0]])
    footer = GFrame_Row('Footer',[exit_button], height=40, parms=[WIN, HIN, HC, VC,[0,0,0], [0,0]])

    stagelabel = GLabel('Title', width=100, height=20, text=stage)
    stagerow = GFrame_Row('StageRow',[stagelabel], height=40, parms=[WIN, HIN, HC, VC,[0,0,0], [0,0]])

    # Create stage selection button
    cedbutton = GButton('GetCED', width=100, height=30, text='CED')
    initialbutton = GButton('GetInitial', width=100, height=30, text='Initial')
    secondpagesbutton = GButton('SecondPages', width=100, height=30, text='Second Pages')
    finalpagesbutton = GButton('FinalPages', width=100, height=30, text='Final Pages')
    sbutton = GFrame_Row('SButtonRow',[cedbutton, initialbutton, secondpagesbutton, finalpagesbutton], height=40, parms=[WIN, HIN, HC, VC,[0,0,0], [0,0]])

    widgets = [header, sbutton, stagerow]
   # Create table
    for i, week in enumerate(weeks):
        tb = create_stuff(i, week)
        widgets.append(tb)
    widgets.append(footer) 
    con3 = HBox('MainBox', widgets)

    root = TK.Tk()

    g = con3
    build_gui(root, g)
    status = ['quit']
    exit_button.set_command(root.destroy)
    cedbutton.set_command(lambda: clicked(root, status, 'ced') )
    initialbutton.set_command(lambda: clicked(root, status, 'initial') )
    secondpagesbutton.set_command(lambda: clicked(root, status, '2ndpages') )
    finalpagesbutton.set_command(lambda: clicked(root, status, 'finalpages') )
    title.widget.configure(foreground="black", font='arial 14 bold', background='white')
    stagelabel.widget.configure(foreground="black", font='arial 12 bold', background='white')
    root.mainloop()
    # Now which button was pressed?
    return status
Esempio n. 3
0
 def create_stage_window(self, stage):
     stagelabel = GLabel(stage + "StageTitle", width=100, height=20, text=stage)
     stagerow = GFrame_Row(stage + "StageRow", [stagelabel], height=40, parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]])
     stagerow.configure(background="black")
     # Create table
     widgets = [stagerow]
     weeks = current_delivery(self.job_recs, stage)
     for i, week in enumerate(weeks):
         tb = create_stage_table(i, week)
         widgets.append(tb)
     stage_window = HBox(stage + "MainBox", widgets)
     # Position Topwindow right of buttons
     x, y = self.ced_button.get_absolute_x_y()
     x += self.ced_button.width + 10
     build_gui(None, stage_window, xpos=x)
     # stagerow.widget.configure(background='black')
     return stage_window
Esempio n. 4
0
    def __init__(self):
        # Initialise database
        self.children = {}
        alljobs = get_crc_all_jobs()
        self.job_recs = alljobs
        self.root = TK.Tk()

        title = GLabel('Title', width=300, height=20, text='AMCAT')
        header = GFrame_Row('Header', [title],
                            height=40,
                            parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]])
        tb = crc_newjobstable(self.job_recs)
        newjobs = HBox('Box1', [tb])
        # Add buttons on the left
        duedatetitle = GLabel('DueDateTitle',
                              width=100,
                              height=30,
                              text='Due Dates')
        self.ced_button = GButton('CED', width=100, height=30, text='CED')
        self.ced_button.set_command(lambda: self.create_stage('ced'))
        b2 = GButton('Initial', width=100, height=30, text='Initial')
        b2.set_command(lambda: self.create_stage('initial'))
        b3 = GButton('2ndPages', width=100, height=30, text='2nd Pages')
        b3.set_command(lambda: self.create_stage('2ndpages'))
        b4 = GButton('FinalPages', width=100, height=30, text='Final Pages')
        b4.set_command(lambda: self.create_stage('finalpages'))
        duedatebuttons = GFrame_Column(
            'DueDateButtons', [duedatetitle, self.ced_button, b2, b3, b4],
            width=140,
            parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0, 0]])

        centerbox = VBox('CenterBox', [duedatebuttons, newjobs])

        footer = create_footer(self.root)
        widgets = [header, centerbox, footer]
        self.mainbox = HBox('MainBox', widgets)
        build_gui(self.root, self.mainbox)
        title.widget.configure(foreground="black",
                               font='arial 14 bold',
                               background='white')
        duedatetitle.widget.configure(foreground="black",
                                      font='arial 12 bold',
                                      background='white')
        self.root.mainloop()
Esempio n. 5
0
 def create_stage_window(self, stage):
     stagelabel = GLabel(stage + 'StageTitle',
                         width=100,
                         height=20,
                         text=stage)
     stagerow = GFrame_Row(stage + 'StageRow', [stagelabel],
                           height=40,
                           parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]])
     stagerow.configure(background='black')
     # Create table
     widgets = [stagerow]
     weeks = current_delivery(self.job_recs, stage)
     for i, week in enumerate(weeks):
         tb = create_stage_table(i, week)
         widgets.append(tb)
     stage_window = HBox(stage + 'MainBox', widgets)
     # Position Topwindow right of buttons
     x, y = self.ced_button.get_absolute_x_y()
     x += self.ced_button.width + 10
     build_gui(None, stage_window, xpos=x)
     #stagerow.widget.configure(background='black')
     return stage_window
Esempio n. 6
0
    def __init__(self):
        # Initialise database
        self.children = {}
        alljobs = get_crc_all_jobs()
        self.job_recs = alljobs
        self.root = TK.Tk()

        title = GLabel("Title", width=300, height=20, text="AMCAT")
        header = GFrame_Row("Header", [title], height=40, parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]])
        tb = crc_newjobstable(self.job_recs)
        newjobs = HBox("Box1", [tb])
        # Add buttons on the left
        duedatetitle = GLabel("DueDateTitle", width=100, height=30, text="Due Dates")
        self.ced_button = GButton("CED", width=100, height=30, text="CED")
        self.ced_button.set_command(lambda: self.create_stage("ced"))
        b2 = GButton("Initial", width=100, height=30, text="Initial")
        b2.set_command(lambda: self.create_stage("initial"))
        b3 = GButton("2ndPages", width=100, height=30, text="2nd Pages")
        b3.set_command(lambda: self.create_stage("2ndpages"))
        b4 = GButton("FinalPages", width=100, height=30, text="Final Pages")
        b4.set_command(lambda: self.create_stage("finalpages"))
        duedatebuttons = GFrame_Column(
            "DueDateButtons",
            [duedatetitle, self.ced_button, b2, b3, b4],
            width=140,
            parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0, 0]],
        )

        centerbox = VBox("CenterBox", [duedatebuttons, newjobs])

        footer = create_footer(self.root)
        widgets = [header, centerbox, footer]
        self.mainbox = HBox("MainBox", widgets)
        build_gui(self.root, self.mainbox)
        title.widget.configure(foreground="black", font="arial 14 bold", background="white")
        duedatetitle.widget.configure(foreground="black", font="arial 12 bold", background="white")
        self.root.mainloop()
Esempio n. 7
0
from sample_widgets import label1, label2, label3, label4, button1, button2, button3, exit_button
from constants import WIN, HIN, VT, HL, VC, VB, HAS, HC, WEX
from containernode import GFrame_Row, GFrame_Column, HBox, VBox
from tablenode import GTable
from sample_table import SampleTable
from build import build_gui
import tkinter as TK

tb = SampleTable()
con1 = VBox('Box1', [tb])
con2 = GFrame_Row('Row4', [exit_button],
                  height=40,
                  parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]])
con3 = HBox('Box2', [con1, con2])

root = TK.Tk()

g = con3
build_gui(root, g)
exit_button.set_command(root.destroy)

root.mainloop()
Esempio n. 8
0

from constants import WIN, HIN, VT, HL, VC, VB, HAS, HC, WEX
from containernode import GFrame_Row, GFrame_Column, HBox, VBox
from build import build_gui
import tkinter as TK

con1 = GFrame_Row('Row1', [], width = 100, height = 40, parms=[WIN, HIN, HL, VC,[], []])
con2 = GFrame_Row('Row2', [], width = 150,  height=30, parms=[WIN, HAS, HL, VC,[], []])
#con3 = GFrame_Column('Column1', [con1, con2], parms=[WIN, HIN, HL, VC,[0,0,0], [0,0]])
con3 = HBox('Box1', [con1, con2])
#con3 = VBox('Box1', [con1, con2])
#con3 = HBox('Box1', [con1, con2], width=200, height = 100)
#con3 = VBox('Box1', [con1, con2], width=200, height = 100)


root = TK.Tk()

g = con3
build_gui(root, g)
con1.widget.config(bg="red")
con2.widget.config(bg="blue")
con3.widget.config(bg="green")

root.mainloop()
Esempio n. 9
0
def resize_test():
    # See what happens when the app width is changed and build called again
    con8.width += 40
    build_gui(root, con8)
Esempio n. 10
0
import tkinter as TK

from widgetnode import GLabel, GButton
from containernode import GFrame_Row, GFrame_Column, HBox, VBox
from constants import WIN, HIN, VT, HL, VC, VB, HAS, HC, WEX
from build import build_gui


root = TK.Tk()

t = GLabel('Title', width=300, height=20, text = 'AMCAT')

header = GFrame_Row('Header', [t], parms=[WIN, HIN, HC, VC,[10,10], [15,15]])

b1 = GButton('Save', width=100, height=30, text='Save')
b1.set_command(root.destroy)
b2 = GButton('Cancel', width=100, height=30, text='Cancel')

footer = GFrame_Row('RowFooter',[b1, b2], height=40, parms=[WIN, HIN, HC, VC,[10,5,10], [0,0]])

main_container = HBox('main', [header,footer])

build_gui(root, main_container)

root.mainloop()
Esempio n. 11
0
def resize_test():
    # See what happens when the app width is changed and build called again
    con8.width += 40
    build_gui(root, con8)