def test_menu_header_light_padding_t3_l4_b3_r4(self): print_screen_edge() header = MenuHeader(MenuStyle(padding=MenuPadding(3, 4, 3, 4), border_style=LightBorderStyle()), title="My Title") for line in header.generate(): print(line)
def test_menu_header_light_margins_t1_l4_b0_r4(self): print_screen_edge() header = MenuHeader(MenuStyle(margins=MenuMargins(1, 4, 0, 4), border_style=LightBorderStyle()), title="My Title") for line in header.generate(): print(line)
def test_menu_header_ascii_no_subtitle(self): print_screen_edge() header = MenuHeader( MenuStyle(border_style_type=MenuBorderStyleType.ASCII_BORDER), title="My Title") for line in header.generate(): print(line)
def test_menu_header_ascii_title_centered(self): print_screen_edge() header = MenuHeader( MenuStyle(border_style_type=MenuBorderStyleType.ASCII_BORDER), title="My Centered Title", title_align='center') for line in header.generate(): print(line)
def test_menu_header_ascii_with_bottom_border(self): print_screen_edge() header = MenuHeader( MenuStyle(border_style_type=MenuBorderStyleType.ASCII_BORDER), title="My Title", subtitle="I Should Have a Bottom Border", show_bottom_border=True) for line in header.generate(): print(line)
def __init__(self, max_dimension=None): if max_dimension is None: max_dimension = Dimension(width=80, height=40) self.__max_dimension = max_dimension self.__border_style_factory = MenuBorderStyleFactory() self.__header = MenuHeader(menu_style=MenuStyle(), max_dimension=max_dimension) self.__prologue = MenuTextSection(menu_style=MenuStyle(), max_dimension=max_dimension) self.__items_section = MenuItemsSection(menu_style=MenuStyle(), max_dimension=max_dimension) self.__epilogue = MenuTextSection(menu_style=MenuStyle(), max_dimension=max_dimension) self.__footer = MenuFooter(menu_style=MenuStyle(), max_dimension=max_dimension) self.__prompt = MenuPrompt(menu_style=MenuStyle(), max_dimension=max_dimension) # Indent items deeper than other sections self.__items_section.style.padding.left = 3 # Change default top border of prompt to 0, so it hugs the bottom of the menu self.__prompt.style.padding.top = 0
def test_menu_header_light_no_subtitle(self): print_screen_edge() header = MenuHeader(MenuStyle(border_style=LightBorderStyle()), title="My Title") for line in header.generate(): print(line)