# Path: multi_input_box.py
# class MultiInputBox(Popup):
#     ok_text = StringProperty('OK')
#     cancel_text = StringProperty('Cancel')
# 
#     def __init__(self, **kwargs):
#         self.window = Window
#         super(MultiInputBox, self).__init__(**kwargs)
#         self.content = self.ids["content"]
#         self.contentButtons = self.ids["contentButtons"]
#         self.wl = []
# 
#     def _dismiss(self):
#         self.dismiss()
# 
#     def open(self):
#         super(MultiInputBox, self).open()
# 
#     def _ok(self):
#         if self.optionCallBack is not None:
#             opts = {}
#             for x in self.wl:
#                 opts[x[0]] = x[1].text
#             self.optionCallBack(opts)
#         self.dismiss()
# 
#     def on_open(self):
#         if self.wl:
#             self.wl[0][1].focus = True
# 
#     def setOptions(self, options, callBack):
#         self.optionCallBack = callBack
#         self.contentButtons.clear_widgets()
#         self.wl = []
#         for name in options:
#             self.contentButtons.add_widget(Label(text=name, size_hint_y=None, height='30dp', halign='right'))
#             tw = TextInput(multiline=False, write_tab=False, use_bubble=False, use_handles=False)
#             self.contentButtons.add_widget(tw)
#             self.wl.append((name, tw))


from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.clock import mainthread
from multi_input_box import MultiInputBox


Builder.load_string('''
<CERow@BoxLayout>:
    canvas.before:
        Color:
            rgba: 0.5, 0.5, 0.5, 1
        Rectangle:
            size: self.size
            pos: self.pos
    k: ''
    v: ''
    Label:
        text: root.k
        text_size: self.size
        size_hint_y: None
        height: sp(32)
        halign: 'left'
    TextInput:
        text: root.v
        size_hint_y: None
        height: sp(32)
        multiline: False

# Path: multi_input_box.py
# class MultiInputBox(Popup):
#     ok_text = StringProperty('OK')
#     cancel_text = StringProperty('Cancel')
# 
#     def __init__(self, **kwargs):
#         self.window = Window
#         super(MultiInputBox, self).__init__(**kwargs)
#         self.content = self.ids["content"]
#         self.contentButtons = self.ids["contentButtons"]
#         self.wl = []
# 
#     def _dismiss(self):
#         self.dismiss()
# 
#     def open(self):
#         super(MultiInputBox, self).open()
# 
#     def _ok(self):
#         if self.optionCallBack is not None:
#             opts = {}
#             for x in self.wl:
#                 opts[x[0]] = x[1].text
#             self.optionCallBack(opts)
#         self.dismiss()
# 
#     def on_open(self):
#         if self.wl:
#             self.wl[0][1].focus = True
# 
#     def setOptions(self, options, callBack):
#         self.optionCallBack = callBack
#         self.contentButtons.clear_widgets()
#         self.wl = []
#         for name in options:
#             self.contentButtons.add_widget(Label(text=name, size_hint_y=None, height='30dp', halign='right'))
#             tw = TextInput(multiline=False, write_tab=False, use_bubble=False, use_handles=False)
#             self.contentButtons.add_widget(tw)
#             self.wl.append((name, tw))


# Path: config_editor.py
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.clock import mainthread
from multi_input_box import MultiInputBox



Builder.load_string('''
<CERow@BoxLayout>:
    canvas.before:
        Color:
            rgba: 0.5, 0.5, 0.5, 1
        Rectangle:
            size: self.size
            pos: self.pos
    k: ''
    v: ''
    Label:
        text: root.k
        text_size: self.size
        size_hint_y: None
        height: sp(32)
        halign: 'left'
    TextInput:
        text: root.v
        size_hint_y: None
        height: sp(32)
        multiline: False

        on_text_validate: root.parent.parent.parent.parent.save_change(root.k, self.text)