Exemple #1
0
    def Create_Add_Trans_Layout(self):
        layout = [
            [T("New Transaction", font=("Helvetica", 18))],
            [T("NOTE:", font=("Helvetica", 20)), T(
                "All fields are required to be filled.")],
            [T("Particulars:"), Multiline("Enter details of transaction",
                                          autoscroll=True, key="Particulars")],
            [T("Transaction type:"), Combo(["Select", "Credit", "Debit"],
                                           "Select", readonly=True, key="new_type")],
            [T("Amount:"), Input(enable_events=True, key="amount")],
            [T("Date Of Transaction:"), Input("YYYY-MM-DD or use the button on the right",
                                              key="date"), CalendarButton("Select Date", target="date", format="%Y-%m-%d")],
            [Submit()]
        ]

        return layout
Exemple #2
0
def showLongInfo(prompt: str, text: str) -> None:
    win: Window = Window(alpha_channel=0.8, finalize=True, debugger_enabled=False, resizable=True,
                         text_justification="center", title=prompt.strip(), no_titlebar=True, keep_on_top=True,
                         disable_close=True, disable_minimize=True, grab_anywhere=True, auto_size_text=True, layout=[
            [Text(text=prompt.strip(), expand_x=True, expand_y=True, auto_size_text=True)],
            [Multiline(
                default_text=text, disabled=True, expand_x=True, expand_y=True, autoscroll=True,
                auto_refresh=True, auto_size_text=True, focus=True, size=(64, 16)
            )],
            [Button(button_text="Copy", expand_x=True, expand_y=True, size=(8, 1)),
             Button(button_text="Close", expand_x=True, expand_y=True, size=(8, 1))],
            [Text(text="Made By: TonicBoomerKewl", expand_x=True, expand_y=True, auto_size_text=True)]
        ])
    focus(win)
    res = win.read()
    win.close()
    if res[0] == "Copy":
        copy(prompt=prompt.strip(), text=text)
Exemple #3
0
 def __init__(self, title: str = 'Test', size=(120, 30), **kwargs):
     super().__init__(title=title)
     self.kwargs = kwargs
     self.size = size
     self.output = Multiline('', key='output', size=self.size, disabled=True, autoscroll=True)
    [Frame('Categories:', [[Radio('Websites', 'radio1', default=True, key='-WEBSITES-', size=(10, 1)),
                            Radio('Software', 'radio1', key='-SOFTWARE-',  size=(10, 1))]],)],
    # Information frame
    [Frame('Information:', [[Column([[Text('Account:')],
                                     [Input(key='-ACCOUNT-IN-', size=(19, 1))],
                                     [Text('User Id:')],
                                     [Input(key='-USERID-IN-', size=(19, 1)),
                                      Button('Copy', key='-USERID-')],
                                     [Text('Password:'******'-PW-IN-', size=(19, 1)),
                                      Button('Copy', key='-PASS-')],
                                     [Text('Location:')],
                                     [Input(key='-LOC-IN-', size=(19, 1)),
                                      Button('Copy', key='-LOC')],
                                     [Text('Notes:')],
                                     [Multiline(key='-NOTES-', size=(25, 5))],
                                     ], size=(235, 350), pad=(0, 0))]])], ], pad=(0, 0))

col3 = Column([[Frame('Actions:', [[Column([[Button('Save'), Button(
    'Clear'), Button('Delete'), ]], size=(450, 45), pad=(0, 0))]])]], pad=(0, 0))

layout = [[col1, col2], [col3]]

window = Window('Passwords', layout)

while True:
    event, values = window.read()
    print(event, values)
    if event is None:
        break
