예제 #1
0
    def init(self):
        self.main_container = flx.VSplit(
            style='font-family: "Helvetica Neue";')
        with self.main_container:
            with flx.VSplit(flex=2):
                self.image = flx.Widget(flex=4, style='background: black;')
                self.title_w = flx.Widget(flex=1)
                with self.title_w:
                    self.title = ui.Label(wrap=True)
                self.overview_w = flx.Widget(flex=1, style='height: 10vh;')
                with self.overview_w:
                    self.overview = ui.Label(wrap=True)
            with flx.HBox(flex=1):
                # self.h_button = flx.Button(text='Horrible', flex=1)
                self.m_button = flx.Button(text='Meh', flex=1)
                self.n_button = flx.Button(text='Neutral', flex=1)
                self.g_button = flx.Button(text='Yeah!', flex=1)
                # self.a_button = flx.Button(text='Amazing', flex=1)
            with flx.HBox(flex=0):
                self.slider = ui.Slider(text='Exploration/Exploitation',
                                        flex=3,
                                        min=0,
                                        max=1,
                                        step=0.01,
                                        value=sliderValue)
                # self.label = ui.Label(flex=1)
                # self.label = flx.Label(flex=1)

            # class JS:
            #     @react.connect('slider.value')
            #     def _change_label(self, value):
            #         self.label.text('x'.repeat(value))
        self.set_movie()
예제 #2
0
    def init(self):
        report = re.Report()
        report.init(
            123,
            42,
            "pepe",
            28,
            "juan",
            2019,
            fileDescriptor=
            "<fo:block ><fo:image ></fo:image><fo:block >Value of Variable: $Variable1$</fo:block></fo:block><fo:block ></fo:block>"
        )

        with flx.VBox():
            with flx.HBox():
                with flx.HBox():
                    self.new = flx.Button(text='Create New Template', flex=0)
                    self.save = flx.Button(text='Save Template', flex=1)
                    self.load = flx.Button(text='Load Template', flex=2)
                    self.download = flx.Button(text='Get_XML_File', flex=3)
                with flx.HBox():
                    self.region = flx.Button(text='Add Region Container',
                                             flex=4)
                    self.text = flx.Button(text='Add Text Container', flex=5)
                    self.image = flx.Button(text='Add Image Container', flex=6)
        self.XML = flx.Label(text="No XML Available Yet", flex=7)
예제 #3
0
    def init(self):

        with flx.VBox():

            flx.Label(
                style='background:#cfc;',
                wrap=1,
                text='Here is some content at the top for which we want to '
                'use minimal size. Thus the use of a VBox. '
                'Below is a splitter, with a box layout on the left '
                'and a fix layout on the right.')

            with flx.HSplit(flex=1):
                with flx.VBox(style='border:1px solid #777;'):

                    flx.Label(text='Flex 0 0 0')
                    with flx.HBox(flex=0):
                        self.b1 = flx.Button(text='Hi')
                        self.b2 = flx.Button(text='Helloooo world!')
                        self.b3 = flx.Button(text='Foo bar')

                    flx.Label(text='Flex 1 1 1')
                    with flx.HBox(flex=0):
                        self.b1 = flx.Button(flex=1, text='Hi')
                        self.b2 = flx.Button(flex=1, text='Helloooo world!')
                        self.b3 = flx.Button(flex=1, text='Foo bar')

                    flx.Label(text='Flex 1 0 3')
                    with flx.HBox(flex=0):
                        self.b1 = flx.Button(flex=1, text='Hi')
                        self.b2 = flx.Button(flex=0, text='Helloooo world!')
                        self.b3 = flx.Button(flex=3, text='Foo bar')

                    # flx.Widget(flex=1)  # spacer widget

                with flx.VFix(style='border:1px solid #777;'):

                    flx.Label(text='Flex 0 0 0 (space divided equally)',
                              style='')
                    with flx.HFix():
                        self.b1 = flx.Button(text='Hi')
                        self.b2 = flx.Button(text='Helloooo world!')
                        self.b3 = flx.Button(text='Foo bar')

                    flx.Label(text='Flex 1 1 1', style='')
                    with flx.HFix():
                        self.b1 = flx.Button(flex=1, text='Hi')
                        self.b2 = flx.Button(flex=1, text='Helloooo world!')
                        self.b3 = flx.Button(flex=1, text='Foo bar')

                    flx.Label(
                        text='Flex 1 0 3 (the widget with zero collapses')
                    with flx.HFix():
                        self.b1 = flx.Button(flex=1, text='Hi')
                        self.b2 = flx.Button(flex=0, text='Helloooo world!')
                        self.b3 = flx.Button(flex=3, text='Foo bar')
