Commit 5c5325f7 authored by Fjen Undso's avatar Fjen Undso
Browse files

c.py: combine number and bar with fs

parent 2bd0dd5e
......@@ -242,8 +242,16 @@ def main(stdscr):
logger.setLevel(logging.INFO)
numbers_text = ['R', 'G', 'B', 'W']
for i in range(len(numbers_text)):
ProgressBar(stdscr, row=0, col=i*8, width=5, height=12, text=numbers_text[i]).draw()
progress_bars = [
ProgressBar(stdscr,
row=0,
col=i*8,
width=5,
height=12,
max_value=255,
prev_key='KEY_DOWN',
next_key='KEY_UP',
text=numbers_text[i]) for i in range(len(numbers_text))]
numbers = [
NumberRange(
stdscr,
......@@ -251,7 +259,9 @@ def main(stdscr):
row=12,
value=i,
prev_key='KEY_DOWN',
next_key='KEY_UP') for i in range(4)]
next_key='KEY_UP') for i in range(len(numbers_text))]
fs_pbn = [FocusSwitcher(i) for i in zip(numbers, progress_bars)]
fs_n = FocusSwitcher(fs_pbn, prev_key='KEY_LEFT', next_key='KEY_RIGHT')
checkboxes = [
CheckBox(
......@@ -261,8 +271,8 @@ def main(stdscr):
toggle_key=' ',
text='ESP' +
str(i)) for i in range(1,9)]
fs_n = FocusSwitcher(numbers, prev_key='KEY_LEFT', next_key='KEY_RIGHT')
fs_cb = FocusSwitcher(checkboxes, prev_key='KEY_UP', next_key='KEY_DOWN')
fs_main = FocusSwitcher([fs_n, fs_cb], prev_key='\t')
fs_main.toggle_focus()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment