def init(self): self.set_title("PATHS") with flx.FormLayout() as self.path_constants_model: self.weather_file = flx.LineEdit( title='Weather File', text='{}'.format(self.root.weather_file_str)) self.idf_file = flx.LineEdit( title='Idf file', text='{}'.format(self.root.idf_file_str)) self.output_path = flx.LineEdit( title='Output directory', text='{}'.format(self.root.output_path_str))
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)
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): self.set_title("CONSTANTS") with flx.FormLayout(flex=1) as self.other_constants_model: self.floor_height = flx.LineEdit( title='Floor Height', text='{}'.format(int(self.root.floor_height_float))) self.window_height = flx.LineEdit( title='Window Height', text='{}'.format(int(self.root.window_height_float))) self.window_edge_height = flx.LineEdit( title='Window edge height', text='{}'.format(int(self.root.window_edge_height_float))) self.heating_setpoint = flx.LineEdit( title='Heating setpoint', text='{}'.format(int(self.root.heating_setpoint_float))) self.cooling_setpoint = flx.LineEdit( title='Cooling setpoint', text='{}'.format(int(self.root.cooling_setpoint_float)))
def init(self): self.set_title("ALGORITHM PARAMETERS") with flx.FormLayout() as self.algo_params_model: self.mutation_param = flx.LineEdit( title='Mutation Parameter', text='{}'.format(int(self.root.mutation_param_int))) self.num_of_generation = flx.LineEdit( title='Num of genertion', text='{}'.format(int(self.root.num_of_generation_int))) self.num_of_individual = flx.LineEdit( title='Num of individual', text='{}'.format(int(self.root.num_of_individual_int))) self.num_of_tour_particps = flx.LineEdit( title='Num of tournament participents', text='{}'.format(int(self.root.num_of_tour_particps_int))) self.max_proc = flx.LineEdit( title='max process in parallel', text='{}'.format(int(self.root.max_proc_int)))
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()
def init(self, retico_widget, mpane, module_list, file_list): self.retico_widget = retico_widget self.mpane = mpane with flx.VBox(css_class="stupid-vbox") as stupid_vbox: stupid_vbox.set_padding("20px") with flx.TreeWidget(max_selected=1, style="height: 300px;", flex=1) as self.module_tree: for k in module_list.keys(): with flx.TreeItem(text=k, checked=None): for m in module_list[k]: flx.TreeItem(text=m, checked=None) self.add_module_button = flx.Button(text="Add Module") flx.Widget(style="min-height:50px;") self.run_button = flx.Button(text="Run", css_class="menu-button") self.stop_button = flx.Button(text="Stop", css_class="menu-button") self.stop_button.set_disabled(True) flx.Widget(style="min-height:50px;") self.file_tree = flx.TreeWidget(max_selected=1, style="height:300px;", flex=1) self.update_file_tree(file_list) self.load_button = flx.Button(text="Load") self.filename_edit = flx.LineEdit() self.save_button = flx.Button(text="Save") self.clear_button = flx.Button(text="Clear") flx.Widget(flex=1)
def init(self): with flx.Widget(): flx.Label(text='Refreshing the page should ' 'maintain the value of the line edit.') self.edit = flx.LineEdit(placeholder_text='username', text=self.session.get_cookie('username', ''))
def init(self): with flx.VBox(): flx.Label(style="text-align:center", text="Networking") with flx.HBox(): with flx.VBox(): flx.Label(style="text-align:right", text="AP Name:") flx.Label(style="text-align:right", text="Password:"******"background-color:#BBBBBB;text-align:center", placeholder_text="ssid") self.fieldPassword = flx.LineEdit( style="background-color:#BBBBBB;text-align:center", placeholder_text="psk") self.submitButton = flx.Button(text='Submit') flx.Widget(flex=1)
def init(self, retico_widget): self.retico_widget = retico_widget self.l_title = flx.Label(text="", css_class="title-label") self.close_button = flx.Button(text="X", css_class="close-button") with flx.VBox( style= "cursor: default; padding-bottom: 30px; padding-left: 20px; padding-right:20px; padding-top: 30px;" ) as self.content_box: self.content_box.set_padding("20px") self.out_button_l = flx.Button(text="◀", css_class="out-button left-button") self.out_button_r = flx.Button(text="▶", css_class="out-button right-button") self.in_button_l = flx.Button(text="▶", css_class="in-button left-button") self.in_button_r = flx.Button(text="◀", css_class="in-button right-button") self.enable_button = flx.Button(text="enabled", css_class="enable-button") self.trigger_edit = flx.LineEdit(self.content_box) self.trigger_button = flx.Button(parent=self.content_box, text="Trigger") self.trigger_edit.set_parent(None) self.trigger_button.set_parent(None) self.trigger_button.set_disabled(True) self.set_active(True) self.set_position()
def init(self, server_name, server_type): self.is_init = False self.server_name = server_name with flx.GroupWidget(title=server_name, flex=1): with flx.FormLayout(flex=1): self.arguments = flx.LineEdit(title="Args", text="") self.feedback = flx.LineEdit(title="Feedback", text="") self.result = flx.LineEdit(title="Result", text="") self.send_goal = flx.Button(text="Send goal") flx.Widget(minsize=40) self.reaction(self._prototype_callback, "!root." + server_name.replace("/", "_") + "_prototype") self.announce_action_client(server_name, server_type)
def init(self, parameters, mpane, module_type, mod_parent): flx.Label(text="Parameters for this module:", style="color: #fff;") self.params = flx.LineEdit(text=parameters, style="width: 500px;") self.okbtn = flx.Button(text="OK") self.mpane = mpane self.module_type = module_type self.mod_parent = mod_parent
def init(self): with flx.FormLayout() as self.form: self.update_button = flx.Button(text='Update JAR', flex=1) flx.Widget(flex=1) self.name = flx.LineEdit(title='Display Name') self.rotation = flx.ComboBox(title='Rotation:', options=rotations, selected_index=0) self.new_screen = flx.Button(text='Create New Display', flex=1)
def init(self, additional_style="width: 100%; height: 100%;"): with flx.VFix(flex=1, style=additional_style) as self.frame: with flx.VFix(flex=1) as self.page: self.custom = flx.VFix(flex=1, style="width: 100%; height: 100%; border: 5px solid green;") with flx.HFix(flex=1): self.but = flx.Button(text="Replace by PyWidget2") self.but_close = flx.Button(text="Close") self.input = flx.LineEdit(text="input")
def init(self): with flx.FormLayout(flex=1, maxsize=400): self.type_message = flx.LineEdit(title="Message to send:", text="") self.send_message = flx.Button(text="Publish message") self.receive_message = flx.Label(title="Received message:", text="Waiting for message...") self.announce_publish("/test_topic", "std_msgs/String") self.subscribe("/test_topic", "std_msgs/String", self.callback)
def init(self): self.f*g = F*g() self.cnt = 0 self.flag = 0 self.ql = [] self.num = 0 # self.apply_style('overflow-y: scroll;') # enable scrolling with flx.VBox() as self.vb1: with flx.HSplit() as self.hb1: self.lb1 = flx.Label(text='题目数量:') self.le1 = flx.LineEdit(placeholder_text='输入题目数量,不要超过1000') self.b1 = flx.Button(text='产生题目') self.b2 = flx.Button(text='导出题目') self.b3 = flx.Button(text='开始答题') with flx.HSplit() as self.hb2: self.lb2 = flx.Label(text='输入答案: ') self.le2 = flx.LineEdit(placeholder_text='输入你的答案') self.lb3 = flx.Label(text='提示框:') self.le3 = flx.LineEdit() self.le4 = flx.Label()
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
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)
def init(self, v=0): self.pkt = None with ui.VBox(): with ui.HBox(): self.lbl_repr = flx.LineEdit(flex=1, css_class="pkt_dump", disabled=1) self.btn_toggle = flx.Button(text="-") self.btn_save = flx.Button(text='save pcap') with ui.VBox(flex=1) as self._cont: with ui.VSplit(flex=1, parent=None) as self.splt_v: pass with ui.HSplit(flex=1) as self.splt_h: self.txt_show = ui.MultiLineEdit(css_class="pkt_dump", flex=4) self.txt_hex = ui.MultiLineEdit(css_class="pkt_dump", flex=6) self.splt = self.splt_h self.toggle_layout(v)
def init(self, parent, name, flex=1, widget="LineEdit"): self._parent = parent # PanelProtocolAbstract self.name = name self.desc = parent.descs[name] self.text = "" with parent._cont: if widget == "MultiLineEdit": self.w = flx.MultiLineEdit( flex=flex, title=self.desc.title, style="height: 100%; min-height: 200px") else: self.w = flx.LineEdit(flex=flex, title=self.desc.title) if self.desc.placeholder: self.w.set_placeholder_text(self.desc.placeholder) if self.desc.autocomp: self.w.set_autocomp(self.desc.autocomp) self._parent.fields.append(self)
def init(self): with flx.HFix(): with flx.FormLayout() as self.form: self.b1 = flx.LineEdit(title='Name:', text='Hola') self.b2 = flx.LineEdit(title='Age:', text='Hello world') self.b3 = flx.LineEdit(title='Favorite color:', text='Foo bar') flx.Button(text='Submit') with flx.FormLayout() as self.form: self.b4 = flx.LineEdit(title='Name:', text='Hola') self.b5 = flx.LineEdit(title='Age:', text='Hello world') self.b6 = flx.LineEdit(title='Favorite color:', text='Foo bar') flx.Button(text='Submit') flx.Widget(flex=1) # Add a spacer
def add_children(self, ev): print("Got add children!") if self.is_init: for c in ev: for child in self.vbox.children: print(child.title, child.text) if child.title == c: child.set_text(str(ev[c])) break return print("Event: ", ev) with self.vbox: for c in ev: if c in ["groups", "type", "source"]: continue l = flx.LineEdit(title=c, text=str(ev[c])) flx.Button(text="Set") flx.Widget(minsize=60) self.is_init = True
def init(self): with flx.VBox(): self.edit = flx.LineEdit(placeholder_text='Your name') flx.Widget(flex=1)
def init(self): with flx.FormLayout() as self.form: self.browse = flx.Button(text='Select Media File to Upload') self.name = flx.LineEdit(title='Name of Event:', text='') self.type = flx.ComboBox(title='Type of Media', options=types, selected_index=0) self.media = flx.ComboBox(title='Media File:', options=medias)
def init(self): self.set_title("MODEL PARAMTERS") with flx.FormLayout() as self.model_params_form: flx.Widget(flex=1) self.exterior_wall = flx.LineEdit( title='Exterior Wall', text='{}'.format(tuple(self.root.exterior_wall_tuple))) self.exterior_roof = flx.LineEdit( title='Exterior Roof', text='{}'.format(tuple(self.root.exterior_roof_tuple))) self.exterior_window = flx.LineEdit( title='Exterior Window', text='{}'.format(tuple(self.root.exterior_window_tuple))) self.eastrate = flx.LineEdit(title='East winwall ratio', text='{}'.format( tuple(self.root.eastrate_tuple))) self.westrate = flx.LineEdit(title='West winwall ratio', text='{}'.format( tuple(self.root.westrate_tuple))) self.southrate = flx.LineEdit( title='South winwall ratio', text='{}'.format(tuple(self.root.southrate_tuple))) self.northrate = flx.LineEdit( title='North winwall ratio', text='{}'.format(tuple(self.root.northrate_tuple))) self.direction = flx.LineEdit( title='direction(deg)', text='{}'.format(tuple(self.root.direction_tuple))) self.airchange = flx.LineEdit( title='airchange', text='{}'.format(tuple(self.root.airchange_tuple))) self.cop = flx.LineEdit(title='cop', text='{}'.format(tuple( self.root.cop_tuple))) self.east_shading = flx.LineEdit( title='east shading', text='{}'.format(tuple(self.root.east_shading_tuple))) self.west_shading = flx.LineEdit( title='west shading', text='{}'.format(tuple(self.root.west_shading_tuple))) self.south_shading = flx.LineEdit( title='south shading', text='{}'.format(tuple(self.root.south_shading_tuple))) self.north_shading = flx.LineEdit( title='north shading', text='{}'.format(self.root.north_shading_tuple)) self.infiltration_airchange = flx.LineEdit( title='infiltration airchange', text='{}'.format(self.root.infiltration_airchange_tuple)) flx.Widget(flex=1)
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("core/gps", "sensor_msgs/NavSatFix", self.gps_callback) self.subscribe("core/battery_fb", "sensor_msgs/BatteryState", self.battery_callback) # We only subscribe to these topics at 1hz self.subscribe("dr/odom", "nav_msgs/Odometry", self.odom_callback, 1.) self.subscribe("core/vbs_fb", "sam_msgs/PercentStamped", self.vbs_callback, 1.) self.subscribe("core/lcg_fb", "sam_msgs/PercentStamped", self.lcg_callback, 1.) self.subscribe("ctrl/depth_feedback", "std_msgs/Float64", self.depth_callback, 1.) self.subscribe("ctrl/pitch_feedback", "std_msgs/Float64", self.pitch_callback, 1.) self.subscribe("ctrl/roll_feedback", "std_msgs/Float64", self.roll_callback, 1.) self.subscribe("ctrl/yaw_feedback", "std_msgs/Float64", self.yaw_callback, 1.)