예제 #4
0
    def init(self):
        with flx.VBox(
                style='border:2px solid gray;border-radius: 5px; align:left'):
            with flx.VBox(style='border:2px solid gray;border-radius: 5px'):
                with flx.HSplit(flex=1, style='text-align:left;'):
                    ui.Label(text='vxlan encap data:')
                    ui.Label(text='eth src:')
                    self.eth_src = ui.LineEdit(text='0')
                    ui.Label(text='eth dst:')
                    self.eth_dst = ui.LineEdit(text='0')
                    ui.Label(text='eth type:')
                    self.eth_type = ui.LineEdit(text='0x0800')
                    ui.Label(text='ip src:')
                    self.ip_src = ui.LineEdit(text='0')
                    ui.Label(text='ip dst:')
                    self.ip_dst = ui.LineEdit(text='0')
                    ui.Label(text='udp src:')
                    self.udp_src = ui.LineEdit(text='0')
                    ui.Label(text='udp dst:')
                    self.udp_dst = ui.LineEdit(text='4789')
                    ui.Label(text='vni:')
                    self.vni = ui.LineEdit(text='123')
                with flx.HBox():
                    self.encap_disp = ui.Label(text='encap_data:')
            with flx.HSplit():
                self.smacs = flx.CheckBox(text="set_mac_src", flex=2)
                self.smacs_v = ui.LineEdit(text='192.168.1.2', flex=2)
                self.smacd = flx.CheckBox(text="set_mac_dst", flex=2)
                self.smacd_v = ui.LineEdit(text='192.168.1.5', flex=2)
                self.sip4s = flx.CheckBox(text="set_ipv4_src", flex=2)
                self.sip4s_v = ui.LineEdit(text='192.168.1.2', flex=2)
                self.sip4d = flx.CheckBox(text="set_ipv4_dst", flex=2)
                self.sip4d_v = ui.LineEdit(text='192.168.1.5', flex=2)
                self.stps = flx.CheckBox(text="set_tp_src", flex=2)
                self.stps_v = ui.LineEdit(text='3456', flex=1)
                self.stpd = flx.CheckBox(text="set_tp_dst", flex=2)
                self.stpd_v = ui.LineEdit(text='3446', flex=1)
            with flx.HBox():
                self.cnt = flx.CheckBox(text="count")
                self.decap = flx.CheckBox(text="vxlan_decap")
                self.encap = flx.CheckBox(text="vxlan_encap")

                self.stag = flx.CheckBox(text="set_tag")
                self.stag_v = ui.LineEdit(text='12')

                self.fate = ui.ComboBox(editable=True,
                                        selected_key='jump',
                                        options=('jump', 'drop', 'rss',
                                                 'queue', 'port id'))
                self.fate_v = ui.LineEdit(text='2')
                self.add = flx.Button(text='add')
            with flx.HBox():
                self.flow_detail = ui.Label(text="Flow to be added")
