Пример #1
0
    def _build_widget(self, **kwargs):
        total_items = []
        for _item in self.radio_items.keys():
            desc = Color.string_input(
                Text("  {}".format(
                    self.radio_items[_item][1])),
                focus_map='string_input focus')
            total_items.append(
                Color.string_input(self.radio_items[_item][0],
                                   focus_map='string_input focus'))
            total_items.append(AttrWrap(desc, 'input'))
            total_items.append(Divider('-'))

        self.input_lbox = ListBox(SimpleListWalker(total_items[:-1]))
        self.add_buttons()

        self.container_box_adapter = BoxAdapter(self.input_lbox,
                                                len(total_items))
        self.container_lbox = ListBox(
            [self.container_box_adapter,
             Divider(),
             self.btn_pile])

        return LineBox(
            BoxAdapter(self.container_lbox,
                       height=len(total_items) + 3),
            title=self.title)
Пример #2
0
 def _build_widget(self, **kwargs):
     total_items = [
         Padding.center_60(Text(self.title, align="center")),
         Padding.center_60(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1))
     ]
     if self.input_items:
         for item in self.input_items:
             key = item[0]
             caption = item[1]
             try:
                 mask = item[2]
             except:
                 mask = None
             self.input_selection[key] = EditInput(caption="",
                                                   mask=mask)
             col = Columns(
                 [
                     ("weight", 0.4, Text(caption, align="right")),
                     Color.string_input(self.input_selection[key],
                                        focus_map="string_input focus")
                 ]
             )
             total_items.append(Padding.center_60(col))
     total_items.append(
         Padding.center_60(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)))
     total_items.append(Padding.center_20(self._build_buttons()))
     return Filler(Pile(total_items), valign='middle')
Пример #3
0
 def _build_widget(self, **kwargs):
     total_items = [
         Padding.center_60(Text(self.title, align="center")),
         Padding.center_60(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1))
     ]
     if self.input_items:
         for item in self.input_items:
             key = item[0]
             caption = item[1]
             try:
                 mask = item[2]
             except:
                 mask = None
             self.input_selection[key] = StringEditor(caption="", mask=mask)
             col = Columns([
                 ("weight", 0.4, Text(caption, align="right")),
                 Color.string_input(self.input_selection[key],
                                    focus_map="string_input focus")
             ])
             total_items.append(Padding.center_60(col))
     total_items.append(
         Padding.center_60(
             Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)))
     total_items.append(Padding.center_20(self._build_buttons()))
     return Filler(Pile(total_items), valign='middle')
Пример #4
0
    def _build_widget(self, **kwargs):
        total_items = []
        for _item in self.radio_items.keys():
            desc = Color.string_input(Text("  {}".format(
                self.radio_items[_item][1])),
                                      focus_map='string_input focus')
            total_items.append(
                Color.string_input(self.radio_items[_item][0],
                                   focus_map='string_input focus'))
            total_items.append(AttrWrap(desc, 'input'))
            total_items.append(Divider('-'))

        self.input_lbox = ListBox(SimpleListWalker(total_items[:-1]))
        self.add_buttons()

        self.container_box_adapter = BoxAdapter(self.input_lbox,
                                                len(total_items))
        self.container_lbox = ListBox(
            [self.container_box_adapter,
             Divider(), self.btn_pile])

        return LineBox(BoxAdapter(self.container_lbox,
                                  height=len(total_items) + 3),
                       title=self.title)
Пример #5
0
    def _build_widget(self, **kwargs):

        total_items = []
        for _item in self.input_items.keys():
            total_items.append(
                Color.string_input(self.input_items[_item],
                                   focus_map='string_input focus'))
        self.input_lbox = ListBox(SimpleListWalker(total_items))

        # Add buttons
        self.add_buttons()
        self.container_box_adapter = BoxAdapter(self.input_lbox,
                                                len(total_items))
        self.container_lbox = ListBox(
            [self.container_box_adapter,
             Divider(), self.btn_pile])

        return LineBox(BoxAdapter(self.container_lbox,
                                  height=len(total_items) + 1 +
                                  len(self.btn_pile.contents)),
                       title=self.title)
Пример #6
0
    def _build_widget(self, **kwargs):

        total_items = []
        for _item in self.input_items.keys():
            total_items.append(Color.string_input(
                self.input_items[_item], focus_map='string_input focus'))
        self.input_lbox = ListBox(SimpleListWalker(total_items))

        # Add buttons
        self.add_buttons()
        self.container_box_adapter = BoxAdapter(self.input_lbox,
                                                len(total_items))
        self.container_lbox = ListBox(
            [self.container_box_adapter,
             Divider(),
             self.btn_pile])

        return LineBox(
            BoxAdapter(self.container_lbox,
                       height=len(total_items) + 1 +
                       len(self.btn_pile.contents)),
            title=self.title)
Пример #7
0
 def __init__(self, caption, **kwargs):
     self._edit = Edit(caption=caption, **kwargs)
     super().__init__(Color.string_input(self._edit,
                                         focus_map="string_input focus"))
Пример #8
0
 def __init__(self, caption, **kwargs):
     self._edit = Edit(caption=caption, **kwargs)
     super().__init__(
         Color.string_input(self._edit, focus_map="string_input focus"))