Esempio n. 1
0
def show_window(user, class_type, code=False): # code for where actions for just one property are requested, otherwise False
    # Set up window
    text = 'Show ' + class_type.title() + 's'
    if class_type == 'property': text = 'Show Properties'
    window = Widget.window(user.root, user, text, 'medium')

    # Set up frames
    top_frame = Widget.side_frame(window, user, 'top')
    scroll_frame = Widget.scroll_frame(window, user)
    bottom_frame = Widget.side_frame(window, user, 'bottom')

    # Top Frame
    text = class_type.title() + 's for ' + user.name + ':'
    if class_type == 'property': text = 'Properties for ' + user.name + ':'
    Widget.title(top_frame, user, text)

    # Scroll Frame
    Widget.scroll_button_list(window, scroll_frame, user, class_type, code)

    # Bottom Frame
    Widget.add_window_button(bottom_frame, user, class_type)
    Widget.close_button(window, 'show', bottom_frame, user, class_type)

    # Add window and scroll frame to user so can be refreshed from outside of method
    show_windows = getattr(user, class_type + '_show_windows')
    show_windows.insert(0, [window, scroll_frame, code])
    # Close window sent through method so can be removed from user
    window.protocol("WM_DELETE_WINDOW", lambda: Widget.close_window(window, 'show', user, class_type))
Esempio n. 2
0
    def see_window(user, number):
        # Set up window
        window =  Widget.window(user.root, user, 'See Landlord', 'medium')

        # Left side entries/update
        row = LandlordWin.see_window_left(window, user, number)

        # Right Side
        LandlordWin.see_window_right(window, user, number)

        # Add window and number to user so see_window_right can be called from outside of method
        user.landlord_see_windows.insert(0, [window, number])
        # Close window sent through method so can be removed from user
        window.protocol("WM_DELETE_WINDOW", lambda: Widget.close_window(window, 'see', user, 'landlord'))
Esempio n. 3
0
    def see_window(user, number):
        # Set up window
        window =  Widget.window(user.root, user, 'See Action', 'medium')

        # Left side entries/update
        row = ActionWin.see_window_left(window, user, number)

        # Left Side Buttons
        code = user.action_list[number].property
        Widget.see_window_button(window, user, 'property', code, row, 2)
        Widget.close_button(window, 'see', window, user, 'action', row, 2)

        # Right Side
        ActionWin.see_window_right(window, user, number)

        # Add window and number to user so see_window_right can be called from outside of method
        user.action_see_windows.insert(0, [window, number])
        # Close window sent through method so can be removed from user
        window.protocol("WM_DELETE_WINDOW", lambda: Widget.close_window(window, 'see', user, 'action'))
Esempio n. 4
0
    def see_window(user, number):
        # Set up window
        window = Widget.window(user.root, user, 'See Contact', 'medium')

        # Left side entries/update
        row = ContactWin.see_window_left(window, user, number)

        # Left Side Buttons
        Widget.close_button(window, 'see', window, user, 'contact', row, 2)

        # Right Side
        ContactWin.see_window_right(window, user, number)

        # Add window and number to user so see_window_right can be called from outside of method
        user.contact_see_windows.insert(0, [window, number])
        # Close window sent through method so can be removed from user
        window.protocol(
            "WM_DELETE_WINDOW",
            lambda: Widget.close_window(window, 'see', user, 'contact'))