예제 #5
0
 def init(self):
     super().init()
     with flx.VBox():
     	 with flx.HBox():
     	 	self.title = flx.Label(flex=1,text='山东宝帅电力铁芯计算')
         with flx.HBox():
         	self.firstname_lable = flx.Label("输入截面积:")
             self.firstname = flx.LineEdit(placeholder_text='First name')
             self.lastname = flx.LineEdit(placeholder_text='Last name')
         with flx.HBox():
             self.but = flx.Button(text='Reset')
             self.label = flx.Label(flex=1)
    def init(self):

        with flx.HSplit():

            with flx.VBox(flex=1):

                flx.Label(html='<b>Box mode</b> (aware of natural size)')
                flx.Label(text='flex: 1, sub-flexes: 0, 0, 0')
                with flx.HBox(flex=1):
                    Panel(text='A', flex=0)
                    Panel(text='B', flex=0)
                    Panel(text='C is a bit longer', flex=0)
                flx.Label(text='flex: 0, sub-flexes: 1, 1, 1')
                with flx.HBox(flex=0):
                    Panel(text='A', flex=1)
                    Panel(text='B', flex=1)
                    Panel(text='C is a bit longer', flex=1)
                flx.Label(text='flex: 1, sub-flexes: 1, 0, 2')
                with flx.HBox(flex=1):
                    Panel(text='A', flex=1)
                    Panel(text='B', flex=0)
                    Panel(text='C is a bit longer', flex=2)
                flx.Label(text='flex: 2, sub-flexes: 1, 2, 3')
                with flx.HBox(flex=2):
                    Panel(text='A', flex=1)
                    Panel(text='B', flex=2)
                    Panel(text='C is a bit longer', flex=3)

            with flx.VBox(flex=1):

                flx.Label(html='<b>Fix mode</b> (high level layout)')
                flx.Label(text='flex: 1, sub-flexes: 0, 0, 0')
                with flx.HFix(flex=1):
                    Panel(text='A', flex=0)
                    Panel(text='B', flex=0)
                    Panel(text='C is a bit longer', flex=0)
                flx.Label(text='flex: 0 (collapses), sub-flexes: 1, 1, 1')
                with flx.HFix(flex=0):
                    Panel(text='A', flex=1, style='min-height:5px;')
                    Panel(text='B', flex=1)
                    Panel(text='C is a bit longer', flex=1)
                flx.Label(text='flex: 1, sub-flexes: 1, 0, 2')
                with flx.HFix(flex=1):
                    Panel(text='A', flex=1)
                    Panel(text='B', flex=0)
                    Panel(text='C is a bit longer', flex=2)
                flx.Label(text='flex: 2, sub-flexes: 1, 2, 3')
                with flx.HFix(flex=2):
                    Panel(text='A', flex=1)
                    Panel(text='B', flex=2)
                    Panel(text='C is a bit longer', flex=3)
예제 #7
0
 def init(self):
     self.box = []
     with flx.VBox(flex=1,
                   style='border:2px solid gray;border-radius: 5px'):
         with flx.HBox(flex=0):
             self.title = flx.Label(text='Interactive:',
                                    flex=0,
                                    style='text-align:left')
             self.input = flx.LineEdit(
                 placeholder_text='> input testpmd commands', flex=2)
             disabled = False if testpmd.alive else True
             self.input.set_disabled(disabled)
         with flx.HBox(flex=1):
             self.testpmdout = TestPMDOut(flex=1)
예제 #8
0
    def init(self):
        with flx.HBox(title='Flexx chatroom demo'):
            flx.Widget(flex=1)
            with flx.VBox():
                self.name_edit = flx.LineEdit(placeholder_text='your name')
                self.people_label = flx.Label(flex=1, minsize=250)
            with flx.VBox(minsize=450):
                self.messages = MessageBox(flex=1)
                with flx.HBox():
                    self.msg_edit = flx.LineEdit(
                        flex=1, placeholder_text='enter message')
                    self.ok = flx.Button(text='Send')
            flx.Widget(flex=1)

        self._update_participants()
예제 #9
0
    def init(self):
        self.nsamples = 200
        self.start_time = time()
        self.status = flx.Label(text='...')
        self.plot_num = 3
        self.plot = []
        self.plot_combobox = []
        self.plot_label = []
        self.plot_latest_val = []
        self.latest_params_names = {}
        self.latest_params_values = {}


        with flx.HSplit(flex=1):
            with flx.GroupWidget(flex=1, title="Plot options", minsize=(270,0)):  
                    with flx.VBox():
                        self.buttons = {}
                        button_list = list(SolarData.commands.keys())
                        for button_name in button_list:
                            with flx.HBox():    
                                self.buttons[button_name] = flx.Button(text=button_name)
                                setattr(self.buttons[button_name],'button_action', button_name)
                                self.buttons[button_name].reaction(self._on_button_pressed, 'pointer_click')
                                self.buttons[button_name].reaction(self._on_button_down, 'pointer_down')
                                self.buttons[button_name].reaction(self._on_button_up, 'pointer_up')
                                flx.Widget(flex=1)

                        for i in range(0, self.plot_num):
                            with flx.HBox():
                                self.plot_combobox[i] = flx.ComboBox(options=list(SolarData.params.keys()), editable=False, selected_index=i) 
                                self.plot_combobox[i].reaction(self.combobox_changed, 'user_selected')
                                self.plot_label[i] = flx.Label(text='Value:')
                                self.plot_latest_val[i] = flx.Label(text='')
                                flx.Widget(flex=1)

                        for i in range(0, len(SolarData.params.keys())):
                            with flx.HBox():
                                name = list(SolarData.params.keys())[i]
                                self.latest_params_names[name] = flx.Label(text='{0}:'.format(name))
                                self.latest_params_values[name] = flx.Label(text='NaN')
                                flx.Widget(flex=1)

                        flx.Widget(flex=1)

            with flx.VBox(flex=4):
                for i in range(0, self.plot_num):
                    self.plot[i] = flx.PlotWidget(flex=1, minsize=(270,0), style='width: 640px; height: 320px;',xdata=[], yrange=(0, 100),ylabel='Plot ' + str(i+1))
                    self.update_plot_range(i)
