Example #1
0
    def __init__(self):
        base.win.set_clear_color(Vec4(0, 0, 0, 1))
        self.skin = LUIDefaultSkin()
        self.skin.load()

        # Construct the LUIRegion
        region = LUIRegion.make("LUI", base.win)
        handler = LUIInputHandler()
        base.mouseWatcher.attach_new_node(handler)
        region.set_input_handler(handler)

        self.root = region.root()
        self.constructorParams = []
Example #2
0
    def __init__(self, interpreter):
        self.interpreter = interpreter
        self.history_objects = []

        skin = LUIDefaultSkin()
        skin.load()

        region = LUIRegion.make("LUI", base.win)
        handler = LUIInputHandler()
        base.mouseWatcher.attach_new_node(handler)
        region.set_input_handler(handler)

        self.console_frame = LUIFrame(
            parent=region.root,
            pos=(0, 0),
            width=base.win.get_x_size() - 10,
            height=base.win.get_y_size() * 0.75,
            style=LUIFrame.FS_raised,
            #style = LUIFrame.FS_sunken,
            margin=(5, 5, 5, 5),
        )
        console = LUIVerticalLayout(parent=self.console_frame, spacing=3)
        #console.use_dividers = True
        console.margin = (0, 0, 0, 0)
        console.width = self.console_frame.width

        self.history_region = LUIScrollableRegion(margin=0,
                                                  width=console.width - 10)
        console.add(self.history_region)
        self.history = LUIVerticalLayout(
            parent=self.history_region.content_node, spacing=2)
        self.history.margin = (0, 0, 0, 0)
        self.history.width = self.history_region.width

        self.command_line = LUIInputField(width=console.width - 10)
        console.add(self.command_line)
        self.command_line.bind("tab", self.tab)
        self.command_line.bind("enter", self.enter)
        self.command_line.bind("control-c", self.copy)
        self.command_line.bind("control-v", self.paste)
        self.command_line.bind("control-x", self.cut)
        self.command_line.bind("control-u", self.kill_to_start)
        self.command_line.bind("control-k", self.kill_to_end)
        self.command_line.bind("control-l", self.kill_line)
Example #3
0
    def __init__(self):
        """ Constructs the demo framework """

        if False:
            self._skin = LUIMetroSkin()
            base.win.set_clear_color(Vec4(1))
        else:
            self._skin = LUIDefaultSkin()
            base.win.set_clear_color(Vec4(0.1, 0.0, 0.0, 1))
        self._skin.load()

        # Construct the LUIRegion
        region = LUIRegion.make("LUI", base.win)
        handler = LUIInputHandler()
        base.mouseWatcher.attach_new_node(handler)
        region.set_input_handler(handler)

        self._root = region.root
        self._constructor_params = []
Example #4
0
    def __init__(self, interpreter):
        self.interpreter = interpreter
        self.history_objects = []
        
        skin = LUIDefaultSkin()
        skin.load()

        region = LUIRegion.make("LUI", base.win)
        handler = LUIInputHandler()
        base.mouseWatcher.attach_new_node(handler)
        region.set_input_handler(handler)

        self.console_frame = LUIFrame(parent = region.root,
                                      pos = (0, 0),
                                      width = base.win.get_x_size() - 10,
                                      height = base.win.get_y_size() * 0.75,
                                      style = LUIFrame.FS_raised,
                                      #style = LUIFrame.FS_sunken,
                                      margin = (5, 5, 5, 5),
                                      )
        console = LUIVerticalLayout(parent = self.console_frame, spacing = 3)
        #console.use_dividers = True
        console.margin = (0, 0, 0, 0)
        console.width = self.console_frame.width
        
        self.history_region = LUIScrollableRegion(margin = 0, width = console.width - 10)
        console.add(self.history_region)
        self.history = LUIVerticalLayout(parent = self.history_region.content_node,
                                         spacing = 2)
        self.history.margin = (0, 0, 0, 0)
        self.history.width = self.history_region.width

        self.command_line = LUIInputField(width = console.width - 10)
        console.add(self.command_line)
        self.command_line.bind("tab", self.tab)
        self.command_line.bind("enter", self.enter)
        self.command_line.bind("control-c", self.copy)
        self.command_line.bind("control-v", self.paste)
        self.command_line.bind("control-x", self.cut)
        self.command_line.bind("control-u", self.kill_to_start)
        self.command_line.bind("control-k", self.kill_to_end)
        self.command_line.bind("control-l", self.kill_line)
Example #5
0
from Skins.Metro.LUIMetroSkin import LUIMetroSkin

s = ShowBase()

# Load a LUI Skin
if False:
    skin = LUIMetroSkin()
    base.win.set_clear_color(Vec4(1))
else:
    skin = LUIDefaultSkin()
    base.win.set_clear_color(Vec4(0.1, 0.0, 0.0, 1))

skin.load()

# Initialize LUI
region = LUIRegion.make("LUI", base.win)
handler = LUIInputHandler()
base.mouseWatcher.attach_new_node(handler)
region.set_input_handler(handler)

# Title
title_label = LUILabel(parent=region.root,
                       text="LUI Console Example",
                       font_size=40,
                       font="header",
                       pos=(25, 17))

# Container
container = LUIFrame(parent=region.root,
                     width=700,
                     height=500,