Exemple #5
0
    def get_tag_rows(self, editable: bool = True) -> tuple[Layout, EleBinds]:
        rows = []
        ele_binds = {}
        nums = defaultdict(count)
        common_binds = {
            '<Button-1>': ':::row_clicked',
            '<Shift-Button-1>': ':::tag_clicked'
        }

        for trunc_id, tag_id, tag_name, disp_name, val in self.track.iter_tag_id_name_values(
        ):
            if disp_name == 'Album Cover':
                continue

            # self.log.debug(f'Making tag row for {tag_id=} {tag_name=} {disp_name=} {val=}')
            if n := next(nums[tag_id]):
                tag_id = f'{tag_id}--{n}'

            key_ele = Text(disp_name,
                           key=self.key_for('tag', tag_id, WRITE_ONLY_KEY),
                           tooltip=tag_id)
            sel_box = Checkbox('',
                               key=self.key_for('del', tag_id),
                               visible=editable,
                               enable_events=True)
            tooltip = f'Toggle all {tag_id} tags with Shift+Click'
            val_key = self.key_for('val', tag_id)

            if disp_name == 'Lyrics':
                val_ele = Multiline(val,
                                    size=(45, 4),
                                    key=val_key,
                                    disabled=True,
                                    tooltip='Pop out with ctrl + click')
                rows.append([key_ele, sel_box, val_ele])
                ele_binds[val_key] = {
                    '<Control-Button-1>': ':::pop_out',
                    **common_binds
                }
            elif disp_name == 'Rating':
                try:
                    rating = stars_from_256(int(val), 10)
                except (ValueError, TypeError):
                    val_ele = value_ele(val,
                                        val_key,
                                        True,
                                        no_add=True,
                                        list_width=45,
                                        tooltip=tooltip)
                    rows.append([key_ele, sel_box, val_ele])
                else:
                    row = [
                        key_ele,
                        sel_box,
                        Rating(rating,
                               key=val_key,
                               show_value=True,
                               disabled=True,
                               tooltip=tooltip,
                               pad=(0, 0)),
                    ]
                    rows.append(row)
                ele_binds[val_key] = common_binds.copy()
            else:
                val_ele = value_ele(val,
                                    val_key,
                                    True,
                                    no_add=True,
                                    list_width=45,
                                    tooltip=tooltip)
                rows.append([key_ele, sel_box, val_ele])
                ele_binds[val_key] = common_binds.copy()
Exemple #6
0
                            [
                                Input(key="-USERID-IN-", size=(19, 1)),
                                Button("Copy", key="-USERID-"),
                            ],
                            [Text("Password:"******"-PW-IN-", size=(19, 1)),
                                Button("Copy", key="-PASS-"),
                            ],
                            [Text("Location:")],
                            [
                                Input(key="-LOC-IN-", size=(19, 1)),
                                Button("Copy", key="-LOC"),
                            ],
                            [Text("Notes:")],
                            [Multiline(key="-NOTES-", size=(25, 5))],
                        ],
                        size=(235, 350),
                        pad=(0, 0),
                    ),
                ]],
            )
        ],
    ],
    pad=(0, 0),
)

col3 = Column(
    [[
        Frame(
            "Actions:",
Exemple #7
0
                     Text('Authority/Subversion', size=(20, 1)),
                     Input('0', key='authority_result', size=(35, 1)),
                     Input('0', key='authority_avg', size=(35, 1))
                 ],
                 [
                     Text('Purity/Degradation', size=(20, 1)),
                     Input('0', key='purity_result', size=(35, 1)),
                     Input('0', key='purity_avg', size=(35, 1))
                 ],
                 [
                     Text('Non-moral', size=(20, 1)),
                     Input('0', key='non-moral_result', size=(35, 1))
                 ]]
tab1_layout = [
    [Text('Enter text to annotate:')],
    [Multiline('', size=(88, 20), key='inputtext')], [Button('Analyze text')],
    [
        Text(
            '''The output in the first column is the estimated probability of the text being relevant to either a vice or virtue of the corresponding moral trait.
Since the system is trained on tweets, try not to analyze a long text!
The second column is the average rating for the words, based on human ratings of the Moral Foundation Dictionary words.
The range goes from 1 to 9:
1: words closely associated to harm, cheating, betrayal, subversion, degradation
9: words closely associated to care, fairness, loyalty, authority, sanctity''')
    ], [Column(output_values)]
]

#the second tab is for analyzing one or more files
tab2_layout = [
    [
        Text(
Exemple #8
0
theme('DarkGrey9')
lua_file = [Text("LUA file\t\t"), In(size=(25, 1), key="LUA"), FileBrowse()]
autocad_file = [
    Text("Autocad file\t"),
    In(size=(25, 1), key="AUTOCAD"),
    FileBrowse()
]
box_name = [
    Text("Box name\t"),
    In(size=(25, 1), key="BOX", default_text='IX1-2')
]
output_path = [
    Text("Output folder\t"),
    In(size=(25, 1), key="PATH"),
    FolderBrowse()
]
output_name = [Text("Output file name\t"), In(size=(25, 1), key="NAME")]
ok_button = [Button("Compare", enable_events=True, key="COMPARE")]
line_split = VSeperator()
left_column = [
    lua_file, autocad_file, box_name, output_path, output_name, ok_button
]

box_title = [Text("Logs:")]
log_box = [Multiline(size=(35, 10), key="LOGBOX")]
right_column = [box_title, log_box]

layout = [[Column(left_column), line_split, Column(right_column)]]
window = Window("LUA autocad comparator", layout)