예제 #10
0
 def init(self):
     self.box = []
     with flx.VBox(
             flex=1,
             style='border:2px solid gray;border-radius: 5px;text-align:left'
     ):
         with flx.HFix(flex=1, style='text-align:left'):
             flx.Label(text='Testpmd args:')
             self.cb_as = flx.CheckBox(text="auto-start")
             self.cb_crc = flx.CheckBox(text="disable-crc-strip")
             self.cb_fia = flx.CheckBox(text="flow-isolate-all")
         with flx.HBox(flex=1):
             ui.Label(text='--rxq:', flex=0)
             self.rxq = ui.LineEdit(text='1', flex=1)
             ui.Label(flex=1, text='')
             ui.Label(text='--rxd:', flex=0)
             self.rxd = ui.LineEdit(text='64', flex=1)
             ui.Label(flex=1, text='')
             ui.Label(text='--txq:', flex=0)
             self.txq = ui.LineEdit(text='1', flex=1)
             ui.Label(flex=1, text='')
             ui.Label(text='--txd:', flex=0)
             self.txd = ui.LineEdit(text='64', flex=1)
             ui.Label(flex=1, text='')
             ui.Label(text='--hairpin:', flex=0)
             self.hairpin = ui.LineEdit(text='0', flex=1)
         with flx.HFix(flex=1, style=' text-align:left'):
             self.cmdline = ui.Label(text='testpmd cmdline:', flex=10)
             self.start = flx.Button(text='start', flex=1)
예제 #11
0
    def init(self):

        with flx.HBox():

            with flx.VBox(flex=0, minsize=150):
                self.b1 = flx.RadioButton(text='Linear')
                self.b2 = flx.RadioButton(text='Basis')
                self.b3 = flx.RadioButton(text='Cardinal', checked=True)
                self.b4 = flx.RadioButton(text='Catmull Rom')
                self.b5 = flx.RadioButton(text='Lagrange')
                self.b6 = flx.RadioButton(text='Lanczos')
                flx.Widget(minsize=10)
                closed = flx.CheckBox(text='Closed')
                flx.Widget(minsize=10)
                self.tension = flx.Slider(min=-0.5,
                                          max=1,
                                          value=0.5,
                                          text=lambda: 'Tension: {value}')
                flx.Widget(flex=1)

            with flx.VBox(flex=1):
                flx.Label(text=GENERAL_TEXT,
                          wrap=True,
                          style='font-size: 12px;')
                self.explanation = flx.Label(text=CARDINAL_TEXT,
                                             wrap=True,
                                             style='font-size: 12px;')

                self.spline = SplineWidget(flex=1,
                                           closed=lambda: closed.checked,
                                           tension=lambda: self.tension.value)
예제 #12
0
파일: rosmon.py 프로젝트: svbhat/flexxros
    def init(self, topic):

        self.server_name = topic.split("/")[1]
        self.service_name = "/" + self.server_name + "/start_stop"

        self.nodes = {}
        self.subscribe(topic, "rosmon_msgs/State", self.callback)
        self.list_container = flx.VBox(flex=1)
        with self.list_container:
            with flx.HBox(flex=1):
                self.expand = flx.Button(flex=0, text=">")
                self.label = flx.Label(flex=0, text=self.server_name + ":")
                self.launch_state = flx.Label(flex=0,
                                              text="IDLE",
                                              style='color: #F00;')
                #self.expand = flx.Button(text="Expand")
                flx.Widget(flex=1)
                self.start_stop = flx.Button(flex=0, text="Stop")
            self.base_layout = flx.VBox(flex=1, style='border:1px solid #777;')
            with self.base_layout:
                with flx.HFix():
                    flx.Label(text="Name")
                    flx.Label(text="State")
                    flx.Label(text="CPU")
                    flx.Label(text="Memory")
                    flx.Label(text="Restarts")
                    flx.Label(text="Action")
        self.base_layout.set_parent(None)
예제 #13
0
    def init(self):
        super().init()

        with flx.HBox():
            self.but1 = flx.Button(text='reset')
            self.but2 = flx.Button(text='increase')
            self.label = flx.Label(text='', flex=1)  # take all remaining space
예제 #14
0
 def init(self, py):
     self.py = py
     self.file_name = flx.StringProp('')
     self.file_input = FileInput()
     with flx.VBox():
         flx.Label(style="background:#cfc;", wrap=1, text="")
         with flx.HSplit(flex=1):
             with flx.VBox(style="border:1px solid #777;", ):
                 flx.Label(text="Properties Tree")
                 self.tree = TreeWithControls(py, flex=1, max_selected=1)
             with flx.VBox(style="border:1px solid #777;"):
                 flx.Label(text="Property", style="")
                 with flx.VBox(flex=1):
                     with flx.VBox(flex=1, style=""):
                         self.combo = ui.ComboBox(editable=True, options=())
                         self.field = ui.LineEdit(
                             placeholder_text="type here")
                         with flx.HBox(flex=1, style="max-height: 20px;"):
                             self.pick_file = ui.Button(text='...')
                             self.do_upload = ui.Button(text='Upload',
                                                        disabled=True)
                     with flx.VBox(flex=5):
                         flx.Label(text="Info", style="")
                         self.info = flx.Label(
                             text="", style="white-space: pre-line;")
                 with flx.VBox(style="border:1px solid #777;", flex=1):
                     flx.Label(text="Raw", style="")
                     self.rawLabel = flx.Label(
                         text="", style="white-space: pre-line;")
         self.update_btn = ui.Button(text="Apply", style="width: 100px;")
예제 #15
0
 def init(self):
     flx.Widget(flex=1)
     with flx.VBox():
         with flx.HBox():
             self.b1 = flx.Button(text='Hello', css_class="border-red", flex=1)
             self.b2 = flx.Button(text='World', css_class="border-green", flex=1)
     flx.Widget(flex=1)
예제 #16
0
    def init(self):
        with flx.HBox():
            self.gamepad = GamepadClient()

        self.done = False
        # This needs to be in a callback fn because Flexx waits for the init
        # call to complete before making the server available
        asyncio.get_event_loop().call_later(1, self.handle_gamepad_start)
예제 #17
0
    def init(self):

        with flx.HBox():
            actuator_bar = SamActuatorBar()
            #flx.Widget(flex=1)
            with flx.VBox(flex=1):
                launch_dashboard = ROSMonDashboardWidget(flex=1)
                info_dash = SamInfoDash(flex=0)
예제 #18
0
 def init(self):
     with flx.VBox(flex=1):
         self.file_browser = flx.FileBrowserWidget(flex=1)
         with flx.HBox():
             flx.LineEdit(text=lambda: self.file_browser.path,
                          flex=8,
                          disabled=1)
             flx.Label(text=" / ")
             self.txt_file = flx.LineEdit(flex=3)
             self.btn_file = flx.Button(flex=1)
예제 #19
0
    def init(self):

        with flx.HBox(flex=1, style="background: #e6e6df;"):
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.heading = flx.LineEdit(title="Heading", text="")
                self.pitch = flx.LineEdit(title="Pitch", text="")
                self.roll = flx.LineEdit(title="Roll", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.depth = flx.LineEdit(title="Depth", text="")
                self.xpos = flx.LineEdit(title="X", text="")
                self.ypos = flx.LineEdit(title="Y", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.xvel = flx.LineEdit(title="X vel", text="")
                self.yvel = flx.LineEdit(title="Y vel", text="")
                self.zvel = flx.LineEdit(title="Z vel", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.gps_status = flx.LineEdit(title="GPS Status", text="")
                self.dvl_status = flx.LineEdit(title="DVL Status", text="")
                self.battery_status = flx.LineEdit(title="Battery level",
                                                   text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.vbs_fb = flx.LineEdit(title="VBS fb", text="")
                self.lcg_fb = flx.LineEdit(title="LCG fb", text="")
                self.rpm_fb = flx.LineEdit(title="RPM fb", text="")
                flx.Widget(minsize=40)

        # We subscribe to these topics at full frquency (no extra arg)
        self.subscribe("/sam/core/gps", "sensor_msgs/NavSatFix",
                       self.gps_callback)
        self.subscribe("/sam/core/battery_fb", "sensor_msgs/BatteryState",
                       self.battery_callback)
        # We only subscribe to these topics at 1hz
        self.subscribe("/sam/dr/odom", "nav_msgs/Odometry", self.odom_callback,
                       1.)
        self.subscribe("/sam/core/vbs_fb", "sam_msgs/PercentStamped",
                       self.vbs_callback, 1.)
        self.subscribe("/sam/core/lcg_fb", "sam_msgs/PercentStamped",
                       self.lcg_callback, 1.)
        self.subscribe("/sam/ctrl/depth_feedback", "std_msgs/Float64",
                       self.depth_callback, 1.)
        self.subscribe("/sam/ctrl/pitch_feedback", "std_msgs/Float64",
                       self.pitch_callback, 1.)
        self.subscribe("/sam/ctrl/roll_feedback", "std_msgs/Float64",
                       self.roll_callback, 1.)
        self.subscribe("/sam/ctrl/yaw_feedback", "std_msgs/Float64",
                       self.yaw_callback, 1.)
예제 #20
0
파일: store.py 프로젝트: www3838438/flexx
    def init(self):
        with flx.VBox():

            with flx.HBox():
                self.first_edit = flx.LineEdit(placeholder_text='first name',
                                               text='Jane')
                self.last_edit = flx.LineEdit(placeholder_text='last name',
                                              text='Doe')
                flx.Widget(flex=1)  # spacer

            with flx.HBox():
                flx.Label(text=lambda: self.root.first_name,
                          style='border:1px solid red')
                flx.Label(text=lambda: self.root.last_name,
                          style='border:1px solid red')
                flx.Widget(flex=1)  # spacer

            MyPersonLabel(style='border:1px solid blue')

            flx.Widget(flex=1)  # spacer
예제 #21
0
파일: stack.py 프로젝트: levinbgu/flexx
 def init(self):
     with flx.VBox():
         with flx.HBox():
             self.buta = flx.Button(text='red')
             self.butb = flx.Button(text='green')
             self.butc = flx.Button(text='blue')
             flx.Widget(flex=1)  # space filler
         with flx.StackLayout(flex=1) as self.stack:
             self.buta.w = flx.Widget(style='background:#a00;')
             self.butb.w = flx.Widget(style='background:#0a0;')
             self.butc.w = flx.Widget(style='background:#00a;')
예제 #22
0
 def init(self):
     super().init()
     with flx.VBox():
         with flx.HBox():
             self.wtitle = flx.Label(flex=1)
             self.wversion = flx.Label(text='v0.0.0')
         self.wprompt = MyPrompt()
         self.wconsole = MyConsole(flex=1)
     self._init_focus()
     self._init_ready()
     return
예제 #23
0
    def init(self, host_ip, base_link, robot_description, rosbridge_port,
             resources_port):

        with flx.HBox():

            actuator_bar = SamActuatorBar()
            robot_model = RobotModelWidget(flex=1,
                                           host_ip=host_ip,
                                           base_link=base_link,
                                           robot_description=robot_description,
                                           rosbridge_port=rosbridge_port,
                                           resources_port=resources_port)
예제 #24
0
 def init(self):
     with flx.VBox():
         with flx.HBox(flex=1):
             flx.Label(text='Tree')
             self.tree = LeoTree(flex=1)
             flx.Label(text='Log')
             self.log = LeoLog(flex=1)
         flx.Label(text='Body')
         LeoBody(flex=1)
         flx.Label(text='Minibuffer')
         LeoMiniBuffer()
         flx.Label(text='Status Line')
         LeoStatusLine()
예제 #25
0
 def init(self):
     time = [i / 100 for i in range(100)]
     with flx.VBox():
         with flx.HBox():
             flx.Label(text='Frequency:')
             self.slider1 = flx.Slider(min=1, max=10, value=5, flex=1)
             flx.Label(text='Phase:')
             self.slider2 = flx.Slider(min=0, max=6, value=0, flex=1)
         self.plot = flx.PlotWidget(flex=1,
                                    xdata=time,
                                    xlabel='time',
                                    ylabel='amplitude',
                                    title='a sinusoid')
예제 #26
0
 def init(self):
     self.set_title("Openlayers example")
     with flx.VBox():
         with flx.HBox():
             self.map = Ol(flex=1)
             self.btn = flx.Button(text="", disabled=True)
             with flx.VBox():
                 self.btnosm = flx.Button(text='Load Openstreetmap')
                 self.btna = flx.Button(text='Load GEOJSON')
                 self.btnr = flx.Button(text='Remove GEOJSON')
                 self.btndraw = flx.Button(text='Draw Points')
                 self.btn_stop_draw = flx.Button(text='Stop Drawing')
                 flx.Widget(flex=1)
         self.coords = flx.Label(flex=1)
예제 #27
0
 def init(self):
     with flx.VBox(flex=0):
         with flx.VBox(flex=0):
             src = str(que[0])
             self.img = flx.ImageWidget(flex=0, stretch=False, source=src)
             self.img.set_minsize(500, 500)
             self.img.set_maxsize(500, 500)
         with flx.HBox(flex=1):
             self.b1 = flx.Button(text="Yes")
             self.void = flx.Label()
             self.b2 = flx.Button(text="No")
             self.b1.set_maxsize(40, 40)
             self.b2.set_maxsize(40, 40)
             self.void.set_maxsize(420, 40)
예제 #28
0
 def init(self):
     with flx.VBox():
         self.root.set_status('Sniffing')
         with flx.HBox():
             iface = self.root.pnl_config.get_section_config(
                 "common", "iface", "lo")
             if ifnames.count(iface) == 0:
                 iface = "lo"
             self.iface = flx.ComboBox(options=ifnames,
                                       flex=2,
                                       selected_key=iface)
             self.start_stop = flx.Button(text="start", flex=1)
             flx.Label(text="", flex=6)
         self.view = PanelRxView(flex=1)
예제 #29
0
 def init(self):
     self.pattern = "pattern "
     with flx.VBox(flex=1,
                   style='border:2px solid gray;border-radius: 5px'):
         with flx.HBox(flex=0):
             ui.Label(text='pattern:')
             self.item = ui.ComboBox(editable=True,
                                     selected_key='eth',
                                     options=('eth', 'ipv4', 'ipv6', 'tcp',
                                              'udp', 'vlan', 'vxlan',
                                              'tag'))
             self.al = ui.Label(text='src:')
             self.av = ui.LineEdit(text='1')
             self.am = ui.Label(text='src_mask:')
             self.amv = ui.LineEdit(text='1')
             self.bl = ui.Label(text='dst:')
             self.bv = ui.LineEdit(text='1')
             self.bm = ui.Label(text='dst_mask:')
             self.bmv = ui.LineEdit(text='1')
             self.add = flx.Button(text='add')
             self.cl = flx.Button(text='clear')
         with flx.HBox():
             self.showitem = ui.Label(text="No pattern")
예제 #30
0
 def init(self):
     with flx.VBox(flex=0):
         with flx.VBox(flex=0):
             src = "https://www.designyourway.net/blog/wp-content/uploads/2019/05/iPad-Pro-wallpaper-54-700x700.jpg"
             self.img = flx.ImageWidget(flex=0, stretch=False, source=src)
             self.img.set_minsize(500, 500)
             self.img.set_maxsize(500, 500)
         with flx.HBox(flex=1):
             self.b1 = flx.Button(text="Yes")
             self.void = flx.Label()
             self.b2 = flx.Button(text="No")
             self.b1.set_maxsize(40, 40)
             self.b2.set_maxsize(40, 40)
             self.void.set_maxsize(420, 40)